-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add format checker to the CI #120
base: main
Are you sure you want to change the base?
Changes from 22 commits
c84d868
16d4a63
b6b2bf1
26d6e40
f0ef9af
2fdbe0c
67c549c
3c351b6
e533e10
b026daa
68bc76a
3831e31
c035c7e
6a37058
3c09b5e
43e24b2
f4e3936
e5b9d69
a254f05
3d021a0
ea13557
87c94e1
34c2efc
cff0722
eb48b6e
1eb4f17
82fda34
35f8ba3
714173d
762791f
f09ed60
ac95c03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CodeQuality | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
explicit_checks: | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
format-check: | ||
name: Format Check | ||
runs-on: ubuntu-20.04 | ||
|
||
env: | ||
CC: gcc-10 | ||
CXX: g++-10 | ||
GEN: ninja | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Install | ||
shell: bash | ||
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build clang-format-11 && sudo pip3 install cmake-format black cxxheaderparser pcpp | ||
|
||
- name: List Installed Packages | ||
shell: bash | ||
run: pip3 freeze | ||
|
||
- name: Format Check | ||
shell: bash | ||
run: | | ||
clang-format --version | ||
clang-format --dump-config | ||
black --version | ||
make format-check-silent | ||
|
||
- name: Generated Check | ||
shell: bash | ||
run: | | ||
git diff --ignore-submodules --exit-code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: newliner There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix: Dtenwolde@eb48b6e |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,9 +132,15 @@ wasm_threads: | |
emmake make -j8 -Cbuild/wasm_threads | ||
|
||
#### Misc | ||
format: | ||
find src/ -iname *.hpp -o -iname *.cpp | xargs clang-format --sort-includes=0 -style=file -i | ||
cmake-format -i CMakeLists.txt | ||
# Rule to fix formatting | ||
format-check: | ||
python extension-ci-tools/scripts/format_extension.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious, why L137 uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point, using python for all in |
||
|
||
format-check-silent: | ||
python3 extension-ci-tools/scripts/format_extension.py --all --check --silent | ||
|
||
format-fix: | ||
python3 extension-ci-tools/scripts/format_extension.py --all --fix --noconfirm | ||
|
||
update: | ||
git submodule update --remote --merge | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add a step like:
and add ci_tools_version AND override_ci_tools to the input, AND pass them down on the test invocation so that they are the current branch / current repo.
You can look at how https://github.com/duckdb/extension-ci-tools/blob/main/.github/workflows/_extension_distribution.yml works, or I can take over later.