mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 08:05:55 +02:00
Set up ruff so that test files have at least some linting (#10399)
Alternative implementation for #7908. In this PR: - set up ruff in CI (add to `tox.ini`, mark dep in `certbot/setup.py`) - add a `ruff.toml` that ignores particularly annoying errors. I think line length isn't actually necessary to set with this workflow since we're not checking it but putting it there for future usage. - either fix or ignore the rest of the errors that come with the default linting configuration. fixed errors are mostly unused variables. ignored are usually where we're doing weird import things for a specific reason.
This commit is contained in:
@@ -1245,7 +1245,7 @@ class MultipleVhostsTest(util.ApacheTest):
|
||||
|
||||
def test_deploy_cert_no_mod_ssl(self):
|
||||
# Create
|
||||
ssl_vhost = self.config.make_vhost_ssl(self.vh_truth[0])
|
||||
self.config.make_vhost_ssl(self.vh_truth[0])
|
||||
self.config.parser.modules["socache_shmcb_module"] = None
|
||||
self.config.prepare_server_https = mock.Mock()
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Tests for ApacheConfigurator for AugeasParserNode classes"""
|
||||
import importlib
|
||||
import sys
|
||||
import unittest
|
||||
from unittest import mock
|
||||
@@ -7,10 +8,10 @@ import pytest
|
||||
|
||||
from certbot_apache._internal.tests import util
|
||||
|
||||
try:
|
||||
import apacheconfig
|
||||
|
||||
if importlib.util.find_spec('apacheconfig'):
|
||||
HAS_APACHECONFIG = True
|
||||
except ImportError: # pragma: no cover
|
||||
else: # pragma: no cover
|
||||
HAS_APACHECONFIG = False
|
||||
|
||||
|
||||
|
||||
@@ -112,12 +112,12 @@ def test_dummy():
|
||||
dirty=False,
|
||||
filepath="/some/random/path"
|
||||
)
|
||||
dummydirective = DummyDirectiveNode(
|
||||
dummydirective = DummyDirectiveNode( # noqa: F841
|
||||
name="Name",
|
||||
ancestor=None,
|
||||
filepath="/another/path"
|
||||
)
|
||||
dummycomment = DummyCommentNode(
|
||||
dummycomment = DummyCommentNode( # noqa: F841
|
||||
comment="Comment",
|
||||
ancestor=dummyblock,
|
||||
filepath="/some/file"
|
||||
|
||||
Reference in New Issue
Block a user