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 C example and file extension. #349

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

agoessling
Copy link
Contributor

@agoessling agoessling commented Jul 24, 2024

This adds clang-format support for C files *.c. clang-tidy support already works correctly for cc_* targets with C sources.

It wasn't clear the best way to add *.c to format.sh given how it seems the output of mirror_linguist_languages.sh is manually copied over.


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
    • Given how cc_* targets silently handle C and C++ users likely already expect C support.
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes
    • Add support for formatting C files.

Test plan

  • New test cases added

@CLAassistant
Copy link

CLAassistant commented Jul 24, 2024

CLA assistant check
All committers have signed the CLA.

@alexeagle
Copy link
Member

I think the more principled answer is to add the missing language: https://github.com/github-linguist/linguist/blob/559a6426942abcae16b6d6b328147476432bf6cb/lib/linguist/languages.yml#L720-L734

We have other cases where one formatter covers multiple languages.

@agoessling
Copy link
Contributor Author

@alexeagle That does sound better. Can you point me to an example to pattern match from?

@alexeagle
Copy link
Member

I think it's simply following the pattern that C++ and other languages here already use.

@agoessling
Copy link
Contributor Author

Ok, I think this is a more principled way of adding C formatting support.

Copy link
Member

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

excellent! thanks a bunch!

@alexeagle alexeagle merged commit 7ef5063 into aspect-build:main Aug 5, 2024
8 checks passed
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.

3 participants