Repository navigation
ci: make ruff, bandit, and pip-audit blocking and clear findings - #143
Closed
kushaldave002 wants to merge 2 commits into
Closed
kushaldave002 wants to merge 2 commits into
kushaldave002 wants to merge 2 commits into
Conversation
| from dataclasses import dataclass, field | ||
|
|
||
| from secfoo.report.sast import SKILL_ID | ||
| from secfoo.report.sast import SKILL_ID # noqa: F401 -- re-exported for web.routes.activities |
Collaborator
|
Thank you, @kushaldave002. The lint work is solid: Blocking
Should fix
Looking forward to the next version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #114
Summary
Clears the existing
ruffandbanditbacklog, pinsruff==0.17.5for reproducibility, makesruff check .,bandit -r src/secfoo -c .bandit -ll, andpip-auditblocking in CI, and updatesCONTRIBUTING.mdwith the pre-PR checklist.Ruff changes
UP045,I001,RUF100,FURB167,RUF022,F401,UP037,FURB188), keeping explicit re-exportSKILL_IDinsrc/secfoo/web/sast_dashboard.pywith# noqa: F401.EXE001(chmod +x scripts/sync_design_system.py),PLW1510(explicitcheck=Falseonsubprocess.runcalls inmcp.pyandrunner.py),BLE001/S110(debug logging inrunner.pyand documented guards indocext.py/templating.py),RUF046(redundantint(round(...))indashboard_common.py), and test cleanups (RUF012,F841,C408,SIM117,RUF059).[tool.ruff.lint.flake8-bugbear].extend-immutable-callsinpyproject.tomlfor standard FastAPI/Typer defaults (B008), added per-file ignore forPYI034insrc/secfoo/storage/repository.py(typing.Selfis Python 3.11+ only andtyping_extensionsis not a runtime dependency), and pinnedruff==0.17.5.Bandit review (all 9 findings resolved — 0 remaining across all severities)
src/secfoo/storage/repository.py:559# nosec B608)group_sqlis looked up from a fixed 3-key dict right above the query.src/secfoo/runner.py:414assert resolved.path is not Nonewith an explicitRuntimeErrorcheck that survivespython -O.src/secfoo/runner.py:150except Exception: passin_try_cloud_syncwithlogger.debug(..., exc_info=True).src/secfoo/runner.py:167except Exception: passin_try_osv_enrichwithlogger.debug(..., exc_info=True).src/secfoo/cli.py:864except Exception: continuein runtime OSV recheck loop withlog.debug(..., exc_info=True).src/secfoo/cli.py:1791# nosec B105)SECRET = "secret-scanning".src/secfoo/sensor/probe.py:129passin sensor shutdown handler with_log.debug(..., exc_info=True).src/secfoo/sensor/probe.py:157# nosec B110)_disable()after printing to stderr; must never raise into the host app.src/secfoo/sensor/probe.py:345_log.debug(...)beforecontinuewhen skipping broken package metadata.CI & Docs
|| truefromruff check .in.github/workflows/ci.yml.bandit -r src/secfoo -c .bandit -llandpip-auditsteps in.github/workflows/ci.yml.CONTRIBUTING.mdto documentpytest tests,ruff check .,bandit -r src/secfoo -c .bandit -ll, andpip-audit.Verification
uv run ruff check .: All checks passed!uv run bandit -r src/secfoo -c .banditand-ll: No issues identified (0 High, 0 Medium, 0 Low).uv run pip-audit: No known vulnerabilities found.uv run pytest tests -q: 1358 passed (only pre-existing macOSSocketTransportEOF test fails locally; tracked in Bug: sensor test fails on macOS; CI only runs on Ubuntu. Add macOS and Windows to the matrix and fix what breaks #113 / fix(sensor): close socket on peer EOF and extend CI matrix to macOS and Windows #141).