From 79072f76d8aa9b84e92e7d4ed97fca830fc8375b Mon Sep 17 00:00:00 2001 From: Deimos Date: Tue, 3 Nov 2020 18:09:36 -0700 Subject: [PATCH] Rename invoke tasks to standardize format I think this is going to be a better way to name invoke tasks. The previous naming where a verb was often first made it much harder for anyone to figure out the name of a task that affects a certain thing without always looking through the entire list. For example, if someone is looking for a task that affects the web server, it's much easier to find web-server-reload than reload-web-server. The changes were: - check-code-style -> code-style-check - reload-web-server -> web-server-reload - renew-tls-certificate -> tls-certificate-renew - type-checking -> type-check - update-pip-requirements -> pip-requirements-update --- git_hooks/pre-commit | 2 +- git_hooks/pre-push | 2 +- tildes/tasks.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit index 6405fa4..5a83dbe 100755 --- a/git_hooks/pre-commit +++ b/git_hooks/pre-commit @@ -3,4 +3,4 @@ # Pre-commit hook script that ensures type-checking, tests, and fast style checks pass vagrant ssh -c ". activate \ - && invoke type-checking test --quiet check-code-style" + && invoke type-check test --quiet code-style-check" diff --git a/git_hooks/pre-push b/git_hooks/pre-push index 6595902..168d670 100755 --- a/git_hooks/pre-push +++ b/git_hooks/pre-push @@ -3,4 +3,4 @@ # Pre-push hook script that ensures all tests and code checks pass vagrant ssh -c ". activate \ - && invoke type-checking test --quiet --full check-code-style --full" + && invoke type-check test --quiet --full code-style-check --full" diff --git a/tildes/tasks.py b/tildes/tasks.py index 8b90925..0ea2f77 100644 --- a/tildes/tasks.py +++ b/tildes/tasks.py @@ -15,7 +15,7 @@ def output(string): @task(help={"full": "Include all checks (very slow)"}) -def check_code_style(context, full=False): +def code_style_check(context, full=False): """Run the various utilities to check code style. By default, runs checks that return relatively quickly. To run the full set of @@ -38,7 +38,7 @@ def check_code_style(context, full=False): @task -def reload_web_server(context): +def web_server_reload(context): """Reload the web server, in order to apply config updates.""" context.run("sudo systemctl reload nginx.service") @@ -48,9 +48,9 @@ def reload_web_server(context): "domain": "Domain to obtain a cert for (can be specified multiple times)", }, iterable=["domain"], - post=[reload_web_server], + post=[web_server_reload], ) -def renew_tls_certificate(context, domain, wildcard=True): +def tls_certificate_renew(context, domain, wildcard=True): """Renew the TLS certificate for the specified domain(s).""" if not domain: raise Exit("No domains specified") @@ -128,14 +128,14 @@ def shell(context): @task -def type_checking(context): +def type_check(context): """Run static type checking on the Python code.""" output("Running static type checking... ") context.run("mypy .") @task -def update_pip_requirements(context): +def pip_requirements_update(context): """Use pip-tools to update package versions in the requirements files.""" for filename in ("requirements.in", "requirements-dev.in"):