Skip to content

Add Pre Commit Hooks and Editor Config#78

Draft
kdvalin wants to merge 3 commits into
mainfrom
feat/code-style
Draft

Add Pre Commit Hooks and Editor Config#78
kdvalin wants to merge 3 commits into
mainfrom
feat/code-style

Conversation

@kdvalin
Copy link
Copy Markdown
Member

@kdvalin kdvalin commented May 12, 2026

Description

Adds an .editorconfig to help enforce code standards.

Adds pre-commit framework to lint committed files. This works in addition to any pre-installed hooks (like Red Hat's leak checker)

Before/After Comparison

Before

Code style was not enforced, required manual review to catch problems.

After

Code style is automatically set by .editorconfig, more advanced linting issues are caught by the shfmt pre-commit hook.

Clerical Stuff

Closes TBD

Relates to JIRA: RPOPC-TBD

kdvalin added 3 commits May 12, 2026 09:24
In general:
- Use tab indents
- No trailing whitespace
- Unix style line endings
- Add a newline at end of the file

YAML is an execption, use 2 spaces for indentation.  Avoid using tabs
due to [the spec](https://yaml.org/spec/1.2.2/#61-indentation-spaces)
@qodo-code-review
Copy link
Copy Markdown
Contributor

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: check_review_label / pr_issue_jira

Failed stage: Run ./pr-requirements [❌]

Failed test name: ""

Failure summary:

The action failed during the ./pr-requirements step because it enforces a PR policy requiring a
related issue, and PR 78 did not have one.
- Log evidence: ##[error]PR has no related issue (line
126)

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

111:  Turn off this advice by setting config variable advice.detachedHead to false
112:  HEAD is now at 974cca1 Update author to Red Hat Performance (#16)
113:  ##[endgroup]
114:  [command]/usr/bin/git log -1 --format=%H
115:  974cca134ffa7b0d019066681104bfdd07e7c3a0
116:  ##[group]Run ./pr-requirements
117:  with:
118:  GITHUB_TOKEN: ***
119:  jira_ticket: true
120:  jira_project: RPOPC
121:  jira_url: https://issues.redhat.com
122:  related_issue: true
123:  ##[endgroup]
124:  Looking at PR 78
125:  Found PR 78
126:  ##[error]PR has no related issue
127:  Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant