Merge pull request #2116 from freifunk-gluon/lint-editorconfig
actions: add editorconfig checker
This commit is contained in:
commit
b2397ebf30
@ -35,6 +35,9 @@ indent_size = 2
|
||||
|
||||
[*.lua]
|
||||
|
||||
[{Makefile,*.mk}]
|
||||
indent_style = unset
|
||||
|
||||
[*.md]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
@ -58,3 +61,7 @@ indent_size = 2
|
||||
[CMakeLists.txt]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[{docs,contrib/ci}/*site*/**/*.conf]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
22
.github/workflows/lint.yml
vendored
22
.github/workflows/lint.yml
vendored
@ -30,3 +30,25 @@ jobs:
|
||||
run: ln -s ./docs/site-example ./site
|
||||
- name: Lint shell code
|
||||
run: make lint-sh
|
||||
|
||||
editorconfig:
|
||||
name: Editorconfig
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install Dependencies
|
||||
run: sudo apt install curl tar
|
||||
- name: Install editorconfig-checker
|
||||
env:
|
||||
VERSION: 2.6.0
|
||||
OS: linux
|
||||
ARCH: amd64
|
||||
run: |
|
||||
curl -O -L -C - https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$VERSION/ec-$OS-$ARCH.tar.gz
|
||||
tar xzf ec-$OS-$ARCH.tar.gz
|
||||
sudo mv ./bin/ec-$OS-$ARCH /usr/bin/editorconfig-checker
|
||||
sudo chmod +x /usr/bin/editorconfig-checker
|
||||
- name: Install example site
|
||||
run: ln -s ./docs/site-example ./site
|
||||
- name: Lint editorconfig
|
||||
run: make lint-editorconfig
|
||||
|
5
Makefile
5
Makefile
@ -151,7 +151,10 @@ list-targets: FORCE
|
||||
echo "$$target"
|
||||
done
|
||||
|
||||
lint: lint-lua lint-sh
|
||||
lint: lint-editorconfig lint-lua lint-sh
|
||||
|
||||
lint-editorconfig: FORCE
|
||||
@scripts/lint-editorconfig.sh
|
||||
|
||||
lint-lua: FORCE
|
||||
@scripts/lint-lua.sh
|
||||
|
@ -24,6 +24,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /tmp/ec &&\
|
||||
wget -O /tmp/ec/ec-linux-amd64.tar.gz https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.6.0/ec-linux-amd64.tar.gz &&\
|
||||
tar -xvzf /tmp/ec/ec-linux-amd64.tar.gz &&\
|
||||
mv bin/ec-linux-amd64 /usr/local/bin/editorconfig-checker &&\
|
||||
rm -rf /tmp/ec
|
||||
|
||||
RUN useradd -d /gluon gluon
|
||||
USER gluon
|
||||
|
||||
|
5
scripts/lint-editorconfig.sh
Executable file
5
scripts/lint-editorconfig.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
editorconfig-checker .github contrib docs package scripts targets tests ./*.* .luacheckrc .editorconfig
|
Loading…
Reference in New Issue
Block a user