Skip to content

-Xlint 1l #14753

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

Closed
wants to merge 5 commits into from
Closed

-Xlint 1l #14753

wants to merge 5 commits into from

Conversation

som-snytt
Copy link
Contributor

Add -Xlint setting and EnumSetting and onUpdate to enable post-processing such as linking another flag.

-Xlint can enable -deprecation, and -Xlint:longlit deprecates 1l. (It is regular deprecation on Scala 2, but treading gently.)

Eventually EnumSetting will want to avoid string comparisons.

The FromDigits error handling is a regular error because otherwise subsequent parse is worse.

Forward porting from
scala/scala#4182
scala/scala#7685

@som-snytt
Copy link
Contributor Author

som-snytt commented Mar 22, 2022

+ diff -rq /tmp/tmp.iYdTX80cgj scaladoc/output/testcases
diff: scaladoc/output/testcases: No such file or directory

probably it was based on upstream/master, the first commit is last June. Or not.

Also the check file update failed.

Ah, the line lengths are different.

45c45
< -- Error: tests/neg/t6124.scala:24:12 -----------------------------------------------------------------------------------
> -- Error: tests/neg/t6124.scala:24:12 ----------------------------------------------------------------------------------
49c49
< -- Error: tests/neg/t6124.scala:24:11 -----------------------------------------------------------------------------------
> -- Error: tests/neg/t6124.scala:24:11 ----------------------------------------------------------------------------------

@som-snytt som-snytt force-pushed the issue/forward-7685 branch from 15c6e6e to 21e0132 Compare March 23, 2022 04:45
@som-snytt som-snytt marked this pull request as ready for review March 23, 2022 05:53
@som-snytt som-snytt marked this pull request as draft March 23, 2022 19:04
@som-snytt
Copy link
Contributor Author

Converting to draft until I understand github actions and how to reproduce the scaladoc build failure.

@som-snytt
Copy link
Contributor Author

The tweak to make -Xlint:deprecation set -deprecation made the scaladoc test fail:

./project/scripts/cmdScaladocTests

presumably to do with how scaladoc extends settings, but I did not track it down.

The urgency is to introduce a linting option. Any linting option.

Aliasing -Xlint as -Wlint for uniformity was suggested somewhere by smarter. It is more regular if not as euphonious.

Or, as an alias, we should say "you phoney".

@som-snytt som-snytt marked this pull request as ready for review June 23, 2022 15:21
@som-snytt
Copy link
Contributor Author

som-snytt commented Jun 23, 2022

community build reminds us that perhaps they'd like to turn off a lint:

invalid choice(s) for -Wlint: -unused,_

edit: context:

[info] Defining Global / scalacOptions
[info] The new value will be used by Compile / scalacOptions, rootJS / scalacOptions, rootJVM / scalacOptions
[info] Reapplying settings...
[info] set current project to scala-stm (in build file:/__w/dotty/dotty/community-build/community-projects/scala-stm/)
[info] Forcing Scala version to 3.2.1-RC1-bin-SNAPSHOT on all projects.
[info] Reapplying settings...
[info] Loading dependency tracking file /__w/dotty/dotty/community-build/dotty-community-build-deps
[info] set current project to scala-stm (in build file:/__w/dotty/dotty/community-build/community-projects/scala-stm/)
[error] invalid choice(s) for -Wlint: -unused,_
[error] one error found
[error] (rootJVM / Compile / compileIncremental) Compilation failed
[error] Total time: 2 s, completed Jun 23, 2022 5:44:01 PM
Rerunning tests in scala-stm because of a previous run failure.
sbt -sbt-version 1.6.2 -Dsbt.supershell=false -Ddotty.communitybuild.dir=/__w/dotty/dotty/community-build --addPluginSbtFile=/__w/dotty/dotty/community-build/sbt-injected-plugins set Global/testOptions += Tests.Argument(TestFramework("munit.Framework"), "+l"); clean; set Global/logLevel := Level.Error; set Global/updateOptions ~= (_.withLatestSnapshots(false)); set Global/scalacOptions ++= List("-Xcheck-macros","-Ysafe-init");++3.2.1-RC1-bin-SNAPSHOT!; rootJVM/test
[info] welcome to sbt 1.6.2 (Private Build Java 1.8.0_282)

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.

1 participant