Skip to content

Commit b851bd0

Browse files
authored
Bump the pre-commit hook checks (#259)
1 parent 831c2c5 commit b851bd0

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/pre-commit/mirrors-autopep8
5-
rev: 'v2.0.2'
4+
- repo: https://github.com/hhatto/autopep8
5+
rev: 'v2.3.1'
66
hooks:
77
- id: autopep8
88
args:
@@ -14,12 +14,12 @@ repos:
1414
- --max-line-length=99
1515

1616
- repo: https://github.com/PyCQA/isort
17-
rev: "5.12.0"
17+
rev: "5.13.2"
1818
hooks:
1919
- id: isort
2020

2121
- repo: https://github.com/pycqa/flake8
22-
rev: "6.0.0"
22+
rev: "7.1.1"
2323
hooks:
2424
- id: flake8
2525
args:
@@ -33,7 +33,7 @@ repos:
3333
)$
3434
3535
- repo: https://github.com/pre-commit/pre-commit-hooks
36-
rev: "v4.4.0"
36+
rev: "v5.0.0"
3737
hooks:
3838
- id: end-of-file-fixer
3939
- id: mixed-line-ending

fmf/base.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def _merge_plus(self, data, key, value, prepend=False):
205205
return
206206

207207
# Use the special merge for merging dictionaries
208-
if type(data[key]) == type(value) == dict:
208+
if isinstance(data[key], dict) and isinstance(value, dict):
209209
self._merge_special(data[key], value)
210210
return
211211

@@ -275,13 +275,13 @@ def _merge_minus(self, data, key, value):
275275
if key not in data:
276276
return
277277
# Subtract numbers
278-
if type(data[key]) == type(value) in [int, float]:
278+
if isinstance(data[key], (int, float)) and isinstance(value, (int, float)):
279279
data[key] = data[key] - value
280280
# Replace matching regular expression with empty string
281-
elif type(data[key]) == type(value) == type(""):
281+
elif isinstance(data[key], str) and isinstance(value, str):
282282
data[key] = re.sub(value, '', data[key])
283283
# Remove given values from the parent list
284-
elif type(data[key]) == type(value) == list:
284+
elif isinstance(data[key], list) and isinstance(value, list):
285285
data[key] = [item for item in data[key] if item not in value]
286286
# Remove given key from the parent dictionary
287287
elif isinstance(data[key], dict) and isinstance(value, list):
@@ -750,10 +750,10 @@ def show(self, brief=False, formatting=None, values=None):
750750
# List available attributes
751751
for key, value in sorted(self.data.items()):
752752
output += "\n{0}: ".format(utils.color(key, 'green'))
753-
if isinstance(value, type("")):
753+
if isinstance(value, str):
754754
output += value.rstrip("\n")
755755
elif isinstance(value, list) and all(
756-
[isinstance(item, type("")) for item in value]):
756+
[isinstance(item, str) for item in value]):
757757
output += utils.listed(value)
758758
else:
759759
output += pretty(value)

tests/unit/test_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ def test_get(self):
231231

232232
def test_show(self):
233233
""" Show metadata """
234-
assert isinstance(self.wget.show(brief=True), type(""))
234+
assert isinstance(self.wget.show(brief=True), str)
235235
assert self.wget.show(brief=True).endswith("\n")
236-
assert isinstance(self.wget.show(), type(""))
236+
assert isinstance(self.wget.show(), str)
237237
assert self.wget.show().endswith("\n")
238238
assert 'tester' in self.wget.show()
239239

0 commit comments

Comments
 (0)