leapfrogtechnology/datamegh

Use formatting tool called Black - a standard python code formatter

Closed this issue · 5 comments

Current Behaviour

Standard formatting tool and linting tool has not been used in the repo to maintain the standard of the code. A common tool should be introduced in order to maintain a common coding standard.

Proposal

  • Add pre-commit hook to auto-format the changed files

  • Add a black checker in Travis CI to ensure the files are black formatted or not ( CI will exit with an error if the files are not formatted with black incase the developer pushes by ignoring the pre-commit hook)

Note: The whole repo will be strictly black formatted code.

Awesome. Thanks for adding this @Basanta78.

cc @shakyapranin

-n would skip the hook 😅

Yes, -n will skip the hook. That's why we will be placing a black formatter checker in our CI which will error out with formatting error if the code has not been formatted with black and will stop the build. So, we will be strictly checking the standard of the code with the use of black.

That’s great to integrate in CI too.

I agree - CI should fail if the code doesn't agree to our formatter.