geobakery / GeospatialAnalyzer

GeospatialAnalyzer HTTP-API
GNU General Public License v3.0
3 stars 0 forks source link

Streamline code style setup #15

Open Henner25 opened 7 months ago

Henner25 commented 7 months ago

Depending on your Git configuration, IDE (version), plugins and/or settings, you might end up with minor differences in code style, especially with regard to indentation and line endings. Differences in code style result in friction in pull requests and differences in line endings may even break scripts such as sql/pg_restore.sh.

For new setups, we want to minimize the (IDE) configuration as much as possible:

artmarks commented 7 months ago

I modified the .gitattributes and the .prettierrc. We currrently set the prettier rules with eslint and a prettifier plugin: 'extends: [ ... 'plugin:prettier/recommended', ],'

Depending on your IDE Settings, the IDE will use their own prettifier settings, or automaticly serach for a .prettierrc file. Searching for a best practice guide, there was no clear solution what do do.

Currently it seems to me, that following way of code styling is the best:

  1. Set Run eslint --fix on every save on your IDE
  2. Deactivate automated prettifier setting on your IDE
    • Even if spacing issues should not be conflicted anymore with the branch updates

This would lead us to always use recommended prettifier settings and only have one source of true.

TODO

We should add a developer part to the documentation for code styling