fgcz / prolfqua

Differential Expression Analysis tool box R lang package for omics data
https://pubs.acs.org/doi/pdf/10.1021/acs.jproteome.2c00441
MIT License
37 stars 7 forks source link

Use pre-commit hooks for consistent code formatting and more #46

Closed fabianegli closed 1 year ago

fabianegli commented 1 year ago

I think it would be great if the prolfqua project adhered to code formatting standards and propose to use pre-commit hooks to keep the repository clean.

I think some of the hooks currently active in this PR might not be desired and the lintr pre-commit could be, but it will require manual work to get it to pass.

Disclaimer: I have not manually reviewed all the changes - and some of the changes I am not confident to asses.

wolski commented 1 year ago

Hi Fabian, Sorry but I will be closing the pull request. Code formatting can be implemented, but which formatter to use would be with me, and I would run the initial re-formatting. Also, the moment has to be right since such a commit trashes the entry commit history.

fabianegli commented 1 year ago

No need to be sorry. I thought instead of just opening an issue, I'd show part of a way how to get there and make it easy for people working on the code to adhere to the standards. I understand this was too much at once and the formatting probably not in the desired configuration.

As for the git history, it is possible to ignore certain commits when it comes to git blame. These commits should be marked for ignorance in a .git-blame-ignore-revs file in the repo. This functionality is made for exactly this kind of changes to retain original author attribution (authorship continues to be attributed to the person who changed the line before the ignored commit). You can find an example here: https://github.com/scikit-learn/scikit-learn/blob/main/.git-blame-ignore-revs

This requires a relatively new version of git, but that shouldn't be an issue and GitHub supports it, too.

A somewhat historical SO post about support by git itself and the GitHub community discussion about ignored revs.

I hope this helps you find a way towards standardized code formatting that suits you.