Skip to content

Commit 1213f15

Browse files
committed
GitHub Actions :Lint Python code with ruff
1 parent ad8f76f commit 1213f15

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
pull_request:
88

99
jobs:
10+
ruff:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: astral-sh/ruff-action@v3
15+
1016
Windows:
1117
name: 'Windows (${{ matrix.python }})'
1218
runs-on: 'windows-latest'

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def setup(app):
101101
# built documents.
102102
#
103103
# The short X.Y version.
104-
import pytest_trio
104+
import pytest_trio # noqa: E402
105105

106106
version = pytest_trio.__version__
107107
# The full version, including alpha/beta/rc tags.
@@ -143,7 +143,7 @@ def setup(app):
143143
# We have to set this ourselves, not only because it's useful for local
144144
# testing, but also because if we don't then RTD will throw away our
145145
# html_theme_options.
146-
import sphinx_rtd_theme
146+
import sphinx_rtd_theme # noqa: E402
147147

148148
html_theme = "sphinx_rtd_theme"
149149
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

pytest_trio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Top-level package for pytest-trio."""
22

3-
from ._version import __version__
3+
from ._version import __version__ # noqa: F401
44
from .plugin import trio_fixture
55

66
__all__ = ["trio_fixture"]

pytest_trio/_tests/test_fixture_mistakes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import pytest
2-
from pytest_trio import trio_fixture
1+
import pytest # noqa: F401
2+
from pytest_trio import trio_fixture # noqa: F401
33

44
from .helpers import enable_trio_mode
55

pytest_trio/_tests/test_trio_mode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pytest
1+
import pytest # noqa: F401
22

33
from .helpers import enable_trio_mode
44

@@ -139,7 +139,7 @@ async def test():
139139

140140

141141
def test_closest_explicit_run_wins(testdir):
142-
testdir.makefile(".ini", pytest=f"[pytest]\ntrio_mode = true\ntrio_run = trio\n")
142+
testdir.makefile(".ini", pytest="[pytest]\ntrio_mode = true\ntrio_run = trio\n")
143143
testdir.makepyfile(qtrio=qtrio_text)
144144

145145
test_text = """
@@ -159,7 +159,7 @@ async def test():
159159

160160

161161
def test_ini_run_wins_with_blank_marker(testdir):
162-
testdir.makefile(".ini", pytest=f"[pytest]\ntrio_mode = true\ntrio_run = qtrio\n")
162+
testdir.makefile(".ini", pytest="[pytest]\ntrio_mode = true\ntrio_run = qtrio\n")
163163
testdir.makepyfile(qtrio=qtrio_text)
164164

165165
test_text = """

0 commit comments

Comments
 (0)