Repository navigation
ci: ./lint formats only the files changed since origin/master (#1050) - #1052
Merged
Merged
Conversation
On a PR the lint lane is the only clang-format/gersemi check, so CI (GITHUB_ACTIONS) still checks every file. Locally the lane checks only committed, staged, unstaged and untracked changes since the merge-base with origin/master; every file again when there is no merge-base or the change touches .clang-format, .gersemirc or the pins in ci/local_gate.py. Refs #1050
…nfig Review finding: an unrebased branch whose base predates a clang-format or gersemi pin bump (or a .clang-format change) would pass the narrowed local check against the old rules. Configuration that changed between the merge-base and origin/master now counts as changed, so every file is checked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1050 (part of #939).
Change
Locally,
./lintruns clang-format and gersemi only on files changed since the merge-base withorigin/master: committed, staged, unstaged and untracked. Before, it checked all 6,593 tracked files, about 48 s of./lint.Every file is still checked when:
GITHUB_ACTIONS). On a PR this lane is the only format check, becausecheck-format.yamlruns those only on pushes;origin/master);.clang-formator.gersemircin any directory, orci/local_gate.py(the tool pins and file lists);Unchanged files are already formatted on master, where every push checks every file. So a local stamp covers the same ground as before.
The other half of #1050 is already done by #427. The
ci/self-tests run in the Checks job, andOBS_GATE_SKIP_SELF_TEST=1skips them in the lane, so no change is needed here.Evidence
FormatScopeTest(CI, local, unknown base, config change) andFormatScopeUpstreamConfigTestfail first and pass now. All ofci/test_local_gate.pypasses.ci/local_gate.py.--fixnow also narrows, so it no longer reformats drift in files you didn't touch.