sanctuary-zero icon indicating copy to clipboard operation
sanctuary-zero copied to clipboard

Add flake8/black support for code styling and linting

Open vinmay opened this issue 3 years ago • 9 comments

@t0xic0der Could we add lint support so that we can have a style guide in place for the project? As the contributors increasing, this will help maintain the decorum of the code.

vinmay avatar Oct 21 '20 15:10 vinmay

@vinmay you are right. That needs to be maintained. What service are we opting for to implement this?

Some alternatives I had in mind were CodeClimate, Travis CI and Circle CI for they provide for free pipelines on open-source repositories without any additional charges.

gridhead avatar Oct 22 '20 03:10 gridhead

@VaibhavSaini19 and @s-katte have exhaustive experience in this too. What do you folks think?

gridhead avatar Oct 22 '20 03:10 gridhead

Yes, it would be great to add a formatter / linter to maintain consistency across the project. I think Prettier and Pylinter would do the job. Prettier is available on GitHub Actions, haven't checked about a linter for python, though. Don't have much idea about the other CI tools either

VaibhavSaini19 avatar Oct 22 '20 03:10 VaibhavSaini19

I was thinking of just a linter but yes, something with respect to a CI/CD pipeline would also be great. Circle CI or Travis CI would be my go to options. Other than those 2, I think Jenkins would be another option. I haven't worked with CodeClimate, so I am not sure about that. I am quiet sure there will be other projects that use these CI/CD pipelines for Linters as well, they should have good support.

vinmay avatar Oct 22 '20 09:10 vinmay

Yes @vinmay, a linter would be in order and that is what we'd be equipping for CI. For every push made to master or pull request created, the CI would automate a lint check and see if the merge is viable or not.

gridhead avatar Oct 23 '20 02:10 gridhead

@t0xic0der This also makes me think, should the structure of the repo change as well? I mean have a client/sever is separate folders, add a setup.py file as well? I know we are digressing from the topic but getting these things together along with having a CI pipeline also makes sense.

Let me know how this sounds -

  1. Add lint checking to comply with PEP8
  2. Add a Setup Script that can also help in building a distributable?
  3. Add tests
  4. Add CI

vinmay avatar Oct 23 '20 10:10 vinmay

@t0xic0der This also makes me think, should the structure of the repo change as well? I mean have a client/sever is separate folders, add a setup.py file as well? I know we are digressing from the topic but getting these things together along with having a CI pipeline also makes sense.

These are all valid points, though digressing from the context of this specific issue. Please go ahead and create a new issue for these concerns where we can discuss about them. We need to tackle the points that you have mentioned in a specific order to yield the best results from the integration pipelines.

gridhead avatar Oct 25 '20 05:10 gridhead

@t0xic0der Sure thing. I will create a few issues for these. Thank you !

vinmay avatar Oct 27 '20 12:10 vinmay

I have a very simple idea, we can simply use inbuilt GitHub actions with tool black, isort. I can get this done anytime I get assigned. I already have this in my repo so it is just like copy paste

amaank404 avatar Dec 15 '20 17:12 amaank404