Skip to content

Commit

Permalink
Linting: Aggressive ruff pass (ruff v0.3.4, #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Mar 24, 2024
2 parents 77c30a8 + 19d6b1f commit 5bbe6bf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ $ pipx install --suffix=@next g --pip-args '\--pre' --force

### Development

- Aggressive automated lint fixes via `ruff` (#23)

via ruff v0.3.4, all automated lint fixes, including unsafe and previews were applied:

```sh
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
```

Branches were treated with:

```sh
git rebase \
--strategy-option=theirs \
--exec 'poetry run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; poetry run ruff format .; git add src tests; git commit --amend --no-edit' \
origin/master
```
- poetry: 1.7.1 -> 1.8.1

See also: https://github.com/python-poetry/poetry/blob/1.8.1/CHANGELOG.md
Expand Down
17 changes: 8 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,14 @@ def linkcode_resolve(domain: str, info: t.Dict[str, str]) -> t.Union[None, str]:
fn,
linespec,
)
else:
return "{}/blob/v{}/{}/{}/{}{}".format(
about["__github__"],
about["__version__"],
"src",
about["__package_name__"],
fn,
linespec,
)
return "{}/blob/v{}/{}/{}/{}{}".format(
about["__github__"],
about["__version__"],
"src",
about["__package_name__"],
fn,
linespec,
)


def remove_tabs_js(app: "Sphinx", exc: Exception) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/g/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import typing as t
from os import PathLike

__all__ = ["sys", "vcspath_registry", "DEFAULT", "run"]
__all__ = ["DEFAULT", "run", "sys", "vcspath_registry"]

vcspath_registry = {".git": "git", ".svn": "svn", ".hg": "hg"}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_output(


@pytest.mark.parametrize(
"argv_args,expect_cmd",
("argv_args", "expect_cmd"),
[
(["g"], "git"),
(["g", "--help"], "git --help"),
Expand Down

0 comments on commit 5bbe6bf

Please sign in to comment.