Skip to content

Commit

Permalink
feat: remove bandit/security task
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed May 30, 2024
1 parent 1a0a6cd commit ffddb52
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 98 deletions.
24 changes: 0 additions & 24 deletions .calcipy_packaging.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@
"name": "babel",
"version": "2.15.0"
},
"bandit": {
"datetime": "2024-03-08T19:25:54.618041+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
"latest_datetime": "2024-03-08T19:25:54.618041+00:00",
"latest_version": "1.7.8",
"name": "bandit",
"version": "1.7.8"
},
"basedpyright": {
"datetime": "2024-05-29T13:03:04.128263+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
Expand Down Expand Up @@ -575,14 +567,6 @@
"name": "pathspec",
"version": "0.12.1"
},
"pbr": {
"datetime": "2023-11-07T18:32:21.527935+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
"latest_datetime": "2023-11-07T18:32:21.527935+00:00",
"latest_version": "6.0.0",
"name": "pbr",
"version": "6.0.0"
},
"pip": {
"datetime": "2024-02-03T09:53:09.575683+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
Expand Down Expand Up @@ -863,14 +847,6 @@
"name": "sortedcontainers",
"version": "2.4.0"
},
"stevedore": {
"datetime": "2024-02-22T20:56:55.149691+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
"latest_datetime": "2024-02-22T20:56:55.149691+00:00",
"latest_version": "5.2.0",
"name": "stevedore",
"version": "5.2.0"
},
"syrupy": {
"datetime": "2024-02-07T05:58:03.481215+00:00",
"domain": "https://pypi.org/pypi/{name}/json",
Expand Down
1 change: 0 additions & 1 deletion calcipy/tasks/all_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def with_progress(items: Any, offset: int = 0) -> TaskList:
types.basedpyright,
nox.noxfile.with_kwargs(session='tests'), # pyright: ignore[reportFunctionMemberAccess]
lint.pre_commit.with_kwargs(no_update=True), # pyright: ignore[reportFunctionMemberAccess]
lint.security,
tags.collect_code_tags,
cl.write,
pack.lock,
Expand Down
13 changes: 0 additions & 13 deletions calcipy/tasks/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from beartype import beartype
from beartype.typing import Optional
from corallium.file_helpers import read_package_name
from corallium.log import logger
from invoke.context import Context

from ..cli import task
Expand Down Expand Up @@ -79,18 +78,6 @@ def pylint(ctx: Context, *, report: bool = False) -> None:
_inner_task(ctx, command='pylint', cli_args=cli_args)


# ==============================================================================
# Security


@task()
def security(ctx: Context) -> None:
"""Attempt to identify possible security vulnerabilities."""
logger.warning('Note: Selectively override bandit with "# nosec"', is_header=True)
pkg_name = read_package_name()
run(ctx, f'{python_dir()}/bandit --recursive {pkg_name} -s B101')


# ==============================================================================
# Pre-Commit

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Unreleased

### Feat

- remove bandit/security task
- remove flake8

### Fix

- remove semgrep
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ poetry config pypi-token.pypi ...
| `calcipy/tasks/defaults.py` | 20 | 0 | 0 | 89.3% |
| `calcipy/tasks/doc.py` | 45 | 0 | 8 | 90.5% |
| `calcipy/tasks/executable_utils.py` | 27 | 0 | 0 | 87.2% |
| `calcipy/tasks/lint.py` | 51 | 1 | 0 | 83.5% |
| `calcipy/tasks/lint.py` | 45 | 1 | 0 | 83.1% |
| `calcipy/tasks/nox.py` | 8 | 0 | 0 | 100.0% |
| `calcipy/tasks/pack.py` | 42 | 10 | 0 | 65.6% |
| `calcipy/tasks/stale.py` | 9 | 1 | 0 | 90.9% |
| `calcipy/tasks/tags.py` | 18 | 1 | 0 | 91.7% |
| `calcipy/tasks/test.py` | 45 | 1 | 2 | 89.2% |
| `calcipy/tasks/types.py` | 20 | 0 | 0 | 89.3% |
| **Totals** | 1024 | 67 | 262 | 87.1% |
| **Totals** | 1018 | 67 | 262 | 87.1% |

Generated on: 2024-05-29
<!-- {cte} -->
53 changes: 2 additions & 51 deletions poetry.lock

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

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ version = "2.1.0"
python = "^3.9.13"
arrow = {optional = true, version = ">=1.2.3"} # tags
autopep8 = {optional = true, version = ">=2.0.1"} # lint
bandit = {optional = true, version = ">=1.7.4"} # lint
basedpyright = {optional = true, version = ">=1.6.0"} # types
beartype = ">=0.18.2"
bidict = {optional = true, version = ">=0.22.1"} # stale
Expand Down Expand Up @@ -94,7 +93,6 @@ doc = [
]
lint = [
"autopep8",
"bandit",
"pip-check",
"ruff",
]
Expand Down
7 changes: 2 additions & 5 deletions tests/tasks/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest

from calcipy.tasks.executable_utils import python_dir, python_m
from calcipy.tasks.lint import autopep8, check, fix, pre_commit, pylint, security, watch
from calcipy.tasks.executable_utils import python_m
from calcipy.tasks.lint import autopep8, check, fix, pre_commit, pylint, watch


@pytest.mark.parametrize(
Expand All @@ -16,9 +16,6 @@
(fix, {}, [f'{python_m()} ruff check ./calcipy ./tests --fix']),
(watch, {}, [f'{python_m()} ruff check ./calcipy ./tests --watch --show-source']),
(pylint, {}, [f'{python_m()} pylint ./calcipy ./tests']),
(security, {}, [
f'{python_dir()}/bandit --recursive calcipy -s B101',
]),
(pre_commit, {}, [
call('which pre-commit', warn=True, hide=True),
'pre-commit install',
Expand Down

0 comments on commit ffddb52

Please sign in to comment.