Repository navigation
lint: adopt a baseline and gate only on new failures - #173
Open
abu-tahir-0 wants to merge 1 commit into
Open
abu-tahir-0 wants to merge 1 commit into
abu-tahir-0 wants to merge 1 commit into
Conversation
lint had no baseline, so a repository with forty undocumented parameters could not turn it on. --write-baseline records today's failures (stdio included) and --baseline marks them accepted, exactly as scan does, so the exit code reflects only what is new.
This branch has not been deployed
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.
Problem
scansupports baselines;lintdid not. A repository with dozens of undocumented parameters could not switch lint on without fixing all of them first. Closes #152.Solution
lint --baseline FILEloads the same baseline format asscanand applies it with the existingtriage.apply_baseline: known failures are marked baselined and stay in the report, anything else still gates. A rule that did not exist in the baseline keeps its "new by construction" flag.lint --write-baseline FILErecords the current lint failures. This is the missing half for stdio servers:baseline createonly takes an endpoint, so without it a--commandserver had no way to produce the file.docs/USING.mdshow the two commands together.Testing
tests/harness/test_stdio_lint.py— two new end-to-end tests against a stdio server:--write-baselineexits 1 and records the failure; re-running with--baselineexits 0 and reports that finding undersummary.gating.baselined.ruleIdsand entries makes that failure gate again and marks itruleIsNewSinceBaseline.pytest tests/harness/test_stdio_lint.py— 4 passed.ruff check .— clean;mypy— success (56 files).The full unit suite is unchanged elsewhere; the four
-n autofailures intest_population,test_grayboxandtest_fleet_serviceare the known environment-dependent ones that also fail onmain.Impact
lintcan now be adopted by an existing repository and fail only on regressions, on HTTP and stdio alike.