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

Introduce a consistent Code style #295

Open
alb-i986 opened this issue Apr 19, 2020 · 5 comments
Open

Introduce a consistent Code style #295

alb-i986 opened this issue Apr 19, 2020 · 5 comments

Comments

@alb-i986
Copy link
Contributor

While working on #294 I noticed there's a bit of a mess from a code style point of view.
See e.g. IsCollectionWithSize: there's a mix of tabs with 2 spaces and others with 4 spaces.

@sf105
Copy link
Member

sf105 commented Apr 19, 2020

That's unfortunate. My preference is for 2 spaces (I like to conserve horizontal line space). This is not just the thing about initial indentation vs further indentation?

brownian-motion added a commit to brownian-motion/JavaHamcrest that referenced this issue Apr 20, 2020
… Google's CheckStyle specs).

Formatted existing .java code to match.

See hamcrest#295
@brownian-motion
Copy link

If it is simply an indentation concern, then I think it's straightforward to address that using CheckStyle to assist with a consistent code style. I've opened up a PR which adds such a rule.

brownian-motion added a commit to brownian-motion/JavaHamcrest that referenced this issue Apr 20, 2020
… Google's CheckStyle specs).

Formatted existing .java code to match.

See hamcrest#295
@alb-i986
Copy link
Contributor Author

Yes, thanks @brownian-motion, that's what I meant.
Shall we go a little further and provide a code style settings so that everyone is on the same page and up & running in few secs?

@alb-i986 alb-i986 changed the title Introduce a coherent Code style Introduce a consistent Code style Apr 20, 2020
@brownian-motion
Copy link

I like this idea, but I'm only familiar with a small set of style settings. I know IntelliJ can import code style from CheckStyle, can Eclipse or other IDEs do the same? If all can, it may be simple enough to define a CheckStyle file.

@alb-i986
Copy link
Contributor Author

I don't know, but if we want to keep it simple, we may just use Google's styles: they are using 2 spaces anyways.
https://github.com/google/styleguide
They provide both for Eclipse and Intellij.

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

3 participants