Skip to content

Commit

Permalink
[lint] fix spurious annotations on formatting linters
Browse files Browse the repository at this point in the history
We would for some reason report formatting-based lints as showing up at
line 1 column 1. This removes them for now. Maybe eventually we can
recover better line numbers from the formatting diff and post messages
for each diff cluster, but that requires actual changes to the linting
engine.

Pull Request resolved: pytorch#75928

Approved by: https://github.com/janeyx99
  • Loading branch information
suo authored and pytorchmergebot committed Apr 16, 2022
1 parent 977a66f commit d8374ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .lintrunner.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[init_config]
last_hash = "7d8b366223b22aaab788b0a7efec064dfef38b24"

[[linter]]
code = 'FLAKE8'
include_patterns = ['**/*.py']
Expand Down
4 changes: 2 additions & 2 deletions tools/linter/adapters/circleci_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def run_check(
return [
LintMessage(
path=config_file,
line=1,
char=1,
line=None,
char=None,
code="CIRCLECI",
severity=LintSeverity.ERROR,
name="config inconsistency",
Expand Down
4 changes: 2 additions & 2 deletions tools/linter/adapters/clangformat_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def check_file(
return [
LintMessage(
path=filename,
line=1,
char=1,
line=None,
char=None,
code="CLANGFORMAT",
severity=LintSeverity.WARNING,
name="format",
Expand Down
4 changes: 2 additions & 2 deletions tools/linter/adapters/nativefunctions_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class LintMessage(NamedTuple):
if contents != new_contents:
msg = LintMessage(
path=args.native_functions_yml,
line=1,
char=1,
line=None,
char=None,
code="NATIVEFUNCTIONS",
severity=LintSeverity.ERROR,
name="roundtrip inconsistency",
Expand Down

0 comments on commit d8374ef

Please sign in to comment.