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

improvement in formatting #53

Closed
jorre127 opened this issue Aug 12, 2022 · 8 comments
Closed

improvement in formatting #53

jorre127 opened this issue Aug 12, 2022 · 8 comments

Comments

@jorre127
Copy link
Contributor

Maybe it would be a good idea to run dart format for the whole project before making every pull request, this way the formatting is the same across the app. Currently the problem is that every contributor has different formatters, line lengths etc., which makes it harder when reviewing pull requests to see what are the actual changes, and what is just the formatting changing.

@rileyhawk1417
Copy link

Would it work just to use the default Formatter that comes with Flutter?
When I reinstall my dart plugins I get prompted to add a config file for the dart formatter.
Not sure if it's relevant though.

@jorre127
Copy link
Contributor Author

Yeah but I don't think we can force everybody to use the same formatter. Also people might have different settings like line length and such. this is why in the pull request right now everybody's formatting looks different which makes it hard to see the changes. The dart format command should always format the same, so if that gets run before each PR we should only see the actual changes, not any formatting changing.

@rileyhawk1417
Copy link

rileyhawk1417 commented Aug 13, 2022

I see so I guess probably having a uniform format or code structure should just work for everyone then?
For example writing functions and variables in a certain way that makes it clean and not congested.
Haven't paid much attention to format styles. I just write and care about the refactoring later 😅

@jorre127
Copy link
Contributor Author

Yeah I good start would be to write commas at the end of every line and attribute, this forces the formatter to put these on separate lines and help to make the formatting more uniform.

@rileyhawk1417
Copy link

So I guess it's just a matter of writing a config file that will be read by the formatter, then format the code accordingly?

@jorre127
Copy link
Contributor Author

Yeah or just use the dart format command, this automatically formats the code according to dart guidelines, so it will be the same for everyone.

@MhouneyLH
Copy link
Contributor

MhouneyLH commented Aug 31, 2022

If nobody has already started I would like to add this to the codebase. :)
We just need to add a new job in the workflows, that runs flutter format. Should not be that big of a deal, shouldn't it?

@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the stale label Sep 21, 2022
@stale stale bot closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants