Skip to content

ci: add ruff, pip-audit, CodeQL, and least-privilege permissions#15

Open
KristianP26 wants to merge 10 commits into
DavidHruby1:mainfrom
KristianP26:ci/tooling
Open

ci: add ruff, pip-audit, CodeQL, and least-privilege permissions#15
KristianP26 wants to merge 10 commits into
DavidHruby1:mainfrom
KristianP26:ci/tooling

Conversation

@KristianP26
Copy link
Copy Markdown
Contributor

Summary

Strengthens CI with linting/formatting, least-privilege permissions, supply-chain CVE scanning, and static security analysis.

Changes

  • ruff — new ruff.toml (line-length 100, target-version py311). Fixed existing lint findings (unused imports; one load-bearing unused binding in main.py kept with # noqa: F841) and applied ruff format across the codebase. New lint job runs ruff check + ruff format --check.
  • Least-privilege permissionsci.yml now declares top-level permissions: contents: read; codeql.yml scopes its own.
  • pip-audit — new audit job scans requirements.txt + requirements-build.txt for known CVEs (runs on Python 3.12 so the pyinstaller pin resolves). Currently clean.
  • CodeQL — new codeql.yml running Python static analysis on push/PR to main and weekly.

Commits

Split into focused commits: ruff config → lint fixes → format → CI jobs → CodeQL → docs.

Verification

ruff check src/ tests/          # All checks passed!
ruff format --check src/ tests/ # already formatted
python -m unittest discover -s tests   # 36 passing

Note

The repo-wide ruff format commit will conflict with the open custom-hotkeys PR (#13), which rewrites several of the same files. Suggested order: merge #13 first, then rebase this branch and re-run ruff format.

ruff is pinned to 0.15.15 in the workflow; since it isn't a requirements manifest, Dependabot won't bump it — update manually when desired.

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread src/config.py Fixed
Comment thread src/config.py Fixed
Comment thread src/config.py Fixed
@DavidHruby1
Copy link
Copy Markdown
Owner

Please rebase this onto current and resolve the conflicts before reopening. Also, this PR currently mixes CI/CD changes with Ruff/security code edits in src/ and tests/, so if the intent is to keep it as a pipeline PR, please split the non-CI changes out or confirm the bundled scope. Once it’s clean and up to date, I can merge it without touching the branch myself.

@DavidHruby1
Copy link
Copy Markdown
Owner

Please rebase this onto the current base branch and resolve the conflicts before reopening. Also, this PR currently mixes CI/CD changes with Ruff/security code edits in src/ and tests/, so if the intent is to keep it as a pipeline PR, please split the non-CI changes out or confirm the bundled scope. Once it’s clean and up to date, I can merge it without touching the branch myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants