From 1fff4df3432f489ec7dd5f34dffc72334a9c5643 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:47:14 +0000 Subject: [PATCH] style: format code with Black and isort This commit fixes the style issues introduced in 659eec1 according to the output from Black and isort. Details: https://github.com/DeepSourceCorp/community-analyzers/pull/8 --- analyzers/cfn-lint/utils/issue_map_gen.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/analyzers/cfn-lint/utils/issue_map_gen.py b/analyzers/cfn-lint/utils/issue_map_gen.py index 5aa0e626..dba7ddbe 100644 --- a/analyzers/cfn-lint/utils/issue_map_gen.py +++ b/analyzers/cfn-lint/utils/issue_map_gen.py @@ -1,7 +1,8 @@ -import os import json +import os import sys + def generate_json(directory): # Dictionary to hold the mappings issue_codes = {} @@ -10,8 +11,8 @@ def generate_json(directory): for filename in os.listdir(directory): if filename.endswith(".toml") and filename.startswith("CFLIN-"): # Extract the issue code (part after 'CFLIN-' and before '.toml') - issue_code = filename[len("CFLIN-"):-len(".toml")] - + issue_code = filename[len("CFLIN-") : -len(".toml")] + # Add to the dictionary issue_codes[issue_code] = {"issue_code": f"CFLIN-{issue_code}"} @@ -23,6 +24,7 @@ def generate_json(directory): file.write(json_data) print("JSON data written to issue_map.json") + if __name__ == "__main__": if len(sys.argv) != 2: print("Usage: python script.py ")