Skip to content

Commit 849aaa9

Browse files
committed
Reformat project with Prettier
1 parent 0c6353f commit 849aaa9

Some content is hidden

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

51 files changed

+318
-286
lines changed

.devcontainer/devcontainer.json

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-docker-compose
33
{
44
"name": "django-pattern-library devcontainer",
5-
"dockerComposeFile": [
6-
"../docker-compose.yml"
7-
],
5+
"dockerComposeFile": ["../docker-compose.yml"],
86
"service": "web",
97
"workspaceFolder": "/app",
108
"settings": {
11-
"terminal.integrated.profiles.linux": {
12-
"bash": {
13-
"path": "bash",
14-
"icon": "terminal-bash"
15-
},
16-
},
17-
"terminal.integrated.defaultProfile.linux": "bash"
9+
"terminal.integrated.profiles.linux": {
10+
"bash": {
11+
"path": "bash",
12+
"icon": "terminal-bash"
13+
}
14+
},
15+
"terminal.integrated.defaultProfile.linux": "bash"
1816
},
1917
"extensions": [
20-
"editorconfig.editorconfig",
21-
"github.vscode-pull-request-github",
22-
"ms-python.python",
23-
"ms-python.vscode-pylance",
24-
"syler.sass-indented"
18+
"editorconfig.editorconfig",
19+
"github.vscode-pull-request-github",
20+
"ms-python.python",
21+
"ms-python.vscode-pylance",
22+
"syler.sass-indented"
2523
],
2624
"remoteUser": "dpl"
2725
}

.github/ISSUE_TEMPLATE/BUG_REPORT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
name: "🐞 Bug Report"
2+
name: '🐞 Bug Report'
33
about: Create a report to help us improve
4-
title: ""
5-
labels: "type:Bug"
6-
assignees: ""
4+
title: ''
5+
labels: 'type:Bug'
6+
assignees: ''
77
---
88

99
Found a bug? Please fill out the sections below. 👍

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
name: "🚀 Feature request"
2+
name: '🚀 Feature request'
33
about: Suggest an idea for improvement
4-
title: ""
5-
labels: "type:Enhancement"
6-
assignees: ""
4+
title: ''
5+
labels: 'type:Enhancement'
6+
assignees: ''
77
---
88

99
### Is your proposal related to a problem?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: "❓ Question"
3+
- name: '❓ Question'
44
url: https://github.com/torchbox/django-pattern-library/discussions
55
about: Use GitHub Discussions to get help with this project.

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- run: pipx install "poetry>=2.1.2,<3"
1313
- uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.13"
16-
cache: "poetry"
15+
python-version: '3.13'
16+
cache: 'poetry'
1717
- run: pip install tox
1818
- run: tox -e lint,py313-dj51
1919
test_compatibility:
@@ -26,13 +26,13 @@ jobs:
2626
# Test with all supported Django versions, for all compatible Python versions.
2727
# See https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django for the official matrix.
2828
# Additionally test on Django’s main branch with the most recent Python version.
29-
- python: "3.10"
29+
- python: '3.10'
3030
toxenv: py310-dj42,py310-dj51,py310-dj52
31-
- python: "3.11"
31+
- python: '3.11'
3232
toxenv: py311-dj42,py311-dj51,py311-dj52
33-
- python: "3.12"
33+
- python: '3.12'
3434
toxenv: py312-dj42,py312-dj52
35-
- python: "3.13"
35+
- python: '3.13'
3636
toxenv: py313-dj42,py313-dj52,py312-djmain
3737
steps:
3838
- uses: actions/checkout@v6
@@ -52,15 +52,15 @@ jobs:
5252
- uses: actions/checkout@v6
5353
- uses: actions/setup-node@v6
5454
with:
55-
node-version-file: ".nvmrc"
55+
node-version-file: '.nvmrc'
5656
- run: npm ci --no-audit
5757
- run: npm run lint || true
5858
- run: npm run build
5959
- run: pipx install "poetry>=2.1.2,<3"
6060
- uses: actions/setup-python@v5
6161
with:
6262
python-version-file: pyproject.toml
63-
cache: "poetry"
63+
cache: 'poetry'
6464
- run: poetry install
6565
- run: poetry run django-admin runserver --settings=tests.settings.production --pythonpath=. &
6666
# Docs website build.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
@@ -17,7 +17,7 @@ on:
1717
- '**/*.html'
1818
- '**/*.scss'
1919
schedule:
20-
- cron: "28 20 * * 5"
20+
- cron: '28 20 * * 5'
2121

2222
jobs:
2323
analyze:
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
language: ["javascript", "python"]
33+
language: ['javascript', 'python']
3434

3535
steps:
3636
- uses: actions/checkout@v3

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
environment:
77
PYTHONDONTWRITEBYTECODE: 1
88
ports:
9-
- "8000:8000"
9+
- '8000:8000'
1010
volumes:
1111
- type: bind
1212
source: .

docs/guides/automated-tests.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ Here is an example Pa11y configuration:
7676
```js
7777
module.exports = {
7878
defaults: {
79-
standard: "WCAG2AAA",
80-
runners: ["axe"],
79+
standard: 'WCAG2AAA',
80+
runners: ['axe'],
8181
},
8282

8383
urls: [
84-
"https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/molecules/accordion/accordion.html",
85-
"https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/pages/people/person_page.html",
84+
'https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/molecules/accordion/accordion.html',
85+
'https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/pages/people/person_page.html',
8686
],
8787
};
8888
```
@@ -106,7 +106,7 @@ static:
106106
- npm ci
107107
- npm run build:prod
108108
artifacts:
109-
name: "static-$CI_JOB_ID"
109+
name: 'static-$CI_JOB_ID'
110110
paths:
111111
- ./demosite/static_compiled
112112
expire_in: 30 mins
@@ -131,7 +131,7 @@ test_python:
131131
- python manage.py render_patterns --wrap-fragment 2>&1 >/dev/null | tee dpl-list.txt
132132
- mv dpl-list.txt dpl-rendered-patterns && cp -R static dpl-rendered-patterns/static && mv dpl-rendered-patterns ../dpl-rendered-patterns
133133
artifacts:
134-
name: "test_patterns-$CI_JOB_ID"
134+
name: 'test_patterns-$CI_JOB_ID'
135135
paths:
136136
- ./dpl-rendered-patterns
137137
expire_in: 30 mins
@@ -161,44 +161,44 @@ pa11y:
161161
Here is the `pa11y.config.js`, which will determine what to test based on the output of `render_patterns`, as listed in the `dpl-list.txt` file:
162162

163163
```js
164-
const path = require("path");
165-
const fs = require("fs");
164+
const path = require('path');
165+
const fs = require('fs');
166166
167167
const defaults = {
168168
chromeLaunchConfig: {
169169
// Needed to run Pa11y in GitLab CI.
170-
args: ["--no-sandbox"],
170+
args: ['--no-sandbox'],
171171
},
172-
standard: "WCAG2AA",
173-
runners: ["axe"],
172+
standard: 'WCAG2AA',
173+
runners: ['axe'],
174174
};
175175
176176
// Assume we run tests over a live django-pattern-library instance, unless TEST_ORIGIN is set;
177-
const local = "http://localhost:8000/pattern-library/render-pattern/patterns";
177+
const local = 'http://localhost:8000/pattern-library/render-pattern/patterns';
178178
const origin = process.env.TEST_ORIGIN || local;
179179
180180
let urls = [];
181181
182182
// In CI mode, retrieve the URLs to test from dpl-rendered-patterns.
183183
if (process.env.CI) {
184-
const list = path.join(__dirname, "dpl-rendered-patterns", "dpl-list.txt");
184+
const list = path.join(__dirname, 'dpl-rendered-patterns', 'dpl-list.txt');
185185
const patterns = fs
186-
.readFileSync(list, "utf-8")
187-
.split("\n")
186+
.readFileSync(list, 'utf-8')
187+
.split('\n')
188188
.filter((p) => p);
189189
190-
urls = patterns.map((p) => `${origin}/${p.replace("patterns/", "")}`);
190+
urls = patterns.map((p) => `${origin}/${p.replace('patterns/', '')}`);
191191
}
192192

193193
// Convert the list of URLs to configuration objects.
194194
urls = [...new Set(urls)].map((url) => {
195195
const config = {
196196
url,
197-
screenCapture: `dpl-rendered-patterns/${url.replace(origin, "")}.png`,
197+
screenCapture: `dpl-rendered-patterns/${url.replace(origin, '')}.png`,
198198
};
199199

200-
if (url.endsWith("tab-nav-item.html")) {
201-
config.ignore = [...defaults.ignore, "aria-required-parent"];
200+
if (url.endsWith('tab-nav-item.html')) {
201+
config.ignore = [...defaults.ignore, 'aria-required-parent'];
202202
}
203203

204204
return config;

docs/guides/defining-template-context.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The `big_red_button.yaml` can be something like this:
1616

1717
```yaml
1818
context:
19-
button_link: https://example.com/
20-
button_text: Example link
19+
button_link: https://example.com/
20+
button_text: Example link
2121
```
2222
2323
In the same way you can provide context in more complex templates. Here is
@@ -46,14 +46,14 @@ You might define a YAML file similar to this to provide fake data:
4646
name: My example pattern
4747
4848
context:
49-
items_title: Related pages
50-
my_objects:
51-
exists: true # simulate `QuerySet`'s `exists` method
52-
all: # simulate `QuerySet`'s `all` method
53-
- title: Page 1
54-
link: /page1
55-
- title: Page 2
56-
link: /page2
49+
items_title: Related pages
50+
my_objects:
51+
exists: true # simulate `QuerySet`'s `exists` method
52+
all: # simulate `QuerySet`'s `all` method
53+
- title: Page 1
54+
link: /page1
55+
- title: Page 2
56+
link: /page2
5757
```
5858
5959
You can define a list or a dict or anything that [`PyYAML`](http://pyyaml.org/wiki/PyYAMLDocumentation) allows you to create in YAML format without creating a custom objects.

0 commit comments

Comments
 (0)