Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lint-style): make sure to read the nolints file outside of t… #19384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Nov 22, 2024

…he linter implementation

This way, we categorically prevent cache invalidation bugs caused by lake replaying unchanged inputs, and thus not reaction to changes in the linter exceptions. For syntax linters, such a bug actually occurred in mathlib. (With the current implementation of text-based linters, this issue won't occur; this is merely a defensive change.)

Suggested in #19275.


Open in Gitpod

…he linter implementation

This way, we categorically prevent cache invalidation bugs caused by lake
replaying unchanged inputs, and thus not reaction to changes in the linter
exceptions. For *syntax linters*, such a bug actually occurred in mathlib.
(With the current implementation of text-based linters, this issue won't
occur; this is merely a defensive change.)
Copy link

PR summary 6285a3e4b5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

def lintModules (moduleNames : Array Lean.Name) (style : ErrorFormat) (fix : Bool) : IO UInt32 := do
-- Read the `nolints` file, with manual exceptions for the linter.
let nolints ← IO.FS.lines ("scripts" / "nolints-style.txt")
def lintModules (nolints: Array String) (moduleNames : Array Lean.Name) (style : ErrorFormat)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def lintModules (nolints: Array String) (moduleNames : Array Lean.Name) (style : ErrorFormat)
def lintModules (nolints : Array String) (moduleNames : Array Lean.Name) (style : ErrorFormat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-linter Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants