add flake8-encoding plugin

This commit is contained in:
Willi Ballenthin
2023-07-06 19:42:57 +02:00
parent 3ad4de70bf
commit ff47270681
3 changed files with 3 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ def get_features(rule_path: str) -> list:
list: A list of all feature statements contained within the rule file.
"""
feature_list = []
with open(rule_path, "r") as f:
with open(rule_path, "r", encoding="utf-8") as f:
try:
new_rule = capa.rules.Rule.from_yaml(f.read())
feature_list = get_child_features(new_rule.statement)

View File

@@ -172,7 +172,7 @@ def main(args: argparse.Namespace) -> None:
logging.info(f"Writing results to {args.output}")
try:
with open(args.output, "w") as jf:
with open(args.output, "w", encoding="utf-8") as jf:
json.dump(data, jf, indent=2)
except BaseException as e:
logging.error(f"Exception encountered when writing results: {e}")

View File

@@ -76,6 +76,7 @@ setuptools.setup(
"pytest-cov==4.1.0",
"flake8==6.0.0",
"flake8-bugbear==23.6.5",
"flake8-encodings==0.5.0.post1",
"ruff==0.0.275",
"black==23.3.0",
"isort==5.11.4",