Skip to content

OU-1389: Style Guide#1089

Draft
PeterYurkovich wants to merge 1 commit into
openshift:mainfrom
PeterYurkovich:style-guide
Draft

OU-1389: Style Guide#1089
PeterYurkovich wants to merge 1 commit into
openshift:mainfrom
PeterYurkovich:style-guide

Conversation

@PeterYurkovich

@PeterYurkovich PeterYurkovich commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/hold

Point of discussion for a potential style guide. All items should be enforced by lint rules where possible

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 23, 2026
@openshift-ci openshift-ci Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 23, 2026
Comment thread docs/STYLEGUIDE.md

Others for consideration:

- Barrel Files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am personally not a fan of barrel files as they add a layer of indirection and don't add any functional change to the codebase. I would prefer either using alias's or just having the full path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, I think they are also more useful for libraries rather than a consumer app

coderabbitai[bot]

This comment was marked as resolved.

@openshift openshift deleted a comment from openshift-ci-robot Jul 23, 2026
@openshift openshift deleted a comment from openshift-ci Bot Jul 23, 2026
@openshift openshift deleted a comment from openshift-ci Bot Jul 23, 2026
@openshift openshift deleted a comment from coderabbitai Bot Jul 23, 2026
@openshift openshift deleted a comment from coderabbitai Bot Jul 23, 2026
@openshift openshift deleted a comment from coderabbitai Bot Jul 23, 2026
@openshift openshift deleted a comment from coderabbitai Bot Jul 23, 2026
@openshift openshift deleted a comment from coderabbitai Bot Jul 23, 2026
@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 23, 2026
@openshift openshift deleted a comment from openshift-ci-robot Jul 23, 2026
Comment thread docs/STYLEGUIDE.md
- Barrel Files
- export all things at bottom of file (easy to find what each file exports)
- Require commit signing
- Require conventional commits https://www.conventionalcommits.org/en/v1.0.0/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment thread docs/STYLEGUIDE.md
Others for consideration:

- Barrel Files
- export all things at bottom of file (easy to find what each file exports)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion about it, but I think IDEs can resolve where the export is so it might be just an overhead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I had just seen the pattern online and thought it was interesting to consider

Comment thread docs/STYLEGUIDE.md
Comment on lines +49 to +52

### 6. `react/self-closing-comp`

Always self close tags have no children

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 6. `react/self-closing-comp`
Always self close tags have no children
### 6. `react/self-closing-comp`
Always self close tags have no children
### 7. co-locate test files
test files must have the `.spec.ts` suffix and be co-located with the file they are testing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, maybe we should note this as being for unit and component tests

As I work through the dynamic test running and discuss more with @etmurasaki we can define the e2e tests placement later (maybe /cypress/features/x or /src/features/x/tests)

Comment thread docs/STYLEGUIDE.md
Always self close tags have no children

Others for consideration:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate visualization from data, using hooks or wrapper components around visualization components

Comment thread docs/STYLEGUIDE.md
Always self close tags have no children

Others for consideration:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using Patternfly components consider creating "wrapper" components that our codebase will use which enable easier backporting by maintaining stable UI structure across versions

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants