mirror of
https://github.com/adrienverge/yamllint.git
synced 2025-02-25 18:55:20 -06:00
style: apply ruff suggestion
Fixes the only error reported by ruff using default settings: E721 Do not compare types, use `isinstance()`
This commit is contained in:
committed by
Adrien Vergé
parent
ef61384491
commit
1d65ab62cb
@@ -62,7 +62,7 @@ def build_temp_workspace(files):
|
|||||||
if not os.path.exists(os.path.dirname(path)):
|
if not os.path.exists(os.path.dirname(path)):
|
||||||
os.makedirs(os.path.dirname(path))
|
os.makedirs(os.path.dirname(path))
|
||||||
|
|
||||||
if type(content) is list:
|
if isinstance(content, list):
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
else:
|
else:
|
||||||
mode = 'wb' if isinstance(content, bytes) else 'w'
|
mode = 'wb' if isinstance(content, bytes) else 'w'
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ def validate_rule_conf(rule, conf):
|
|||||||
# Example: CONF = {option: ['flag1', 'flag2', int]}
|
# Example: CONF = {option: ['flag1', 'flag2', int]}
|
||||||
# → {option: [flag1]} → {option: [42, flag1, flag2]}
|
# → {option: [flag1]} → {option: [42, flag1, flag2]}
|
||||||
elif isinstance(options[optkey], list):
|
elif isinstance(options[optkey], list):
|
||||||
if (type(conf[optkey]) is not list or
|
if (not isinstance(conf[optkey], list) or
|
||||||
any(flag not in options[optkey] and
|
any(flag not in options[optkey] and
|
||||||
type(flag) not in options[optkey]
|
type(flag) not in options[optkey]
|
||||||
for flag in conf[optkey])):
|
for flag in conf[optkey])):
|
||||||
|
|||||||
Reference in New Issue
Block a user