chore(linters): Reorder linters, make hadolint ignores more specific#832
chore(linters): Reorder linters, make hadolint ignores more specific#832MaxymVlasov merged 11 commits intomasterfrom
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request reorganizes the configuration for pre-commit linting and updates Dockerfile instructions. In the pre-commit configuration, the hadolint hook is reintroduced without previous ignore arguments, and a new Bash section with shfmt and shellcheck hooks is added. The YAML and JSON5 linter sections are streamlined, with obsolete comments removed. In the Dockerfiles, comments have been added to clarify linting rules for Docker RUN commands, and the testing Dockerfile now uses Alpine’s package manager (apk) to install datamash, simplifying the dependency installation process. Changes
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Sadly, but hadolint ignore doesn't work if there any symbol on the same line - ignore stop working. That's why set justification on different line to hadolint ignore comment
| # Cleanup | ||
| rm -rf /var/lib/apt/lists/* | ||
| RUN apk add --no-cache \ | ||
| datamash=~1.8 |
There was a problem hiding this comment.
I found that we changed base image to alpine a long time ago :)
|
|
||
| # Checking binaries versions and write it to debug file | ||
|
|
||
| # SC2086 - We do not need to quote "$F" variable, because it's not contain spaces |
There was a problem hiding this comment.
It doesn't hurt to wrap in double quotes though and the benefit would be to not skip this check is we, by any chance, will add any new var into this code block.
There was a problem hiding this comment.
If we add new vars here, it should be moved to separate .sh file, as it will become too complicated
There was a problem hiding this comment.
But the skipping check may remain and will disable checking it =)
There was a problem hiding this comment.
It's always a good idea to use the "${VAR}" syntax for consistency and to prevent unexpected behavior happening due to changes in seemingly unrelated places not having been caught because of some forgotten linting suppression.
There was a problem hiding this comment.
Despite the use of curly brackets is also encouraged by at least some shell linters I guess, I'd argue against it as curly brackets denote variable expansion syntax, which is pointless where no expansion is meant or expected.
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
|
|
||
| # Checking binaries versions and write it to debug file | ||
|
|
||
| # SC2086 - We do not need to quote "$F" variable, because it's not contain spaces |
There was a problem hiding this comment.
But the skipping check may remain and will disable checking it =)
|
This PR is included in version 1.98.0 🎉 |
Split from #831
Hadolint supports its own config file, and that make able 3rd-party tools that utilize hadolint also known about specified config options, not pre-commit only