Skip to content

COMP: Format code to address clang_format warnings#45

Merged
tbirdso merged 2 commits into
InsightSoftwareConsortium:masterfrom
Leengit:clang_format
Apr 18, 2022
Merged

COMP: Format code to address clang_format warnings#45
tbirdso merged 2 commits into
InsightSoftwareConsortium:masterfrom
Leengit:clang_format

Conversation

@Leengit

@Leengit Leengit commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator

This fixes warnings about individual lines of C++ code. However, the following warning generated by .github/workflows/clang-format-linter.yml remains unaddressed

Run InsightSoftwareConsortium/ITKClangFormatLinterAction@master
  with:
    error-message: Code is inconsistent with ITK Coding Style.
/usr/bin/docker run --name bcf09832c3d6d9c6e47ed9a70b1d4169a3bc0_f5e03a --label 2bcf09 --workdir /github/workspace --rm -e INPUT_ERROR-MESSAGE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ITKVkFFTBackend/ITKVkFFTBackend":"/github/workspace" 2bcf09:832c3d6d9c6e47ed9a70b1d4169a3bc0  "Code is inconsistent with ITK Coding Style."
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
error: cannot use -i when reading from stdin.
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
Error: Code is inconsistent with ITK Coding Style.
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

@dzenanz

dzenanz commented Apr 13, 2022

Copy link
Copy Markdown
Member

@bradking Do you have some ideas about git config --global --add safe.directory /github/workspace fatal: unsafe repository ('/github/workspace' is owned by someone else)?

@Leengit

Leengit commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator Author

Updating .github/workflows/clang-format-linter.yml and adding .github/workflows/apply-clang-format.yml, to be as they are in ITK, changes the message to the following:

Run InsightSoftwareConsortium/ITKClangFormatLinterAction@master
  with:
    error-message: Code is inconsistent with ITK Coding Style. Add the *action:ApplyClangFormat* PR label to correct.
/usr/bin/docker run --name bcf0961b78e37bf7b412a82c0bb2e94dec3cf_ea18d9 --label 2bcf09 --workdir /github/workspace --rm -e INPUT_ERROR-MESSAGE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ITKVkFFTBackend/ITKVkFFTBackend":"/github/workspace" 2bcf09:61b78e37bf7b412a82c0bb2e94dec3cf  "Code is inconsistent with ITK Coding Style. Add the *action:ApplyClangFormat* PR label to correct."
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
error: cannot use -i when reading from stdin.
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
Error: Code is inconsistent with ITK Coding Style. Add the *action:ApplyClangFormat* PR label to correct.
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

Is it possible that this change has to be merged before the warning goes away?

@bradking

Copy link
Copy Markdown
Member

See actions/checkout#760

@Leengit

Leengit commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator Author

@bradking I assume some sort of git config --global --add safe.directory something_here command goes in clang-format-linter.yml but I don't know what the something_here part should be nor do I have familiarity with the yml file to know how/where to put that in. If you happen to know ....

@Leengit

Leengit commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator Author

The last force-push is to git rebase master.

Comment thread .github/workflows/apply-clang-format.yml Outdated
@Leengit

Leengit commented Apr 18, 2022

Copy link
Copy Markdown
Collaborator Author

We are all green on the checks for this pull request. Are we good to merge at this point?

@tbirdso tbirdso merged commit c6a8eec into InsightSoftwareConsortium:master Apr 18, 2022
@Leengit Leengit deleted the clang_format branch May 3, 2022 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants