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

refactor: adopt jspecify #5384

Merged
merged 5 commits into from
Aug 27, 2023
Merged

Conversation

tenax66
Copy link
Contributor

@tenax66 tenax66 commented Aug 13, 2023

This is a pull request for issue #5320 .

  • add the dependency for jspecify.
  • applied the @Nullable annotation to several packages as a first step:spoon, spoon.compiler, spoon.metamodel and spoon.pattern.internal.

Note: This pull request does not include checks for annotations. We may use jspecify-reference-checker in the future.

@tenax66 tenax66 force-pushed the refactor/jspecify-1 branch from 85b7e90 to a3f2a58 Compare August 13, 2023 06:49
@tenax66
Copy link
Contributor Author

tenax66 commented Aug 13, 2023

When annotating a return type of a method by jspecify's @Nullable, it should look like this.

public @Nullable String foo() {
  return ""
}

That is to say, the annotation is applied directly to the return type.

But annotations in that position don't pass Qodana's checks (MissortedModifiers).

@SirYwell
Copy link
Collaborator

When annotating a return type of a method by jspecify's @Nullable, it should look like this.

public @Nullable String foo() {
  return ""
}

That is to say, the annotation is applied directly to the return type.

But annotations in that position don't pass Qodana's checks (MissortedModifiers).

This is configurable in IntelliJ, but I don't know if/how it can be configured using the qodana.yaml. @MartinWitt maybe you know more about that?

@MartinWitt
Copy link
Collaborator

MartinWitt commented Aug 15, 2023 via email

@tenax66
Copy link
Contributor Author

tenax66 commented Aug 16, 2023

you could try adding the .idea config file to the repo after changing the setting in IJ.
If this does not work, disabling the rule with a comment why is also fine for me.

I tried the latter, as I could not find any information that the .idea folder can modify qodana's CI settings.

@MartinWitt
Copy link
Collaborator

@SirYwell can you provide the config file with the changed IJ setting?

@INRIA INRIA deleted a comment from sonatype-lift bot Aug 27, 2023
@I-Al-Istannen
Copy link
Collaborator

I-Al-Istannen commented Aug 27, 2023

Okay, I give up. It seems to work locally, but what do I know. Let's disable that modifier check.

@MartinWitt
Copy link
Collaborator

@I-Al-Istannen so we merge and fix this at a later stage?

@MartinWitt MartinWitt merged commit 2c64874 into INRIA:master Aug 27, 2023
@MartinWitt
Copy link
Collaborator

Thanks @tenax66 for your work.

@tenax66 tenax66 deleted the refactor/jspecify-1 branch August 28, 2023 11:44
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.

4 participants