Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add prettier pre-commit hook and format YAML files #1716

Merged
merged 4 commits into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,40 @@
# under the License.

notifications:
commits: [email protected]
issues_status: [email protected]
issues_comment: [email protected]
discussions: [email protected]
pullrequests_status: [email protected]
pullrequests_comment: [email protected]
jira_options: link label worklog
commits: [email protected]
issues_status: [email protected]
issues_comment: [email protected]
discussions: [email protected]
pullrequests_status: [email protected]
pullrequests_comment: [email protected]
jira_options: link label worklog
github:
description: "A cluster computing framework for processing large-scale geospatial data"
homepage: https://sedona.apache.org/
collaborators:
- MrPowers
- umartin
- zhangfengcdt
- james-willis
- gregleleu
autolink_jira:
- SEDONA
labels:
- geospatial
- cluster-computing
- spatial-query
- spatial-analysis
- spatial-sql
- scala
- java
- python
features:
# Enable wiki for documentation
wiki: false
# Enable issue management
issues: true
# Enable projects for project management boards
projects: false
# Enable github discussion
discussions: true
ghp_branch:
description: 'A cluster computing framework for processing large-scale geospatial data'
homepage: https://sedona.apache.org/
collaborators:
- MrPowers
- umartin
- zhangfengcdt
- james-willis
- gregleleu
autolink_jira:
- SEDONA
labels:
- geospatial
- cluster-computing
- spatial-query
- spatial-analysis
- spatial-sql
- scala
- java
- python
features:
# Enable wiki for documentation
wiki: false
# Enable issue management
issues: true
# Enable projects for project management boards
projects: false
# Enable GitHub discussion
discussions: true
ghp_branch:
1 change: 1 addition & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extends: default

rules:
colons: disable
comments: disable
document-start: disable
line-length: disable
truthy: false
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
spark: ['3.5.1', '3.4.3', '3.3.4']
include:
- spark: 3.5.1
sedona: "latest"
geotools: "auto"
sedona: 'latest'
geotools: 'auto'
- spark: 3.4.3
sedona: 1.6.0
geotools: 28.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
cache: true
extra-packages: |
any::pkgdown
working-directory : './R'
working-directory: './R'
- run: Rscript -e 'pkgdown::build_site(pkg = "./R", preview = FALSE, override = list(destination = "../docs/api/rdocs"))'
- run: git config --global user.name = "GitHub Action"
- run: git config --global user.email = "[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/first-interaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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."
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."
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.'
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.'
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ permissions:

jobs:
pre-commit:
name: Run pre-commit # https://pre-commit.com/
name: Run pre-commit # https://pre-commit.com/
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: 'Checkout ${{ github.ref }} ( ${{ github.sha }} )'
uses: actions/checkout@v4
- uses: actions/setup-python@v5 # https://www.python.org/
- uses: actions/setup-python@v5 # https://www.python.org/
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies # https://pip.pypa.io/en/stable/
run: |
python -m pip install --upgrade pip
pip install pre-commit
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ on:

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
JAI_CORE_VERSION: "1.1.3"
JAI_CODEC_VERSION: "1.1.3"
JAI_IMAGEIO_VERSION: "1.1"
JAI_CORE_VERSION: '1.1.3'
JAI_CODEC_VERSION: '1.1.3'
JAI_IMAGEIO_VERSION: '1.1'
DO_NOT_TRACK: true

permissions:
Expand Down Expand Up @@ -108,8 +108,8 @@ jobs:
SPARK_VERSION: ${{ matrix.spark }}
SCALA_VERSION: ${{ matrix.scala }}
run: |
SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} -Dscala=${SCALA_VERSION:0:4} -Dgeotools
SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} -Dscala=${SCALA_VERSION:0:4} -Dgeotools
- run: sudo apt-get -y install python3-pip python-dev-is-python3
- run: sudo pip3 install -U setuptools
- run: sudo pip3 install -U wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
extra-packages: |
any::testthat
any::rcmdcheck
working-directory : './R'
working-directory: './R'
- name: Build and check R package
uses: r-lib/actions/[email protected]
with:
Expand Down
35 changes: 23 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ default_stages: [pre-commit, pre-push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
# force all unspecified Node hooks to run Node.js v22.14.0 LTS
node: 22.14.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js v22.14.0 is the LTS version we should be now using.

https://nodejs.org/en

And seen on the pre-commit site we can set the node version as default.

For node they use nodeenv.

https://pre-commit.com/#overriding-language-version

And here shows how nodeenv uses and lists its version numbers without the v prefix:

nodeenv --list

https://github.com/ekalinin/nodeenv?tab=readme-ov-file#advanced

minimum_pre_commit_version: '3.2.0'
repos:
- repo: meta
Expand All @@ -29,6 +31,15 @@ repos:
name: run identity check
- id: check-hooks-apply
name: run check hooks apply
- repo: local
hooks:
- id: prettier
name: run prettier
description: format files with prettier
entry: prettier --write '**/*.yaml' '**/*.yml'
files: \.ya?ml$
language: node
additional_dependencies: ['[email protected]']
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
Expand All @@ -37,7 +48,7 @@ repos:
files: \.c$
args:
- --comment-style
- "/*| *| */"
- '/*|*|*/'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -46,7 +57,7 @@ repos:
files: \.h$
args:
- --comment-style
- "/*| *| */"
- '/*| *| */'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -55,7 +66,7 @@ repos:
files: \.java$
args:
- --comment-style
- "/*|*|*/"
- '/*|*|*/'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -64,7 +75,7 @@ repos:
files: \.md$
args:
- --comment-style
- "<!--|| -->"
- '<!--|| -->'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -74,7 +85,7 @@ repos:
files: ^Makefile$
args:
- --comment-style
- "|#|"
- '|#|'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -83,7 +94,7 @@ repos:
files: \.R$
args:
- --comment-style
- "|#|"
- '|#|'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -92,7 +103,7 @@ repos:
files: \.scala$
args:
- --comment-style
- "/*| *| */"
- '/*| *| */'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -101,7 +112,7 @@ repos:
files: \.toml$
args:
- --comment-style
- "|#|"
- '|#|'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -110,7 +121,7 @@ repos:
files: \.ya?ml$
args:
- --comment-style
- "|#|"
- '|#|'
- --license-filepath
- .github/workflows/license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
Expand All @@ -134,8 +145,8 @@ repos:
- id: bandit
name: run bandit
description: check Python code for security issues
args: ["-c=pyproject.toml", "-r"]
additional_dependencies: ["bandit[toml]"]
args: ['-c=pyproject.toml', '-r']
additional_dependencies: ['bandit[toml]']
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
Expand Down Expand Up @@ -229,4 +240,4 @@ repos:
- id: oxipng
name: run oxipng
description: check PNG files with oxipng
args: ["-o", "4", "--strip", "safe", "--alpha"]
args: ['-o', '4', '--strip', 'safe', '--alpha']
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.json
.idea
.mypy_cache
.venv
site/
target/
binder/Pipfile.lock
docs-overrides/main.html
zeppelin/index.js
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"bracketSpacing": false,
"singleQuote": true
}
30 changes: 15 additions & 15 deletions R/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ template:
# bootswatch: cosmo
bslib:
# font_scale: 1.1
primary: "#ff6e42"
light: "#ff6e42"
navbar-light-color: "#fff"
primary: '#ff6e42'
light: '#ff6e42'
navbar-light-color: '#fff'
# navbar-light-active-color: "#ff8a66"
nav-tabs-link-active-bg: "#ff8a66"
nav-tabs-link-active-bg: '#ff8a66'
# navbar-light-bg: "#ff6e42"
# bg: "#fff"
navbar:
Expand All @@ -42,36 +42,36 @@ home:
[Homepage](https://sedona.apache.org/)

reference:
- title: "Reading and Writing Spatial DataFrames"
desc: "Functions for reading and writing Spark DataFrames."
- title: 'Reading and Writing Spatial DataFrames'
desc: 'Functions for reading and writing Spark DataFrames.'
contents:
- starts_with("spark_read")
- starts_with("spark_write")
- sedona_save_spatial_rdd
- title: "Reading and Writing Spatial RDDs"
desc: "Functions for reading and writing Spatial RDDs."
- title: 'Reading and Writing Spatial RDDs'
desc: 'Functions for reading and writing Spatial RDDs.'
contents:
- starts_with("sedona_read")
- starts_with("sedona_write")
- title: "Conversion"
desc: "Functions to convert between Spark DataFrames and Spatial RDDs."
- title: 'Conversion'
desc: 'Functions to convert between Spark DataFrames and Spatial RDDs.'
contents:
- contains("sdf_register")
- to_spatial_rdd
- title: "RDD functions"
- subtitle: "Visualization"
- title: 'RDD functions'
- subtitle: 'Visualization'
contents:
- starts_with("sedona_visualization_routines")
- starts_with("sedona_render")
- subtitle: "Joins"
- subtitle: 'Joins'
contents:
- sedona_spatial_join
- sedona_spatial_join_count_by_key
- subtitle: "Query"
- subtitle: 'Query'
contents:
- sedona_knn_query
- sedona_range_query
- subtitle: "Others"
- subtitle: 'Others'
contents:
- sedona_apply_spatial_partitioner
- sedona_build_index
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ nav:
- DataFrame Style functions: api/sql/DataFrameAPI.md
- Query optimization: api/sql/Optimizer.md
- Nearest-Neighbour searching: api/sql/NearestNeighbourSearching.md
- "Spider:Spatial Data Generator": api/sql/Spider.md
- 'Spider:Spatial Data Generator': api/sql/Spider.md
- Reading Legacy Parquet Files: api/sql/Reading-legacy-parquet.md
- Visualization:
- SedonaPyDeck: api/sql/Visualization_SedonaPyDeck.md
Expand Down Expand Up @@ -235,4 +235,4 @@ plugins:
- git-revision-date-localized:
type: datetime
- mike:
canonical_version: "latest"
canonical_version: 'latest'