From 441bf8f7eef52fd0b71cf1961cf7aedec9814d99 Mon Sep 17 00:00:00 2001 From: Jules Tamagnan Date: Wed, 17 Feb 2021 12:32:23 -0800 Subject: [PATCH] Improve autoformatting documentation --- README.md | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 43741a1..aa37f58 100644 --- a/README.md +++ b/README.md @@ -67,14 +67,42 @@ The two main autoformatters that we use are - `black`: General Python formatting - `isort`: Import sorting -## Statement of Support - -This software is provided as-is, without warranty of any kind or -commercial support through Delphix. See the associated license for -additional details. Questions, issues, feature requests, and -contributions should be directed to the community as outlined in the -[Delphix Community -Guidelines](https://delphix.github.io/community-guidelines.html). +## Running the formatting + +The formatting is automatically run remotely on every Github pull +request and on every push to Github. + +It is possible to run these locally in two ways. Automatically before +every push and manually. + +To have the checks run automatically before every push you can enable +`pre-commit`. + +``` +tox +.tox/format/bin/pre-commit install --hook-type pre-push +``` + +To run the checks manually: +On the entire repository +``` + tox -- --all-files +``` +on a specific file +``` + tox -- --file +``` +On every file in the most recent commit +``` + git diff-tree --no-commit-id --name-only -r HEAD | xargs tox -- --files +``` + +## Something neat worth noting + +Each of the scripts leverage +[docopt](https://github.com/docopt/docopt), which is a great module +for parsing POSIX compliant help documentation as arguments. It's +really awesome. ## License