mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
🔧 Setup ruff format (initially excluding all files) (#12136)
Co-authored-by: danieleades <33452915+danieleades@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
3
.github/workflows/lint.yml
vendored
3
.github/workflows/lint.yml
vendored
@@ -36,6 +36,9 @@ jobs:
|
|||||||
- name: Lint with Ruff
|
- name: Lint with Ruff
|
||||||
run: ruff check . --output-format github
|
run: ruff check . --output-format github
|
||||||
|
|
||||||
|
- name: Format with Ruff
|
||||||
|
run: ruff format . --diff
|
||||||
|
|
||||||
flake8:
|
flake8:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|||||||
68
.ruff.toml
68
.ruff.toml
@@ -49,7 +49,6 @@ select = [
|
|||||||
# mccabe ('C90')
|
# mccabe ('C90')
|
||||||
# "C901", # `{name}` is too complex ({complexity} > {max_complexity})
|
# "C901", # `{name}` is too complex ({complexity} > {max_complexity})
|
||||||
# flake8-commas ('COM')
|
# flake8-commas ('COM')
|
||||||
"COM812", # Trailing comma missing
|
|
||||||
"COM818", # Trailing comma on bare tuple prohibited
|
"COM818", # Trailing comma on bare tuple prohibited
|
||||||
"COM819", # Trailing comma prohibited
|
"COM819", # Trailing comma prohibited
|
||||||
# flake8-copyright ('CPY')
|
# flake8-copyright ('CPY')
|
||||||
@@ -422,3 +421,70 @@ inline-quotes = "single"
|
|||||||
forced-separate = [
|
forced-separate = [
|
||||||
"tests",
|
"tests",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[format]
|
||||||
|
quote-style = "single"
|
||||||
|
exclude = [
|
||||||
|
"doc/**/*",
|
||||||
|
"sphinx/__init__.py",
|
||||||
|
"sphinx/addnodes.py",
|
||||||
|
"sphinx/application.py",
|
||||||
|
"sphinx/builders/**/*",
|
||||||
|
"sphinx/cmd/**/*",
|
||||||
|
"sphinx/config.py",
|
||||||
|
"sphinx/deprecation.py",
|
||||||
|
"sphinx/directives/**/*",
|
||||||
|
"sphinx/domains/**/*",
|
||||||
|
"sphinx/environment/**/*",
|
||||||
|
"sphinx/errors.py",
|
||||||
|
"sphinx/events.py",
|
||||||
|
"sphinx/ext/**/*",
|
||||||
|
"sphinx/extension.py",
|
||||||
|
"sphinx/highlighting.py",
|
||||||
|
"sphinx/io.py",
|
||||||
|
"sphinx/jinja2glue.py",
|
||||||
|
"sphinx/locale/__init__.py",
|
||||||
|
"sphinx/parsers.py",
|
||||||
|
"sphinx/project.py",
|
||||||
|
"sphinx/pycode/**/*",
|
||||||
|
"sphinx/pygments_styles.py",
|
||||||
|
"sphinx/registry.py",
|
||||||
|
"sphinx/roles.py",
|
||||||
|
"sphinx/search/**/*",
|
||||||
|
"sphinx/templates/**/*",
|
||||||
|
"sphinx/testing/**/*",
|
||||||
|
"sphinx/theming.py",
|
||||||
|
"sphinx/transforms/**/*",
|
||||||
|
"sphinx/util/**/*",
|
||||||
|
"sphinx/versioning.py",
|
||||||
|
"sphinx/writers/**/*",
|
||||||
|
"tests/certs/**/*",
|
||||||
|
"tests/conftest.py",
|
||||||
|
"tests/roots/**/*",
|
||||||
|
"tests/test_addnodes.py",
|
||||||
|
"tests/test_application.py",
|
||||||
|
"tests/test_builders/**/*",
|
||||||
|
"tests/test_config/**/*",
|
||||||
|
"tests/test_directives/**/*",
|
||||||
|
"tests/test_domains/**/*",
|
||||||
|
"tests/test_environment/**/*",
|
||||||
|
"tests/test_errors.py",
|
||||||
|
"tests/test_events.py",
|
||||||
|
"tests/test_extensions/**/*",
|
||||||
|
"tests/test_highlighting.py",
|
||||||
|
"tests/test_intl/**/*",
|
||||||
|
"tests/test_markup/**/*",
|
||||||
|
"tests/test_project.py",
|
||||||
|
"tests/test_pycode/**/*",
|
||||||
|
"tests/test_quickstart.py",
|
||||||
|
"tests/test_roles.py",
|
||||||
|
"tests/test_search.py",
|
||||||
|
"tests/test_theming/**/*",
|
||||||
|
"tests/test_toctree.py",
|
||||||
|
"tests/test_transforms/**/*",
|
||||||
|
"tests/test_util/**/*",
|
||||||
|
"tests/test_versioning.py",
|
||||||
|
"tests/test_writers/**/*",
|
||||||
|
"tests/utils.py",
|
||||||
|
"utils/**/*",
|
||||||
|
]
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -1,7 +1,7 @@
|
|||||||
PYTHON ?= python3
|
PYTHON ?= python3
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: style-check type-check test
|
all: format style-check type-check doclinter test
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: style-check type-check doclinter
|
check: style-check type-check doclinter
|
||||||
@@ -48,6 +48,10 @@ style-check:
|
|||||||
@flake8 .
|
@flake8 .
|
||||||
@ruff check .
|
@ruff check .
|
||||||
|
|
||||||
|
.PHONY: format
|
||||||
|
format:
|
||||||
|
@ruff format .
|
||||||
|
|
||||||
.PHONY: type-check
|
.PHONY: type-check
|
||||||
type-check:
|
type-check:
|
||||||
@mypy
|
@mypy
|
||||||
|
|||||||
Reference in New Issue
Block a user