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

update AppCode project-level code style settings #98

Closed
rhgills opened this issue Nov 11, 2013 · 7 comments
Closed

update AppCode project-level code style settings #98

rhgills opened this issue Nov 11, 2013 · 7 comments

Comments

@rhgills
Copy link
Contributor

rhgills commented Nov 11, 2013

This should make it easier to keep a more consistent code style with contributing developers who use AppCode (in particular, making sure that code generated by AppCode's codegen matches the project style).

@jasperblues:
Anything in the project level code style settings that seems incorrect to you? I used them briefly and fixed things that it did that seemed wrong, but I may have missed some things.

It might actually be easiest to overwrite the current project level code settings with whatever your default settings are, as I imagine those reflect the canonical style of the majority of the codebase. I noticed one of us committed a change (probably accidentally) that set the code style setting default for the project to the setting named 'Default (1)', which isn't actually bundled with the project. On second thought that may have been me, as I know I have a setting named that on my desktop machine. Anyway, that's something to watch out for while we iron out the project-level code settings!

@jasperblues
Copy link
Member

@rhgills heh - I think I have a style called "Default (1)" too ;)

I tweaked the formatter a little and applied some changes. . I hope that doesn't disrupt you!

I'm not too fussed about the actual formatting choices, as long as they're consistent.

For my personal projects I like:

  • Braces on a new line.
  • Star next to the object (GnuStep style).
  • Wrap lines if long.
  • Don't line up by colon character (except for auto-boxed dictionaries or enum declarations).

Main change is I made line width 140 - I like AppCode's hard wrapping, because it favors breaking up the line at a sensible place, however I think Xcode style soft wrapping could also work).

If you have any strong preferences its no problem to go ahead and change the style.

@rhgills
Copy link
Contributor Author

rhgills commented Nov 11, 2013

@jasperblues Awesome, thanks; and it shouldn't disrupt my work!

No strong preferences here as well. The most important thing is consistency.

I'll use these new settings for awhile and see if I notice anything, then close this issue.

@rhgills
Copy link
Contributor Author

rhgills commented Nov 13, 2013

I made some changes to this that I think are consistent with the project as a whole; namely:

  • no space between a cast and the variable being casted
  • spaces around && and || operators

@jasperblues
Copy link
Member

(y) +1

@rhgills
Copy link
Contributor Author

rhgills commented Jan 4, 2014

Looks like code style settings changed in 0c40d09. Method braces are now placed at the end of the line, instead of on the next one, among other changes. Was this intentional?

@jasperblues
Copy link
Member

Not intentional. . . I opened the project in IntelliJ while I was testing Gradle builds. . maybe that did it.

Are you ok to revert it?

@rhgills
Copy link
Contributor Author

rhgills commented Jan 7, 2014

Will do!

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

No branches or pull requests

2 participants