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 Scalastyle #77

Merged
merged 2 commits into from
Feb 5, 2015
Merged

Add Scalastyle #77

merged 2 commits into from
Feb 5, 2015

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Feb 5, 2015

This addresses one of the requests made in #50.

I just kind of went with rules that seemed right for the project. People are free to suggest changes.

Currently one has to explicitly run the scalastyle or test:scalastyle task to check style. Adding linting to the compile task would probably be too slow. We could potentially add it to the test task, but I gave that a quick try and was having some trouble getting it to check the main source in addition to the test source with that approach. Once we have Travis CI integration, we should be able to run the linting without slowing down our compile or test tasks. It might still be worth making one uber sbt task to test and run linting, and I would encourage someone who understands SBT much better than I do to do so! :)

I just kind of went with rules that seemed right for the project. People
are free to suggest changes.

Currently Scalatest is failing to parse Free.scala which seems like a
bug in Scalastyle. The error message is "Free.scala: Expected token
RBRACKET but got Token(DOT,.,1985,.)". I believe the following code is
tripping it up:

```scala
case y: Gosub[S, x.C] =>
  y.a().flatMap(z => y.f(z) flatMap x.f).resume
```

I've got to get to work for now, but I'll follow up on this later.
@travisbrown
Copy link
Contributor

This looks great to me—thanks for putting it together. I don't see a strong need for Scalastyle to run in the test task—we don't want to slow things down until the configuration is settled—but here's a quick example of how you could do it if you wanted to.

@non
Copy link
Contributor

non commented Feb 5, 2015

This seems good for now. We may want to relax some of these (or add more) as we hit issues, but for now I think it's a good default. 👍

@stew
Copy link
Contributor

stew commented Feb 5, 2015

👍

stew added a commit that referenced this pull request Feb 5, 2015
@stew stew merged commit d57ccec into typelevel:master Feb 5, 2015
@stew stew removed the in progress label Feb 5, 2015
@ceedubs ceedubs deleted the scalastyle branch February 5, 2015 20:21
@ceedubs
Copy link
Contributor Author

ceedubs commented Feb 5, 2015

Does anyone know what we need to do to make the Travis builds run scalastyle and validate that no errors are detected?

@travisbrown
Copy link
Contributor

script: "sbt test scalastyle" should do it.

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

4 participants