Toni-SM / skrl

Modular reinforcement learning library (on PyTorch and JAX) with support for NVIDIA Isaac Gym, Omniverse Isaac Gym and Isaac Lab
https://skrl.readthedocs.io/
MIT License
445 stars 43 forks source link

Add pre-commit settings #34

Closed juhannc closed 1 year ago

juhannc commented 1 year ago

Add pre-commit settings

Introduction and description

This PR adds adds pre-commit hooks for easier developing. The hooks can automate mundane tasks to make a developers life easier.

Notably file changes

  1. pre-commit-config.yaml: The file containing the configuration for the hooks.
  2. CONTRIBUTING.md: Small addition about the usage of pre-commit hooks.
  3. setup.py: Add pre-commit as a dependency

Added hooks

Currently implemented hooks (see the list of hooks for further info and more hooks):

Future improvements

The following pre-commit hooks might also be worth considering:

I guess the last one is currently not really needed but might be interesting if you, @Toni-SM, decide to upgrade the minimum Python version in the future. Although, it would convert the currently used format options for strings with the superior f-strings

Cheers,

Johann

Toni-SM commented 1 year ago

Nice... the only thing to say against it is that it modifies the .svg files šŸ™„

juhannc commented 1 year ago

Nice... the only thing to say against it is that it modifies the .svg files šŸ™„

They also had problems with the line endings and end of files. I looked into the raw diffs to ensure it didn't change the svg itself. I also tried out the codespell but it did in fact change the svg. Thus, if you want to include the codespell in the future to fix common typos, we'd have to take a look at what files to exclude.