From 6a35e5887d17343875e3fa4ce0348678b1908052 Mon Sep 17 00:00:00 2001 From: Carlos Matos Date: Tue, 5 Mar 2024 19:25:38 -0500 Subject: [PATCH 1/4] chore: fix pylint R1725 --- plugins/inventory/falcon_discover.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inventory/falcon_discover.py b/plugins/inventory/falcon_discover.py index 59e45712..3e619868 100644 --- a/plugins/inventory/falcon_discover.py +++ b/plugins/inventory/falcon_discover.py @@ -166,14 +166,14 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): NAME = "crowdstrike.falcon.falcon_discover" def verify_file(self, path): - if super(InventoryModule, self).verify_file(path): + if super().verify_file(path): if re.match(r".{0,}falcon_discover\.(yml|yaml)$", path): return True return False def parse(self, inventory, loader, path, cache=True): """Parse the inventory file and return JSON data structure.""" - super(InventoryModule, self).parse(inventory, loader, path) + super().parse(inventory, loader, path) self._read_config_data(path) cache_key = self.get_cache_key(path) From 2b3625ffdb85ea90b445542a9568cda0f7b29501 Mon Sep 17 00:00:00 2001 From: Carlos Matos Date: Tue, 5 Mar 2024 19:27:07 -0500 Subject: [PATCH 2/4] chore: update ignore list for flake8 and pylint --- .flake8 | 2 +- .pylintrc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 120ee2aa..34293f7b 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,2 @@ [flake8] -ignore = E501,E402 +ignore = E501,E402,DAR101,DAR201,DAR401 diff --git a/.pylintrc b/.pylintrc index 6bee806c..efbffa5b 100644 --- a/.pylintrc +++ b/.pylintrc @@ -161,6 +161,8 @@ disable=raw-checker-failed, too-few-public-methods, useless-object-inheritance, # Remove when we no longer run on python2 systems too-many-instance-attributes, + no-name-in-module, + use-dict-literal # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 3a7948903b2acbd6800a3b8fcc36bff43470ac50 Mon Sep 17 00:00:00 2001 From: Carlos Matos Date: Tue, 5 Mar 2024 19:31:03 -0500 Subject: [PATCH 3/4] chore: ignore bandit error B103 --- plugins/modules/sensor_download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/sensor_download.py b/plugins/modules/sensor_download.py index e7aceae5..cf6b49f1 100644 --- a/plugins/modules/sensor_download.py +++ b/plugins/modules/sensor_download.py @@ -133,7 +133,7 @@ def main(): if not dest: dest = mkdtemp() - os.chmod(dest, 0o755) + os.chmod(dest, 0o755) #nosec tmp_dir = True # Make sure path exists and is a directory From 33028b779d7e4736ff2ebac940f82e5518b2e935 Mon Sep 17 00:00:00 2001 From: Carlos Matos Date: Tue, 5 Mar 2024 19:34:09 -0500 Subject: [PATCH 4/4] chore: more fixes for linting --- plugins/inventory/falcon_discover.py | 1 + plugins/modules/sensor_download.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/inventory/falcon_discover.py b/plugins/inventory/falcon_discover.py index 3e619868..1c0d60b0 100644 --- a/plugins/inventory/falcon_discover.py +++ b/plugins/inventory/falcon_discover.py @@ -166,6 +166,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): NAME = "crowdstrike.falcon.falcon_discover" def verify_file(self, path): + """Verify the inventory file.""" if super().verify_file(path): if re.match(r".{0,}falcon_discover\.(yml|yaml)$", path): return True diff --git a/plugins/modules/sensor_download.py b/plugins/modules/sensor_download.py index cf6b49f1..71509ced 100644 --- a/plugins/modules/sensor_download.py +++ b/plugins/modules/sensor_download.py @@ -133,7 +133,7 @@ def main(): if not dest: dest = mkdtemp() - os.chmod(dest, 0o755) #nosec + os.chmod(dest, 0o755) # nosec tmp_dir = True # Make sure path exists and is a directory