Skip to content

ci: add linelint and normalise whitespace across first-party files - #2490

Merged
ronaldtse merged 4 commits into
mainfrom
ci-linelint-2300
Sep 24, 2026
Merged

ronaldtse merged 4 commits into
mainfrom
ci-linelint-2300

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

  • Adds the linelint action to the lint workflow, as suggested by @ni4 in Add linelint to the lint workflows. #2300, together with a .linelint.yml configuration.
  • The configuration excludes the vendored nlohmann and libsexpp trees, the parser test fixtures under 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 through mt.exe.
  • To satisfy the checks, trailing whitespace was stripped from six 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 and provably so: git diff -w over the patch is empty, and the modified Python and YAML files still parse. No behaviour changes.

Test plan

  • cli_tests.py and cli_common.py still compile (py_compile)
  • the six workflows still parse as YAML
  • the linelint job passes with the new configuration
  • full lint workflow on the PR

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

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.45%. Comparing base (26482f6) to head (a83d19c).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@ronaldtse

Copy link
Copy Markdown
Contributor Author

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 rules.end-of-file.enable), and file exclusions are declared with gitignore-style ignore patterns rather than exclude. Because unknown keys are dropped silently, the previous configuration parsed to zero enabled rules and the tool aborted.

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: cmake/version.cmake keeps its exact bytes because the version-cmake-up-to-date job diffs it byte-for-byte against the copy in rnpgp/cmake-versioning, and the upstream copy does not end with a newline.

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.

@ni4 ni4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ronaldtse
ronaldtse merged commit 7324380 into main Sep 24, 2026
148 of 150 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants