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 objc clang format #7677

Merged
merged 4 commits into from
Jun 20, 2023
Merged

Add objc clang format #7677

merged 4 commits into from
Jun 20, 2023

Conversation

qqaatw
Copy link
Contributor

@qqaatw qqaatw commented Jun 19, 2023

The main PR is #7643. Submitting this PR first to get the CI workflows in the main PR run normally without further approval.

cc @NicolasHug @pmeier.

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 19, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7677

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures, 1 Unrelated Failure

As of commit e034624:

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base b9a1984:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

.clang-format Outdated Show resolved Hide resolved
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

LGTM but the yaml checker is tripping. @pmeier any insight? Maybe we should get rid of it if it's becoming unreliable

@pmeier
Copy link
Collaborator

pmeier commented Jun 19, 2023

Kinda surprised that it is picking .clang-format as viable target in the first place. I'll have a look.

@pmeier
Copy link
Collaborator

pmeier commented Jun 19, 2023

According to the clang-format docs:

The .clang-format file uses YAML format:

The hook is configured to trigger on yaml files. The pre-commit docs state

The tags are discovered through a set of heuristics by the identify library. identify was chosen as it is a small portable pure python library.

And indeed

$ identify-cli .clang-format
["file", "non-executable", "text", "yaml"]

In the YAML specification, each --- indicates a separate document. Meaning, here we have two documents in a single file. This is what the hook is complaining about. However, this is not only correct, but also the way to go according to the clang-format documentation.

Thus, we have three options:

  1. Ignore .clang-format in the check-yaml hook
  2. Add the --allow-multiple-documents option to the hook
  3. Disable the hook completely

My preference is 2 > 1 > 3.

@qqaatw
Copy link
Contributor Author

qqaatw commented Jun 20, 2023

@NicolasHug @pmeier Thanks. Added the option.

@NicolasHug
Copy link
Member

Thanks a lot for the investigation @pmeier . Lint jobs are green so we can merge

@NicolasHug NicolasHug merged commit fc83b28 into pytorch:main Jun 20, 2023
@NicolasHug NicolasHug added code quality other if you have no clue or if you will manually handle the PR in the release notes labels Jun 20, 2023
@github-actions
Copy link

Hey @NicolasHug!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

@qqaatw qqaatw deleted the add_objc_clang_format branch June 20, 2023 13:14
facebook-github-bot pushed a commit that referenced this pull request Jul 3, 2023
Reviewed By: vmoens

Differential Revision: D47186585

fbshipit-source-id: deb3f62c9fc8c7225054d5a0c843220def2f439b

Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
Co-authored-by: Philip Meier <github.pmeier@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed code quality other if you have no clue or if you will manually handle the PR in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants