From 6e3fb53d88aa87eb309410e6fc930c2d3659da00 Mon Sep 17 00:00:00 2001 From: Jason Ng <116290832+jason490@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:53:51 -0500 Subject: [PATCH] [Documentation:Developer] Added python black formatter option (#561) Added option to developers to use black formatter to automate formatting python code --- _docs/developer/testing/linting_static_analysis.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/_docs/developer/testing/linting_static_analysis.md b/_docs/developer/testing/linting_static_analysis.md index e56e2865..fa839ddf 100644 --- a/_docs/developer/testing/linting_static_analysis.md +++ b/_docs/developer/testing/linting_static_analysis.md @@ -36,6 +36,18 @@ python3 -m flake8 bin/generate_repos.py python3 -m pylint bin/generate_repos.py ``` +If you wish to automatically fix the basic linting problems, you can use [black formatter](https://github.com/psf/black): +```bash +# install black formatter +pip install git+https://github.com/psf/black + +# formats all the files in that directory +black ./files/location/ + +# formats specified file +black ./location/file.py +``` + See also: [Python Style Guide](/developer/coding_style_guide/python) ## PHP Linting