Skip to content

Suggest removal of print statements #461

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
jonasfj opened this issue Dec 17, 2018 · 3 comments
Closed

Suggest removal of print statements #461

jonasfj opened this issue Dec 17, 2018 · 3 comments

Comments

@jonasfj
Copy link
Member

jonasfj commented Dec 17, 2018

At least in flutter libraries people shouldn't be printing stuff, example of something that was released:
https://github.com/dooboolab/flutter_calendar_carousel/blob/825df5e8c1e5224972776efc1ed5e0047fa6cf04/lib/flutter_calendar_carousel.dart#L718

Maybe we could come up with a rule for this...?

Note. we should probably still support CLI libraries that needs to print stuff.

@isoos
Copy link
Collaborator

isoos commented Dec 17, 2018

Hm, good question. On a high level it seems to be a good rule to have, as it is a likely indication of a leftover debug statement, which, even on a server app, could mess up the logs (some app log to stdout, and a separate collector will do the shipping to a centralized server).

On the other hand, one can always use zones to catch all the print calls and turn them into meaningful logging or raise awareness...

I'm wondering: can this be a linter rule?

@pq
Copy link
Member

pq commented Dec 17, 2018

I'm wondering: can this be a linter rule?

👍

Disallowing calls to print would be straight-forward and there's lots of precedent (e.g., https://eslint.org/docs/rules/no-console, pylint's "print-statement", etc).

There's an open request here:dart-lang/sdk#57216. More motivation there welcome!

@isoos
Copy link
Collaborator

isoos commented Aug 26, 2020

This was implemented as a lint, and it is up to the package's author to use it.

@isoos isoos closed this as completed Aug 26, 2020
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

No branches or pull requests

3 participants