diff --git a/Makefile b/Makefile index c9f7256f17f4..87c89eb56787 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,9 @@ deps_upgrade_project: .state/docker-build-base translations: .state/docker-build-base docker compose run --rm base bin/translations +patch: .state/docker-build-base + docker compose run --rm base bin/patch + requirements/%.txt: requirements/%.in docker compose run --rm base pip-compile --generate-hashes --output-file=$@ $< @@ -266,4 +269,4 @@ codeql-test: .state/codeql-packs codeql-clean: rm -rf dev/codeql .state/codeql-db .state/codeql-packs .state/codeql-cli -.PHONY: default build serve resetdb initdb shell dbshell tests dev-docs user-docs deps deps_upgrade_all deps_upgrade_project clean purge debug stop compile-pot runmigrations checkdb codeql codeql-db codeql-rebuild codeql-analyze codeql-test codeql-clean +.PHONY: default build serve resetdb initdb shell dbshell tests dev-docs user-docs deps deps_upgrade_all deps_upgrade_project clean purge debug stop compile-pot runmigrations checkdb codeql codeql-db codeql-rebuild codeql-analyze codeql-test codeql-clean patch diff --git a/bin/patch b/bin/patch new file mode 100755 index 000000000000..f5cd0829978f --- /dev/null +++ b/bin/patch @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -ex + + +# NOTE: The ordering of these is important! +# NOTE: We do this as by composing the scripts rather than composing the make +# targets so that they can all run in the same docker container and we +# dont end up spinning up N docker containers. + +# We reformat first, as this can automatically fix some of the issues that +# linting catches. +bin/reformat + +# Then we lint, because if there are any remaining issues, we want to catch them +# before doing anything else because fixing them may change line numbers so the +# later steps may not be valid after the fix anyways. +bin/lint + +# Then we extract our translatable strings, this embeds line numbers of where it +# finds theose strings, so this comes last because if the above changes the +# line numbers at all, this would need to be re-ran. +bin/translations diff --git a/docs/dev/development/getting-started.md b/docs/dev/development/getting-started.md index ee25a35bdd1b..261a3383440b 100644 --- a/docs/dev/development/getting-started.md +++ b/docs/dev/development/getting-started.md @@ -705,6 +705,13 @@ This is useful in scenarios like passing a TESTARGS="--randomly-seed=1234" make tests ``` +You can run the common tools (formaters, linting, translations) to make sure +that a patch is ready by running: + +```shell +make patch +``` + You can run linters, programs that check the code, with: ```shell