Skip to content

Commit

Permalink
fix(linter)!: Use --output-format in the RUFF linter (#77)
Browse files Browse the repository at this point in the history
The `--format` option has been renamed to `--output-format` in
astral-sh/ruff#7984

This is a breaking change and we require ruff>=0.0.291 to be compatible.
  • Loading branch information
justinchuby authored Oct 16, 2023
1 parent ff376a5 commit 6aba46c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ init_command = [
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'ruff==0.0.262',
'ruff==0.0.291',
]
is_formatter = true

Expand Down
4 changes: 2 additions & 2 deletions lintrunner_adapters/adapters/ruff_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def check_files(
"ruff",
"--exit-zero",
"--quiet",
"--format=json",
"--output-format=json",
*([f"--config={config}"] if config else []),
*filenames,
],
Expand Down Expand Up @@ -238,7 +238,7 @@ def check_file_for_fixes(

def main() -> None:
parser = argparse.ArgumentParser(
description=f"Ruff linter. Linter code: {LINTER_CODE}. Use with RUFF-FIX to auto-fix issues.",
description=f"Ruff linter with auto-fix support. Linter code: {LINTER_CODE}.",
fromfile_prefix_chars="@",
)
parser.add_argument(
Expand Down
4 changes: 2 additions & 2 deletions lintrunner_adapters/adapters/rustfmt_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def check_file(
replacement=None,
description=(
"Possible rustfmt bug. "
"rustfmt returned error output but didn't fail:\n{}"
).format(clean_err),
f"rustfmt returned error output but didn't fail:\n{clean_err}"
),
)
]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ warn_unused_ignores = false

[tool.poetry]
name = "lintrunner-adapters"
version = "0.9.0"
version = "0.10.0"
description = "Adapters and tools for lintrunner"
authors = ["Justin Chu <justinchu@microsoft.com>"]
license = "MIT"
Expand Down

0 comments on commit 6aba46c

Please sign in to comment.