Merge pull request #128 from smkent/pre-commit

Remove trailing whitespace, add pre-commit and CI workflow to check whitespace
This commit is contained in:
Ruud 2024-01-06 17:46:32 +01:00 committed by GitHub
commit e7478a7dc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 321 additions and 282 deletions

34
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Test
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
Test:
name: pre-commit
runs-on: ubuntu-latest
steps:
- name: 💾 Check out repository
uses: actions/checkout@v3
- name: 🪝 Cache pre-commit hooks
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml')
}}"
- name: ✨ Install pre-commit
shell: bash
run: python3 -m pip install pre-commit
- name: 🔥 Test
run: pre-commit run --show-diff-on-failure --all-files
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

7
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace

View file

@ -62,7 +62,6 @@ gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap, l_gri
// ===== CONSTRUCTION ===== //
module gridfinityLite(gridx, gridy, gridz, gridz_define, style_lip, enable_zsnap, length, div_base_x, div_base_y, style_hole, only_corners) {
union() {
difference() {

View file

@ -526,4 +526,3 @@ module sweep_rounded(w=10, h=10) {
children();
}
}