Skip to content

Commit f156e21

Browse files
committed
remove pylint and suppressed inline errors from pylint
Signed-off-by: E3E <ntanzill@purdue.edu>
1 parent da38b47 commit f156e21

24 files changed

Lines changed: 3 additions & 88 deletions

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ updates:
1818
- "bandit"
1919
- "coverage"
2020
- "mypy"
21-
- "pylint"
2221
- "ruff"
2322
- "tox"
2423
dependencies:

examples/uploader/_localrepo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def open(self, role: str) -> Metadata:
6262

6363
# if there is a metadata version fetched from remote, use that
6464
# HACK: access Updater internals
65-
# pylint: disable=protected-access
6665
if role in self.updater._trusted_set:
6766
return copy.deepcopy(self.updater._trusted_set[role])
6867

@@ -105,7 +104,7 @@ def add_target(self, role: str, targetpath: str) -> bool:
105104
with self.edit_targets(role) as delegated:
106105
delegated.targets[targetpath] = targetfile
107106

108-
except Exception as e: # pylint: disable=broad-except
107+
except Exception as e:
109108
print(f"Failed to submit new {role} with added target: {e}")
110109
return False
111110

pyproject.toml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -95,56 +95,6 @@ ignore = ["D400","D415","D213","D205","D202","D107","D407","D413","D212","D104",
9595
"tests/*" = ["D", "E"]
9696
"examples/*/*" = ["D"]
9797

98-
# Pylint section
99-
100-
# Minimal pylint configuration file for Secure Systems Lab Python Style Guide:
101-
# https://github.com/secure-systems-lab/code-style-guidelines
102-
#
103-
# Based on Google Python Style Guide pylintrc and pylint defaults:
104-
# https://google.github.io/styleguide/pylintrc
105-
# http://pylint.pycqa.org/en/latest/technical_reference/features.html
106-
107-
[tool.pylint.message_control]
108-
# Disable the message, report, category or checker with the given id(s).
109-
# NOTE: To keep this config as short as possible we only disable checks that
110-
# are currently in conflict with our code. If new code displeases the linter
111-
# (for good reasons) consider updating this config file, or disable checks with.
112-
disable=[
113-
"fixme",
114-
"too-few-public-methods",
115-
"too-many-arguments",
116-
"format",
117-
"duplicate-code"
118-
]
119-
120-
[tool.pylint.basic]
121-
good-names = ["i","j","k","v","e","f","fn","fp","_type","_"]
122-
# Regexes for allowed names are copied from the Google pylintrc
123-
# NOTE: Pylint captures regex name groups such as 'snake_case' or 'camel_case'.
124-
# If there are multiple groups it enfoces the prevalent naming style inside
125-
# each modules. Names in the exempt capturing group are ignored.
126-
function-rgx="^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$"
127-
method-rgx="(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$"
128-
argument-rgx="^[a-z][a-z0-9_]*$"
129-
attr-rgx="^_{0,2}[a-z][a-z0-9_]*$"
130-
class-attribute-rgx="^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
131-
class-rgx="^_?[A-Z][a-zA-Z0-9]*$"
132-
const-rgx="^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
133-
inlinevar-rgx="^[a-z][a-z0-9_]*$"
134-
module-rgx="^(_?[a-z][a-z0-9_]*|__init__)$"
135-
no-docstring-rgx="(__.*__|main|test.*|.*test|.*Test)$"
136-
variable-rgx="^[a-z][a-z0-9_]*$"
137-
docstring-min-length=10
138-
139-
[tool.pylint.logging]
140-
logging-format-style="old"
141-
142-
[tool.pylint.miscellaneous]
143-
notes="TODO"
144-
145-
[tool.pylint.STRING]
146-
check-quote-consistency="yes"
147-
14898
# mypy section
14999
# Read more here: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
150100
[tool.mypy]

requirements/lint.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Lint tools
77
# (We are not so interested in the specific versions of the tools: the versions
88
# are pinned to prevent unexpected linting failures when tools update)
9-
pylint==3.0.3
109
ruff==0.2.1
1110
mypy==1.8.0
1211
bandit==1.7.7

tests/repository_simulator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class RepositoryTarget:
9999
class RepositorySimulator(FetcherInterface):
100100
"""Simulates a repository that can be used for testing."""
101101

102-
# pylint: disable=too-many-instance-attributes
103102
def __init__(self) -> None:
104103
self.md_delegates: Dict[str, Metadata[Targets]] = {}
105104

tests/test_api.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
logger = logging.getLogger(__name__)
5757

5858

59-
# pylint: disable=too-many-public-methods,too-many-statements
6059
class TestMetadata(unittest.TestCase):
6160
"""Tests for public API of all classes in 'tuf/api/metadata.py'."""
6261

@@ -246,7 +245,7 @@ def test_sign_failures(self) -> None:
246245
os.path.join(self.repo_dir, "metadata", "snapshot.json")
247246
)
248247

249-
class FailingSigner(Signer): # pylint: disable=missing-class-docstring
248+
class FailingSigner(Signer):
250249
@classmethod
251250
def from_priv_key_uri(
252251
cls,
@@ -365,7 +364,6 @@ def test_metadata_verify_delegate(self) -> None:
365364
role2.verify_delegate("role1", role1)
366365

367366
def test_signed_verify_delegate(self) -> None:
368-
# pylint: disable=too-many-locals,too-many-statements
369367
root_path = os.path.join(self.repo_dir, "metadata", "root.json")
370368
root_md = Metadata[Root].from_file(root_path)
371369
root = root_md.signed
@@ -742,7 +740,6 @@ def test_root_add_key_and_revoke_key(self) -> None:
742740
root.signed.revoke_key(keyid, "nosuchrole")
743741

744742
def test_is_target_in_pathpattern(self) -> None:
745-
# pylint: disable=protected-access
746743
supported_use_cases = [
747744
("foo.tgz", "foo.tgz"),
748745
("foo.tgz", "*"),

tests/test_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def _run_script_and_assert_files(
5353
CWD."""
5454
script_path = str(self.repo_examples_dir / script_name)
5555
with open(script_path, "rb") as f:
56-
# pylint: disable=exec-used
5756
exec(
5857
compile(f.read(), script_path, "exec"),
5958
{"__file__": script_path},

tests/test_metadata_eq_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def setUpClass(cls) -> None:
8989

9090
@utils.run_sub_tests_with_dataset(classes_attributes_modifications)
9191
def test_classes_eq_(self, test_case_data: Dict[str, Any]) -> None:
92-
obj = self.objects[self.case_name] # pylint: disable=no-member
92+
obj = self.objects[self.case_name]
9393

9494
# Assert that obj is not equal to an object from another type
9595
self.assertNotEqual(obj, "")

tests/test_metadata_serialization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
logger = logging.getLogger(__name__)
3535

3636

37-
# pylint: disable=too-many-public-methods
3837
class TestSerialization(unittest.TestCase):
3938
"""Test serialization for all classes in 'tuf/api/metadata.py'."""
4039

tests/test_trusted_metadata_set.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
logger = logging.getLogger(__name__)
3030

3131

32-
# pylint: disable=too-many-public-methods
3332
class TestTrustedMetadataSet(unittest.TestCase):
3433
"""Tests for all public API of the TrustedMetadataSet class."""
3534

0 commit comments

Comments
 (0)