Skip to content

Commit 9a14c24

Browse files
committed
chore: fix flake8 warnings around isinstance use
Also add max-line-length to setup.cfg to avoid E501 flagging existing code (and 100 is the standard default in most Python modules due to black/ruff)
1 parent c6c0be8 commit 9a14c24

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

detect_secrets/plugins/artifactory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ArtifactoryDetector(RegexBasedDetector):
2121

2222
def verify(self, token, *args, **kwargs):
2323
try:
24-
if type(token) == bytes:
24+
if isinstance(token, bytes):
2525
token = token.decode('UTF-8')
2626
headers = {'X-JFrog-Art-API': token}
2727
response = requests.get(

detect_secrets/plugins/github_enterprise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, ghe_instance=DEFAULT_GHE_INSTANCE, *args, **kwargs):
7777

7878
def verify(self, token, *args, **kwargs):
7979
try:
80-
if type(token) == bytes:
80+
if isinstance(token, bytes):
8181
token = token.decode('UTF-8')
8282
headers = {'Authorization': 'token %s' % token}
8383
response = requests.get(f'https://{self.ghe_instance}/api/v3', headers=headers)

detect_secrets/plugins/ibm_cloud_iam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def verify(self, token, *args, **kwargs):
4242

4343

4444
def verify_cloud_iam_api_key(apikey): # pragma: no cover
45-
if type(apikey) == bytes:
45+
if isinstance(apikey, bytes):
4646
apikey = apikey.decode('UTF-8')
4747
headers = {
4848
'Content-Type': 'application/x-www-form-urlencoded',

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ description-file = README.md
44
[wheel]
55
universal = True
66

7+
[flake8]
8+
max-line-length = 100
9+
710
[tool:pytest]
811
norecursedirs=tests/testing

0 commit comments

Comments
 (0)