Skip to content

Commit

Permalink
chore: fix flake8 warnings around isinstance use
Browse files Browse the repository at this point in the history
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)

Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe committed May 15, 2024
1 parent c6c0be8 commit 4099ee5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion detect_secrets/plugins/artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ArtifactoryDetector(RegexBasedDetector):

def verify(self, token, *args, **kwargs):
try:
if type(token) == bytes:
if isinstance(token, bytes):
token = token.decode('UTF-8')
headers = {'X-JFrog-Art-API': token}
response = requests.get(
Expand Down
2 changes: 1 addition & 1 deletion detect_secrets/plugins/github_enterprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, ghe_instance=DEFAULT_GHE_INSTANCE, *args, **kwargs):

def verify(self, token, *args, **kwargs):
try:
if type(token) == bytes:
if isinstance(token, bytes):
token = token.decode('UTF-8')
headers = {'Authorization': 'token %s' % token}
response = requests.get(f'https://{self.ghe_instance}/api/v3', headers=headers)
Expand Down
2 changes: 1 addition & 1 deletion detect_secrets/plugins/ibm_cloud_iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def verify(self, token, *args, **kwargs):


def verify_cloud_iam_api_key(apikey): # pragma: no cover
if type(apikey) == bytes:
if isinstance(apikey, bytes):
apikey = apikey.decode('UTF-8')
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ description-file = README.md
[wheel]
universal = True

[flake8]
max-line-length = 100

[tool:pytest]
norecursedirs=tests/testing

0 comments on commit 4099ee5

Please sign in to comment.