Skip to content

8349847: Support configuring individual lint categories as errors #25558

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 4 commits into from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented May 30, 2025

(Note: this is a resubmission of #23622 which was closed accidentally due to a bot bug and which I'm not allowed to reopen.)

This PR refines the -Werror flag to support lint categories just like -Xlint does. So, for example -Werror:all,-preview would cause an error if any warning other than a preview warning occurred.

A few notes:

  • Some warnings emitted by the compiler do not have a corresponding Lint ca[tegory. As always, they cause an error if -Werror is given, but what if -Werror:all is given instead? The answer given here is yes, an error will occur.
  • The -Werror works the same way as before, i.e., any warning results in an error. That means if -Werror is given -Werror:foo flags have no effect.
  • Refactoring has been done to allow -Xlint and -Werror to utilize the same "parsing" logic. The existing -Xlint flag has a particular behavior when conflicting flags are combined (e.g., -Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo equals -Xlint:all). This behavior has been preserved and Javadocumented.
  • A few minor cleanups are included

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8350044 to be approved

Issues

  • JDK-8349847: Support configuring individual lint categories as errors (Enhancement - P4)
  • JDK-8350044: Support configuring individual lint categories as errors (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25558/head:pull/25558
$ git checkout pull/25558

Update a local copy of the PR:
$ git checkout pull/25558
$ git pull https://git.openjdk.org/jdk.git pull/25558/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25558

View PR using the GUI difftool:
$ git pr show -t 25558

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25558.diff

Using Webrev

Link to Webrev Comment

@archiecobbs
Copy link
Contributor Author

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented May 30, 2025

👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 30, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels May 30, 2025
@openjdk
Copy link

openjdk bot commented May 30, 2025

@archiecobbs an approved CSR request is already required for this pull request.

@openjdk
Copy link

openjdk bot commented May 30, 2025

@archiecobbs The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented May 30, 2025

Webrevs

@ExE-Boss
Copy link

(Note: this is a resubmission of #23622 which was closed accidentally due to a bot bug and which I'm not allowed to reopen.)

/touch is for already open pull requests, /open is for re‑opening bot‑closed pull requests.

@archiecobbs
Copy link
Contributor Author

archiecobbs commented May 31, 2025

/touch is for already open pull requests, /open is for re‑opening bot‑closed pull requests.

Ah, didn't know about/open... I was trying to use the github controls. I will try that. Thanks!

Closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler [email protected] csr Pull request needs approved CSR before integration rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants