FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace Flake8 with Ruff and add more linting for GitHub Actions by hugovk · Pull Request #189 · python/python-docs-theme · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .toml  (1) .yaml  (1) .yml  (1) dotfile  (1) All 5 file types selected
Only manifest files
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
--build-root ./build_root
--www-root ./www
--log-directory ./logs
--group $(id -g)
--group "$(id -g)"
--skip-cache-invalidation
--theme $(pwd)
--theme "$(pwd)"
--language en
--branch ${{ matrix.branch }}
- name: Show logs
Expand Down
42 changes: 18 additions & 24 deletions .pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- id: ruff
args: [--exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
rev: 24.4.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
[flake8-2020, flake8-implicit-str-concat, flake8-logging]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -38,8 +21,19 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
hooks:
- id: actionlint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 1.8.0
hooks:
- id: pyproject-fmt
args: [--max-supported-python=3.13]
Expand Down
32 changes: 29 additions & 3 deletions pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,32 @@ include = [
"python_docs_theme/",
]

[tool.isort]
add_imports = "from __future__ import annotations"
profile = "black"
[tool.ruff]
fix = true

[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"F", # pyflakes errors
"I", # isort
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PYI", # flake8-pyi
"RUF100", # unused noqa (yesqa)
"RUF022", # unsorted-dunder-all
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]


[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
2 changes: 1 addition & 1 deletion python_docs_theme/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _asset_hash(path: str) -> str:
def _add_asset_hashes(static: list[str], add_digest_to: list[str]) -> None:
for asset in add_digest_to:
index = static.index(asset)
static[index].filename = _asset_hash(asset) # type: ignore
static[index].filename = _asset_hash(asset) # type: ignore[attr-defined]


def _html_page_context(
Expand Down

Back | FazBrowse Home | New Git URL