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

Use clang-format for consistent styles, as discussed in PR #242 #246

Merged
merged 3 commits into from Sep 8, 2020
Merged

Use clang-format for consistent styles, as discussed in PR #242 #246

merged 3 commits into from Sep 8, 2020

Conversation

boazsegev
Copy link
Contributor

This PR currently has only the clang-format file, avoiding any changes to other files.

The style matches the discussion in #242 , where we strive for the minimal amount of changes in the code while also setting:

AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
BreakBeforeBraces: Attach

This keeps the most prevalent styling choices in the current code base while minimizing edit amplification concern.

Should anyone request, I will add a commit to this PR with all files updated to this consistent style.

@ioquatix
Copy link
Member

ioquatix commented Sep 7, 2020

I'm happy to update the PR with the style changes.

However, it would make my life easier if we don't apply these to the libev code base since that comes from upstream, and I need to diff/merge it occasionally.

ext/nio4r/.clang-format Outdated Show resolved Hide resolved
@boazsegev
Copy link
Contributor Author

However, it would make my life easier if we don't apply these to the libev code base since that comes from upstream, and I need to diff/merge it occasionally.

Depending on how your IDE is set up, as long as we don't edit them here they shouldn't be effected.

However, if you do want to edit these files in the repo, we could set up another .clang-format file within the libev folder and mark that folder as un-styled (exclude it from clang-format) using:

Language: Cpp
DisableFormat: true

@boazsegev
Copy link
Contributor Author

P.S.: since .clang-format files effect only the folder (and subfolders) in which they reside,, the current .clang-format file should only effect the files under the nio4r folder and shouldn't effect the libev folder at all.

@ioquatix ioquatix changed the base branch from master to style September 8, 2020 01:25
@ioquatix ioquatix merged commit 4c0ef11 into socketry:style Sep 8, 2020
@ioquatix
Copy link
Member

ioquatix commented Sep 8, 2020

I am going to merge this, thanks. I may change some of the rules to minimise changes, but it looks like a great improvement. Thanks for your effort.

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

2 participants