Skip to content

8349847: Support configuring individual lint categories as errors #23622

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Feb 13, 2025

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 category. 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

This PR includes the following PR as a dependency/prerequisite:


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/23622/head:pull/23622
$ git checkout pull/23622

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23622

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 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.

@archiecobbs
Copy link
Contributor Author

/csr

@openjdk
Copy link

openjdk bot commented Feb 13, 2025

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

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

openjdk bot commented Feb 13, 2025

@archiecobbs has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@archiecobbs please create a CSR request for issue JDK-8349847 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

openjdk bot commented Feb 13, 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 Feb 13, 2025

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 13, 2025

@archiecobbs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@archiecobbs
Copy link
Contributor Author

Keepis Alivimus

@mcimadamore
Copy link
Contributor

Can we please hold off on this for now? There's many lint-related improvements going on at the same time, and, while it's good to see some activity in this area, I'd like to proceed in a more incremental fashion. Let's try to clear up the queue before we add more to it.

@archiecobbs
Copy link
Contributor Author

Hi @mcimadamore,

Certainly - I was only trying to stave off the bot, not implying impatience.

Maybe we need a new bot command like /keep-alive 8w that could change the idle timeout setting... ?

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 30, 2025

@archiecobbs This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk
Copy link

openjdk bot commented May 9, 2025

@archiecobbs this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8349847
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed rfr Pull request is ready for review labels May 9, 2025
@openjdk openjdk bot added rfr Pull request is ready for review and removed merge-conflict Pull request has merge conflict with target branch labels May 9, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented May 28, 2025

@archiecobbs This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this May 28, 2025
@archiecobbs
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented May 28, 2025

@archiecobbs This command can only be used in open pull requests.

@ExE-Boss
Copy link

/open

@openjdk
Copy link

openjdk bot commented May 31, 2025

@ExE-Boss Only the pull request author can set the pull request state to "open"

@archiecobbs
Copy link
Contributor Author

/open

@openjdk openjdk bot reopened this May 31, 2025
@openjdk
Copy link

openjdk bot commented May 31, 2025

@archiecobbs This pull request is now open

@openjdk
Copy link

openjdk bot commented Jun 17, 2025

⚠️ @archiecobbs This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

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.

3 participants