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

Remove Bandit and Ruff PL rule #157

Merged
merged 4 commits into from
Aug 28, 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
6 changes: 0 additions & 6 deletions .bandit.yml

This file was deleted.

1 change: 0 additions & 1 deletion development/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**/*

!/files/
!/.bandit.yml
!/.coveragerc
!/.github/
!/.yamllint.yml
Expand Down
2 changes: 0 additions & 2 deletions docs/dev/dev_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ Each command can be executed with `invoke <command>`. All commands support the a
#### Testing

```
bandit Run bandit to validate basic static code security analysis.
ruff Run ruff to perform code formatting and/or linting.
pylint Run pylint code analysis.
tests Run all tests for this app.
Expand Down Expand Up @@ -304,7 +303,6 @@ To run an individual test, you can run any or all of the following:

```bash
➜ invoke unittest
➜ invoke bandit
➜ invoke ruff
➜ invoke pylint
```

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

# The following tokens are for the development only and safe to store in the repo.
_COMMAND_TOKENS = {
"clear": "u7p1an973bd1jqg75i3y7pxj7y", # nosec
"nautobot": "ncygprhkt3rrxr4rkytcaa7c9c", # nosec
"{{ cookiecutter.chatops_interactive_command }}": "fh1kbk45xtgm8r48jzr39ru1ww", # nosec
"clear": "u7p1an973bd1jqg75i3y7pxj7y",
"nautobot": "ncygprhkt3rrxr4rkytcaa7c9c",
"{{ cookiecutter.chatops_interactive_command }}": "fh1kbk45xtgm8r48jzr39ru1ww",
}

for command, token in _COMMAND_TOKENS.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ nautobot = "^{{ cookiecutter.min_nautobot_version }}"
nautobot-chatops = "^3.0.1"

[tool.poetry.group.dev.dependencies]
bandit = "*"
coverage = "*"
django-debug-toolbar = "*"
invoke = "*"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ nautobot = "^{{ cookiecutter.min_nautobot_version }}"
nautobot-ssot = "^2.0.0"

[tool.poetry.group.dev.dependencies]
bandit = "*"
coverage = "*"
django-debug-toolbar = "*"
invoke = "*"
Expand Down
6 changes: 0 additions & 6 deletions nautobot-app/{{ cookiecutter.project_slug }}/.bandit.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ jobs:
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: ruff format"
run: "poetry run invoke ruff --action format"
bandit:
runs-on: "ubuntu-22.04"
env:
INVOKE_{{ cookiecutter.app_name.upper() }}_LOCAL: "True"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v6"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
ruff-lint:
runs-on: "ubuntu-22.04"
env:
Expand Down Expand Up @@ -84,7 +73,6 @@ jobs:
run: "poetry run invoke yamllint"
check-in-docker:
needs:
- "bandit"
- "ruff-format"
- "ruff-lint"
- "poetry"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The project is packaged with a light [development environment](dev_environment.m

The project is following Network to Code software development guidelines and is leveraging the following:

- Python linting and formatting: `pylint`, `bandit`, and `ruff`.
- Python linting and formatting: `pylint` and `ruff`.
- YAML linting is done with `yamllint`.
- Django unit test to ensure the app is working properly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Each command can be executed with `invoke <command>`. All commands support the a
#### Testing

```
bandit Run bandit to validate basic static code security analysis.
ruff Run ruff to perform code formatting and/or linting.
pylint Run pylint code analysis.
tests Run all tests for this app.
Expand Down Expand Up @@ -462,7 +461,6 @@ To run an individual test, you can run any or all of the following:

```bash
➜ invoke unittest
➜ invoke bandit
➜ invoke ruff
➜ invoke pylint
```
Expand Down
2 changes: 0 additions & 2 deletions nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ python = ">=3.8,<3.13"
nautobot = "^{{ cookiecutter.min_nautobot_version }}"

[tool.poetry.group.dev.dependencies]
bandit = "*"
coverage = "*"
django-debug-toolbar = "*"
invoke = "*"
Expand Down Expand Up @@ -99,7 +98,6 @@ target-version = "py38"
select = [
"D", # pydocstyle
"F", "E", "W", # flake8
"PL", # pylint
"S", # bandit
"I", # isort
]
Expand Down
9 changes: 0 additions & 9 deletions nautobot-app/{{ cookiecutter.project_slug }}/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,6 @@ def ruff(context, action=None, target=None, fix=False, output_format="concise"):
run_command(context, command, warn=True)


@task
def bandit(context):
"""Run bandit to validate basic static code security analysis."""
command = "bandit --recursive . --configfile .bandit.yml"
run_command(context, command)


@task
def yamllint(context):
"""Run yamllint to validate formatting adheres to NTC defined YAML standards.
Expand Down Expand Up @@ -825,8 +818,6 @@ def tests(context, failfast=False, keepdb=False, lint_only=False):
# Sorted loosely from fastest to slowest
print("Running ruff...")
ruff(context)
print("Running bandit...")
bandit(context)
print("Running yamllint...")
yamllint(context)
print("Running poetry check...")
Expand Down
92 changes: 1 addition & 91 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ python = "^3.8"
pyyaml = "*"

[tool.poetry.group.dev.dependencies]
bandit = "*"
coverage = "*"
invoke = "*"
isort = "*"
Expand Down
Loading