8000 Add prettier to pre-commit (#1255) · Conan520/pyscript@03e798a · GitHub
[go: up one dir, main page]

Skip to content

Commit 03e798a

Browse files
authored
Add prettier to pre-commit (pyscript#1255)
* Add prettier to pre-commit * Apply prettier
1 parent 34a0205 commit 03e798a

16 files changed

+672
-652
lines changed

.github/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
changelog:
22
categories:
3-
- title: New Features
4-
- title: Breaking Changes
5-
- title: Known Issues
3+
- title: New Features
4+
- title: Breaking Changes
5+
- title: Known Issues

.github/workflows/build-unstable.yml

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: '[CI] Build Unstable'
1+
name: "[CI] Build Unstable"
22

33
on:
44
push: # Only run on merges into main that modify files under pyscriptjs/ and examples/
55
branches:
6-
- main
6+
- main
77
paths:
8-
- pyscriptjs/**
9-
- examples/**
10-
- .github/workflows/build-latest.yml # Test that workflow works when changed
8+
- pyscriptjs/**
9+
- examples/**
10+
- .github/workflows/build-latest.yml # Test that workflow works when changed
1111

1212
pull_request: # Run on any PR that modifies files under pyscriptjs/ and examples/
1313
branches:
14-
- main
14+
- main
1515
paths:
16-
- pyscriptjs/**
17-
- examples/**
18-
- .github/workflows/build-unstable.yml # Test that workflow works when changed
16+
- pyscriptjs/**
17+
- examples/**
18+
- .github/workflows/build-unstable.yml # Test that workflow works when changed
1919
workflow_dispatch:
2020

2121
jobs:
@@ -28,59 +28,59 @@ jobs:
2828
MINICONDA_PYTHON_VERSION: py38
2929
MINICONDA_VERSION: 4.11.0
3030
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v3
33-
34-
- name: Install node
35-
uses: actions/setup-node@v3
36-
with:
37-
node-version: 18.x
38-
39-
- name: Cache node modules
40-
uses: actions/cache@v3
41-
env:
42-
cache-name: cache-node-modules
43-
with:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Install node
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 18.x
38+
39+
- name: Cache node modules
40+
uses: actions/cache@v3
41+
env:
42+
cache-name: cache-node-modules
43+
with:
4444
# npm cache files are stored in `~/.npm` on Linux/macOS
45-
path: ~/.npm
46-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
47-
restore-keys: |
48-
${{ runner.os }}-build-${{ env.cache-name }}-
49-
${{ runner.os }}-build-
50-
${{ runner.os }}-
51-
52-
- name: setup Miniconda
53-
uses: conda-incubator/setup-miniconda@v2
54-
55-
- name: Setup Environment
56-
run: make setup
57-
58-
- name: Build
59-
run: make build
60-
61-
- name: TypeScript Tests
62-
run: make test-ts
63-
64-
- name: Python Tests
65-
run: make test-py
66-
67-
- name: Integration Tests
68-
run: make test-integration-parallel
69-
70-
- uses: actions/upload-artifact@v3
71-
with:
72-
name: pyscript
73-
path: |
74-
pyscriptjs/build/
75-
if-no-files-found: error
76-
retention-days: 7
77-
78-
- uses: actions/upload-artifact@v3
79-
if: success() || failure()
80-
with:
81-
name: test_results
82-
path: pyscriptjs/test_results
83-
if-no-files-found: error
45+
path: ~/.npm
46+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-build-${{ env.cache-name }}-
49+
${{ runner.os }}-build-
50+
${{ runner.os }}-
51+
52+
- name: setup Miniconda
53+
uses: conda-incubator/setup-miniconda@v2
54+
55+
- name: Setup Environment
56+
run: make setup
57+
58+
- name: Build
59+
run: make build
60+
61+
- name: TypeScript Tests
62+
run: make test-ts
63+
64+
- name: Python Tests
65+
run: make test-py
66+
67+
- name: Integration Tests
68+
run: make test-integration-parallel
69+
70+
- uses: actions/upload-artifact@v3
71+
with:
72+
name: pyscript
73+
path: |
74+
pyscriptjs/build/
75+
if-no-files-found: error
76+
retention-days: 7
77+
78+
- uses: actions/upload-artifact@v3
79+
if: success() || failure()
80+
with:
81+
name: test_results
82+
path: pyscriptjs/test_results
83+
if-no-files-found: error
8484

8585
Deploy:
8686
runs-on: ubuntu-latest
@@ -91,17 +91,17 @@ jobs:
9191
id-token: write
9292

9393
steps:
94-
- uses: actions/download-artifact@v3
95-
with:
96-
name: pyscript
97-
path: ./build/
98-
99-
# Deploy to S3
100-
- name: Configure AWS credentials
101-
uses: aws-actions/configure-aws-credentials@v1.6.1
102-
with:
103-
aws-region: ${{ secrets.AWS_REGION }}
104-
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
105-
106-
- name: Sync to S3
107-
run: aws s3 sync --quiet ./build/ s3://pyscript.net/unstable/
94+
- uses: actions/download-artifact@v3
95+
with:
96+
name: pyscript
97+
path: ./build/
98+
99+
# Deploy to S3
100+
- name: Configure AWS credentials
101+
uses: aws-actions/configure-aws-credentials@v1.6.1
102+
with:
103+
aws-region: ${{ secrets.AWS_REGION }}
104+
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
105+
106+
- name: Sync to S3
107+
run: aws s3 sync --quiet ./build/ s3://pyscript.net/unstable/

.github/workflows/docs-release.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: '[Docs] Build Release'
1+
name: "[Docs] Build Release"
22

33
on:
44
release:
@@ -13,50 +13,50 @@ jobs:
1313
env:
1414
SPHINX_HTML_BASE_URL: https://docs.pyscript.net/
1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
18-
with:
19-
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
20-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
21-
22-
- name: Setup
23-
uses: conda-incubator/setup-miniconda@v2
24-
with:
25-
auto-update-conda: true
26-
activate-environment: docs
27-
environment-file: docs/environment.yml
28-
python-version: '3.9'
29-
30-
- name: Build
31-
shell: bash -l {0}
32-
run: |
33-
cd docs/
34-
make html
35-
36-
- name: Upload artifacts
37-
uses: actions/upload-artifact@v3
38-
with:
39-
name: pyscript-docs-${{ github.ref_name }}
40-
path: docs/_build/html/
41-
42-
# Deploy to S3
43-
- name: Configure AWS credentials
44-
uses: aws-actions/configure-aws-credentials@v1.6.1
45-
with:
46-
aws-region: ${{ secrets.AWS_REGION }}
47-
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
48-
49-
- name: Copy redirect file
50-
run: aws s3 cp --quiet ./docs/_build/html/_static/redirect.html s3://docs.pyscript.net/index.html
51-
52-
- name: Sync to S3
53-
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/${{ github.ref_name }}/
54-
55-
# Make sure to remove the latest folder so we sync the full docs upon release
56-
- name: Delete latest directory
57-
run: aws s3 rm --recursive s3://docs.pyscript.net/latest/
58-
59-
# Note that the files are the same as above, but we want to have folders with
60-
# /<tag name>/ AND /latest/ which latest will always point to the latest release
61-
- name: Sync to /latest
62-
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/latest/
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
20+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
21+
22+
- name: Setup
23+
uses: conda-incubator/setup-miniconda@v2
24+
with:
25+
auto-update-conda: true
26+
activate-environment: docs
27+
environment-file: docs/environment.yml
28+
python-version: "3.9"
29+
30+
- name: Build
31+
shell: bash -l {0}
32+
run: |
33+
cd docs/
34+
make html
35+
36+
- name: Upload artifacts
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: pyscript-docs-${{ github.ref_name }}
40+
path: docs/_build/html/
41+
42+
# Deploy to S3
43+
- name: Configure AWS credentials
44+
uses: aws-actions/configure-aws-credentials@v1.6.1
45+
with:
46+
aws-region: ${{ secrets.AWS_REGION }}
47+
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
48+
49+
- name: Copy redirect file
50+
run: aws s3 cp --quiet ./docs/_build/html/_static/redirect.html s3://docs.pyscript.net/index.html
51+
52+
- name: Sync to S3
53+
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/${{ github.ref_name }}/
54+
55+
# Make sure to remove the latest folder so we sync the full docs upon release
56+
- name: Delete latest directory
57+
run: aws s3 rm --recursive s3://docs.pyscript.net/latest/
58+
59+
# Note that the files are the same as above, but we want to have folders with
60+
# /<tag name>/ AND /latest/ which latest will always point to the latest release
61+
- name: Sync to /latest
62+
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/latest/

.github/workflows/docs-review.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: '[Docs] Build Review'
1+
name: "[Docs] Build Review"
22

33
on:
44
pull_request:
55
branches:
6-
- '*'
6+
- "*"
77
paths:
8-
- docs/**
8+
- docs/**
99

1010
concurrency:
1111
# Concurrency group that uses the workflow name and PR number if available
@@ -26,48 +26,48 @@ jobs:
2626
env:
2727
SPHINX_HTML_BASE_URL: https://docs.pyscript.net/
2828
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v3
31-
with:
32-
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
33-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
with:
32+
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
33+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
3434

35-
- name: Setup
36-
uses: conda-incubator/setup-miniconda@v2
37-
with:
38-
auto-update-conda: true
39-
activate-environment: docs
40-
environment-file: docs/environment.yml
41-
python-version: '3.9'
35+
- name: Setup
36+
uses: conda-incubator/setup-miniconda@v2
37+
with:
38+
auto-update-conda: true
39+
activate-environment: docs
40+
environment-file: docs/environment.yml
41+
python-version: "3.9"
4242

43-
- name: Build
44-
shell: bash -l {0}
45-
run: |
46-
cd docs/
47-
make html
43+
- name: Build
44+
shell: bash -l {0}
45+
run: |
46+
cd docs/
47+
make html
4848
49-
- name: Upload artifacts
50-
uses: actions/upload-artifact@v3
51-
with:
52-
name: pyscript-docs-review-${{ github.event.number }}
53-
path: docs/_build/html/
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: pyscript-docs-review-${{ github.event.number }}
53+
path: docs/_build/html/
5454

55-
# Deploy to S3
56-
- name: Configure AWS credentials
57-
uses: aws-actions/configure-aws-credentials@v1.6.1
58-
with:
59-
aws-region: ${{ secrets.AWS_REGION }}
60-
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
55+
# Deploy to S3
56+
- name: Configure AWS credentials
57+
uses: aws-actions/configure-aws-credentials@v1.6.1
58+
with:
59+
aws-region: ${{ secrets.AWS_REGION }}
60+
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
6161

62-
- name: Copy redirect file
63-
run: aws s3 cp --quiet ./docs/_build/html/_static/redirect.html s3://docs.pyscript.net/index.html
62+
- name: Copy redirect file
63+
run: aws s3 cp --quiet ./docs/_build/html/_static/redirect.html s3://docs.pyscript.net/index.html
6464

65-
- name: Sync to S3
66-
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/review/${{ github.event.number }}/
65+
- name: Sync to S3
66+
run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/review/${{ github.event.number }}/
6767

68-
- name: Adding step summary
69-
run: |
70-
echo "### Review documentation" >> $GITHUB_STEP_SUMMARY
71-
echo "As with any pull request, you can find the rendered documentation version for pull request ${{ github.event.number }} here:"
72-
echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line
73-
echo "https://docs.pyscript.net/review/${{ github.event.number }}/" >> $GITHUB_STEP_SUMMARY
68+
- name: Adding step summary
69+
run: |
70+
echo "### Review documentation" >> $GITHUB_STEP_SUMMARY
71+
echo "As with any pull request, you can find the rendered documentation version for pull request ${{ github.event.number }} here:"
72+
echo "" >> $GITHUB_STEP_SUMMARY # this is a blank line
73+
echo "https://docs.pyscript.net/review/${{ github.event.number }}/" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)
0