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

Bump ruff-pre-commit to v0.3.2 #412

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: check-docstring-first

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.2
hooks:
- id: ruff
- id: ruff-format
39 changes: 21 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,30 @@ extend-exclude = [
]

[tool.ruff.lint]
ignore = [
"ISC001", # prevent conflicts with the formatter
]
unfixable = [
"ERA", # do not autoremove commented out code
"ERA", # do not autoremove commented out code
]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ERA", # flake8-eradicate/eradicate
"I", # isort
"N", # pep8-naming
"PIE", # flake8-pie
"PGH", # pygrep
"PTH", # flake8-use-pathlib
"ISC", # flake8-implicit-string-concat
"RET", # flake8-return
"FLY", # flynt
"PERF", # perflint
"RUF", # ruff checks
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ERA", # flake8-eradicate/eradicate
"I", # isort
"N", # pep8-naming
"PIE", # flake8-pie
"PGH", # pygrep
"PTH", # flake8-use-pathlib
"ISC", # flake8-implicit-string-concat
"RET", # flake8-return
"FLY", # flynt
"PERF", # perflint
"RUF", # ruff checks
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]

[tool.ruff.lint.flake8-tidy-imports]
Expand Down
2 changes: 1 addition & 1 deletion src/cleo/ui/progress_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _overwrite(self, message: str) -> None:
Overwrites a previous message to the output.
"""
if self._io.is_decorated():
self._io.write("\x0D\x1B[2K")
self._io.write("\x0d\x1b[2K")
self._io.write(message)
else:
self._io.write_line(message)
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/test_progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def generate_output(expected: list[str]) -> str:
count = line.count("\n")

if count:
output += f"\x1B[{count}A\x1B[1G\x1b[2K"
output += f"\x1b[{count}A\x1b[1G\x1b[2K"
else:
output += "\x1b[1G\x1b[2K"

Expand Down
12 changes: 6 additions & 6 deletions tests/ui/test_progress_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ def test_default_indicator(ansi_io: BufferedIO, sleep: Callable[[float], None])
" | Done...",
]

expected = "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected = "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

output = [" - Starting Again...", " \\ Starting Again...", " \\ Done Again..."]

expected += "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected += "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

output = [" - Starting Again...", " \\ Starting Again...", " - Done Again..."]

expected += "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected += "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

Expand Down Expand Up @@ -106,19 +106,19 @@ def test_explicit_format(ansi_io: BufferedIO, sleep: Callable[[float], None]) ->
" | Done...",
]

expected = "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected = "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

output = [" - Starting Again...", " \\ Starting Again...", " \\ Done Again..."]

expected += "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected += "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

output = [" - Starting Again...", " \\ Starting Again...", " - Done Again..."]

expected += "\x0D\x1B[2K" + "\x0D\x1B[2K".join(output)
expected += "\x0d\x1b[2K" + "\x0d\x1b[2K".join(output)

expected += "\n"

Expand Down