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 -quickfix compiler option to apply quickfixes to source files #10482

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Aug 3, 2023

With 2.13.12 the compiler starts providing quick fixes with certain warnings and errors. Typically these are presented in IDEs, however it can also be practical to have the compiler directly patch the source files.

From -quickfix:help:

Apply quick fixes provided by the compiler for warnings and errors to source files.
Syntax: -quickfix:<filter>,...,<filter>

<filter> syntax is the same as for configurable warnings, see `-Wconf:help`. Examples:
  -quickfix:any                    apply all available quick fixes
  -quickfix:msg=Auto-application   apply quick fixes where the message contains "Auto-application"

Use `-Wconf:any:warning-verbose` to display applicable message filters with each warning.

@scala-jenkins scala-jenkins added this to the 2.13.13 milestone Aug 3, 2023
@lrytz lrytz modified the milestones: 2.13.13, 2.13.12 Aug 3, 2023
@lrytz lrytz force-pushed the quickfix branch 3 times, most recently from a7bd1db to 3505209 Compare August 3, 2023 19:33
With 2.13.12 the compiler starts providing quick fixes with certain
warnings and errors. Typically these are presented in IDEs, however
it can also be practical to have the compiler directly patch the source
files.

From `-quickfix:help`:

```
Apply quick fixes provided by the compiler for warnings and errors to source files.
Syntax: -quickfix:<filter>,...,<filter>

<filter> syntax is the same as for configurable warnings, see `-Wconf:help`. Examples:
  -quickfix:any                    apply all available quick fixes
  -quickfix:msg=Auto-application   apply quick fixes where the message contains "Auto-application"

Use `-Wconf:any:warning-verbose` to display applicable message filters with each warning.
```
@SethTisue SethTisue added prio:hi high priority (used only by core team, only near release time) release-notes worth highlighting in next release notes labels Aug 8, 2023
@SethTisue SethTisue changed the title Add -quickfix compiler option to apply quick fixes to source files Add -quickfix compiler option to apply quick fixes to source files Aug 13, 2023
@SethTisue SethTisue merged commit 86f40c2 into scala:2.13.x Aug 15, 2023
3 checks passed
@SethTisue SethTisue removed the prio:hi high priority (used only by core team, only near release time) label Aug 23, 2023
@SethTisue SethTisue changed the title Add -quickfix compiler option to apply quick fixes to source files Add -quickfix compiler option to apply quickfixes to source files Aug 23, 2023
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Sep 30, 2023
### What changes were proposed in this pull request?
This pr aims to upgrade Scala from 2.13.11 to 2.13.12.

Additionally, this pr adds ``-Wconf:msg=legacy-binding:s`` to suppress similar compiler warnings as below:

```
[ERROR] /Users/yangjie01/SourceCode/git/spark-mine-13/core/src/main/scala/org/apache/spark/deploy/client/StandaloneAppClient.scala:171: reference to stop is ambiguous;
it is both defined in the enclosing class StandaloneAppClient and inherited in the enclosing class ClientEndpoint as method stop (defined in trait RpcEndpoint, inherited through parent trait ThreadSafeRpcEndpoint)
In Scala 2, symbols inherited from a superclass shadow symbols defined in an outer scope.
Such references are ambiguous in Scala 3. To continue using the inherited symbol, write `this.stop`.
Or use `-Wconf:msg=legacy-binding:s` to silence this warning. [quickfixable]
Applicable -Wconf / nowarn filters for this fatal warning: msg=<part of the message>, cat=other, site=org.apache.spark.deploy.client.StandaloneAppClient.ClientEndpoint.receive
```

### Why are the changes needed?
The new version bring some regression fixes:
- scala/scala#10422
- scala/scala#10424

And a new feature: Quickfixes
```
For some errors and warnings, the compiler now suggests an edit that could fix the issue. Tooling such as IDEs can then offer the edits, or the compiler itself will make the change if run again with -quickfix.
```
- scala/scala#10406
- scala/scala#10482
- scala/scala#10484

The release notes as follows:
- https://github.com/scala/scala/releases/tag/v2.13.12

### Does this PR introduce _any_ user-facing change?
Yes, Scala version changed.

### How was this patch tested?
Pass Github

### Was this patch authored or co-authored using generative AI tooling?
NO

Closes #43185 from LuciferYang/SPARK-45331.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
3 participants