Skip to content

Commit d8cf71c

Browse files
chrisjsewelldanieleadespicnixz
authored
🔧 Setup ruff format (initially excluding all files) (#12136)
Co-authored-by: danieleades <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
1 parent b0f096f commit d8cf71c

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- name: Lint with Ruff
3737
run: ruff check . --output-format github
3838

39+
- name: Format with Ruff
40+
run: ruff format . --diff
41+
3942
flake8:
4043
runs-on: ubuntu-latest
4144

.ruff.toml

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ select = [
4949
# mccabe ('C90')
5050
# "C901", # `{name}` is too complex ({complexity} > {max_complexity})
5151
# flake8-commas ('COM')
52-
"COM812", # Trailing comma missing
5352
"COM818", # Trailing comma on bare tuple prohibited
5453
"COM819", # Trailing comma prohibited
5554
# flake8-copyright ('CPY')
@@ -422,3 +421,70 @@ inline-quotes = "single"
422421
forced-separate = [
423422
"tests",
424423
]
424+
425+
[format]
426+
quote-style = "single"
427+
exclude = [
428+
"doc/**/*",
429+
"sphinx/__init__.py",
430+
"sphinx/addnodes.py",
431+
"sphinx/application.py",
432+
"sphinx/builders/**/*",
433+
"sphinx/cmd/**/*",
434+
"sphinx/config.py",
435+
"sphinx/deprecation.py",
436+
"sphinx/directives/**/*",
437+
"sphinx/domains/**/*",
438+
"sphinx/environment/**/*",
439+
"sphinx/errors.py",
440+
"sphinx/events.py",
441+
"sphinx/ext/**/*",
442+
"sphinx/extension.py",
443+
"sphinx/highlighting.py",
444+
"sphinx/io.py",
445+
"sphinx/jinja2glue.py",
446+
"sphinx/locale/__init__.py",
447+
"sphinx/parsers.py",
448+
"sphinx/project.py",
449+
"sphinx/pycode/**/*",
450+
"sphinx/pygments_styles.py",
451+
"sphinx/registry.py",
452+
"sphinx/roles.py",
453+
"sphinx/search/**/*",
454+
"sphinx/templates/**/*",
455+
"sphinx/testing/**/*",
456+
"sphinx/theming.py",
457+
"sphinx/transforms/**/*",
458+
"sphinx/util/**/*",
459+
"sphinx/versioning.py",
460+
"sphinx/writers/**/*",
461+
"tests/certs/**/*",
462+
"tests/conftest.py",
463+
"tests/roots/**/*",
464+
"tests/test_addnodes.py",
465+
"tests/test_application.py",
466+
"tests/test_builders/**/*",
467+
"tests/test_config/**/*",
468+
"tests/test_directives/**/*",
469+
"tests/test_domains/**/*",
470+
"tests/test_environment/**/*",
471+
"tests/test_errors.py",
472+
"tests/test_events.py",
473+
"tests/test_extensions/**/*",
474+
"tests/test_highlighting.py",
475+
"tests/test_intl/**/*",
476+
"tests/test_markup/**/*",
477+
"tests/test_project.py",
478+
"tests/test_pycode/**/*",
479+
"tests/test_quickstart.py",
480+
"tests/test_roles.py",
481+
"tests/test_search.py",
482+
"tests/test_theming/**/*",
483+
"tests/test_toctree.py",
484+
"tests/test_transforms/**/*",
485+
"tests/test_util/**/*",
486+
"tests/test_versioning.py",
487+
"tests/test_writers/**/*",
488+
"tests/utils.py",
489+
"utils/**/*",
490+
]

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PYTHON ?= python3
22

33
.PHONY: all
4-
all: style-check type-check test
4+
all: format style-check type-check doclinter test
55

66
.PHONY: check
77
check: style-check type-check doclinter
@@ -48,6 +48,10 @@ style-check:
4848
@flake8 .
4949
@ruff check .
5050

51+
.PHONY: format
52+
format:
53+
@ruff format .
54+
5155
.PHONY: type-check
5256
type-check:
5357
@mypy

0 commit comments

Comments
 (0)