RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
888 stars 262 forks source link

Add a standard configuration to every contributor follow #649

Closed brunoocasali closed 3 years ago

brunoocasali commented 3 years ago

Context

When I delivering some pull requests like #648 and #647 I've noticed about my editor not removing trailing spaces to me, then I realized this project have no standard configuration about editor configuration. So, this PR addresses this improvement!

Summary of Changes

DeeDeeG commented 3 years ago

Quick comment: We are looking at adopting the Rubocop linter for Ruby code in #644. Hopefully this is consistent with what Rubocop does? (For example: the amount of spacing for indentation).

brunoocasali commented 3 years ago

Quick comment: We are looking at adopting the Rubocop linter for Ruby code in #644. Hopefully this is consistent with what Rubocop does? (For example: the amount of spacing for indentation).

Yes @DeeDeeG, rubocop and editorconfig can live in the same project! Actually editorconfig can prevent many offenses that will be raised by rubocop :)

DeeDeeG commented 3 years ago

@brunoocasali do you mind if this is the config?

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

I think it's simpler to apply the rules to all files. And it looks like the markdown/md rule may have been auto-generated, but I personally think it's a good idea to add a newline at the end of markdown files.

I have tried this configuration in Atom, with the editorconfig package. It seems to work fine with all our existing files.