forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Closed
Changes from all 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 dad5335
Revert: CI(clang-format): Temporarily set all permissions to write-all
echoix b50dc85
CI(clang-format): Use reviewdog/action-suggester to add diff comments
echoix 4b91bd5
Update main.c
echoix 0a5c5d7
CI(clang-format): Use reviewdog/action-suggester to add code suggestions
echoix a0ca999
Add a formatting errors in db.copy
echoix f243cc2
Apply suggestions from code review
echoix 59f4ebd
Change clang-format version to cause errors in unchanged files
echoix ebdec5e
CI(clang-format): Add back verify-changed-files
echoix 17ff24d
CI(clang-format): Add step that fails if changed files
echoix 80cc35e
Add a formatting errors in db.copy
echoix 5896bc9
CI(clang-format): Add text in job summary that more fixes need to be …
echoix 5ec84d7
Apply suggestions from code review
echoix b2d7e22
CI(clang-format): Use "\n" as separator for file list
echoix 2e0e0b9
CI(clang-format): Add text in job summary that more fixes need to be …
echoix 3ef5690
Revert: CI(clang-format): Use "\n" as separator for file list
echoix 2969237
Use bash loop to split list of files
echoix c6ad1e5
CI(clang-format): Use file filter mode for a second call
echoix 3b0b606
CI(clang-format): Add better text for job summary when changes remain…
echoix 6af7e25
Add a file with spaces in the name
echoix cb069a4
CI(clang-format): Use "\n" as separator for file list
echoix 6c45480
Apply suggestions from code review
echoix 28681cd
Add a file with special characters in the name
echoix 50587c5
Use git ls-files to set a file list
echoix 927c82d
CI(clang-format): Upload artifacts of changed files from git ls-files…
echoix 5334446
CI(clang-format): Upload artifacts of changed files from git ls-files…
echoix 237f262
Add broken files
echoix 78bbf38
CI(clang-format): Remove unneeded steps
echoix 92957ad
Revert "Add broken files"
echoix fc74626
CI(clang-format): Remove file suggestions
echoix d606f67
CI(clang-format): Edit text in job summary
echoix c1f31c2
CI(clang-format): Fill file list from env var
echoix fd9897a
Add error in db.copy
echoix 30e3111
CI(clang-format): Re-use version 15 of clang-format
echoix 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,85 @@ | ||
--- | ||
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: 15 | ||
inplace: True | ||
- name: Verify Changed files | ||
uses: tj-actions/verify-changed-files@d774a4c7ebe335445d79c7b44138f56a76058ba0 # v19.0.0 | ||
id: verify-changed-files | ||
- id: git-changed-files | ||
run: | | ||
{ | ||
echo 'CHANGED_FILES<<EOF' | ||
git ls-files --other --modified --exclude-standard | ||
echo EOF | ||
} >> "$GITHUB_OUTPUT" | ||
- name: List all changed files tracked and untracked files | ||
run: | | ||
echo "Changed files: ${{ steps.git-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 "${CHANGED_FILES}" | ||
echo '```' | ||
} >> "$GITHUB_STEP_SUMMARY" | ||
env: | ||
CHANGED_FILES: ${{ steps.git-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: Explain that more files need to be fixed | ||
if: ${{ steps.verify-changed-files.outputs.files_changed == 'true' }} | ||
run: | | ||
{ | ||
echo '' | ||
echo 'Suggestions can only be added near to lines changed in this PR.' | ||
echo 'All these fixed files are included in the artifact. The artifact can be downloaded and copied to the the repository to replace unformatted files with the formatted files.' | ||
} >> "$GITHUB_STEP_SUMMARY" | ||
exit 1 | ||
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
if: always() | ||
with: | ||
name: my-artifact | ||
path: | | ||
.clang-format | ||
${{ steps.git-changed-files.outputs.CHANGED_FILES }} |
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,13 +18,13 @@ | |||||||||
#include <grass/dbmi.h> | ||||||||||
#include <grass/glocale.h> | ||||||||||
|
||||||||||
int main(int argc, char **argv) | ||||||||||
{ | ||||||||||
int main(int argc, char * *argv) | ||||||||||
{ | ||||||||||
int ret; | ||||||||||
struct Option *from_driver, *from_database, *from_table; | ||||||||||
struct Option *to_driver, *to_database, *to_table; | ||||||||||
struct Option *where, *select; | ||||||||||
struct GModule *module; | ||||||||||
struct Option * where, *select; | ||||||||||
struct GModule * module ; | ||||||||||
Comment on lines
+26
to
+27
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. [clang-format] reported by reviewdog 🐶
Suggested change
|
||||||||||
const char *drv, *db; | ||||||||||
|
||||||||||
G_gisinit(argv[0]); | ||||||||||
|
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,21 @@ | ||
/**************************************************************************** | ||
* | ||
* 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) | ||
{ | ||
int ret; | ||
} |
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,21 @@ | ||
/**************************************************************************** | ||
* | ||
* 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) | ||
{ | ||
int ret; | ||
} |
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,21 @@ | ||
/**************************************************************************** | ||
* | ||
* 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) | ||
{ | ||
int ret; | ||
} |
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.
[clang-format] reported by reviewdog 🐶