Skip to content

Commit

Permalink
Add prettier to pre-commit (#98)
Browse files Browse the repository at this point in the history
and apply it everywhere
  • Loading branch information
hoodmane authored Sep 30, 2023
1 parent 5c2ca5f commit f57aef2
Show file tree
Hide file tree
Showing 20 changed files with 242 additions and 282 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:

runs-on: ubuntu-latest

continue-on-error: true

strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
python-version: ["3.10", "3.11"]
experimental: [false]

name: Python ${{ matrix.python-version}}
Expand All @@ -34,7 +33,7 @@ jobs:
python -m pip install --upgrade pip
pip install nox
- name: Test
run: nox -s tests-${{ matrix.python-version }}
run: nox -s tests-${{ matrix.python-version }}

- uses: actions/upload-artifact@v2
if: success() || failure()
Expand All @@ -43,16 +42,15 @@ jobs:
path: test-results.xml

test-typedoc-versions:

runs-on: ubuntu-latest

continue-on-error: true

strategy:
fail-fast: false
matrix:
python-version: ['3.11']
typedoc-version: ['0.25']
python-version: ["3.11"]
typedoc-version: ["0.25"]
experimental: [false]

name: Python ${{ matrix.python-version}} + typedoc ${{ matrix.typedoc-version }}
Expand All @@ -69,7 +67,7 @@ jobs:
python -m pip install --upgrade pip
pip install nox
- name: Test
run: nox -s "test_typedoc-${{ matrix.python-version }}(typedoc='${{ matrix.typedoc-version }}')"
run: nox -s "test_typedoc-${{ matrix.python-version }}(typedoc='${{ matrix.typedoc-version }}')"

- uses: actions/upload-artifact@v2
if: success() || failure()
Expand Down
35 changes: 17 additions & 18 deletions .github/workflows/test_report.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
name: 'Test Report'
name: "Test Report"
on:
workflow_run:
workflows: ['CI']
workflows: ["CI"]
types:
- completed
jobs:
report:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
python-version: ["3.10", "3.11"]

runs-on: ubuntu-latest
steps:
- uses: dorny/[email protected]
with:
artifact: test-results-${{ matrix.python-version }}
name: Test report - ${{ matrix.python-version }}
path: test-results.xml
reporter: java-junit
- uses: dorny/[email protected]
with:
artifact: test-results-${{ matrix.python-version }}
name: Test report - ${{ matrix.python-version }}
path: test-results.xml
reporter: java-junit
report-typedoc:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
typedoc-version: ['0.20', '0.21']

python-version: ["3.10", "3.11"]
typedoc-version: ["0.20", "0.21"]

runs-on: ubuntu-latest
steps:
- uses: dorny/[email protected]
with:
artifact: test_typedoc-results-${{ matrix.python-version }}-${{ matrix.typedoc-version }}
name: Test report - Python ${{ matrix.python-version}} + typedoc ${{ matrix.typedoc-version }}
path: test-results.xml
reporter: java-junit
- uses: dorny/[email protected]
with:
artifact: test_typedoc-results-${{ matrix.python-version }}-${{ matrix.typedoc-version }}
name: Test report - Python ${{ matrix.python-version}} + typedoc ${{ matrix.typedoc-version }}
path: test-results.xml
reporter: java-junit
29 changes: 17 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ repos:
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.6"
hooks:
- id: prettier

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.2"
hooks:
- id: codespell

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
hooks:
Expand All @@ -43,17 +60,5 @@ repos:
- types-parsimonious
- types-setuptools

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.2"
hooks:
- id: codespell

ci:
autoupdate_schedule: "quarterly"
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ For more details, please read the
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).

## How to Report

For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.
18 changes: 8 additions & 10 deletions tests/roots/test-incremental_js/a.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
* Class doc.
*/
class ClassA {
/**
* Static.
*/
static noUseOfThis() {}

/**
* Static.
*/
static noUseOfThis() {}

/**
* Here.
*/
methodA() {
}
/**
* Here.
*/
methodA() {}
}
18 changes: 8 additions & 10 deletions tests/roots/test-incremental_js/inner/b.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
* Class doc.
*/
class ClassB {
/**
* Static.
*/
static noUseOfThis() {}

/**
* Static.
*/
static noUseOfThis() {}

/**
* Here.
*/
methodB() {
}
/**
* Here.
*/
methodB() {}
}
2 changes: 1 addition & 1 deletion tests/roots/test-incremental_js/jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"source": {
"includePattern":".+\\.js(doc|x)?$"
"includePattern": ".+\\.js(doc|x)?$"
}
}
6 changes: 2 additions & 4 deletions tests/roots/test-incremental_ts/a.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export class ClassA {
constructor() {
}
constructor() {}

/**
* Here.
*/
methodA() {
}
methodA() {}
}
6 changes: 2 additions & 4 deletions tests/roots/test-incremental_ts/inner/b.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export class ClassB {
constructor() {
}
constructor() {}

/**
* Here.
*/
methodB() {
}
methodB() {}
}
Loading

0 comments on commit f57aef2

Please sign in to comment.