tonythomas01 / gdrive-to-commons

Tool to upload pictures from Google Drive to Wikimedia Commons ⚠️ Moved to Wikimedia Gerrit, so this repo is read only.
https://gdrive-to-commons.toolforge.org/
Apache License 2.0
9 stars 10 forks source link

Document the use of Prettier in the project #21

Closed srish closed 5 years ago

srish commented 5 years ago

git commit generated the following output for me without indicating which files are problematic and any hints for fixing the errors in them. Took some time to realize, that I've been happily ignoring the keyword "Failed" in the log and the fact that the git commit is failing.

Srish:gdrive_to_commons srish$ git commit -m "improved the main screen design"
black................................................(no files to check)Skipped
prettier.................................................................Failed
hookid: prettier

Files were modified by this hook. Additional output:

assets/css/style.css 106ms
uploader/templates/home.html 302ms

It would be useful to document the steps for using Prettier (https://prettier.io/) before pushing changes, perhaps in the README for now, but in the contribution guidelines in the future. I imagine, the steps would be:

tonythomas01 commented 5 years ago

So, we use pre-commit hooks to automatically fix human errors using prettier. However, I see that people might miss that prettier is automatically fixing the Failure it noticed. Something like:

  1. Run git commit and wait for pre-commit output.
  2. If there were some modifications by the hook, stage your files again using git add <file_name>.
  3. Run git commit again.
tonythomas01 commented 5 years ago

I wouldn't call it a bug though.

tonythomas01 commented 5 years ago

Documented at https://github.com/tonythomas01/gdrive_to_commons/blob/master/CONTRIBUTING.md