Skip to content

[espresso] Enable warnings as errors #3414

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

Merged
merged 14 commits into from
Mar 9, 2023

Conversation

navaronbracke
Copy link
Contributor

This PR enables javac lint options for espresso and fixes the violations.

List which issues are fixed by this PR. You must list at least one issue.
Part of flutter/flutter#91868

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
N/A

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@navaronbracke navaronbracke requested a review from reidbaker as a code owner March 8, 2023 12:07
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@navaronbracke
Copy link
Contributor Author

navaronbracke commented Mar 8, 2023

@stuartmorgan I managed to fix all violations, except one error (which is reported twice):

/Users/navaronbracke/.gradle/caches/transforms-3/eb8527de6e1dbbf4b7e85b2278bb4bc3/transformed/espresso-idling-resource-3.5.1-api.jar(/androidx/test/espresso/IdlingRegistry.class):
warning: [classfile] MethodParameters attribute introduced in version 52.0 class files is ignored in version 51.0 class files

Do you have a clue on how to fix this one? Per https://mvnrepository.com/artifact/androidx.test.espresso/espresso-idling-resource we have the latest version of that dependency.

@stuartmorgan-g
Copy link
Contributor

@CaseyHillers
Copy link
Contributor

test-exempt: Lints were updated, and they're verified in presubmit tests

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open questions about annotation scope but overall this looks good.

@navaronbracke navaronbracke requested review from reidbaker and stuartmorgan-g and removed request for reidbaker March 8, 2023 19:29

* Aligns Dart and Flutter SDK constraints.
* Changes the severity of `javac` warnings so that they are treated as errors and fixes the violations.
* Migrates uses of the deprecated `@Beta` annotation to the new `@ExperimentalApi` annotation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be first, and have the **BREAKING CHANGE** annotation described at https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

## 0.3.0

**BREAKING CHANGES**:
* Changes the severity of `javac` warnings so that they are treated as errors and fixes the violations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one isn't a breaking change. It should be:

* **BREAKING CHANGE**: Migrates uses of the deprecated [...]
* Changes the severity [...]
* Aligns [...]

@navaronbracke navaronbracke force-pushed the espresso_warnings_as_errors branch from 83f8a6c to ca4f092 Compare March 8, 2023 19:47
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 9, 2023
@auto-submit auto-submit bot merged commit eb2fe26 into flutter:main Mar 9, 2023
@navaronbracke navaronbracke deleted the espresso_warnings_as_errors branch March 9, 2023 17:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 10, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
[espresso] Enable warnings as errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App needs tests p: espresso platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants