Skip to content

Commit f08b7f8

Browse files
committed
Update pre-commit config.
1 parent 62314df commit f08b7f8

File tree

22 files changed

+230
-141
lines changed

22 files changed

+230
-141
lines changed

.pre-commit-config.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
exclude: |
2+
(?x)^(
3+
^.github/|
4+
bin/.*\.gitkeep
5+
)
16
repos:
27
- repo: https://github.com/pre-commit/pre-commit-hooks
38
rev: v5.0.0
@@ -16,6 +21,33 @@ repos:
1621
rev: v4.0.0-alpha.8
1722
hooks:
1823
- id: prettier
19-
args: ["--tab-width", "2", "--trailing-comma", "es5"]
20-
additional_dependencies: ["prettier", "prettier-plugin-astro"]
24+
entry: pnpm run format:files
2125
exclude: "pnpm-lock.yaml"
26+
exclude_types: ["svg", "editorconfig", "gitignore"]
27+
28+
- repo: local
29+
hooks:
30+
- id: local_prettier
31+
name: prettier
32+
entry: pnpm run format:files
33+
language: node
34+
types_or: ["text"]
35+
exclude_types: ["editorconfig", "gitignore"]
36+
additional_dependencies: ["prettier", "prettier-plugin-astro"]
37+
files: \.(astro|mdx|md|yml|yaml|ts|js|mjs)$
38+
39+
- id: astro-check
40+
name: astro check
41+
entry: astro check
42+
language: node
43+
files: "^(?:public|src)/.+|astro\\.config\\.mjs|tsconfig\\.json"
44+
pass_filenames: false
45+
additional_dependencies: ["astro", "@astrojs/check"]
46+
47+
- id: astro-build
48+
name: astro build
49+
entry: astro build
50+
language: node
51+
files: "^(?:public|src)/.+|astro\\.config\\.mjs|tsconfig\\.json"
52+
pass_filenames: false
53+
additional_dependencies: ["astro"]

.prettierrc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"tabWidth": 2,
3+
"trailingComma": "es5",
4+
"plugins": ["prettier-plugin-astro"],
5+
"overrides": [
6+
{
7+
"files": "*.astro",
8+
"options": {
9+
"parser": "astro"
10+
}
11+
}
12+
],
13+
"printWidth": 100,
14+
"semi": true,
15+
"singleQuote": false,
16+
"bracketSpacing": true,
17+
"bracketSameLine": false,
18+
"arrowParens": "avoid",
19+
"endOfLine": "lf",
20+
"ignore": ["pnpm-lock.yaml", ".github/**", "**/.gitkeep"],
21+
"include": [
22+
"\\.astro$",
23+
"\\.mdx$",
24+
"\\.md$",
25+
"\\.yml$",
26+
"\\.yaml$",
27+
"\\.ts$",
28+
"\\.js$",
29+
"\\.mjs$"
30+
]
31+
}

astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default defineConfig({
5959
site: process.env.SITE_URL || "https://ep2025.europython.eu",
6060
redirects: {
6161
"/c-api-summit/": "/programme/c-api-summit/",
62-
"/programme/cfp/": "/programme/cfp/",
62+
"/cfp/": "/programme/cfp/",
6363
"/planning/": "https://forms.gle/riw6CvML8ck94A4V9",
6464
"/reviewers/": "https://forms.gle/4GTJjwZ1nHBGetM18",
6565
"/rust-summit/": "/programme/rust-summit/",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "astro check && astro build && pnpm pagefind --site dist",
99
"preview": "astro preview",
1010
"astro": "astro",
11-
"format": "prettier --write --plugin=prettier-plugin-astro ."
11+
"format:files": "pnpm prettier --config .prettierrc --write --log-level=error",
12+
"format": "pnpm run format:files ."
1213
},
1314
"dependencies": {
1415
"@astro-community/astro-embed-youtube": "^0.5.6",

src/components/accordion/accordion.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const { title, id } = Astro.props;
2828
const hash = window.location.hash.substring(1); // Remove #
2929
if (hash) {
3030
const details = document.getElementById(
31-
hash,
31+
hash
3232
) as HTMLDetailsElement | null;
3333
if (details) {
3434
details.open = true;

src/components/card/card.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ const { title, subtitle, url, image } = Astro.props;
2222
src={image}
2323
width={600}
2424
height={375}
25-
alt=`Card image - ${title}`
25+
alt=`Card image - ${title}`
2626
class="not-prose rounded-xl aspect-[3/2] w-full"
2727
loading="lazy"
2828
/>
2929
</div>
3030
</a>
3131
<div class="flex items-center flex-col flex-grow mb-2">
3232
<a href={url} class="block hover:underline">
33-
<h3 >{title}</h3>
33+
<h3>{title}</h3>
3434
</a>
3535
<slot />
3636
</div>

src/components/header/header-actions.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const IS_LIVE = false;
2727
{
2828
!mobile ? (
2929
<>
30-
<Button url="/tickets" icon="ticket">Register Now!</Button>
30+
<Button url="/tickets" icon="ticket">
31+
Register Now!
32+
</Button>
3133
{IS_LIVE && <Button url="/live">Live</Button>}
3234
</>
3335
) : null
@@ -116,7 +118,7 @@ const IS_LIVE = false;
116118
--pagefind-ui-border: #d8d8d8;
117119
--pagefind-ui-border-width: 2px;
118120
--pagefind-ui-border-radius: 0;
119-
width:50%;
121+
width: 50%;
120122
min-width: 10vw;
121123
}
122124
.pagefind-ui.yellow {

src/components/keynoters/keynoter.astro

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ const placeholders = [Person1, Person2, Person3, Person4, Person5];
3131
3232
const Placeholder =
3333
placeholders[Math.floor(Math.random() * placeholders.length)];
34-
3534
---
3635

3736
<li class:list={["list-none rounded-2xl overflow-clip flex group", className]}>
38-
<a class="block w-full h-full relative " >
37+
<a class="block w-full h-full relative">
3938
<div class="relative aspect-[9/10] overflow-clip">
4039
{
4140
image ? (
@@ -53,9 +52,7 @@ const Placeholder =
5352
}
5453
</div>
5554

56-
<div
57-
class="px-5 py-2 pb-4 bg-keynoter-info rounded-t-none h-full "
58-
>
55+
<div class="px-5 py-2 pb-4 bg-keynoter-info rounded-t-none h-full">
5956
{
6057
placeholder ? (
6158
<p class="text-body-inverted ">More keynoters coming soon</p>

src/components/keynoters/keynoters.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,6 @@ const placeholders = Math.max(0, 5 - keynoters.length);
126126
</div>
127127
</section>
128128
<style>
129-
.fill-hero-primary {}
129+
.fill-hero-primary {
130+
}
130131
</style>

src/components/schedule/speakers.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Props {
1010
const allSpeakers = await getCollection("speakers");
1111
1212
const speakersByCode = Object.fromEntries(
13-
allSpeakers.map((speaker) => [speaker.data.code, speaker]),
13+
allSpeakers.map((speaker) => [speaker.data.code, speaker])
1414
);
1515
1616
const speakers = Astro.props.speakers

0 commit comments

Comments
 (0)