What CI checks must pass before a PR is accepted, and are there any style/lint/test conventions we should follow? #1035
-
|
What CI checks must pass before a PR is accepted, and are there any style/lint/test conventions we should follow? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
|
To have a PR accepted, mandatory CI checks typically include successful code compilation, passing all unit tests, and linting validation (such as Ruff or ESLint) to ensure there are no syntax errors or basic security vulnerabilities. Additionally, many pipelines require that test coverage does not decrease, mandating that developers include tests for any new features before the merge can be completed. |
Beta Was this translation helpful? Give feedback.
-
|
Before a pull request (PR) is accepted, most projects require a standard set of CI checks to pass and follow specific style/lint/test conventions. While exact requirements vary by project, here are the common expectations: Required CI Checks
Use pre-commit hooks (e.g., Husky, pre-commit) to auto-format before committing Keep lines under 80–120 characters; use consistent naming (camelCase, snake_case, etc.)
Aim for 70–85% coverage—100% often yields diminishing returns Use descriptive test names: should_return_error_when_input_is_null()
Write clear commit messages explaining why, not just what Update documentation (README.md, docstrings, API docs) for any public-facing changes
Review new dependencies for vulnerabilities before adding them
Require all CI checks to pass before merging Require 1–2 reviewer approvals Disallow direct pushes to main/master Quick Checklist Before Submitting a PR All tests pass (npm test, pytest, etc.) Code is formatted (run prettier --write, black, etc.) No secrets or sensitive data committed Documentation updated PR description explains the change clearly |
Beta Was this translation helpful? Give feedback.
Before a pull request (PR) is accepted, most projects require a standard set of CI checks to pass and follow specific style/lint/test conventions. While exact requirements vary by project, here are the common expectations:
Required CI Checks
Check Type | Purpose | Common Tools -- | -- | -- Linting | Enforces code style & catches syntax errors | ESLint, Pylint, RuboCop, Flake8 Formatting | Ensures consistent code formatting | Prettier, Black, gofmt Unit Tests | Verifies individual components work | Jest, pytest, JUnit, Mocha Integration Tests | Tests component interactions | Cypress, Selenium, pytest-integration Build/Compilation | Confirms code compiles successfully | npm build, mvn, gr…