Skip to content

Commit 320f71b

Browse files
committed
chore: Update pre-commit
1 parent 9ce48a9 commit 320f71b

20 files changed

Lines changed: 247 additions & 227 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
schedule: [cron: "40 1 * * *"]
99

1010
jobs:
11-
1211
commitsar:
1312
name: Verify commit messages
1413
runs-on: ubuntu-22.04
@@ -42,8 +41,8 @@ jobs:
4241
- uses: actions/setup-python@v5
4342
with:
4443
python-version: 3.11
45-
cache: 'pip'
46-
cache-dependency-path: '**/requirements-*.txt'
44+
cache: "pip"
45+
cache-dependency-path: "**/requirements-*.txt"
4746

4847
- name: Start background server
4948
run: |
@@ -205,15 +204,15 @@ jobs:
205204
yarn build --target aarch64-unknown-linux-musl &&
206205
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
207206
node:
208-
- '18'
209-
- '20'
207+
- "18"
208+
- "20"
210209

211210
name: NodeJS ${{ matrix.node }} on ${{ matrix.settings.target }}
212211
runs-on: ${{ matrix.settings.host }}
213212
env:
214213
DEBUG: napi:*
215214
APP_NAME: css-inline
216-
MACOSX_DEPLOYMENT_TARGET: '10.13'
215+
MACOSX_DEPLOYMENT_TARGET: "10.13"
217216
steps:
218217
- uses: actions/checkout@v4
219218

@@ -286,7 +285,7 @@ jobs:
286285
if: ${{ matrix.settings.docker }}
287286
with:
288287
image: ${{ matrix.settings.docker }}
289-
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build/bindings/javascript'
288+
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
290289
run: ${{ matrix.settings.build }}
291290

292291
- name: Build
@@ -328,7 +327,7 @@ jobs:
328327
uses: addnab/docker-run-action@v3
329328
with:
330329
image: node:${{ matrix.node }}-slim
331-
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build/bindings/javascript'
330+
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
332331
run: |
333332
set -e
334333
yarn test
@@ -338,7 +337,7 @@ jobs:
338337
uses: addnab/docker-run-action@v3
339338
with:
340339
image: node:${{ matrix.node }}-alpine
341-
options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build/bindings/javascript'
340+
options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
342341
run: |
343342
set -e
344343
yarn test
@@ -348,7 +347,7 @@ jobs:
348347
uses: addnab/docker-run-action@v3
349348
with:
350349
image: node:${{ matrix.node }}-bullseye-slim
351-
options: '--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build/bindings/javascript'
350+
options: "--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
352351
run: |
353352
set -e
354353
yarn test
@@ -358,7 +357,7 @@ jobs:
358357
fail-fast: false
359358
matrix:
360359
os: [ubuntu-22.04, macos-12, windows-2022]
361-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
360+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
362361

363362
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
364363
runs-on: ${{ matrix.os }}
@@ -371,8 +370,8 @@ jobs:
371370
with:
372371
python-version: ${{ matrix.python-version }}
373372
architecture: x64
374-
cache: 'pip'
375-
cache-dependency-path: '**/requirements-*.txt'
373+
cache: "pip"
374+
cache-dependency-path: "**/requirements-*.txt"
376375

377376
- run: python -m pip install -r requirements/dev.txt
378377
working-directory: ./bindings/python
@@ -385,12 +384,8 @@ jobs:
385384
strategy:
386385
fail-fast: false
387386
matrix:
388-
os: [
389-
ubuntu-22.04,
390-
macos-12,
391-
windows-2022
392-
]
393-
ruby-version: ['2.7', '3.2']
387+
os: [ubuntu-22.04, macos-12, windows-2022]
388+
ruby-version: ["2.7", "3.2"]
394389

395390
name: Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
396391
runs-on: ${{ matrix.os }}
@@ -521,8 +516,8 @@ jobs:
521516
- uses: actions/setup-python@v5
522517
with:
523518
python-version: 3.11
524-
cache: 'pip'
525-
cache-dependency-path: '**/requirements-*.txt'
519+
cache: "pip"
520+
cache-dependency-path: "**/requirements-*.txt"
526521

527522
- name: Start background server
528523
run: |

.github/workflows/javascript-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
env:
5959
DEBUG: napi:*
6060
APP_NAME: css-inline
61-
MACOSX_DEPLOYMENT_TARGET: '10.13'
61+
MACOSX_DEPLOYMENT_TARGET: "10.13"
6262

6363
steps:
6464
- uses: actions/checkout@v4
@@ -132,7 +132,7 @@ jobs:
132132
if: ${{ matrix.settings.docker }}
133133
with:
134134
image: ${{ matrix.settings.docker }}
135-
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build/bindings/javascript'
135+
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
136136
run: ${{ matrix.settings.build }}
137137

138138
- name: Build

.github/workflows/python-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
runs-on: windows-latest
9191
strategy:
9292
matrix:
93-
target: [ x64, x86 ]
93+
target: [x64, x86]
9494
steps:
9595
- uses: actions/checkout@v4
9696
- uses: actions/setup-python@v5
@@ -117,7 +117,7 @@ jobs:
117117
runs-on: ubuntu-22.04
118118
strategy:
119119
matrix:
120-
target: [ x86_64, i686 ]
120+
target: [x86_64, i686]
121121
steps:
122122
- uses: actions/checkout@v4
123123
- uses: actions/setup-python@v5
@@ -144,7 +144,7 @@ jobs:
144144
runs-on: ubuntu-22.04
145145
strategy:
146146
matrix:
147-
target: [ aarch64, armv7 ]
147+
target: [aarch64, armv7]
148148
steps:
149149
- uses: actions/checkout@v4
150150
- uses: actions/setup-python@v5
@@ -246,8 +246,8 @@ jobs:
246246
runs-on: ${{ matrix.os }}
247247
strategy:
248248
matrix:
249-
os: [ ubuntu-22.04, macos-latest ]
250-
target: [ x86_64, aarch64 ]
249+
os: [ubuntu-22.04, macos-latest]
250+
target: [x86_64, aarch64]
251251
python-version:
252252
- "3.7"
253253
- "3.8"

.pre-commit-config.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.4.0
6+
rev: v4.5.0
77
hooks:
88
- id: check-yaml
99
- id: end-of-file-fixer
@@ -13,24 +13,28 @@ repos:
1313
args: [--fix=lf]
1414
- id: check-merge-conflict
1515

16+
- repo: https://github.com/pre-commit/mirrors-prettier
17+
rev: v3.1.0
18+
hooks:
19+
- id: prettier
20+
exclude: index.d.ts|index.js|README.md|example.html
21+
1622
- repo: https://github.com/jorisroovers/gitlint
1723
rev: v0.19.1
1824
hooks:
1925
- id: gitlint
2026

2127
- repo: https://github.com/adrienverge/yamllint
22-
rev: v1.32.0
28+
rev: v1.33.0
2329
hooks:
2430
- id: yamllint
2531

26-
- repo: https://github.com/ambv/black
27-
rev: 23.3.0
32+
- repo: https://github.com/astral-sh/ruff-pre-commit
33+
rev: v0.1.9
2834
hooks:
29-
- id: black
30-
types: [python]
35+
- id: ruff-format
3136

32-
- repo: https://github.com/pre-commit/mirrors-isort
33-
rev: v5.10.1
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.1.9
3439
hooks:
35-
- id: isort
36-
additional_dependencies: ["isort[pyproject]"]
40+
- id: ruff

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ your commits before merging, depending.
2727
If you'd like to suggest a feature, feel free to [submit an issue](https://github.com/Stranger6667/css-inline/issues)
2828
and:
2929

30-
* Write a simple and descriptive title to identify your suggestion.
31-
* Provide as many details as possible, explain your context, and how the feature should work.
32-
* Explain why this improvement would be useful.
33-
* Keep the scope narrow. It will make it easier to implement.
30+
- Write a simple and descriptive title to identify your suggestion.
31+
- Provide as many details as possible, explain your context, and how the feature should work.
32+
- Explain why this improvement would be useful.
33+
- Keep the scope narrow. It will make it easier to implement.
3434

3535
## Report bugs
3636

3737
Report bugs for `css-inline` in the [issue tracker](https://github.com/Stranger6667/css-inline/issues).
3838

3939
If you are reporting a bug, please:
4040

41-
* Write a simple and descriptive title to identify the problem.
42-
* Describe the exact steps which reproduce the problem in as many details as possible.
43-
* Describe the behavior you observed after following the steps and point out the problem with that behavior.
44-
* Explain which behavior you expected to see instead and why.
45-
* Include your Rust and `css-inline` version. Additionally include your Python version if you use our Python bindings.
41+
- Write a simple and descriptive title to identify the problem.
42+
- Describe the exact steps which reproduce the problem in as many details as possible.
43+
- Describe the behavior you observed after following the steps and point out the problem with that behavior.
44+
- Explain which behavior you expected to see instead and why.
45+
- Include your Rust and `css-inline` version. Additionally include your Python version if you use our Python bindings.
4646

4747
It would be awesome if you can submit a failing test that demonstrates the problem.
4848

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ For instance, the crate transforms HTML like this:
1414

1515
```html
1616
<html>
17-
<head>
18-
<style>h1 { color:blue; }</style>
19-
</head>
20-
<body>
21-
<h1>Big Text</h1>
22-
</body>
17+
<head>
18+
<style>h1 { color:blue; }</style>
19+
</head>
20+
<body>
21+
<h1>Big Text</h1>
22+
</body>
2323
</html>
2424
```
2525

2626
into:
2727

2828
```html
2929
<html>
30-
<head></head>
31-
<body>
32-
<h1 style="color:blue;">Big Text</h1>
33-
</body>
30+
<head></head>
31+
<body>
32+
<h1 style="color:blue;">Big Text</h1>
33+
</body>
3434
</html>
3535
```
3636

@@ -101,23 +101,23 @@ You can also skip CSS inlining for an HTML tag by adding the `data-css-inline="i
101101

102102
```html
103103
<head>
104-
<style>h1 { color:blue; }</style>
104+
<style>h1 { color:blue; }</style>
105105
</head>
106106
<body>
107-
<!-- The tag below won't receive additional styles -->
108-
<h1 data-css-inline="ignore">Big Text</h1>
107+
<!-- The tag below won't receive additional styles -->
108+
<h1 data-css-inline="ignore">Big Text</h1>
109109
</body>
110110
```
111111

112112
The `data-css-inline="ignore"` attribute also allows you to skip `link` and `style` tags:
113113

114114
```html
115115
<head>
116-
<!-- Styles below are ignored -->
117-
<style data-css-inline="ignore">h1 { color:blue; }</style>
116+
<!-- Styles below are ignored -->
117+
<style data-css-inline="ignore">h1 { color:blue; }</style>
118118
</head>
119119
<body>
120-
<h1>Big Text</h1>
120+
<h1>Big Text</h1>
121121
</body>
122122
```
123123

0 commit comments

Comments
 (0)