-
Notifications
You must be signed in to change notification settings - Fork 27
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
Open
Dtenwolde
wants to merge
32
commits into
duckdb:main
Choose a base branch
from
Dtenwolde:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c84d868
Add yaml file for code quality checker
Dtenwolde 16d4a63
Merge pull request #1 from Dtenwolde/code-quality-check
Dtenwolde b6b2bf1
Update workflow file
Dtenwolde 26d6e40
Go up one dir
Dtenwolde f0ef9af
Check cur directory
Dtenwolde 2fdbe0c
Add ls
Dtenwolde 67c549c
Add ls to extension-ci-tools
Dtenwolde 3c351b6
Fetch extension-ci-tools
Dtenwolde e533e10
Remove debug step
Dtenwolde b026daa
Add a make format-check rule
Dtenwolde 68bc76a
Update workflow
Dtenwolde 3831e31
Fix format-check not exiting properly whenever an incorrectly formatt…
Dtenwolde c035c7e
Simplify format makerule
Dtenwolde 6a37058
Add format-fix rule
Dtenwolde 3c09b5e
Format fix
Dtenwolde 43e24b2
Should say format-fix
Dtenwolde f4e3936
Commit with formatting mistake
Dtenwolde e5b9d69
Updated make format with some incorrectly formatted code
Dtenwolde a254f05
Fetch submodules
Dtenwolde 3d021a0
Move format_extension.py to extension-ci-tools
Dtenwolde ea13557
Add open_utf8 function to format_extension.py
Dtenwolde 87c94e1
Update paths
Dtenwolde 34c2efc
Add code quality check to TestCITools.yml
Dtenwolde cff0722
Use python instead of python3 everywhere
Dtenwolde eb48b6e
Add newline
Dtenwolde 1eb4f17
Add override to checkout repo
Dtenwolde 82fda34
Remove override repository
Dtenwolde 35f8ba3
Add the corresponding inputs
Dtenwolde 714173d
Change to use main ci tools version
Dtenwolde 762791f
Add some debugging
Dtenwolde f09ed60
Try cd ..
Dtenwolde ac95c03
Output content of makefile
Dtenwolde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: CodeQuality | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
explicit_checks: | ||
required: false | ||
type: string | ||
# The version of the https://github.com/duckdb/extension-ci-tools submodule of the extension. In most cases will be identical to `duckdb_version`. | ||
# Passing this explicitly is required because of https://github.com/actions/toolkit/issues/1264 | ||
ci_tools_version: | ||
required: true | ||
type: string | ||
# Override the repo for the CI tools (for testing CI tools itself) | ||
override_ci_tools_repository: | ||
required: false | ||
type: string | ||
default: "duckdb/extension-ci-tools" | ||
|
||
|
||
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 | ||
name: Checkout current repository | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'true' | ||
|
||
- uses: actions/checkout@v4 | ||
name: Checkout Extension CI tools | ||
with: | ||
path: 'extension-ci-tools' | ||
ref: ${{ inputs.ci_tools_version }} | ||
repository: ${{ inputs.override_ci_tools_repository }} | ||
|
||
- 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 | ||
cat makefiles/duckdb_extension.Makefile | ||
make format-check-silent | ||
|
||
- name: Generated Check | ||
shell: bash | ||
run: | | ||
git diff --ignore-submodules --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
curious, why L137 uses
python
while L140 and L143 usespython3
?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.
Fair point, using python for all in
cff0722
(#120)