Skip to content

switch over to clang-format style #61

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

Merged
merged 3 commits into from
Feb 23, 2018
Merged

switch over to clang-format style #61

merged 3 commits into from
Feb 23, 2018

Conversation

strega-nil
Copy link

@strega-nil strega-nil commented Feb 20, 2018

I can add a .clang-format as well;

BasedOnStyle: LLVM

AlignAfterOpenBracket: AlwaysBreak
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
PointerAlignment: Left

I can upload a .clang-format if you want, as well
@strega-nil strega-nil mentioned this pull request Feb 20, 2018
8 tasks
@leios
Copy link
Member

leios commented Feb 20, 2018

Yeah, I guess it makes sense to change the style to something that is easy to maintain. I assume that this is done simply with the .editorconfig?

@strega-nil
Copy link
Author

I have no idea. I don't know what .editorconfig is.

@strega-nil
Copy link
Author

It looks like .editorconfig has been entirely replaced by clang-format in the C++ community; similarly with rustfmt in the Rust community. Is it possible, for languages with formatting tools, to use those instead?

@leios
Copy link
Member

leios commented Feb 20, 2018

That seems reasonable and should probably be mentioned in PR #59

@Butt4cak3
Copy link
Contributor

A .clang-format file in the repo sounds like a good idea to me.

I briefly read up on clang-format and saw that it's not only used for C++. What I did not find, however, is a way to place multiple .clang-format files for multiple languages in the same repository. Is there a way to do this? Would it even make sense or should we just use it for C++ and leave it at that?

@strega-nil
Copy link
Author

@Butt4cak3 I have zero opinion on non-C++ languages. That'd be up to the contributes for those languages.

@Butt4cak3 Butt4cak3 mentioned this pull request Feb 20, 2018
15 tasks
@leios
Copy link
Member

leios commented Feb 22, 2018

Hey @ubsan I assume that this is related to the Issue #60 ? Should I wait for those issues to be resolved before merging?

@strega-nil
Copy link
Author

Oh, it's actually quite trivial.

---
Language: Cpp
BasedOnStyle: LLVM

AlignAfterOpenBracket: AlwaysBreak
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
PointerAlignment: Left
---
Language: C
...
---

so basically, if people of other languages want to use .clang-format, they can.

@leios I don't think so; it's trivial to add support for other languages once they agree how they're going to format them, and this is blocking me on some other things I'd like to do.

@leios
Copy link
Member

leios commented Feb 22, 2018

@ubsan so you would prefer to merge this asap? I'll merge it soon, then. I just wanted to see if anyone else (@Gathros in particular) wanted to discuss the style.

@strega-nil
Copy link
Author

Yep! although I'll add a clang-format to the base directory.

@strega-nil
Copy link
Author

@leios please merge

@leios
Copy link
Member

leios commented Feb 23, 2018

Alright. Gathros said he didn't mind the format change earlier, so it should be fine.

@leios leios merged commit 53337bb into algorithm-archivists:master Feb 23, 2018
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