Repository navigation
Conversation
End-of-file whitespace fixes in non-shell files from the pre-commit run. The shell-script reformatting is grouped in 'qual: reformat shell scripts (beautysh)'; the .cache/cppcheck/.gitkeep addition and the .gitignore update are part of 'qual: Add pre-commit flow'.
ef79b90 to
8471153
Compare
8471153 to
b633da8
Compare
cppcheck / cpplint hook results on this branchRunning the pre-commit flow on this branch, the cppcheck and cpplint hooks still fail. These are pre-existing issues in the upstream C code, not introduced by this branch — the branch only adds the hooks and their configuration. shellcheck, beautysh, mdformat and the generic pre-commit-hooks pass.
I can undertake actions to ignore or fix multiple instances of these (e.g. add suppressions to the cppcheck/cpplint hook configuration, or fix the code in follow-up PRs), but I am waiting for feedback on the preferred direction before doing so. cppcheck notices (230)cpplint notices (257 lines, 257 total errors) |
907a660 to
882d878
Compare
882d878 to
44265bd
Compare
|
As mentioned previously. pre-commit is not a fit. cpplint is also Google's C++ linter, also not needed. Superseded by #1201 |
If you mentioned it, I overlooked it or misunderstood - the only comment I know (#982 (comment)) - was for an old PR with conflicts. Through the hooks, pre-commit also helps maintain a consistent style. Anyway, not proposing again & will remove my fork. |
|
Also note that several of the cppcheck notices reported through the pre-commit workflow merit attention. For instance, I know that "(shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour" is real (I had an intel processor not honoring a 32-bit shift, the value stayed the same), and others are at least suspicious/fixable. |
Ah, no. Sorry. That is my fault. That is what I mentioned in 982 however. |
Mixed fixes between #1188 and #1201 -- If there are more I missed, please do feel free to submit 🙇♂️ |
|
If the same issues are not captured by your integration of cppcheck in a workflow, than the latter needs to change as catching the issues is more important than "fixing" them. Fixing is a an implicit side-effect when the checks are in ci. |
|
CI can be updated. Just pre-commit isn't really a fit |
Adds the pre-commit flow (
.pre-commit-config.yaml,.github/workflows/pre-commit.yml,uncrustify.cfg,.gitignore) together with the fixes integrated in this branch. Given these integrated fixes, most pre-commit hooks pass on this branch — the cppcheck and cpplint hooks still fail on pre-existing issues in the C code (summarized in a comment below with the full notice lists).Integrated fixes:
.cache/cppcheck/.gitkeep: the cppcheck hook passes--cppcheck-build-dir=.cache/cppcheck/, and cppcheck refuses to run when that directory does not exist (cppcheck: error: Directory '...' specified by --cppcheck-build-dir argument has to be existent). Git does not track empty directories, so without.gitkeepa fresh clone has no.cache/cppcheck/and the hook fails immediately. The placeholder file keeps the directory present in every checkout; the workflow cleans cached files but preserves.gitkeep(find .cache -type f ! -name .gitkeep -delete).SKIP: no-commit-to-branch,uncrustify—uncrustify.cfgis added by this flow, but uncrustify is not enforced until the formatting rules are clarified.NEWS.mdandrsync.1.md. This can be skipped, split into a separate PR, or ignored via PR rules (e.g. path-based ignores for the.mdfiles) if you prefer to keep this PR focused on the pre-commit flow itself.-DHAVE_GETGROUPS:config.his generated and gitignored, so cppcheck in CI never sees it and analyzed the fallback branch — producing the misleading notice behind qual: fix cppcheck notice(s) #1195 (suggestingconstfor the buffer thatgetgroups()writes into). Defining it makes cppcheck analyze the real code paths, so no source change is needed.popt/,zlib/,rsync-web/,params.c): vendored/external content is left untouched by the hooks and by this branch.check-shebang-scripts-are-executablehook: per qual: Executable bit for files with shebang #1189, scripts keep their shebangs without the executable bit (they are not invoked directly), so file modes are left unchanged.constcommits were dropped: upstream ci: run ShellCheck on all tracked shell scripts #1198 already rewrote those scripts to pass ShellCheck, and qual: fix cppcheck notice(s) #1195'sconstsuggestion no longer occurs withHAVE_GETGROUPSdefined.The remaining updates included in this PR (trailing blank-line removals in
TODOandpackaging/solaris/build_pkg.sh, and the automated mdformat/beautysh fixes described above) can each be split into separate PRs if desired — or ignored via updates to the PR rules (e.g. path-based ignores for those files) if you prefer to keep this PR focused on the pre-commit flow itself.