mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 07:28:34 -08:00
add flake8-encoding plugin
This commit is contained in:
@@ -42,7 +42,7 @@ def get_features(rule_path: str) -> list:
|
|||||||
list: A list of all feature statements contained within the rule file.
|
list: A list of all feature statements contained within the rule file.
|
||||||
"""
|
"""
|
||||||
feature_list = []
|
feature_list = []
|
||||||
with open(rule_path, "r") as f:
|
with open(rule_path, "r", encoding="utf-8") as f:
|
||||||
try:
|
try:
|
||||||
new_rule = capa.rules.Rule.from_yaml(f.read())
|
new_rule = capa.rules.Rule.from_yaml(f.read())
|
||||||
feature_list = get_child_features(new_rule.statement)
|
feature_list = get_child_features(new_rule.statement)
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ def main(args: argparse.Namespace) -> None:
|
|||||||
|
|
||||||
logging.info(f"Writing results to {args.output}")
|
logging.info(f"Writing results to {args.output}")
|
||||||
try:
|
try:
|
||||||
with open(args.output, "w") as jf:
|
with open(args.output, "w", encoding="utf-8") as jf:
|
||||||
json.dump(data, jf, indent=2)
|
json.dump(data, jf, indent=2)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
logging.error(f"Exception encountered when writing results: {e}")
|
logging.error(f"Exception encountered when writing results: {e}")
|
||||||
|
|||||||
1
setup.py
1
setup.py
@@ -76,6 +76,7 @@ setuptools.setup(
|
|||||||
"pytest-cov==4.1.0",
|
"pytest-cov==4.1.0",
|
||||||
"flake8==6.0.0",
|
"flake8==6.0.0",
|
||||||
"flake8-bugbear==23.6.5",
|
"flake8-bugbear==23.6.5",
|
||||||
|
"flake8-encodings==0.5.0.post1",
|
||||||
"ruff==0.0.275",
|
"ruff==0.0.275",
|
||||||
"black==23.3.0",
|
"black==23.3.0",
|
||||||
"isort==5.11.4",
|
"isort==5.11.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user