Replace black and flake8 with ruff for linting and formatting

- Remove .flake8; add [tool.ruff] and [tool.ruff.format] config in pyproject.toml
  (line-length 120, excludes, ignore list, per-file-ignores, mccabe complexity)
- Update GitHub workflow lint job to run `ruff check .` and `ruff format --check .`
- Swap black and flake8 for ruff in requirements.txt and Pipfile
- Change capnp/__init__.py to ruff-style noqa comment
- Move max-complexity into [tool.ruff.lint.mccabe], lint options into [tool.ruff.lint]
- Add per-file-ignores for capnp/__init__.py (F401, F403, F405), remove inline noqa
- Run ruff format across codebase (24 files) for consistent style
This commit is contained in:
Jacob Alexander
2026-02-25 17:24:24 -08:00
parent a27c849021
commit 162fddbcf6
30 changed files with 89 additions and 203 deletions

View File

@@ -19,9 +19,7 @@ def cleanup():
p.kill()
def run_subprocesses(
address, server, client, wildcard_server=False, ipv4_force=True
): # noqa
def run_subprocesses(address, server, client, wildcard_server=False, ipv4_force=True): # noqa
server_attempt = 0
server_attempts = 2
done = False
@@ -29,9 +27,7 @@ def run_subprocesses(
c_address = address
s_address = address
while not done:
assert server_attempt < server_attempts, "Failed {} server attempts".format(
server_attempts
)
assert server_attempt < server_attempts, "Failed {} server attempts".format(server_attempts)
server_attempt += 1
# Force ipv4 for tests (known issues on GitHub Actions with IPv6 for some targets)
@@ -125,9 +121,7 @@ def test_async_calculator_example(unused_tcp_port, cleanup):
def test_addressbook_example(cleanup):
proc = subprocess.Popen(
[sys.executable, os.path.join(examples_dir, "addressbook.py")]
)
proc = subprocess.Popen([sys.executable, os.path.join(examples_dir, "addressbook.py")])
ret = proc.wait()
assert ret == 0