oamg / leapp-repository

Leapp repositories containing actors for the Leapp framework (https://github.com/oamg/leapp). Currently provides leapp repositories for in-place upgrades of RHEL systems.
Apache License 2.0
48 stars 144 forks source link

use pre-commit hooks as a way to run linters #561

Open zhukovgreen opened 4 years ago

zhukovgreen commented 4 years ago

The current way of checking the new code against our linters setup, has the following disadvantages:

  1. The process takes roughly 2-3 minutes (running linters for each new and existing files)
  2. The process is not proactive in terms of helping contributors to pass the linters. The contributor either has to run linters and wait for outputs (not convenient as it takes quite long + not all contributors know about our linters at all), or they have to push the code and then waiting when travis will do the job (even longer).
  3. Current linter just finds the problems and not fixing them

https://pre-commit.com acts in a different manner. It is:

  1. Automatically running so-called pre-commit hooks each time the contributor commits something in a local tree (makes it proactive)
  2. The scope of the pre-commit hooks run are only files which are committed (make the run time neglectable)
  3. pre-commit ecosystem has a lot of hooks, which fixes problems instead of you (i.e. empty line in the end of file etc.)

Under the scope of this task:

zhukovgreen commented 3 years ago

Just FYI, I am not working, neither pushing it anymore, so these tickets are in stale