Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
ccc86641
Commit
ccc86641
authored
Oct 30, 2024
by
Roang
Browse files
Options
Downloads
Patches
Plain Diff
Add prettier and djLint to GitLab and tox
parent
232edde3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+22
-3
22 additions, 3 deletions
.gitlab-ci.yml
package.json
+3
-0
3 additions, 0 deletions
package.json
pyproject.toml
+4
-2
4 additions, 2 deletions
pyproject.toml
tox.ini
+13
-1
13 additions, 1 deletion
tox.ini
with
42 additions
and
6 deletions
.gitlab-ci.yml
+
22
−
3
View file @
ccc86641
...
...
@@ -35,8 +35,9 @@ default:
-
key
:
files
:
-
src/plainui/yarn.lock
-
yarn.lock
paths
:
-
.yarn
-
cache/
-
.yarn
/
cache/
.django_runner_settings
:
before_script
:
...
...
@@ -109,10 +110,9 @@ generate_css:
-
.default-rules
image
:
node:20-bookworm
stage
:
prepare
needs
:
[]
script
:
-
cd src/plainui/
-
echo 'yarn-offline-mirror ".yarn
-
cache/"' >> .yarnrc
-
echo 'yarn-offline-mirror ".yarn
/
cache/"' >> .yarnrc
-
echo 'yarn-offline-mirror-pruning
true
' >> .yarnrc
-
yarn install --non-interactive --no-progress --frozen-lockfile
-
yarn run build
...
...
@@ -139,6 +139,8 @@ meta_build:
extends
:
-
.django_runner_settings
image
:
$CI_REGISTRY_IMAGE/build_image:$CI_PIPELINE_ID
variables
:
PDM_CACHE_DIR
:
.cache/pdm
needs
:
-
meta_build
...
...
@@ -175,6 +177,23 @@ format:
-
python3 -V
-
pdm sync -d --no-editable -G dev
-
pdm run format
-
git diff --exit-code -- . ':!src/version.json'
allow_failure
:
true
rules
:
-
when
:
always
format_prettier
:
image
:
node:22-alpine
stage
:
test
needs
:
[]
before_script
:
-
apk add --no-cache git
-
corepack enable
-
'
echo
"cacheFolder:
\".yarn/cache/\""
>
.yarnrc.yml'
-
yarn install --immutable
script
:
-
yarn format
-
git diff --exit-code -- . ':!src/version.json'
allow_failure
:
true
rules
:
-
when
:
always
...
...
...
...
This diff is collapsed.
Click to expand it.
package.json
+
3
−
0
View file @
ccc86641
...
...
@@ -3,5 +3,8 @@
"packageManager"
:
"yarn@4.5.0"
,
"devDependencies"
:
{
"
prettier
"
:
"
^3.3.3
"
},
"scripts"
:
{
"format"
:
"prettier --write --ignore-unknown ."
}
}
This diff is collapsed.
Click to expand it.
pyproject.toml
+
4
−
2
View file @
ccc86641
...
...
@@ -88,10 +88,12 @@ all = "tox"
check-migrations
=
"tox -e migrations"
coverage-report
=
"tox -e coverage-report"
style-check
=
{
composite
=
[
"format"
,
"lint"
]}
format
=
{
composite
=
[
"py-format"
]}
lint
=
{
composite
=
[
"py-lint"
]}
format
=
{
composite
=
[
"py-format"
,
"html-format"
]}
lint
=
{
composite
=
[
"py-lint"
,
"html-lint"
]}
py-format
=
"tox -e py-format"
py-lint
=
"tox -e py-lint"
html-format
=
"tox -e html-format"
html-lint
=
"tox -e html-lint"
test
=
"tox -e django-test"
live-test
=
"tox -e live-test"
...
...
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
13
−
1
View file @
ccc86641
[tox]
requires
=
tox>=4
env_list
=
py-lint, py-format, migrations, django-test, coverage-report
env_list
=
py-lint, py-format,
html-lint, html-format,
migrations, django-test, coverage-report
work_dir
=
.tools/tox
[hub]
...
...
@@ -30,6 +30,18 @@ commands = ruff check .
groups
=
lint
commands
=
ruff format . --diff
[testenv:html-lint]
groups
=
lint
commands
=
djlint
--profile
jinja
-e
j2
--lint
.
djlint
--profile
django
-e
html
--lint
.
[testenv:html-format]
groups
=
lint
commands
=
djlint
--profile
jinja
-e
j2
--reformat
.
djlint
--profile
django
-e
html
--reformat
.
[testenv:migrations]
groups
=
dev
change_dir
=
{toxinidir}/src
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment