nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.38k stars 112 forks source link

style: add `.pre-commit-config.yml` #117

Closed SauravMaheshkar closed 1 year ago

SauravMaheshkar commented 1 year ago

I noticed that most of (if not all) the steps of the CI checks can be enforced via pre-commit. Having pre-commit would make that process much easier and enforce that the developers follow coding conventions.

I'd be more than happy to take this up.

This is a simple proposal for the config file

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: end-of-file-fixer
    -   id: trailing-whitespace
    -   id: check-yaml
    -   id: check-merge-conflict
    -   id: requirements-txt-fixer
-   repo: https://github.com/psf/black
    rev: 22.10.0
    hooks:
      - id: black
        language_version: python3.8.12
-   repo: https://github.com/pycqa/isort
    rev: 5.10.1
    hooks:
      - id: isort
liruilong940607 commented 1 year ago

Yeah this is a good suggestion. Happy to take PRs if you want to contribute!

SauravMaheshkar commented 1 year ago

@liruilong940607 I opened a PR viz. #118

liruilong940607 commented 1 year ago

Thanks for contribute! merged!