Code Monkey home page Code Monkey logo

Comments (3)

matthewfarwell avatar matthewfarwell commented on September 27, 2024

Thanks for your input. I agree that we can change things to make this easier, and I think your idea of having a normal input task is a good one, and would cover the bases. Now all we have to do is think of a good name: how about scalastyleTask

from scalastyle-sbt-plugin.

steinybot avatar steinybot commented on September 27, 2024

My comment saying that we "first call the compile task" is a bit misleading since we are not really calling it, sbt will figure out the order for us. There is also an unused scalastyleTask argument which if it was used would not work since then the order is not defined. It works in this case but only because it calls doScalastyle directly. This is all a little bit silly.

I went to the sbt docs to go and lookup Defining a sequential task with Def.sequential and low and behold the example is exactly what we want. Keeping in mind that it should be a "raw task" so that users can choose the configuration to use (for reference Provide raw settings and configured settings).

As for the name, that is a hard one. I would say that it should probably start with compile. The most descriptive would be something like compileThenCheckStyle.

In terms of completeness I would be inclined to do something like:

  1. Add a val scalastyleDefaultArgs = Setting[Seq[String]] for the default args which defaults to Seq.empty
  2. A non-input task that does something like scalastyleWithDefaultArgs := scalastyle.toTask(scalastyleDefaultArgs.mkString(" ")).value
  3. A raw task for compiling and checking the style compileThenCheckStyle := Def.sequential(compile, scalastyleWithDefaultArgs).value

If I remember this later I'll double check that it works and submit a PR.

from scalastyle-sbt-plugin.

er1c avatar er1c commented on September 27, 2024

@steinybot this would be really helpful!

from scalastyle-sbt-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.