Skip to content
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 a formatting error in db.copy #62

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c88293e
Add a formatting error in db.copy
echoix Mar 6, 2024
dad5335
Revert: CI(clang-format): Temporarily set all permissions to write-all
echoix Mar 6, 2024
b50dc85
CI(clang-format): Use reviewdog/action-suggester to add diff comments
echoix Mar 6, 2024
4b91bd5
Update main.c
echoix Mar 6, 2024
0a5c5d7
CI(clang-format): Use reviewdog/action-suggester to add code suggestions
echoix Mar 6, 2024
a0ca999
Add a formatting errors in db.copy
echoix Mar 6, 2024
f243cc2
Apply suggestions from code review
echoix Mar 6, 2024
59f4ebd
Change clang-format version to cause errors in unchanged files
echoix Mar 6, 2024
ebdec5e
CI(clang-format): Add back verify-changed-files
echoix Mar 6, 2024
17ff24d
CI(clang-format): Add step that fails if changed files
echoix Mar 6, 2024
80cc35e
Add a formatting errors in db.copy
echoix Mar 6, 2024
5896bc9
CI(clang-format): Add text in job summary that more fixes need to be …
echoix Mar 6, 2024
5ec84d7
Apply suggestions from code review
echoix Mar 6, 2024
b2d7e22
CI(clang-format): Use "\n" as separator for file list
echoix Mar 6, 2024
2e0e0b9
CI(clang-format): Add text in job summary that more fixes need to be …
echoix Mar 6, 2024
3ef5690
Revert: CI(clang-format): Use "\n" as separator for file list
echoix Mar 6, 2024
2969237
Use bash loop to split list of files
echoix Mar 6, 2024
c6ad1e5
CI(clang-format): Use file filter mode for a second call
echoix Mar 6, 2024
3b0b606
CI(clang-format): Add better text for job summary when changes remain…
echoix Mar 6, 2024
6af7e25
Add a file with spaces in the name
echoix Mar 6, 2024
cb069a4
CI(clang-format): Use "\n" as separator for file list
echoix Mar 6, 2024
6c45480
Apply suggestions from code review
echoix Mar 6, 2024
28681cd
Add a file with special characters in the name
echoix Mar 6, 2024
50587c5
Use git ls-files to set a file list
echoix Mar 6, 2024
927c82d
CI(clang-format): Upload artifacts of changed files from git ls-files…
echoix Mar 6, 2024
5334446
CI(clang-format): Upload artifacts of changed files from git ls-files…
echoix Mar 6, 2024
237f262
Add broken files
echoix Mar 6, 2024
78bbf38
CI(clang-format): Remove unneeded steps
echoix Mar 6, 2024
92957ad
Revert "Add broken files"
echoix Mar 6, 2024
fc74626
CI(clang-format): Remove file suggestions
echoix Mar 6, 2024
d606f67
CI(clang-format): Edit text in job summary
echoix Mar 6, 2024
c1f31c2
CI(clang-format): Fill file list from env var
echoix Mar 6, 2024
fd9897a
Add error in db.copy
echoix Mar 6, 2024
30e3111
CI(clang-format): Re-use version 15 of clang-format
echoix Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 88 additions & 66 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,89 @@
---
name: ClangFormat Check
on:
push:
branches:
- main
- releasebranch_*
pull_request:
branches:
- main
- releasebranch_*
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
# permissions: {}
permissions: write-all
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
# permissions:
# pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d # v0.17
with:
source: "."
clangFormatVersion: 15
inplace: True
- name: Verify Changed files
uses: tj-actions/verify-changed-files@d774a4c7ebe335445d79c7b44138f56a76058ba0 # v19.0.0
id: verify-changed-files
- run: echo '${{toJson(steps.verify-changed-files.outputs)}}'
- name: List all changed files tracked and untracked files
run: |
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"
- name: Add job summary without changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'false' }}
run: |
{
echo "### Changed files:"
echo "No files were changed by clang-format"
} >> "$GITHUB_STEP_SUMMARY"
- name: Add job summary with changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: |
{
echo '### Changed files:'
echo '```'
echo '${{ steps.verify-changed-files.outputs.changed_files }}'
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- uses: parkerbxyz/suggest-changes@f5b10bcbfe35840153c0e823095d260d5abad1f9 # v1.0.0
with:
comment: |
Please commit the suggested changes from clang-format.

Suggestions can only be added to lines near lines changed in this PR.
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
name: my-artifact
path: |
.clang-format
${{ steps.verify-changed-files.outputs.changed_files }}

name: ClangFormat Check
on:
push:
branches:
- main
- releasebranch_*
pull_request:
branches:
- main
- releasebranch_*
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
permissions: {}
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d # v0.17
with:
source: "."
clangFormatVersion: 16
inplace: True
- name: Verify Changed files
uses: tj-actions/verify-changed-files@d774a4c7ebe335445d79c7b44138f56a76058ba0 # v19.0.0
id: verify-changed-files
- run: echo '${{toJson(steps.verify-changed-files.outputs)}}'
- name: List all changed files tracked and untracked files
run: |
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"
- name: Add job summary without changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'false' }}
run: |
{
echo "### Changed files:"
echo "No files were changed by clang-format"
} >> "$GITHUB_STEP_SUMMARY"
- name: Add job summary with changed files
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: |
{
echo '### Changed files:'
echo '```'
for i in $CHANGED_FILES
do
echo $i
done
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
- name: Add code suggestions
uses: reviewdog/action-suggester@3d7fde6859623ad6174df5fd662677a0eb63310a # v1.11.0
with:
tool_name: clang-format
fail_on_error: true
cleanup: false
- name: Add file suggestions
uses: reviewdog/action-suggester@3d7fde6859623ad6174df5fd662677a0eb63310a # v1.11.0
with:
tool_name: clang-format
fail_on_error: true
filter_mode: file
cleanup: false
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
name: my-artifact
path: |
.clang-format
${{ steps.verify-changed-files.outputs.changed_files }}
- name: Explain that more files need to be fixed
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }}
run: |
{
echo '' >> "$GITHUB_STEP_SUMMARY"
echo 'Suggestions can only be added near to lines changed in this PR.'
echo 'All the files above still need to be formatted, even without suggestions.'
} >> "$GITHUB_STEP_SUMMARY"
exit 1
23 changes: 23 additions & 0 deletions file with spaces.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/****************************************************************************
*
* MODULE: db.copy
* AUTHOR(S): Radim Blazek <radim.blazek gmail.com> (original contributor)
* Glynn Clements <glynn gclements.plus.com>,
* Markus Neteler <neteler itc.it>
* PURPOSE: copy a table
* COPYRIGHT: (C) 2003-2006 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
*****************************************************************************/

#include <stdlib.h>


int main(int argc, char * * argv)
echoix marked this conversation as resolved.
Show resolved Hide resolved
{
int ret;

}
echoix marked this conversation as resolved.
Show resolved Hide resolved
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format] reported by reviewdog 🐶

Suggested change
}
}

Loading