esi-neuroscience / syncopy

Systems Neuroscience Computing in Python: user-friendly analysis of large-scale electrophysiology data
BSD 3-Clause "New" or "Revised" License
44 stars 13 forks source link

Adding a `.pre-commit-config.yaml` file #557

Closed Sai-Suraj-27 closed 1 year ago

Sai-Suraj-27 commented 1 year ago

Is your feature request related to a problem? Please describe. No.

Describe the solution you'd like I'm thinking about adding a pre-commit configuration file (.pre-commit-config.yaml) to the codebase as it helps improve the code quality and maintain consistency within the project. It will allow all the developers/future contributors to maintain a consistent code style. Adding this will help us by running some automated checks before anyone tries to make a commit. Many Python based organizations/repos maintain a pre-commit configuration file for these benefits. So, if you think it is useful let me know I will make a PR, Thank you.

dfsp-spirit commented 1 year ago

Thanks for the idea, but at this time I cannot tell you what should put into such a file.

I think that the Syncopy core developers would first need to discuss internally and decide what exactly to put into such a file. We already have rules we adhere to. And we would prefer, for example, not to have something that enforces that we 'cut every line after 79 chars', to be honest. Still, in general I think the idea of a .pre-commit-config.yaml to enforce our rules is not bad. We will think about it.

Sai-Suraj-27 commented 1 year ago

@dfsp-spirit Sure, sir thanks for the reply. We can start by creating a basic .pre-commit-config.yaml that formats all the code according to the code-formatter black. Note that it is not mandatory to follow the rule of 'cut every line after 79 chars'. We can simply change the maximum-line-length to 120 chars or whatever we want. Let me know if you want me to make a PR, Thank you.