Skip to content
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
4 changes: 0 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
- name: Install dependencies
run: uv sync --frozen --no-build --no-binary-package django-memoize --extra ci

# Linting will come after the migration to uv is complete, disabled for now
#- name: Lint with ruff
# run: uv run --frozen ruff check .

- name: Django system check
env:
DATABASE_URL: postgres://postgres:insecure@localhost/fragforce_test
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/ruff-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Ruff Check

on:
push:
branches:
- dev
- master
pull_request:

jobs:
ruff-check:
name: Run Ruff linting
runs-on: ubuntu-latest
permissions:
contents: read
checks: write

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.13'

- name: Install dependencies
run: uv sync --frozen --no-build --no-binary-package django-memoize --extra ci

- name: Run Ruff linting
run: uv run --no-sync --no-build ruff check .
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed

- Renamed fields on `ffdonations` to follow linting requirements (numDonations -> num_donations)
- Linted the whole codebase, passes `ruff check` fully now.

### Added

- Added `ruff-check.yaml` workflow to force linting on all pull requests and pushes.

## [3.0.0] - 2026-09-09

### Fixed
Expand Down
1 change: 0 additions & 1 deletion dev/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ if [[ -z "$FILES" ]]; then
exit 0
fi

echo "Linting is not currently enforced, but would be appreciated until it is enforced"
echo "Running ruff on $(echo $FILES | wc -w | tr -d ' ') Python files..."
dc exec -T web uv run --no-sync --no-build ruff check $FILES
20 changes: 19 additions & 1 deletion dev/pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,48 @@
# dev/pr.sh "PR title"
# dev/pr.sh "PR title" --base some-branch # default base is dev
# dev/pr.sh "PR title" --body "Description" # add a description above test results
# dev/pr.sh "PR title" --skip-lint # push and open PR without running lint
# dev/pr.sh "PR title" --skip-tests # push and open PR without running tests

cd "$(git rev-parse --show-toplevel)"

TITLE="${1}"
if [[ -z "$TITLE" ]]; then
echo "Usage: dev/pr.sh \"PR title\" [--base <branch>] [--body \"description\"] [--skip-tests]"
echo "Usage: dev/pr.sh \"PR title\" [--base <branch>] [--body \"description\"] [--skip-lint] [--skip-tests]"
exit 1
fi
shift

BASE="dev"
SKIP_LINT=false
SKIP_TESTS=false
BODY=""
while [[ $# -gt 0 ]]; do
case "$1" in
--base) BASE="$2"; shift 2 ;;
--body) BODY="$2"; shift 2 ;;
--skip-lint) SKIP_LINT=true; shift ;;
--skip-tests) SKIP_TESTS=true; shift ;;
*) echo "Unknown argument: $1"; exit 1 ;;
esac
done

BRANCH=$(git rev-parse --abbrev-ref HEAD)

if [[ "$SKIP_LINT" = false ]]; then
echo "Running lint..."
LINT_OUTPUT=$(dev/lint.sh 2>/dev/null)
LINT_EXIT=$?

if [[ $TEST_EXIT -ne 0 ]]; then
echo ""
echo "Linting failed - aborting. Use --skip-lint to open a PR anyway."
echo ""
echo "$LINT_OUTPUT"
echo $LINT_EXIT
fi
fi

if [[ "$SKIP_TESTS" = false ]]; then
echo "Running tests..."
TEST_OUTPUT=$(dev/runtests.sh 2>/dev/null)
Expand Down Expand Up @@ -61,5 +78,6 @@ ${BODY:+${BODY}
}## Test Results

${TEST_OUTPUT:-"Tests skipped."}
${LINT_OUTPUT:-"Linting skipped"}
EOF
)"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies = [
[project.optional-dependencies]
ci = [
"coverage",
"ruff>=0.16.6",
"unittest-xml-reporting",
]
dev = [
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

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