ci: add linelint and normalise whitespace across first-party files - #2490
Conversation
Adds the linelint action (issue #2300) to the lint workflow, together with a .linelint.yml configuration which excludes the vendored nlohmann and libsexpp trees, the parser test fixtures under src/tests/data, the Windows SDK finder module and the UTF-8 manifest fixture consumed by the msys2 workflow, since those files are meant to keep their exact bytes. To satisfy the checks, trailing whitespace was stripped from the lint workflows, the issue template, cli_tests.py, cli_common.py and docs/develop.adoc, and a missing final newline was added to nineteen first-party sources. The changes are whitespace-only: git diff -w shows no content change, and the python and YAML files still parse.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2490 +/- ##
=======================================
Coverage 85.45% 85.45%
=======================================
Files 125 125
Lines 23042 23043 +1
=======================================
+ Hits 19691 19692 +1
Misses 3351 3351 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
linelint fails with 'No valid rule enabled' when the configuration file omits the rules section, so the five rules are now enabled explicitly. The exclusion list is unchanged.
linelint reads the rules and exclude lists from the top level of the configuration file, not from under a wrapper key. The previous nesting produced 'No valid rule enabled' and a failing job.
The fernandrone/linelint action is pinned to 0.0.6, whose configuration schema differs from the current project README: the only supported rule is end-of-file, controlled by rules.end-of-file.enable, and exclusions use gitignore-style ignore patterns. The previous configuration file followed the newer schema, so the pinned version parsed it to zero enabled rules and failed with "No valid rule enabled". Rewrite the configuration for the 0.0.6 schema, enable the end-of-file rule with single-new-line, and normalise the eleven first-party files that ended without a final newline or with a trailing blank line. The cmake/version.cmake file is excluded because the version-cmake-up-to-date job diffs it byte-for-byte against rnpgp/cmake-versioning, whose copy does not end with a newline.
|
The repeated "No valid rule enabled" failure is now root-caused and fixed in a83d19c. The action is pinned to fernandrone/[email protected], and that version parses a different configuration schema from the one shown in the project README today: the only rule it implements is end-of-file (configured through The configuration is rewritten for the 0.0.6 schema, and the eleven first-party files that ended without a final newline or with a trailing blank line are normalised so the tree passes the end-of-file rule. One exclusion is deliberate and documented in the configuration file: Please note that with version 0.0.6 the enforced rule set is the end-of-file rule only; rules such as trailing whitespace or conflict markers are not implemented in that release. The whitespace normalisation already carried by this pull request remains in place, and upgrading the pinned action at a later time would allow re-enabling the broader rule set. I verified the new configuration and the normalisation locally with a linelint 0.0.6 binary built from the upstream tag, and the full tree passes. Thank you. |
Summary
.linelint.ymlconfiguration.src/tests/data(whose exact bytes, including deliberate malformed armour, trailing whitespace and CRLF endings, are part of the tests), the Windows SDK finder module and the UTF-8 manifest fixture which the msys2 workflow embeds throughmt.exe.cli_tests.py,cli_common.pyanddocs/develop.adoc, and a missing final newline was added to nineteen first-party sources.git diff -wover the patch is empty, and the modified Python and YAML files still parse. No behaviour changes.Test plan
cli_tests.pyandcli_common.pystill compile (py_compile)