Skip to content

Commit 4e597da

Browse files
committed
add ruff checking
1 parent 2f33e9e commit 4e597da

File tree

204 files changed

+506
-741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+506
-741
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Legal Boilerplate
22

3-
Look, I get it.
4-
Contributing to HOPE Workspace, I retain all rights, title and interest in and to my contributions, and by keeping
5-
this boilerplate intact I confirm that HOPE Workspace can use, modify, copy, and redistribute my contributions,
3+
Look, I get it.
4+
Contributing to HOPE Workspace, I retain all rights, title and interest in and to my contributions, and by keeping
5+
this boilerplate intact I confirm that HOPE Workspace can use, modify, copy, and redistribute my contributions,
66
under HOPE's choice of terms.

.github/actions/docker_build/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ runs:
8484
run: |
8585
build_date=$(date +"%Y-%m-%d %H:%M")
8686
echo "BUILD_DATE=$build_date" >> $GITHUB_ENV
87-
87+
8888
if [[ "${{inputs.target}}" == "dist" ]]; then
8989
echo "TAG_PREFIX=" >> $GITHUB_ENV
9090
else
@@ -114,7 +114,7 @@ runs:
114114
- name: "Check Image"
115115
id: image_status
116116
shell: bash
117-
run: |
117+
run: |
118118
set +e
119119
echo "::notice::ℹ Checking checksum for ${{ steps.image_name.outputs.name }}"
120120
image_checksum=$(regctl image inspect \
@@ -134,7 +134,7 @@ runs:
134134
echo "::warning::🤬 Checksum: found '${image_checksum}' expected '${code_checksum}'"
135135
echo "updated=false" >> $GITHUB_OUTPUT
136136
fi
137-
if [[ "${{inputs.rebuild}}" == "true" ]]; then
137+
if [[ "${{inputs.rebuild}}" == "true" ]]; then
138138
echo "::warning::⚠ Forced build due input parameter"
139139
fi
140140
- name: Set up Docker BuildX
@@ -188,7 +188,7 @@ runs:
188188
if: (steps.image_status.outputs.updated != 'true' || inputs.rebuild == 'true') && inputs.dryrun != 'true'
189189
shell: bash
190190
run: |
191-
echo "${{ toJSON(steps.build_push.outputs) }}"
191+
echo "${{ toJSON(steps.build_push.outputs) }}"
192192
regctl image inspect -p linux/amd64 ${{ steps.image_name.outputs.name }}
193193
echo "::notice:: Image ${{ steps.meta.outputs.tags }} successfully built and pushed"
194194
echo "created=true" >> $GITHUB_OUTPUT

.github/actions/last_commit/action.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ outputs:
1313
runs:
1414
using: "composite"
1515
steps:
16-
- name: Setup Environment (PR)
17-
if: ${{ github.event_name == 'pull_request' }}
18-
shell: bash
19-
run: |
16+
- name: Setup Environment (PR)
17+
if: ${{ github.event_name == 'pull_request' }}
18+
shell: bash
19+
run: |
2020
echo "LAST_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
21-
- name: Setup Environment (Push)
22-
if: ${{ github.event_name == 'push' }}
21+
- name: Setup Environment (Push)
22+
if: ${{ github.event_name == 'push' }}
2323
shell: bash
24-
run: |
24+
run: |
2525
echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
2626
- id: result
2727
shell: bash
2828
run: |
29-
raw=${{env.LAST_COMMIT_SHA}}
29+
raw=${{env.LAST_COMMIT_SHA}}
3030
echo "last_commit_sha=$raw" >> $GITHUB_OUTPUT
3131
echo "last_commit_short_sha=${raw::8}" >> $GITHUB_OUTPUT

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The property '#/updates/0/package-ecosystem' value "" did not match one of the following values: npm, bundler, composer, devcontainers, maven, mix, cargo, gradle, nuget, gomod, docker, elm, gitsubmodule, github-actions, pip, terraform, pub, swift
66
version: 2
77
updates:
8-
- package-ecosystem: "pip"
8+
- package-ecosystem: "pip"
99
directory: "/"
1010
schedule:
1111
interval: "weekly"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229
# django-admin upgrade
230230

231231
- name: Publish images
232-
run: |
232+
run: |
233233
docker push ${{needs.test.outputs.image}}
234234
docker inspect ${{needs.test.outputs.image}} | jq -r '.[0].Config.Labels'
235235
echo "::notice::✅ Image ${{needs.test.outputs.image}} built and pushed"

.pre-commit-config.yaml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
27
- repo: https://github.com/adamchainz/djade-pre-commit
38
rev: "1.3.2"
49
hooks:
@@ -10,28 +15,17 @@ repos:
1015
hooks:
1116
- id: isort
1217
stages: [pre-commit]
13-
- repo: https://github.com/ambv/black
14-
rev: 24.10.0
15-
hooks:
16-
- id: black
17-
args: [--config=pyproject.toml]
18-
exclude: "migrations|snapshots"
19-
stages: [pre-commit]
20-
- repo: https://github.com/PyCQA/flake8
21-
rev: 7.1.1
22-
hooks:
23-
- id: flake8
24-
args: [--config=.flake8]
25-
stages: [ pre-commit ]
26-
- repo: https://github.com/PyCQA/bandit
27-
rev: '1.7.10' # Update me!
28-
hooks:
29-
- id: bandit
30-
args: ["-c", "bandit.yaml"]
3118
- repo: https://github.com/twisted/towncrier
3219
rev: 24.8.0
3320
hooks:
3421
- id: towncrier-check
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.8.4
24+
hooks:
25+
- id: ruff
26+
- id: ruff-format
27+
args:
28+
- --check
3529

3630
- repo: https://github.com/saxix/pch
3731
rev: '0.1'
@@ -47,12 +41,3 @@ repos:
4741
- src
4842
- tests
4943
stages: [ pre-push ]
50-
51-
- id: check-forbidden
52-
args:
53-
- -p
54-
- /\.showbrowser\(/
55-
- -p
56-
- /print\(111/
57-
stages: [ pre-commit ]
58-
additional_dependencies: [ setuptools ]

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ RUN --mount=type=cache,target=/root/.uv-cache \
9292

9393
# ------- production only deps-------
9494
FROM builder AS production
95-
ENV PATH=/app/.venv/bin:/usr/local/bin/:/usr/bin:/bin \
95+
ENV PATH=/venv/bin:/usr/local/bin/:/usr/bin:/bin \
9696
DJANGO_SETTINGS_MODULE=country_workspace.config.settings \
9797
PYTHONUNBUFFERED=1 \
9898
PYTHONDONTWRITEBYTECODE=1 \
@@ -147,7 +147,7 @@ COPY . /app/
147147
COPY --chown=hope:unicef --from=production /venv /venv
148148
COPY --from=builder /usr/local/bin/uwsgi /usr/local/bin/uv /usr/local/bin/
149149
RUN --mount=type=cache,target=/root/.uv-cache \
150-
uv --cache-dir=/root/.uv-cache pip install --link-mode=copy --no-deps . \
150+
uv --cache-dir=/root/.uv-cache pip install --no-deps . \
151151
&& rm -fr /app
152152

153153

docs/_theme/css/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Install [uv](https://docs.astral.sh/uv/)
2222
wget https://github.com/sqreen/PyMiniRacer/files/7575004/libmini_racer.dylib.zip
2323

2424
1. Unzip The Dylib file
25-
25+
2626
unzip libmini_racer.dylib.zip
27-
27+
2828
1. MV Dylib file to your site-packages
2929

3030
mv libmini_racer.dylib /opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/py_mini_racer/.
3131

3232
1. Import Success.
33-
33+
3434
>>> from py_mini_racer import MiniRacer
3535

3636

@@ -42,11 +42,11 @@ CSS. CSS sources are located in the `country_workspace/workspaces/theme/static_s
4242
If you need to edit the CSS follow the below steps:
4343

4444
1. Install node dependencies
45-
45+
4646
./manage.py tailwind install
4747

4848
1. Configure the enviroment
49-
49+
5050
export EXTRA_APPS="country_workspace.contrib.hope,django_browser_reload"
5151
export EXTRA_MIDDLEWARES="django_browser_reload.middleware.BrowserReloadMiddleware,"
5252

docs/src/dev_helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
show_bases: false
77
show_bases: false
88
show_root_heading: true
9-
show_source: true
9+
show_source: true

0 commit comments

Comments
 (0)