mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-18 19:59:48 +08:00
Check for trailing whitespace
As a result of editing, trailing whitespace is often resulting and since some editors automatically remove trailing whitespace this creates diffs with more changed lines than necessary. Add a check that files do not have trailing whitespace and fail if there are.
This commit is contained in:
parent
9744b4f3bc
commit
1f80715308
47
.github/workflows/code_style.yaml
vendored
47
.github/workflows/code_style.yaml
vendored
@ -22,6 +22,7 @@ jobs:
|
|||||||
find src test tsl -name '*.cmake' -exec cmake-format -i {} +
|
find src test tsl -name '*.cmake' -exec cmake-format -i {} +
|
||||||
- name: Check for diff
|
- name: Check for diff
|
||||||
run: git diff --exit-code
|
run: git diff --exit-code
|
||||||
|
|
||||||
perl_checks:
|
perl_checks:
|
||||||
name: Check Perl code in tree
|
name: Check Perl code in tree
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@ -30,12 +31,42 @@ jobs:
|
|||||||
run: sudo apt install perltidy
|
run: sudo apt install perltidy
|
||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Check trailing whitespace
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
find . -name '*.p[lm]' -exec perl -pi -e 's/[ \t]+$//' {} +
|
||||||
|
git diff --exit-code
|
||||||
- name: Format Perl files, if needed
|
- name: Format Perl files, if needed
|
||||||
run: find . -name '*.p[lm]' -exec perltidy -b -bext=/ {} +
|
if: always()
|
||||||
- name: Check for diff
|
run: |
|
||||||
run: git diff --exit-code
|
find . -name '*.p[lm]' -exec perltidy -b -bext=/ {} +
|
||||||
|
git diff --exit-code
|
||||||
|
|
||||||
|
cc_checks:
|
||||||
|
name: Check code formatting
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout source
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Check trailing whitespace
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
find . -name '*.[ch]' -exec perl -pi -e 's/[ \t]+$//' {} +
|
||||||
|
git diff --exit-code
|
||||||
|
|
||||||
|
- name: Check code formatting
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
sudo apt install clang-format-14
|
||||||
|
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100
|
||||||
|
sudo update-alternatives --set clang-format /usr/bin/clang-format-14
|
||||||
|
./scripts/clang_format_all.sh
|
||||||
|
git diff --exit-code
|
||||||
|
|
||||||
misc_checks:
|
misc_checks:
|
||||||
name: Check formatting, license, update scripts and git hooks
|
name: Check license, update scripts, and git hooks
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -53,14 +84,6 @@ jobs:
|
|||||||
- name: Check for unreferenced test files
|
- name: Check for unreferenced test files
|
||||||
if: always()
|
if: always()
|
||||||
run: ./scripts/check_unreferenced_files.sh
|
run: ./scripts/check_unreferenced_files.sh
|
||||||
- name: Check code formatting
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
sudo apt install clang-format-14
|
|
||||||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100
|
|
||||||
sudo update-alternatives --set clang-format /usr/bin/clang-format-14
|
|
||||||
./scripts/clang_format_all.sh
|
|
||||||
git diff --exit-code
|
|
||||||
- name: Check update scripts
|
- name: Check update scripts
|
||||||
if: always()
|
if: always()
|
||||||
run: ./scripts/check_update_scripts.sh
|
run: ./scripts/check_update_scripts.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user