Developer-DAO/pixel-avatars

Add automatic code styling

Closed this issue ยท 10 comments

As we're getting more people involved it'd be great to have some ESlint / TSlint / Prettier setup.

Bonus if run automatically with Github Actions on PR commits ๐Ÿš€

Great idea. For Solidity, @kevincharm (discord) suggested using SolHint. https://github.com/fvictorio/solhint-plugin-prettier

Any takers on this welcomed

I've been using solhint locally and also https://github.com/prettier-solidity/prettier-plugin-solidity plugin with very good results.

I've been using solhint locally and also https://github.com/prettier-solidity/prettier-plugin-solidity plugin with very good results.

Added Solidity code formatter on this PR #41

Added prettier setup on web preview directory on this PR #42

@rasmuscnielsen just cleaning up. Has this been incorporated and be closed now?

This one is still up for grabs ๐Ÿ‘

It pretty much just need to be a GH action that runs npm run style (webpreviewer context) on every commit on open PR's and commit if any changes :-)

If no takers I'll probably give it a crack myself at some point ๐Ÿ˜„

I'll take a look. I'm just adding Github Actions in #58 to run the Solidity hardhat tests.

I'm assuming we just need to run Prettier in each of the major sections:

  • contract
  • web-client
  • web-server - I don't see prettier currently configured for this one, but can add

@briangershon

I'm assuming we just need to run Prettier in each of the major sections:

Exactly

Web server - I don't see prettier currently configured for this one, but can add

Love it!

Hello, here's the PR for review: #59

"Pretty" was easy, but "push" took some trial and error getting through the edge cases.

โš ๏ธ I see the "push" worked on my repo but failed on DAO repo with a 403 -- probably due to my access level. More details: https://github.com/Developer-DAO/pixel-avatars/runs/4671326081?check_suite_focus=true

Ok, the PR is ready for review. This goes with the simpler pre-commit hook approach instead of Github Action approach.

#60