Skip to content

Commit bec014c

Browse files
authored
Cease using flake8 (#13204)
1 parent 4bf0b2b commit bec014c

18 files changed

+95
-159
lines changed

.flake8

-38
This file was deleted.

.github/workflows/lint.yml

-22
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,6 @@ jobs:
4545
- name: Format with Ruff
4646
run: ruff format . --diff
4747

48-
flake8:
49-
runs-on: ubuntu-latest
50-
51-
steps:
52-
- uses: actions/checkout@v4
53-
with:
54-
persist-credentials: false
55-
- name: Set up Python
56-
uses: actions/setup-python@v5
57-
with:
58-
python-version: "3"
59-
- name: Install uv
60-
run: >
61-
curl --no-progress-meter --location --fail
62-
--proto '=https' --tlsv1.2
63-
"https://astral.sh/uv/install.sh"
64-
| sh
65-
- name: Install dependencies
66-
run: uv pip install --upgrade "flake8>=6.0"
67-
- name: Lint with flake8
68-
run: flake8 .
69-
7048
mypy:
7149
runs-on: ubuntu-latest
7250

.ruff.toml

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ ignore = [
7777
"UP032", # Use f-string instead of `format` call
7878
]
7979
external = [ # Whitelist for RUF100 unknown code warnings
80-
"E704",
8180
"SIM113",
8281
]
8382
select = [

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ clean: clean
4545

4646
.PHONY: style-check
4747
style-check:
48-
@echo '[+] running flake8' ; flake8 .
4948
@echo '[+] running ruff' ; ruff check .
5049

5150
.PHONY: format

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ docs = [
8181
"sphinxcontrib-websupport",
8282
]
8383
lint = [
84-
"flake8>=6.0",
8584
"ruff==0.8.1",
8685
"mypy==1.13.0",
8786
"sphinx-lint>=0.9",

sphinx/application.py

+31-31
Original file line numberDiff line numberDiff line change
@@ -505,23 +505,23 @@ def require_sphinx(version: tuple[int, int] | str) -> None:
505505
# ---- Core events -------------------------------------------------------
506506

507507
@overload
508-
def connect( # NoQA: E704
508+
def connect(
509509
self,
510510
event: Literal['config-inited'],
511511
callback: Callable[[Sphinx, Config], None],
512512
priority: int = 500,
513513
) -> int: ...
514514

515515
@overload
516-
def connect( # NoQA: E704
516+
def connect(
517517
self,
518518
event: Literal['builder-inited'],
519519
callback: Callable[[Sphinx], None],
520520
priority: int = 500,
521521
) -> int: ...
522522

523523
@overload
524-
def connect( # NoQA: E704
524+
def connect(
525525
self,
526526
event: Literal['env-get-outdated'],
527527
callback: Callable[
@@ -531,47 +531,47 @@ def connect( # NoQA: E704
531531
) -> int: ...
532532

533533
@overload
534-
def connect( # NoQA: E704
534+
def connect(
535535
self,
536536
event: Literal['env-before-read-docs'],
537537
callback: Callable[[Sphinx, BuildEnvironment, list[str]], None],
538538
priority: int = 500,
539539
) -> int: ...
540540

541541
@overload
542-
def connect( # NoQA: E704
542+
def connect(
543543
self,
544544
event: Literal['env-purge-doc'],
545545
callback: Callable[[Sphinx, BuildEnvironment, str], None],
546546
priority: int = 500,
547547
) -> int: ...
548548

549549
@overload
550-
def connect( # NoQA: E704
550+
def connect(
551551
self,
552552
event: Literal['source-read'],
553553
callback: Callable[[Sphinx, str, list[str]], None],
554554
priority: int = 500,
555555
) -> int: ...
556556

557557
@overload
558-
def connect( # NoQA: E704
558+
def connect(
559559
self,
560560
event: Literal['include-read'],
561561
callback: Callable[[Sphinx, Path, str, list[str]], None],
562562
priority: int = 500,
563563
) -> int: ...
564564

565565
@overload
566-
def connect( # NoQA: E704
566+
def connect(
567567
self,
568568
event: Literal['doctree-read'],
569569
callback: Callable[[Sphinx, nodes.document], None],
570570
priority: int = 500,
571571
) -> int: ...
572572

573573
@overload
574-
def connect( # NoQA: E704
574+
def connect(
575575
self,
576576
event: Literal['env-merge-info'],
577577
callback: Callable[
@@ -581,47 +581,47 @@ def connect( # NoQA: E704
581581
) -> int: ...
582582

583583
@overload
584-
def connect( # NoQA: E704
584+
def connect(
585585
self,
586586
event: Literal['env-updated'],
587587
callback: Callable[[Sphinx, BuildEnvironment], str],
588588
priority: int = 500,
589589
) -> int: ...
590590

591591
@overload
592-
def connect( # NoQA: E704
592+
def connect(
593593
self,
594594
event: Literal['env-get-updated'],
595595
callback: Callable[[Sphinx, BuildEnvironment], Iterable[str]],
596596
priority: int = 500,
597597
) -> int: ...
598598

599599
@overload
600-
def connect( # NoQA: E704
600+
def connect(
601601
self,
602602
event: Literal['env-check-consistency'],
603603
callback: Callable[[Sphinx, BuildEnvironment], None],
604604
priority: int = 500,
605605
) -> int: ...
606606

607607
@overload
608-
def connect( # NoQA: E704
608+
def connect(
609609
self,
610610
event: Literal['write-started'],
611611
callback: Callable[[Sphinx, Builder], None],
612612
priority: int = 500,
613613
) -> int: ...
614614

615615
@overload
616-
def connect( # NoQA: E704
616+
def connect(
617617
self,
618618
event: Literal['doctree-resolved'],
619619
callback: Callable[[Sphinx, nodes.document, str], None],
620620
priority: int = 500,
621621
) -> int: ...
622622

623623
@overload
624-
def connect( # NoQA: E704
624+
def connect(
625625
self,
626626
event: Literal['missing-reference'],
627627
callback: Callable[
@@ -632,15 +632,15 @@ def connect( # NoQA: E704
632632
) -> int: ...
633633

634634
@overload
635-
def connect( # NoQA: E704
635+
def connect(
636636
self,
637637
event: Literal['warn-missing-reference'],
638638
callback: Callable[[Sphinx, Domain, addnodes.pending_xref], bool | None],
639639
priority: int = 500,
640640
) -> int: ...
641641

642642
@overload
643-
def connect( # NoQA: E704
643+
def connect(
644644
self,
645645
event: Literal['build-finished'],
646646
callback: Callable[[Sphinx, Exception | None], None],
@@ -650,15 +650,15 @@ def connect( # NoQA: E704
650650
# ---- Events from builtin builders --------------------------------------
651651

652652
@overload
653-
def connect( # NoQA: E704
653+
def connect(
654654
self,
655655
event: Literal['html-collect-pages'],
656656
callback: Callable[[Sphinx], Iterable[tuple[str, dict[str, Any], str]]],
657657
priority: int = 500,
658658
) -> int: ...
659659

660660
@overload
661-
def connect( # NoQA: E704
661+
def connect(
662662
self,
663663
event: Literal['html-page-context'],
664664
callback: Callable[
@@ -668,7 +668,7 @@ def connect( # NoQA: E704
668668
) -> int: ...
669669

670670
@overload
671-
def connect( # NoQA: E704
671+
def connect(
672672
self,
673673
event: Literal['linkcheck-process-uri'],
674674
callback: Callable[[Sphinx, str], str | None],
@@ -678,7 +678,7 @@ def connect( # NoQA: E704
678678
# ---- Events from builtin extensions-- ----------------------------------
679679

680680
@overload
681-
def connect( # NoQA: E704
681+
def connect(
682682
self,
683683
event: Literal['object-description-transform'],
684684
callback: Callable[[Sphinx, str, str, addnodes.desc_content], None],
@@ -688,23 +688,23 @@ def connect( # NoQA: E704
688688
# ---- Events from first-party extensions --------------------------------
689689

690690
@overload
691-
def connect( # NoQA: E704
691+
def connect(
692692
self,
693693
event: Literal['autodoc-process-docstring'],
694694
callback: _AutodocProcessDocstringListener,
695695
priority: int = 500,
696696
) -> int: ...
697697

698698
@overload
699-
def connect( # NoQA: E704
699+
def connect(
700700
self,
701701
event: Literal['autodoc-before-process-signature'],
702702
callback: Callable[[Sphinx, Any, bool], None],
703703
priority: int = 500,
704704
) -> int: ...
705705

706706
@overload
707-
def connect( # NoQA: E704
707+
def connect(
708708
self,
709709
event: Literal['autodoc-process-signature'],
710710
callback: Callable[
@@ -725,15 +725,15 @@ def connect( # NoQA: E704
725725
) -> int: ...
726726

727727
@overload
728-
def connect( # NoQA: E704
728+
def connect(
729729
self,
730730
event: Literal['autodoc-process-bases'],
731731
callback: Callable[[Sphinx, str, Any, dict[str, bool], list[str]], None],
732732
priority: int = 500,
733733
) -> int: ...
734734

735735
@overload
736-
def connect( # NoQA: E704
736+
def connect(
737737
self,
738738
event: Literal['autodoc-skip-member'],
739739
callback: Callable[
@@ -753,15 +753,15 @@ def connect( # NoQA: E704
753753
) -> int: ...
754754

755755
@overload
756-
def connect( # NoQA: E704
756+
def connect(
757757
self,
758758
event: Literal['todo-defined'],
759759
callback: Callable[[Sphinx, todo_node], None],
760760
priority: int = 500,
761761
) -> int: ...
762762

763763
@overload
764-
def connect( # NoQA: E704
764+
def connect(
765765
self,
766766
event: Literal['viewcode-find-source'],
767767
callback: Callable[
@@ -772,7 +772,7 @@ def connect( # NoQA: E704
772772
) -> int: ...
773773

774774
@overload
775-
def connect( # NoQA: E704
775+
def connect(
776776
self,
777777
event: Literal['viewcode-follow-imported'],
778778
callback: Callable[[Sphinx, str, str], str | None],
@@ -782,7 +782,7 @@ def connect( # NoQA: E704
782782
# ---- Catch-all ---------------------------------------------------------
783783

784784
@overload
785-
def connect( # NoQA: E704
785+
def connect(
786786
self,
787787
event: str,
788788
callback: Callable[..., Any],
@@ -1405,7 +1405,7 @@ def add_transform(self, transform: type[Transform]) -> None:
14051405
refs: `Transform Priority Range Categories`__
14061406
14071407
__ https://docutils.sourceforge.io/docs/ref/transforms.html#transform-priority-range-categories
1408-
""" # NoQA: E501,RUF100 # Flake8 thinks the URL is too long, Ruff special cases URLs.
1408+
"""
14091409
self.registry.add_transform(transform)
14101410

14111411
def add_post_transform(self, transform: type[Transform]) -> None:

sphinx/cmd/build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from typing import Protocol
3333

3434
class SupportsWrite(Protocol):
35-
def write(self, text: str, /) -> int | None: ... # NoQA: E704
35+
def write(self, text: str, /) -> int | None: ...
3636

3737

3838
def handle_exception(

0 commit comments

Comments
 (0)