Linting#
Automate code formatting and static code analysis. Integrate linting into the feature branch workflow.
Dryer lint traps capture waste fibers shed by laundry instead of letting them dirty our homes. Linters are computer programs that capture stylistic mistakes or code quality problems instead of letting them dirty our code. Linters perform static code analysis that flags stylistic mistakes, programming errors, design defects, and suspicious constructs in source code.
Recommended Software#
Guidance
Developers SHOULD use the latest versions of the listed tools to format code and perform static code analysis.
pre-commit, a multi-language pre-commit hook management framework
flake8, a Python linter
Black, a Python code formatter
isort, which runs before Black to sort Python import statements
tflint, a Terraform linter
checkov, which scans cloud infrastructure configurations to find misconfigurations before they’re deployed
trivy, which finds vulnerabilities (CVE) and misconfigurations (IaC) across code repositories, binary artifacts, container images, Kubernetes clusters, and more
ShellCheck, a static code analysis tool for shell scripts
actionlint, a static checker for GitHub Actions workflow definitions