Skip to content

Commit

Permalink
ruff: add flake8-raise (RSE) and auto-run
Browse files Browse the repository at this point in the history
  • Loading branch information
Marshall-Hallenbeck committed Oct 13, 2023
1 parent ae14929 commit 781afc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nxc/modules/add_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def do_samr_add(self, context):
context.log.highlight("Available domain(s):")
for domain in domains:
context.log.highlight(f" * {domain['Name']}")
raise Exception()
raise Exception
else:
selected_domain = domain[0]["Name"]
else:
Expand Down Expand Up @@ -179,7 +179,7 @@ def do_samr_add(self, context):
samr.hSamrLookupNamesInDomain(dce, domain_handle, [self.__computerName])
self.noLDAPRequired = True
context.log.highlight("{}".format('Computer account already exists with the name: "' + self.__computerName + '"'))
raise Exception()
raise Exception
except samr.DCERPCSessionError as e:
if e.error_code != 0xC0000073:
raise
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ build-backend = "poetry.core.masonry.api"
# Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
# Other options: pep8-naming (N), flake8-annotations (ANN), flake8-blind-except (BLE), flake8-commas (COM), flake8-pyi (PYI), flake8-pytest-style (PT), etc
select = ["E", "F", "D", "UP", "YTT", "ASYNC", "B", "A", "C4", "ISC", "ICN", "PIE", "PT", "Q"]
select = ["E", "F", "D", "UP", "YTT", "ASYNC", "B", "A", "C4", "ISC", "ICN", "PIE", "PT", "Q", "RSE"]
ignore = [ "E501", "F405", "F841", "D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107", "D203", "D204", "D205", "D212", "D213", "D400", "D401", "D415", "D417", "D419"]

# Allow autofix for all enabled rules (when `--fix`) is provided.
Expand Down

0 comments on commit 781afc9

Please sign in to comment.