Skip to content

Commit 6c1bdd7

Browse files
authored
pre-commit: add yaml file lint (#2790)
* max line-length is 120 * lint warnings have been fixed in all yaml files
1 parent 0ac0943 commit 6c1bdd7

21 files changed

+112
-72
lines changed

.clang-format

-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
BasedOnStyle: LLVM
33
IndentWidth: 4
4-
54
---
65
Language: Cpp
76
AccessModifierOffset: -4
@@ -23,13 +22,9 @@ IfMacros:
2322
MacroBlockBegin: GNO_BEGIN
2423
MacroBlockEnd: GNO_END
2524
SortIncludes: Never
26-
2725
---
2826
Language: ObjC
29-
3027
---
3128
Language: JavaScript
32-
3329
---
3430
Language: Json
35-
...

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
---
12
open_collective: grass

.github/codeql/codeql-config.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: "CodeQL config"
1+
---
2+
name: CodeQL config
23
paths-ignore:
3-
- "**/testsuite/**"
4-
- "bin.*"
5-
- "dist.*"
4+
- '**/testsuite/**'
5+
- bin.*
6+
- dist.*
67
- node_modules
78
- python/grass/pygrass/tests

.github/workflows/additional_checks.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Additional Checks
23

34
# Checks which are not in standardized tools such as custom checks by scripts
@@ -35,7 +36,7 @@ jobs:
3536
- name: Set up Python
3637
uses: actions/setup-python@v4
3738
with:
38-
python-version: "3.10"
39+
python-version: '3.10'
3940

4041
- name: Generate core modules with last commit JSON file and test it
4142
run: |

.github/workflows/black.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Python Black Formatting
23

34
on:
@@ -20,8 +21,8 @@ jobs:
2021
matrix:
2122
include:
2223
- os: ubuntu-22.04
23-
python-version: "3.10"
24-
black-version: "22.3.0"
24+
python-version: '3.10'
25+
black-version: 22.3.0
2526

2627
runs-on: ${{ matrix.os }}
2728

.github/workflows/centos.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: CentOS
23

34
on:

.github/workflows/clang-format-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
- name: Run clang-format style check for C/C++/Protobuf programs.
1919
uses: jidicula/[email protected]
2020
with:
21-
clang-format-version: "15"
21+
clang-format-version: '15'
2222
check-path: .

.github/workflows/codeql-analysis.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: "CodeQL"
1+
---
2+
name: CodeQL
23

34
on:
45
push:
@@ -8,12 +9,12 @@ on:
89
branches:
910
- main
1011
paths-ignore:
11-
- "**/*.html"
12-
- "**/*.md"
13-
- "**/*.txt"
12+
- '**/*.html'
13+
- '**/*.md'
14+
- '**/*.txt'
1415
schedule:
1516
# Check every Saturday at 18:36
16-
- cron: "36 18 * * 6"
17+
- cron: 36 18 * * 6
1718

1819
jobs:
1920
analyze:
@@ -55,8 +56,8 @@ jobs:
5556
5657
- name: Build
5758
env:
58-
CFLAGS: "-std=gnu11"
59-
CXXFLAGS: "-std=c++11"
59+
CFLAGS: -std=gnu11
60+
CXXFLAGS: -std=c++11
6061
run: .github/workflows/build_ubuntu-22.04.sh $HOME/install
6162

6263
- name: Perform CodeQL Analysis

.github/workflows/create_release_draft.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Create or check a release draft
23

34
on:
@@ -12,8 +13,8 @@ on:
1213
- main
1314
- releasebranch_*
1415
paths:
15-
- '.github/**'
16-
- 'utils/**'
16+
- .github/**
17+
- utils/**
1718

1819
jobs:
1920
build:
@@ -28,7 +29,7 @@ jobs:
2829
- name: Set up Python
2930
uses: actions/setup-python@v4
3031
with:
31-
python-version: "3.10"
32+
python-version: '3.10'
3233

3334
- name: Generate core modules with last commit JSON file and patch file
3435
run: |

.github/workflows/docker.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
name: Docker
3+
14
# This workflow builds and pushes docker images to dockerhub
25
#
36
# Summary
@@ -14,24 +17,22 @@
1417
# job docker-release-os-matrix:
1518
# * creates tags <version>-alpine, <version>-debian and <version>-ubuntu for each release
1619

17-
name: Docker
18-
1920
on:
2021
push:
2122
branches:
22-
- 'main'
23-
- 'releasebranch_*'
23+
- main
24+
- releasebranch_*
2425
- '!releasebranch_7_*'
25-
- 'releasebranch_7_8'
26+
- releasebranch_7_8
2627
tags: ['*.*.*']
27-
paths-ignore: ['doc/**']
28+
paths-ignore: [doc/**]
2829
release:
2930
types: [published]
3031

3132
env:
32-
# Additionally mentioned in docker-sha-release-latest
33-
# as use of variable fails there
34-
DOCKERHUB_REPOSITORY: mundialis/grass-py3-pdal
33+
# Additionally mentioned in docker-sha-release-latest
34+
# as use of variable fails there
35+
DOCKERHUB_REPOSITORY: mundialis/grass-py3-pdal
3536

3637
jobs:
3738

.github/workflows/flake8.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Python Flake8 Code Quality
23

34
on:
@@ -20,7 +21,7 @@ jobs:
2021
- name: Set up Python
2122
uses: actions/setup-python@v4
2223
with:
23-
python-version: "3.10"
24+
python-version: '3.10'
2425

2526
- name: Install
2627
run: |

.github/workflows/gcc.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: GCC C/C++ standards check
23

34
on:
@@ -54,7 +55,7 @@ jobs:
5455
- name: Build
5556
env:
5657
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
57-
CFLAGS: "-std=${{ matrix.c }} -fPIC -Wall"
58+
CFLAGS: -std=${{ matrix.c }} -fPIC -Wall
5859
# TODO: -pedantic-errors here won't compile
59-
CXXFLAGS: "-std=${{ matrix.cpp }} -fPIC -Wall"
60+
CXXFLAGS: -std=${{ matrix.cpp }} -fPIC -Wall
6061
run: .github/workflows/build_ubuntu-22.04.sh $HOME/install -Werror

.github/workflows/macos.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: macOS
3+
34
# Build and run tests on macOS
45

56
on:
@@ -35,9 +36,10 @@ jobs:
3536
uses: actions/cache@v3
3637
with:
3738
path: ~/miniconda3/envs/grass-env
38-
key: conda-macos-x86_64-${{steps.get-date.outputs.today
39-
}}-${{hashFiles('.github/workflows/macos_dependencies.txt') }}-${{
40-
env.CACHE_NUMBER}}
39+
key: conda-macos-x86_64-${{
40+
steps.get-date.outputs.today }}-${{
41+
hashFiles('.github/workflows/macos_dependencies.txt') }}-${{
42+
env.CACHE_NUMBER }}
4143
id: cache
4244
- name: Update environment
4345
run: mamba env update -n grass-env -f .github/workflows/macos_dependencies.txt
@@ -65,16 +67,18 @@ jobs:
6567
shell: bash -el {0}
6668
run: >
6769
grass --tmp-location XY --exec \
68-
g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME
70+
g.download.location url=${{ env.SampleData }} path=$HOME
6971
grass --tmp-location XY --exec \
7072
python3 -m grass.gunittest.main \
7173
--grassdata $HOME --location nc_spm_full_v2alpha2 --location-type nc \
7274
--min-success 100 --config .github/workflows/macos_gunittest.cfg
75+
env:
76+
SampleData: "https://grass.osgeo.org/sampledata/north_carolina/\
77+
nc_spm_full_v2alpha2.tar.gz"
7378
- name: Make HTML test report available
7479
if: ${{ always() }}
7580
uses: actions/upload-artifact@v3
7681
with:
7782
name: testreport-macOS
7883
path: testreport
7984
retention-days: 3
80-
...

.github/workflows/osgeo4w.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: OSGeo4W
23

34
on:
@@ -32,14 +33,27 @@ jobs:
3233
path-type: inherit
3334
location: D:\
3435
update: true
35-
install: tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-fftw mingw-w64-x86_64-lapack mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-libpng mingw-w64-x86_64-pcre mingw-w64-x86_64-python3-six
36+
install: tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain
37+
mingw-w64-x86_64-fftw mingw-w64-x86_64-lapack mingw-w64-x86_64-pkgconf
38+
mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv
39+
mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre
40+
mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-libpng
41+
mingw-w64-x86_64-pcre mingw-w64-x86_64-python3-six
3642

3743
- name: Install OSGeo4W
38-
run: |
44+
run: >
3945
$exe = 'osgeo4w-setup.exe'
46+
4047
$url = 'http://download.osgeo.org/osgeo4w/v2/' + $exe
48+
4149
(New-Object System.Net.WebClient).DownloadFile($url, $exe)
42-
Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/osgeo4w/v2/ -P proj-devel,gdal-devel,geos-devel,libtiff-devel,libpng-devel,pdal-devel,netcdf-devel,cairo-devel,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,libpq-devel,pdcurses,python3-matplotlib,python3-numpy,python3-ply,python3-pywin32,python3-six,python3-wxpython,regex-devel,zstd-devel' -Wait
50+
51+
Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/osgeo4w/v2/ \
52+
-P ${{ env.Deps }}' -Wait
53+
env:
54+
Deps: "proj-devel,gdal-devel,geos-devel,libtiff-devel,libpng-devel,pdal-devel,netcdf-devel,cairo-devel,\
55+
fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,libpq-devel,pdcurses,python3-matplotlib,\
56+
python3-numpy,python3-ply,python3-pywin32,python3-six,python3-wxpython,regex-devel,zstd-devel"
4357

4458
- name: Compile GRASS GIS
4559
run: D:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') (Get-Location)

.github/workflows/pylint.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Python Pylint Code Quality
23

34
on:
@@ -12,17 +13,17 @@ on:
1213

1314
jobs:
1415
pylint:
15-
name: "Pylint ${{ matrix.pylint-version }}"
16+
name: Pylint ${{ matrix.pylint-version }}
1617

1718
# Using matrix just to get variables which are not environmental variables
1819
# and also to sync with other workflows which use matrix.
1920
strategy:
2021
matrix:
2122
include:
2223
- os: ubuntu-22.04
23-
python-version: "3.10"
24-
min-python-version: "3.7"
25-
pylint-version: "2.12.2"
24+
python-version: '3.10'
25+
min-python-version: '3.7'
26+
pylint-version: 2.12.2
2627

2728
runs-on: ${{ matrix.os }}
2829

@@ -85,7 +86,13 @@ jobs:
8586
pip install pytest pytest-pylint
8687
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
8788
export LD_LIBRARY_PATH=$HOME/install/grass83/lib:$LD_LIBRARY_PATH
88-
pytest --pylint -m pylint --pylint-rcfile=.pylintrc --pylint-jobs=$(nproc) --pylint-ignore-patterns="python/.*,gui/wxpython/.*,doc/.*,man/.*,utils/.*,locale/.*,raster/.*,imagery/.*,scripts/r.in.wms/wms_drv.py,scripts/g.extension/g.extension.py,temporal/t.rast.accdetect/t.rast.accdetect.py,temporal/t.rast.accumulate/t.rast.accumulate.py,scripts/d.rast.edit/d.rast.edit.py"
89+
pytest --pylint -m pylint --pylint-rcfile=.pylintrc --pylint-jobs=$(nproc) \
90+
--pylint-ignore-patterns="${{ env.PylintIgnore }}"
91+
env:
92+
PylintIgnore: "python/.*,gui/wxpython/.*,doc/.*,man/.*,utils/.*,locale/.*,raster/.*,\
93+
imagery/.*,scripts/r.in.wms/wms_drv.py,scripts/g.extension/g.extension.py,\
94+
temporal/t.rast.accdetect/t.rast.accdetect.py,temporal/t.rast.accumulate/t.rast.accumulate.py,\
95+
scripts/d.rast.edit/d.rast.edit.py"
8996

9097
- name: Test compiling example modules
9198
run: |

.github/workflows/pytest.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: pytest
23

34
on:
@@ -17,8 +18,8 @@ jobs:
1718
os:
1819
- ubuntu-22.04
1920
python-version:
20-
- "3.8"
21-
- "3.10"
21+
- '3.8'
22+
- '3.10'
2223
fail-fast: true
2324

2425
runs-on: ${{ matrix.os }}

.github/workflows/super-linter.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: General linting
23

34
on:

.github/workflows/ubuntu.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
name: Ubuntu
3+
24
# Build and run tests on Ubuntu
35

46
on:
@@ -19,13 +21,13 @@ jobs:
1921
strategy:
2022
matrix:
2123
include:
22-
- name: "22.04"
24+
- name: '22.04'
2325
os: ubuntu-22.04
2426
config: ubuntu-22.04
2527
# This is without optional things but it still keeps things useful,
2628
# so, e.g., without OpenMP, but with PDAL. Code or tests should be written
2729
# so that test pass even when these optional things are not present.
28-
- name: "minimum config"
30+
- name: minimum config
2931
os: ubuntu-22.04
3032
config: ubuntu-22.04_without_x
3133
fail-fast: false
@@ -62,9 +64,9 @@ jobs:
6264
- name: Build
6365
env:
6466
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
65-
CFLAGS: "-fPIC"
67+
CFLAGS: -fPIC
6668
# TODO: -pedantic-errors here won't compile
67-
CXXFLAGS: "-fPIC"
69+
CXXFLAGS: -fPIC
6870
run: .github/workflows/build_${{ matrix.config }}.sh $HOME/install -Werror
6971

7072
- name: Add the bin directory to PATH

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ repos:
6262
(?x)^(
6363
man/jquery.fixedheadertable.min.js
6464
)
65+
- repo: https://github.com/adrienverge/yamllint.git
66+
rev: v1.29.0
67+
hooks:
68+
- id: yamllint
69+
args: [--format, parsable, --strict, -d,
70+
'{extends: default, rules: {truthy: disable, line-length: {max: 120, allow-non-breakable-words: true}}}']

0 commit comments

Comments
 (0)