nv-morpheus / Morpheus

Morpheus SDK
Apache License 2.0
310 stars 119 forks source link

[FEA]: Add pre-commit hook for formatting of python and C++ code #1702

Open mdemoret-nv opened 1 month ago

mdemoret-nv commented 1 month ago

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

Low (would be nice)

Please provide a clear description of problem this feature solves

Currently, CI is the only enforcer of correct formatting. Unless your IDE settings are set up to use the same settings as CI, its difficult to get the correct formatting without running CI.

Describe your ideal solution

Add a new pre-commit hook to run the following:

  1. yapf on python code
  2. isort on python code
  3. clang-format on C++ code

These should be quick enough to work in a pre-commit hook. Any other fast linting steps can also be included but linters like pylint and clang-tidy should be avoided due to the long run time.

Additional context

No response

Code of Conduct