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

Receiving a bunch of 'Missing a required trailing comma' warnings #1153

Closed
umang-sinha opened this issue Jan 23, 2022 · 6 comments · Fixed by #1154
Closed

Receiving a bunch of 'Missing a required trailing comma' warnings #1153

umang-sinha opened this issue Jan 23, 2022 · 6 comments · Fixed by #1154
Assignees
Labels
bug Something isn't working

Comments

@umang-sinha
Copy link

umang-sinha commented Jan 23, 2022

Describe the bug
Not exactly a bug but the entire codebase has missing trailing commas in most of the function calls and declarations. This is not a good linting practice as specified by the Dart Linter Rules

To Reproduce
Steps to reproduce the behavior:

  1. If you have the Flutter and Dart plugin for VS Code installed, you should receive a bunch of warnings with the message "Missing a required trailing comma."

Screenshots
image

@umang-sinha umang-sinha added the bug Something isn't working label Jan 23, 2022
@github-actions
Copy link

Congratulations on making your first Issue! 🎊 If you haven't already, check out our Contributing Guidelines and Issue Reporting Guidelines to ensure that you are following our guidelines for contributing and making issues.

@github-actions github-actions bot added the unapproved Unapproved, needs to be triaged label Jan 23, 2022
@umang-sinha
Copy link
Author

I would love to work on improving the linting in the entire repository. Please assign it to me

@umang-sinha
Copy link
Author

So I added trailing commas wherever they were missing and then formatted the code using dartfmt. These trailing commas have been added to a total of 99 files. Not sure if I should add all of it in a single pull request or break it down into smaller pull requests based on changes in a sub-directory. What do you suggest?

@palisadoes
Copy link
Contributor

Our pull request automation pull-request.yml file runs a flutter format --set-exit-if-changed . command on the submitted repo files. We do this for linting consistency.

Unless the command you propose is available with all operating systems we cannot use it.

@umang-sinha
Copy link
Author

umang-sinha commented Jan 23, 2022

Dart Formatter comes by default with the Dart plugin on VS Code.
Also, flutter format is essentially doing the same thing and they operate identically. flutter format is just a wrapper around dart format with dartfmt being the original formatter as pointed out in this StackOverflow answer.

@palisadoes
Copy link
Contributor

If that is the case, then open a separate PR just for linting.

@palisadoes palisadoes removed the unapproved Unapproved, needs to be triaged label Jan 23, 2022
palisadoes pushed a commit that referenced this issue Jan 24, 2022
…1154)

* style: add trailing commas wherever missing and format code

* ci: add files with more than 300 lines of code to pull-request.yml to be ignored by countline.py

* style: change formatting

* refactor: remove unused import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants