Skip to content

Commit 1d9a595

Browse files
authored
[CI] Add prettier pre-commit hook and format YAML files (#1716)
* [CI] Add prettier pre-commit hook and format YAML files * Fix up linter * Update .pre-commit-config.yaml
1 parent 34874ca commit 1d9a595

File tree

14 files changed

+108
-83
lines changed

14 files changed

+108
-83
lines changed

.asf.yaml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,40 @@
1616
# under the License.
1717

1818
notifications:
19-
20-
issues_status: [email protected]
21-
issues_comment: [email protected]
22-
discussions: [email protected]
23-
pullrequests_status: [email protected]
24-
pullrequests_comment: [email protected]
25-
jira_options: link label worklog
19+
20+
issues_status: [email protected]
21+
issues_comment: [email protected]
22+
discussions: [email protected]
23+
pullrequests_status: [email protected]
24+
pullrequests_comment: [email protected]
25+
jira_options: link label worklog
2626
github:
27-
description: "A cluster computing framework for processing large-scale geospatial data"
28-
homepage: https://sedona.apache.org/
29-
collaborators:
30-
- MrPowers
31-
- umartin
32-
- zhangfengcdt
33-
- james-willis
34-
- gregleleu
35-
autolink_jira:
36-
- SEDONA
37-
labels:
38-
- geospatial
39-
- cluster-computing
40-
- spatial-query
41-
- spatial-analysis
42-
- spatial-sql
43-
- scala
44-
- java
45-
- python
46-
features:
47-
# Enable wiki for documentation
48-
wiki: false
49-
# Enable issue management
50-
issues: true
51-
# Enable projects for project management boards
52-
projects: false
53-
# Enable github discussion
54-
discussions: true
55-
ghp_branch:
27+
description: 'A cluster computing framework for processing large-scale geospatial data'
28+
homepage: https://sedona.apache.org/
29+
collaborators:
30+
- MrPowers
31+
- umartin
32+
- zhangfengcdt
33+
- james-willis
34+
- gregleleu
35+
autolink_jira:
36+
- SEDONA
37+
labels:
38+
- geospatial
39+
- cluster-computing
40+
- spatial-query
41+
- spatial-analysis
42+
- spatial-sql
43+
- scala
44+
- java
45+
- python
46+
features:
47+
# Enable wiki for documentation
48+
wiki: false
49+
# Enable issue management
50+
issues: true
51+
# Enable projects for project management boards
52+
projects: false
53+
# Enable GitHub discussion
54+
discussions: true
55+
ghp_branch:

.github/linters/.yaml-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extends: default
2121

2222
rules:
2323
colons: disable
24+
comments: disable
2425
document-start: disable
2526
line-length: disable
2627
truthy: false

.github/workflows/docker-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
spark: ['3.5.1', '3.4.3', '3.3.4']
4646
include:
4747
- spark: 3.5.1
48-
sedona: "latest"
49-
geotools: "auto"
48+
sedona: 'latest'
49+
geotools: 'auto'
5050
- spark: 3.4.3
5151
sedona: 1.6.0
5252
geotools: 28.2

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
cache: true
6565
extra-packages: |
6666
any::pkgdown
67-
working-directory : './R'
67+
working-directory: './R'
6868
- run: Rscript -e 'pkgdown::build_site(pkg = "./R", preview = FALSE, override = list(destination = "../docs/api/rdocs"))'
6969
- run: git config --global user.name = "GitHub Action"
7070
- run: git config --global user.email = "[email protected]"

.github/workflows/first-interaction.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ jobs:
3131
uses: actions/first-interaction@v1
3232
with:
3333
repo-token: ${{ secrets.GITHUB_TOKEN }}
34-
issue-message: "Thank you for your interest in Apache Sedona! We appreciate you opening your first issue. Contributions like yours help make Apache Sedona better."
35-
pr-message: "Welcome and thank you for your first pull request! We appreciate your contribution to Apache Sedona. Your code changes will be reviewed shortly."
34+
issue-message: 'Thank you for your interest in Apache Sedona! We appreciate you opening your first issue. Contributions like yours help make Apache Sedona better.'
35+
pr-message: 'Welcome and thank you for your first pull request! We appreciate your contribution to Apache Sedona. Your code changes will be reviewed shortly.'

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ jobs:
2828
steps:
2929
- uses: actions/labeler@v5
3030
with:
31-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
31+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
3232
sync-labels: true

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ permissions:
2424

2525
jobs:
2626
pre-commit:
27-
name: Run pre-commit # https://pre-commit.com/
27+
name: Run pre-commit # https://pre-commit.com/
2828
runs-on: ubuntu-latest
2929
steps:
30-
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
30+
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
3131
uses: actions/checkout@v4
32-
- uses: actions/setup-python@v5 # https://www.python.org/
32+
- uses: actions/setup-python@v5 # https://www.python.org/
3333
with:
34-
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
35-
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
36-
- name: Install dependencies # https://pip.pypa.io/en/stable/
34+
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
35+
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
36+
- name: Install dependencies # https://pip.pypa.io/en/stable/
3737
run: |
3838
python -m pip install --upgrade pip
3939
pip install pre-commit

.github/workflows/python.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ on:
4141

4242
env:
4343
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
44-
JAI_CORE_VERSION: "1.1.3"
45-
JAI_CODEC_VERSION: "1.1.3"
46-
JAI_IMAGEIO_VERSION: "1.1"
44+
JAI_CORE_VERSION: '1.1.3'
45+
JAI_CODEC_VERSION: '1.1.3'
46+
JAI_IMAGEIO_VERSION: '1.1'
4747
DO_NOT_TRACK: true
4848

4949
permissions:
@@ -108,8 +108,8 @@ jobs:
108108
SPARK_VERSION: ${{ matrix.spark }}
109109
SCALA_VERSION: ${{ matrix.scala }}
110110
run: |
111-
SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
112-
mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} -Dscala=${SCALA_VERSION:0:4} -Dgeotools
111+
SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
112+
mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} -Dscala=${SCALA_VERSION:0:4} -Dgeotools
113113
- run: sudo apt-get -y install python3-pip python-dev-is-python3
114114
- run: sudo pip3 install -U setuptools
115115
- run: sudo pip3 install -U wheel

.github/workflows/r.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
extra-packages: |
8989
any::testthat
9090
any::rcmdcheck
91-
working-directory : './R'
91+
working-directory: './R'
9292
- name: Build and check R package
9393
uses: r-lib/actions/[email protected]
9494
with:

.pre-commit-config.yaml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ default_stages: [pre-commit, pre-push]
2121
default_language_version:
2222
# force all unspecified Python hooks to run python3
2323
python: python3
24+
# force all unspecified Node hooks to run Node.js v22.14.0 LTS
25+
node: 22.14.0
2426
minimum_pre_commit_version: '3.2.0'
2527
repos:
2628
- repo: meta
@@ -29,6 +31,15 @@ repos:
2931
name: run identity check
3032
- id: check-hooks-apply
3133
name: run check hooks apply
34+
- repo: local
35+
hooks:
36+
- id: prettier
37+
name: run prettier
38+
description: format files with prettier
39+
entry: prettier --write '**/*.yaml' '**/*.yml'
40+
files: \.ya?ml$
41+
language: node
42+
additional_dependencies: ['[email protected]']
3243
- repo: https://github.com/Lucas-C/pre-commit-hooks
3344
rev: v1.5.5
3445
hooks:
@@ -37,7 +48,7 @@ repos:
3748
files: \.c$
3849
args:
3950
- --comment-style
40-
- "/*| *| */"
51+
- '/*|*|*/'
4152
- --license-filepath
4253
- .github/workflows/license-templates/LICENSE.txt
4354
- --fuzzy-match-generates-todo
@@ -46,7 +57,7 @@ repos:
4657
files: \.h$
4758
args:
4859
- --comment-style
49-
- "/*| *| */"
60+
- '/*| *| */'
5061
- --license-filepath
5162
- .github/workflows/license-templates/LICENSE.txt
5263
- --fuzzy-match-generates-todo
@@ -55,7 +66,7 @@ repos:
5566
files: \.java$
5667
args:
5768
- --comment-style
58-
- "/*|*|*/"
69+
- '/*|*|*/'
5970
- --license-filepath
6071
- .github/workflows/license-templates/LICENSE.txt
6172
- --fuzzy-match-generates-todo
@@ -64,7 +75,7 @@ repos:
6475
files: \.md$
6576
args:
6677
- --comment-style
67-
- "<!--|| -->"
78+
- '<!--|| -->'
6879
- --license-filepath
6980
- .github/workflows/license-templates/LICENSE.txt
7081
- --fuzzy-match-generates-todo
@@ -74,7 +85,7 @@ repos:
7485
files: ^Makefile$
7586
args:
7687
- --comment-style
77-
- "|#|"
88+
- '|#|'
7889
- --license-filepath
7990
- .github/workflows/license-templates/LICENSE.txt
8091
- --fuzzy-match-generates-todo
@@ -83,7 +94,7 @@ repos:
8394
files: \.R$
8495
args:
8596
- --comment-style
86-
- "|#|"
97+
- '|#|'
8798
- --license-filepath
8899
- .github/workflows/license-templates/LICENSE.txt
89100
- --fuzzy-match-generates-todo
@@ -92,7 +103,7 @@ repos:
92103
files: \.scala$
93104
args:
94105
- --comment-style
95-
- "/*| *| */"
106+
- '/*| *| */'
96107
- --license-filepath
97108
- .github/workflows/license-templates/LICENSE.txt
98109
- --fuzzy-match-generates-todo
@@ -101,7 +112,7 @@ repos:
101112
files: \.toml$
102113
args:
103114
- --comment-style
104-
- "|#|"
115+
- '|#|'
105116
- --license-filepath
106117
- .github/workflows/license-templates/LICENSE.txt
107118
- --fuzzy-match-generates-todo
@@ -110,7 +121,7 @@ repos:
110121
files: \.ya?ml$
111122
args:
112123
- --comment-style
113-
- "|#|"
124+
- '|#|'
114125
- --license-filepath
115126
- .github/workflows/license-templates/LICENSE.txt
116127
- --fuzzy-match-generates-todo
@@ -134,8 +145,8 @@ repos:
134145
- id: bandit
135146
name: run bandit
136147
description: check Python code for security issues
137-
args: ["-c=pyproject.toml", "-r"]
138-
additional_dependencies: ["bandit[toml]"]
148+
args: ['-c=pyproject.toml', '-r']
149+
additional_dependencies: ['bandit[toml]']
139150
- repo: https://github.com/codespell-project/codespell
140151
rev: v2.4.1
141152
hooks:
@@ -229,4 +240,4 @@ repos:
229240
- id: oxipng
230241
name: run oxipng
231242
description: check PNG files with oxipng
232-
args: ["-o", "4", "--strip", "safe", "--alpha"]
243+
args: ['-o', '4', '--strip', 'safe', '--alpha']

0 commit comments

Comments
 (0)