Skip to content

Commit bb31429

Browse files
committed
ruff: Enable upgrade, security rules
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 0ea83c4 commit bb31429

File tree

13 files changed

+14
-25
lines changed

13 files changed

+14
-25
lines changed

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ target-version = 'py39'
55
[tool.ruff.format]
66
quote-style = "preserve"
77
docstring-code-format = true
8+
9+
[tool.ruff.lint]
10+
select = ["E4", "E7", "E9", "F", "S", "UP"]
11+
ignore = []
12+
13+
[tool.ruff.lint.per-file-ignores]
14+
"tests/*" = ["S101"]

sphinxcontrib/apidoc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"""
1010

1111
import pbr.version
12-
from typing import Any, Dict
12+
from typing import Any
1313

1414
from sphinx.application import Sphinx
1515
from sphinxcontrib.apidoc import ext
1616

1717
__version__ = pbr.version.VersionInfo('sphinxcontrib-apidoc').version_string()
1818

1919

20-
def setup(app: Sphinx) -> Dict[str, Any]:
20+
def setup(app: Sphinx) -> dict[str, Any]:
2121
app.setup_extension('sphinx.ext.autodoc') # We need autodoc to function
2222

2323
app.connect('builder-inited', ext.builder_inited)

sphinxcontrib/apidoc/ext.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ def cmd_opts():
6767
yield '--templatedir'
6868
yield template_dir
6969

70-
for arg in extra_args:
71-
yield arg
70+
yield from extra_args
7271

7372
yield module_dir
7473

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import print_function
2-
3-
4-
class Bar(object):
1+
class Bar:
52
def foo(self):
63
print('Hello, world')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Baz(object):
1+
class Baz:
22
def inga(self):
33
return 1 + 3

tests/roots/test-advanced-negative/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import print_function
2-
3-
4-
class Bar(object):
1+
class Bar:
52
def foo(self):
63
print('Hello, world')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Baz(object):
1+
class Baz:
22
def inga(self):
33
return 1 + 3

tests/roots/test-advanced/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53

tests/roots/test-basics/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53

tests/roots/test-invalid-directory/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53

tests/roots/test-missing-configuration/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53

tests/test_ext.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
test_apidoc
43
~~~~~~~~~~~

0 commit comments

Comments
 (0)