Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace Flake8 with Ruff and add more linting for GitHub Actions#189

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 3 commits intopython:mainfromhugovk:replace-flake8-with-ruff
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions.flake8
View file
Open in desktop

This file was deleted.

4 changes: 2 additions & 2 deletions.github/workflows/tests.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionpython_docs_theme/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
Loading

[8]ページ先頭

©2009-2025 Movatter.jp