Skip to content

Commit d6ac976

Browse files
committed
update pre-commit hooks
1 parent cc4fa87 commit d6ac976

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: https://github.com/rhysd/actionlint
3-
rev: v1.7.6
3+
rev: v1.7.7
44
hooks:
55
- id: actionlint-docker
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.8.6
7+
rev: v0.9.4
88
hooks:
99
- id: ruff
1010
files: ^(cloudsplaining/|setup.py)

cloudsplaining/command/create_exclusions_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def create_exclusions_file(output_file: str, verbosity: int) -> None:
4141
set_log_level(verbosity)
4242

4343
with open(output_file, "a", encoding="utf-8") as file_obj:
44-
for line in EXCLUSIONS_TEMPLATE:
45-
file_obj.write(line)
44+
file_obj.write(EXCLUSIONS_TEMPLATE)
45+
4646
utils.print_green(f"Success! Exclusions template file written to: {output_file}")
4747
print(
4848
"Make sure you download your account authorization details before running the scan."

cloudsplaining/command/create_multi_account_config_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def create_multi_account_config_file(output_file: str, verbosity: int) -> None:
4747
os.remove(output_file)
4848

4949
with open(output_file, "a", encoding="utf-8") as file_obj:
50-
for line in MULTI_ACCOUNT_CONFIG_TEMPLATE:
51-
file_obj.write(line)
50+
file_obj.write(MULTI_ACCOUNT_CONFIG_TEMPLATE)
51+
5252
utils.print_green(f"Success! Multi-account config file written to: {os.path.relpath(output_file)}")
5353
print(
5454
f"\nMake sure you edit the {os.path.relpath(output_file)} file and then run the scan-multi-account command, as shown below."

cloudsplaining/scan/inline_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def getFindingLinks(self, findings: list[dict[str, Any]]) -> dict[str, str]: #
7070
links = {}
7171
for finding in findings:
7272
links[finding["type"]] = (
73-
f'https://cloudsplaining.readthedocs.io/en/latest/glossary/privilege-escalation/#{finding["type"]}'
73+
f"https://cloudsplaining.readthedocs.io/en/latest/glossary/privilege-escalation/#{finding['type']}"
7474
)
7575
return links
7676

cloudsplaining/scan/managed_policy_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def getFindingLinks(self, findings: list[dict[str, Any]]) -> dict[Any, str]: #
244244
links = {}
245245
for finding in findings:
246246
links[finding["type"]] = (
247-
f'https://cloudsplaining.readthedocs.io/en/latest/glossary/privilege-escalation/#{finding["type"]}'
247+
f"https://cloudsplaining.readthedocs.io/en/latest/glossary/privilege-escalation/#{finding['type']}"
248248
)
249249
return links
250250

cloudsplaining/scan/statement_detail.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ def missing_resource_constraints(self, exclusions: Exclusions = DEFAULT_EXCLUSIO
241241
# Fix #390 - if flag_resource_arn_statements is True, then let's treat this as missing resource constraints so we can flag the action anyway.
242242
elif self.flag_resource_arn_statements:
243243
actions_missing_resource_constraints = self.restrictable_actions
244-
else:
245-
pass
244+
246245
result = exclusions.get_allowed_actions(actions_missing_resource_constraints)
247246
result.sort()
248247
return result

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ def get_description() -> str:
6868
entry_points={"console_scripts": "cloudsplaining=cloudsplaining.bin.cli:main"},
6969
zip_safe=True,
7070
keywords="aws iam roles policy policies privileges security",
71-
python_requires=">=3.8",
71+
python_requires=">=3.9",
7272
)

test/command/test_scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_scan_example_file_with_click(self):
1616
)
1717
input_file = os.path.join(examples_directory, "files", "example.json")
1818
exclusions_file = os.path.join(examples_directory, "example-exclusions.yml")
19-
command = f"--input-file {input_file} " f"--exclusions-file {exclusions_file} " "--skip-open-report " "-v"
19+
command = f"--input-file {input_file} --exclusions-file {exclusions_file} --skip-open-report -v"
2020
args = shlex.split(command)
2121
response = self.runner.invoke(cli=scan, args=args)
2222
# print(response.output)

0 commit comments

Comments
 (0)