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 linter for conventions and style #50

Closed
travisbrown opened this issue Feb 3, 2015 · 7 comments
Closed

Add linter for conventions and style #50

travisbrown opened this issue Feb 3, 2015 · 7 comments
Assignees

Comments

@travisbrown
Copy link
Contributor

This may need to be a longer-term goal, but in my view providing a linter is one of the single most important things a project can do to promote contribution.

I definitely agree that we should be documenting conventions like #27, but having to parse a bunch of guidelines in prose (and then extrapolate from the current source when the guidelines aren't 100% unambiguous, which is always) can be stressful—I know that I'm personally a lot less likely to click the submit button on local work if I'm worried that it's going to be picked apart because I didn't understand all the details of the project's contributor guidelines (and that's even if I don't think the maintainers are going to be dismissive or condescending). Being able to go through a few rounds of local correction for formatting and convention before I put something in public is hugely confidence-building.

I like both WartRemover and Scalastyle, but I'm not sure either is a perfect solution to this problem.

@mpilquist
Copy link
Member

👍 Scalariform would also be nice to standardize syntax.

@ceedubs
Copy link
Contributor

ceedubs commented Feb 3, 2015

👍 to Scalastyle and WartRemover (at least what we can enable - we probably will have some things like isInstanceOf for performance hacks).

Scalariform may be okay in this project, but my previous experience in a project that used Shapeless was that there was no permutation of options that would allow me to tell it not to reformat HList literals into an unreadable mess.

@non
Copy link
Contributor

non commented Feb 3, 2015

I think this is a good suggestion. My feeling is that we should produce a (relatively detailed) document explaining the coding style/standard for type classes etc. and then try to reify some of those guidelines in a linter tool.

Like @ceedubs I'm wary of code rewriting but if we can find a set of settings that doesn't mangle nice code I'm definitely open to it.

@coltfred
Copy link
Contributor

coltfred commented Feb 3, 2015

👍 for Scalariform. Without some sort of automated code formatting tool it's really hard to tell if I'm conforming to style. Linter and WartRemover make builds glacial, but we've had really good success with having them in a different target which we run just before pushing.

@wedens
Copy link
Contributor

wedens commented Feb 4, 2015

automatic formatters is good only in simple cases. when you have some high-arity functions and parameters, formatter will create unreadable mess from it (as @ceedubs said).

@ceedubs
Copy link
Contributor

ceedubs commented Feb 4, 2015

I started a branch on my cats fork to add Scalastyle. It did a good job of catching some whitespace issues, but I ran into an issue. It uses Scalariform internally, which fails to parse Free.scala. I left more info in a commit message and will try to follow up when I get some time.

@non
Copy link
Contributor

non commented May 22, 2015

Fixed by #77

@non non closed this as completed May 22, 2015
@non non removed the in progress label May 22, 2015
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

7 participants