diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c260035646da..6917282012a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -233,6 +233,10 @@ To maintain the quality of the documentation, the following two facilities are p TSDoc specifications can be customized using the `tsdoc.json` configuration file that can be found in the root of the repository. Currently, the `@hidden` tag is used which is only supported by TypeDoc and is not a TSDoc tag, so it is added as a custom tag in `tsdoc.json`. +### Formatting changed files + +We used to have a git hook that formats your changed files on commit but it was removed because it did not work well for some people for various reasons. If you would like to enable it in your fork, you will need to just revert this [PR](https://github.com/Azure/azure-sdk-for-js/pull/13982/) in your branch and then run `rush update` so the hook script gets copied into `.git/hooks`. Moreover, without the hook, you can manually format changed files by invoking `rush prettier`. + ## Onboarding a new library All libraries must follow our [repository structure](https://github.com/Azure/azure-sdk/blob/master/docs/policies/repostructure.md) (specifically, it must be located at `sdk//`) and your library's `package.json` must contain the required scripts as documented [above](#other-npm-scripts). diff --git a/common/git-hooks/pre-commit b/common/git-hooks/pre-commit deleted file mode 100644 index 9a9ad0ae93d6..000000000000 --- a/common/git-hooks/pre-commit +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. - -# Invoke the "rush prettier" custom command to reformat files whenever they -# are committed. The command is defined in common/config/rush/command-line.json -# and uses the "rush-prettier" autoinstaller. - -echo -------------------------------------------- -echo Starting Git hook: pre-commit - -MERGE=$(git rev-parse -q --verify MERGE_HEAD) - -if [ ! -z ${MERGE} ]; then - echo "This is a merge.... Skipping prettying" - exit -fi - -node common/scripts/install-run-rush.js prettier || exit $? - -echo Finished Git hook: pre-commit -echo --------------------------------------------