Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update python linting for modules #462

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[flake8]
ignore = E501,E402
ignore = E501,E402,DAR101,DAR201,DAR401
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions plugins/inventory/falcon_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,15 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
NAME = "crowdstrike.falcon.falcon_discover"

def verify_file(self, path):
if super(InventoryModule, self).verify_file(path):
"""Verify the inventory file."""
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)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/sensor_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading