[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[various] Enable avoid_print #6842

Merged
merged 6 commits into from
Dec 14, 2022

Conversation

stuartmorgan
Copy link
Contributor
@stuartmorgan stuartmorgan commented Dec 14, 2022

Enables the avoid_print lint, and fixes violations (mostly by opting example files out of it).

Also fixes a typo in the analysis file that wasn't noticed until adding script/tool/analysis_options.yaml, and makes minor (test/example-only) updates to actually fix that option now that it's really enabled.

Part of flutter/flutter#76229 and flutter/flutter#113764

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/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin 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.

Enables the `avoid_print` lint, and fixes violations (mostly by opting
example files out of it).
@stuartmorgan
Copy link
Contributor Author
stuartmorgan commented Dec 14, 2022

Not all of these version bumps are necessary (the tooling doesn't do line-by-line analysis yet, so doesn't know when it's just changing // ignores), but it's easier to just let the tool run than to analyze package by package, and releasing bugfix versions even if it's not necessary is pretty harmless.

Copy link
Contributor
@GaryQian GaryQian left a comment

Choose a reason for hiding this comment

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

LGTM

Hopefully nobody depended on these debug prints 🤞as that would be quite silly

@stuartmorgan stuartmorgan added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Dec 14, 2022
@stuartmorgan
Copy link
Contributor Author

Based on the review comments, I've gone back and removed almost all of the version bumps. In some cases that means that the Example tab on pub.dev will be slightly out of sync with the actual example code in the repo until the next actual change, but it seems like the consensus is that since there are just either adding an // ignore or removing a print or two (none of which is material to understanding the example) it's not really worth publishing them (which I agree with).

This leaves version changes for:

  • The shared_preference implementations that were actually printing in production code when things failed.
  • camera, where the change actually shows up in the README, because I think a showing a comment saying what people should add is better than showing a print, since otherwise people may well copy the print into their own code thinking it's an example of good error handling.

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 14, 2022
@auto-submit auto-submit bot merged commit 3a093e4 into flutter:main Dec 14, 2022
@stuartmorgan stuartmorgan deleted the analysis-options-avoid-print branch December 14, 2022 21:03
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 15, 2022
* 00b77e4cc Roll Flutter from 15af817 to 028c6e2 (13 revisions) (flutter/plugins#6843)

* b2cdcb69a [camera_android_camerax] `unnecessary_parenthesis` lint fix (flutter/plugins#6841)

* 3a093e49b [various] Enable avoid_print (flutter/plugins#6842)

* 78de28ca2 [webview_flutter_platform_interface] Updates platform interface to new interface (flutter/plugins#6846)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…#117145)

* 00b77e4cc Roll Flutter from 15af817 to 028c6e2 (13 revisions) (flutter/plugins#6843)

* b2cdcb69a [camera_android_camerax] `unnecessary_parenthesis` lint fix (flutter/plugins#6841)

* 3a093e49b [various] Enable avoid_print (flutter/plugins#6842)

* 78de28ca2 [webview_flutter_platform_interface] Updates platform interface to new interface (flutter/plugins#6846)
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* [various] Enable avoid_print

Enables the `avoid_print` lint, and fixes violations (mostly by opting
example files out of it).

* Version bumps

* Add tooling analysis option file that was accidentally omitted

* Fix typo in analysis_options found by adding tool sub-options

* Revert most version bumps

* Fix ios_platform_images
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants