Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate redundant linting #11902

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
31 changes: 0 additions & 31 deletions .flake8

This file was deleted.

18 changes: 1 addition & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,11 @@ jobs:
run: python -m pip install --upgrade pip

- name: Install Ruff
run: python -m pip install "ruff==0.1.13"
run: python -m pip install "ruff==0.1.14"

- name: Lint with Ruff
run: ruff . --output-format github

flake8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "flake8>=3.5.0" "flake8-simplify"
- name: Lint with flake8
run: flake8 .

mypy:
runs-on: ubuntu-latest

Expand Down
6 changes: 1 addition & 5 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
target-version = "py39" # Pin Ruff to Python 3.9
line-length = 95
required-version = "0.1.13"
required-version = "0.1.14"
show-source = true

[lint]
Expand All @@ -23,10 +23,6 @@ ignore = [
# pylint
"PLC1901", # simplify truthy/falsey string comparisons
]
external = [ # Whitelist for RUF100 unknown code warnings
"E704",
"SIM113",
]
select = [
# flake8-builtins ('A')
# NOT YET USED
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ clean: clean

.PHONY: style-check
style-check:
@flake8
@ruff

.PHONY: type-check
type-check:
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ docs = [
"sphinxcontrib-websupport",
]
lint = [
"flake8>=3.5.0",
"flake8-simplify",
"ruff==0.1.13",
"ruff==0.1.14",
"mypy==1.8.0",
"sphinx-lint",
"docutils-stubs",
Expand Down
2 changes: 1 addition & 1 deletion sphinx/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ def add_transform(self, transform: type[Transform]) -> None:
refs: `Transform Priority Range Categories`__

__ https://docutils.sourceforge.io/docs/ref/transforms.html#transform-priority-range-categories
""" # NoQA: E501,RUF100 # Flake8 thinks the URL is too long, Ruff special cases URLs.
""" # NoQA: RUF100
self.registry.add_transform(transform)

def add_post_transform(self, transform: type[Transform]) -> None:
Expand Down
36 changes: 18 additions & 18 deletions sphinx/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,38 +100,38 @@

class _DomainsType(MutableMapping[str, Domain]):
@overload
def __getitem__(self, key: Literal["c"]) -> CDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["c"]) -> CDomain: ...
@overload
def __getitem__(self, key: Literal["cpp"]) -> CPPDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["cpp"]) -> CPPDomain: ...
@overload
def __getitem__(self, key: Literal["changeset"]) -> ChangeSetDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["changeset"]) -> ChangeSetDomain: ...
@overload
def __getitem__(self, key: Literal["citation"]) -> CitationDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["citation"]) -> CitationDomain: ...
@overload
def __getitem__(self, key: Literal["index"]) -> IndexDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["index"]) -> IndexDomain: ...
@overload
def __getitem__(self, key: Literal["js"]) -> JavaScriptDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["js"]) -> JavaScriptDomain: ...
@overload
def __getitem__(self, key: Literal["math"]) -> MathDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["math"]) -> MathDomain: ...
@overload
def __getitem__(self, key: Literal["py"]) -> PythonDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["py"]) -> PythonDomain: ...
@overload
def __getitem__(self, key: Literal["rst"]) -> ReSTDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["rst"]) -> ReSTDomain: ...
@overload
def __getitem__(self, key: Literal["std"]) -> StandardDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["std"]) -> StandardDomain: ...
@overload
def __getitem__(self, key: Literal["duration"]) -> DurationDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["duration"]) -> DurationDomain: ...
@overload
def __getitem__(self, key: Literal["todo"]) -> TodoDomain: ... # NoQA: E704
def __getitem__(self, key: Literal["todo"]) -> TodoDomain: ...
@overload
def __getitem__(self, key: str) -> Domain: ... # NoQA: E704
def __getitem__(self, key): raise NotImplementedError # NoQA: E704
def __setitem__( # NoQA: E301,E704
def __getitem__(self, key: str) -> Domain: ...
def __getitem__(self, key): raise NotImplementedError
def __setitem__( # NoQA: E301
self, key: str, value: Domain,
) -> NoReturn: raise NotImplementedError
def __delitem__(self, key: str) -> NoReturn: raise NotImplementedError # NoQA: E704
def __iter__(self) -> NoReturn: raise NotImplementedError # NoQA: E704
def __len__(self) -> NoReturn: raise NotImplementedError # NoQA: E704
def __delitem__(self, key: str) -> NoReturn: raise NotImplementedError
def __iter__(self) -> NoReturn: raise NotImplementedError
def __len__(self) -> NoReturn: raise NotImplementedError

else:
_DomainsType = dict
Expand Down
Loading