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

Lint our GitHub Actions workflows with zizmor #215

Merged
merged 1 commit into from
Jan 9, 2025
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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
container: debian:bookworm
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install dependencies
run: |
apt-get update && apt-get install --yes --no-install-recommends make openssl python3 python3-poetry
Expand All @@ -21,10 +23,12 @@ jobs:
container: debian:bookworm
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install dependencies
run: |
apt-get update && apt-get install --yes --no-install-recommends make python3 python3-poetry
poetry install --no-ansi
- name: Check code formatting via black
- name: Run all linters
run: |
make check-black
make lint
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ image := fpf.local/securedrop-https-everywhere-ruleset:$(shell cat latest-rulese

DEFAULT_GOAL: help

.PHONY: lint
lint: check-black zizmor ## Run all linters

.PHONY: check-black
check-black: ## Check Python source code formatting with black
@poetry run black --check --diff ./
Expand All @@ -10,6 +13,10 @@ check-black: ## Check Python source code formatting with black
black: ## Format Python source code with black
@poetry run black ./

.PHONY: zizmor
zizmor: ## Lint GitHub Actions workflows
@poetry run zizmor .

.PHONY: test-key
test-key: ## Generates a test key for development/testing purposes locally.
openssl genrsa -out key.pem 4096
Expand Down
27 changes: 25 additions & 2 deletions poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pgpy = ">=0.6.0"
[tool.poetry.group.dev.dependencies]
black = "*"
pytest = "^8.3.4"
zizmor = "^1.0.0"

[tool.black]
line-length = 100
Loading