awslabs / damo

DAMON user-space tool
https://damonitor.github.io/
GNU General Public License v2.0
148 stars 28 forks source link

Please run `pre-commit install` before making commits #98

Closed honggyukim closed 3 weeks ago

honggyukim commented 3 weeks ago

Hi SeongJae,

I've added pre-commit hooks before at #62, but it seems that you didn't install its hooks.

So the current pre-commit hooks complain a lot as follows.

$ pre-commit run -a
check yaml...............................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing src/_damo_print.py

trim trailing whitespace.................................................Passed
isort....................................................................Failed
- hook id: isort
- files were modified by this hook

Fixing /home/honggyu/work/damo/src/damo_show.py
Fixing /home/honggyu/work/damo/tests/unit/test_damon_sysfs.py
Fixing /home/honggyu/work/damo/src/damo_report_times.py
Fixing /home/honggyu/work/damo/tests/unit/test_damo_records.py
Fixing /home/honggyu/work/damo/tests/unit/test_damo_show.py
Fixing /home/honggyu/work/damo/tests/unit/test_damon_dbgfs.py
Fixing /home/honggyu/work/damo/src/damo_record.py
Fixing /home/honggyu/work/damo/src/damo_report_profile.py
Fixing /home/honggyu/work/damo/src/damo_heats.py
Fixing /home/honggyu/work/damo/src/damo_heatmap.py

codespell................................................................Failed
- hook id: codespell
- exit code: 65

src/_damon_args.py:88: legth ==> length
src/_damon_args.py:567: shoule ==> should
src/damo_status.py:117: fiedls ==> fields
src/damo_heats.py:18: givne ==> given
src/_damon.py:449: supporing ==> supporting
src/_damon.py:1058: overwirte ==> overwrite
src/damo_heatmap.py:20: givne ==> given
src/damo_record.py:120: childs ==> children, child's
USAGE.md:34: resluts ==> results
USAGE.md:72: descripton ==> description
USAGE.md:114: recieves ==> receives
USAGE.md:227: successed ==> succeeded, success, successful
USAGE.md:762: Miscelleneous ==> Miscellaneous
src/_damo_records.py:503: fileds ==> fields
src/_damo_records.py:520: tolen ==> token

It'd be better to run pre-commit install before making commits from now on unless you don't like these kind warnings.

sjp38 commented 3 weeks ago

Thank you for this kind report, Honggyu! I wanted to learn more about the pre-commit hook and use it, but unfortunately couldn't find time for that so far. Let me try more. I will fix the reported issues first.

sjp38 commented 3 weeks ago

I successfully installed pre-commit on my development machine and fixed all warnings.

honggyukim commented 3 weeks ago

Thanks. Maybe we can think about adding some description about pre-commit at CONTRIBUTING file just like https://github.com/namhyung/uftrace/blob/master/CONTRIBUTING.md#coding-style.