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

COMP: Format code to address clang_format warnings #45

Merged
merged 2 commits into from Apr 18, 2022

Conversation

Leengit
Copy link
Collaborator

@Leengit Leengit commented Apr 13, 2022

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
Copy link
Member

dzenanz commented Apr 13, 2022

@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
Copy link
Collaborator Author

Leengit commented Apr 13, 2022

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
Member

See actions/checkout#760

@Leengit
Copy link
Collaborator Author

Leengit commented Apr 13, 2022

@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
Copy link
Collaborator Author

Leengit commented Apr 13, 2022

The last force-push is to git rebase master.

@Leengit
Copy link
Collaborator Author

Leengit commented Apr 18, 2022

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.

None yet

4 participants