Comments (7)
If you want to disable fatal warnings for part of your build for whatever reason, how would you do that with sbt-tpolecat?
To answer this specific question, you could do something like:
lazy val foo = project.in(file("foo"))
.settings(
tpolecatScalacOptions ~= { _.filterNot(Set(ScalacOptions.fatalWarnings)) }
)
Or you could set the more specific option key just for the default mode tpolecatCiModeOptions
if you wanted to be extremely specific.
from sbt-tpolecat.
Ok, thanks, that's helpful. So tlFatalWarnings
might live on as a one liner to do that ☝️
from sbt-tpolecat.
I have a PR open with sbt to make removing options nicer (sbt/sbt#6856) but unfortunately it's stuck on a legal review of the CLA at the moment 😢
from sbt-tpolecat.
If Someone™️ wants to do the work to add a JavacOptions DSL I don't have any objection in principle, but since I rarely use mixed projects personally I wasn't planning to do it myself. 😛
We'd need to bear in mind that javac options have evolved over time in much the same way as Scala compiler options, although generally with much greater attention to deprecating old options before removal.
I don't have any objection to setting javacOptions
directly either.
Both are definitely a breaking change for users that currently set their own javacOptions
.
BTW, how do you think that tlFatalWarnings
and tpolecatOptionsMode
should be unified?
from sbt-tpolecat.
Yeah, it's somewhat a question of philosophy. If The sbt-tpolecat Way is to individually add lints instead of doing the lazy -Xlint:all
, then probably this doesn't make sense and it can just be an sbt-typelevel-settings thing.
BTW, how do you think that
tlFatalWarnings
andtpolecatOptionsMode
should be unified?
That's a good question. I'm a little confused I guess. If you want to disable fatal warnings for part of your build for whatever reason, how would you do that with sbt-tpolecat?
from sbt-tpolecat.
At the moment there are different modes for the plugin, and default "option sets" for each mode. For the "development" mode we have:
tpolecatDevModeOptions := ScalacOptions.default
for "CI" mode we have:
tpolecatCiModeOptions := tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings
for "release" mode we have:
tpolecatReleaseModeOptions := tpolecatCiModeOptions.value + ScalacOptions.optimizerMethodLocal
If you want to enable a certain mode you can either use a command:
> tpolecatDevMode
or set an environment variable:
SBT_TPOLECAT_DEV=true sbt prePR
If no environment variable is set then you get the default mode (CI mode).
So at the moment, if you want to disable fatal warnings, you can either fiddle with the option sets to set them how you like in each mode, or set SBT_TPOLECAT_DEV
to any value in your CI build, or run the tpolecatDevMode
command as the first part of a command chain.
The reason that the default mode is the CI mode is that existing users didn't want the behaviour to change (i.e. fatal warnings should be enabled in the default configuration for this plugin).
from sbt-tpolecat.
Good places to look to understand what we need to configure here:
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html
https://docs.oracle.com/en/java/javase/11/tools/javac.html
https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html
Annoyingly the page for the javac command keeps moving in each JDK release 😆
from sbt-tpolecat.
Related Issues (20)
- Scala.js options overwritten on Scala 3 HOT 8
- Extract settings DSL into a library HOT 1
- Error when enabling scalafix in multi project build on versions > 0.3.1 HOT 4
- Is it possible to disable the unused warnings for generated src code in `target/src_manged`? HOT 7
- warnUnused is reporting on Assertions HOT 17
- Warn unused is reporting on XML literals HOT 3
- Set every tpolecatOptionsMode with tpolecatDevMode
- `-source` choices passed to scalac 3.* via space instead of colon and gets ignored. HOT 1
- New linting options for 3.3.0 HOT 1
- Change modes in intellij HOT 2
- Support `safe-init` in Scala 3
- warnNonUnitStatement has no effect in Scala 3.3.x HOT 1
- Scala 3's -Yexplicit-nulls HOT 5
- Consider verbose warnings
- `-Wnonunit-statement` seems not to work for scala-3 (3.3.3) HOT 3
- @nowarn annotations behavior change between 0.5.0 and 0.5.1 HOT 3
- Options for implicit conversions
- Add `-language:noAutoTupling` in Scala 3
- Write a Scalafix migration to migrate usages of the old package name
- Add this project to Typelevel Steward's repo list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-tpolecat.