Skip to content

Commit

Permalink
Merge pull request #202 from jamescurtin/add-pre-commit
Browse files Browse the repository at this point in the history
Add pre-commit hook
  • Loading branch information
iragm authored Sep 3, 2024
2 parents ec351e3 + d6c2519 commit 807d691
Show file tree
Hide file tree
Showing 251 changed files with 2,230 additions and 2,197 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"service": "dev",
"workspaceFolder": "/workspace",
"postCreateCommand": ". /workspace/.devcontainer/post-create.sh",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
Expand Down
4 changes: 4 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

cd /workspace
pre-commit install-hooks
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ RECAPTCHA_PRIVATE_KEY='secret'
GOOGLE_OAUTH_LINK="secret.apps.googleusercontent.com"
HTTP_PORT="80"
SSL_PORT="443"

7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ jobs:
- uses: actions/checkout@v4
- run: ./.github/scripts/prepare-ci.sh
- run: docker compose run --rm test --ci
pre-commit:
name: pre-commit validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ media/
auctions/templates/ads.txt
swag/
mediafiles/
staticfiles/
staticfiles/
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.3
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RUN pip install -r requirements-test.txt
FROM builder AS dev
COPY ./requirements*.txt .
RUN pip install -r requirements.txt
RUN pip install -r requirements-test.txt

#########
# FINAL #
Expand Down
14 changes: 7 additions & 7 deletions auctions/static/admin/css/dark_mode.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
:root {
--primary: #264b5d;
--primary-fg: #f7f7f7;

--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;

--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);

--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;

--hairline-color: #272727;
--border-color: #353535;

--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;

--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;

--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
Expand Down
2 changes: 1 addition & 1 deletion auctions/static/admin/img/gis/move_vertex_off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion auctions/static/admin/img/gis/move_vertex_on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions auctions/static/admin/js/SelectFilter2.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Requires core.js and SelectBox.js.
[field_name]
)
);

const filter_selected_p = quickElement('p', selector_chosen, '', 'id', field_id + '_filter_selected');
filter_selected_p.className = 'selector-filter';

Expand All @@ -115,11 +115,11 @@ Requires core.js and SelectBox.js.

const to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', '', 'size', from_box.size, 'name', from_box.name);
to_box.className = 'filtered';

const warning_footer = quickElement('div', selector_chosen, '', 'class', 'list-footer-display');
quickElement('span', warning_footer, '', 'id', field_id + '_list-footer-display-text');
quickElement('span', warning_footer, ' (click to clear)', 'class', 'list-footer-display__clear');

const clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link');
clear_all.className = 'selector-clearall';

Expand Down
4 changes: 2 additions & 2 deletions auctions/static/admin/js/admin/RelatedObjectLookups.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
relatedWindows.forEach(function(win) {
if(!win.closed) {
win.dismissChildPopups();
win.close();
win.close();
}
});
}

function setPopupIndex() {
if(document.getElementsByName("_popup").length > 0) {
const index = window.name.lastIndexOf("__") + 2;
popupIndex = parseInt(window.name.substring(index));
popupIndex = parseInt(window.name.substring(index));
} else {
popupIndex = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/af.js

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

2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/ar.js

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

2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/az.js

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

2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/bg.js

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

2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/bn.js

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

2 changes: 1 addition & 1 deletion auctions/static/admin/js/vendor/select2/i18n/bs.js

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

Loading

0 comments on commit 807d691

Please sign in to comment.