Skip to content

Commit

Permalink
prettier: ensure svelte files are formatted
Browse files Browse the repository at this point in the history
Also, remove default indent size for all files from editorconfig so that
prettier's default of 2 spaces is used for most files (and only
explicitly set it in the editor config for the most common file types).
  • Loading branch information
yagebu committed Jan 6, 2024
1 parent d0569ac commit 9734214
Show file tree
Hide file tree
Showing 35 changed files with 310 additions and 302 deletions.
12 changes: 6 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.{js,json,ts,css,html,svelte}]
[*.{ts,json,css,html,svelte}]
indent_style = space
indent_size = 2
78 changes: 39 additions & 39 deletions .github/workflows/docs-pages.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Deploy website to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e docs
- if: github.repository == 'beancount/fava'
uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: "build/docs"
deploy:
if: github.repository == 'beancount/fava' && github.event_name == 'push'
needs: "build"
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: "ubuntu-latest"
steps:
- id: deployment
uses: actions/deploy-pages@v4
build:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e docs
- if: github.repository == 'beancount/fava'
uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: "build/docs"
deploy:
if: github.repository == 'beancount/fava' && github.event_name == 'push'
needs: "build"
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: "ubuntu-latest"
steps:
- id: deployment
uses: actions/deploy-pages@v4
68 changes: 34 additions & 34 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Build Python package (and upload to PyPI on tags)

on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: python -m pip install -c constraints.txt build twine
- run: python -m build
- run: twine check dist/*
- name: Publish release
if: github.event_name == 'push' && github.ref_type == 'tag'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: python -m pip install -c constraints.txt build twine
- run: python -m build
- run: twine check dist/*
- name: Publish release
if: github.event_name == 'push' && github.ref_type == 'tag'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
170 changes: 85 additions & 85 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
name: Test

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-py:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
py: ["3.12", "3.8"]
toxenv: ["py", "old_deps"]
exclude:
- os: "macos-latest"
toxenv: "old_deps"
- os: "windows-latest"
toxenv: "old_deps"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: touch src/fava/static/app.js
- run: tox -e ${{ matrix.toxenv }}
test-js:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: cd frontend && npm ci
- run: cd frontend && npm run build
- run: cd frontend && npm test
lint-js:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: python -m pip install -c constraints.txt pre-commit
- run: cd frontend && npm ci
- run: pre-commit run -a eslint
- run: cd frontend; npx tsc
- run: cd frontend; npx svelte-check
lint-python:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e lint
build-pyinstaller:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e pyinstaller
test-py:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
py: ["3.12", "3.8"]
toxenv: ["py", "old_deps"]
exclude:
- os: "macos-latest"
toxenv: "old_deps"
- os: "windows-latest"
toxenv: "old_deps"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: touch src/fava/static/app.js
- run: tox -e ${{ matrix.toxenv }}
test-js:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: cd frontend && npm ci
- run: cd frontend && npm run build
- run: cd frontend && npm test
lint-js:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: python -m pip install -c constraints.txt pre-commit
- run: cd frontend && npm ci
- run: pre-commit run -a eslint
- run: cd frontend; npx tsc
- run: cd frontend; npx svelte-check
lint-python:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e lint
build-pyinstaller:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "constraints*.txt"
- run: python -m pip install -c constraints.txt tox
- run: tox -e pyinstaller
Loading

0 comments on commit 9734214

Please sign in to comment.