Commit Graph

3 Commits

Author SHA1 Message Date
Wyatt Hepler
ce14cb227e pw_presubmit: Use logging; UI improvements
- Switch many print statements to log statements.
- Only show command output when commands fail or debug logging is
  enabled.
- Add a wrapper class for check functions to consolidate running
  and logging logic for presubmit checks.

Change-Id: I72e155d602135b60c18f8973a778f40e65bb40da
2019-12-06 12:54:48 -08:00
Wyatt Hepler
b90f341ba5 pw_presubmit: Add new pw format command
- pw format (or pw_presubmit/format_code.py) supports checking and
  fixing the format of Python, C/C++, GN, and Go code.
- Move code format presubmit checks into format_code.py.
- Accept paths not in a Git repository for pw format.
- Add an explicit check that pw presubmit is run from a Git repo.

Change-Id: I74bf54057bd5ace70a90271f7d1343711455792a
2019-12-05 09:31:11 -08:00
Wyatt Hepler
c18f4b28d7 presubmit: Make pw_presubmit a package and plugin
- Organize pw_presubmit as a Python package.
- Move presubmit.py to into the package as pigweed_presubmit.py.
- Set up pigweed_presubmit.py to run whether the pw_presubmit package is
  installed or not.

Change-Id: Id85937971d554332ab7d4adfd668eeafa6379976
2019-12-02 22:00:40 +00:00