-
Notifications
You must be signed in to change notification settings - Fork 661
NO-JIRA: Add Claude Code command /check-best-practices #15616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@krishagarwal278: This pull request explicitly references no jira issue. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: krishagarwal278 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/label docs-approved |
a5909f0 to
b7344d6
Compare
|
/retest |
4df651c to
e778905
Compare
e778905 to
4e93329
Compare
| ### Additional OpenShift Console Specific Practices | ||
|
|
||
| **React Component Patterns**: | ||
| - Use `React.FCC` instead of `React.FC` for components (fixes legacy dependency issues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Use `React.FCC` instead of `React.FC` for components (fixes legacy dependency issues) | |
| - Use `React.FCC` instead of `React.FC` for components (fixes an issue with implicit `children` in `React.FC` provided by React 17, our current React version) |
|
|
||
| ### Additional OpenShift Console Specific Practices | ||
|
|
||
| **React Component Patterns**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **React Component Patterns**: | |
| ### React Component Patterns |
| **React Component Patterns**: | ||
| - Use `React.FCC` instead of `React.FC` for components (fixes legacy dependency issues) | ||
|
|
||
| **Type Safety & Kubernetes Integration**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **Type Safety & Kubernetes Integration**: | |
| ### Type Safety & Kubernetes Integration |
| - Use optional chaining for safe property access | ||
| - Initialize with proper defaults instead of repeated null checks | ||
|
|
||
| **Code Organization**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **Code Organization**: | |
| ### Code Organization |
| - Never use absolute paths in code. The app should be able to run behind a proxy under an arbitrary path. | ||
| - TESTS: Should follow a similar "test tables" convention as used in Go where applicable. | ||
|
|
||
| ### Additional OpenShift Console Specific Practices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can integrate this better into the styleguide?
| ### Directory and File Names | ||
| - ✅ **Use lowercase dash-separated names for all files** (avoids git issues with case-insensitive file systems) | ||
| - ✅ **Exceptions only for conventional files** (Dockerfile, Makefile, README) | ||
|
|
||
| ### Go Best Practices | ||
| - ✅ **All Go code should be formatted by gofmt** | ||
| - ✅ **Import statements should be separated into 3 groups**: stdlib, external dependency, current project | ||
| - ✅ **Tests should follow "test tables" convention** | ||
|
|
||
| ### TypeScript and JavaScript Best Practices | ||
| - ✅ **New code should be written in TypeScript, not JavaScript** | ||
| - ✅ **Prefer functional components to class-based components** | ||
| - ✅ **Use React hooks with functional components if you need state** | ||
| - ✅ **Prefer composition to inheritance** | ||
| - ✅ **Follow all rules defined in .eslintrc** | ||
| - ✅ **Never use absolute paths in code** - app should run behind a proxy under arbitrary path | ||
| - ✅ **Tests should follow "test tables" convention** (similar to Go) | ||
|
|
||
| ### SCSS/CSS Best Practices | ||
| - ✅ **All SCSS files imported from top-level** `/frontend/public/style.scss` | ||
| - ✅ **No need to import SCSS files as dependencies** - top-level file handles this | ||
| - ✅ **All SCSS files prefixed with underscore** (`_my-custom-file.scss`) | ||
| - ✅ **Avoid element selectors, prefer class selectors** | ||
| - ✅ **Scope all classes with `co-` prefix** to avoid collisions with imported CSS | ||
| - ✅ **Class names lowercase and dash-separated** | ||
| - ✅ **All SCSS variables scoped within their component** | ||
| - ✅ **Use BEM naming conventions** | ||
|
|
||
| ### Additional OpenShift Console Specific Practices | ||
|
|
||
| **React Component Patterns**: | ||
| - Use `React.FCC` instead of `React.FC` for components (fixes legacy dependency issues) | ||
| - Prefer functional components with hooks over class components | ||
| - Use composition over inheritance patterns | ||
|
|
||
| **Type Safety & Kubernetes Integration**: | ||
| - Use specific Kubernetes resource types instead of generic `K8sResourceCommon` when possible | ||
| - Avoid excessive use of `any` types | ||
| - Avoid type assertions with `as any` | ||
| - Use optional chaining for safe property access | ||
| - Initialize with proper defaults instead of repeated null checks | ||
|
|
||
| **Code Organization**: | ||
| - Follow established directory structure patterns | ||
| - Use consistent import organization | ||
| - Maintain clear separation of concerns | ||
|
|
||
| ### Analysis Process | ||
|
|
||
| 1. **File Structure**: Check file naming and organization | ||
| 2. **Go Code Quality**: Verify gofmt formatting and import grouping | ||
| 3. **TypeScript Usage**: Verify modern TypeScript patterns | ||
| 4. **React Patterns**: Assess component structure and hooks usage | ||
| 5. **SCSS/CSS Patterns**: Check BEM naming, prefixing, and organization | ||
| 6. **Style Guide Compliance**: Check against official OpenShift Console style guide | ||
| 7. **Code Quality**: Evaluate maintainability and consistency | ||
| 8. **OpenShift Specific**: Review Kubernetes integration patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this stuff is in the styleguide, do we need to deduplicate it for claude?
Uh oh!
There was an error while loading. Please reload this page.