summaryrefslogtreecommitdiff
path: root/doc/source/dev
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/dev')
-rw-r--r--doc/source/dev/development_environment.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/source/dev/development_environment.rst b/doc/source/dev/development_environment.rst
index 013414568..fb1b8cd6a 100644
--- a/doc/source/dev/development_environment.rst
+++ b/doc/source/dev/development_environment.rst
@@ -188,6 +188,35 @@ For more extensive information, see :ref:`testing-guidelines`
*Note: do not run the tests from the root directory of your numpy git repo without ``runtests.py``,
that will result in strange test errors.*
+Running Linting
+---------------
+Lint checks can be performed on newly added lines of Python code.
+
+Install all dependent packages using pip::
+
+ $ python -m pip install -r linter_requirements.txt
+
+To run lint checks before committing new code, run::
+
+ $ python runtests.py --lint uncommitted
+
+To check all changes in newly added Python code of current branch with target branch, run::
+
+ $ python runtests.py --lint main
+
+If there are no errors, the script exits with no message. In case of errors::
+
+ $ python runtests.py --lint main
+ ./numpy/core/tests/test_scalarmath.py:34:5: E303 too many blank lines (3)
+ 1 E303 too many blank lines (3)
+
+It is advisable to run lint checks before pushing commits to a remote branch
+since the linter runs as part of the CI pipeline.
+
+For more details on Style Guidelines:
+
+ - `Python Style Guide`_
+ - `C Style Guide`_
Rebuilding & cleaning the workspace
-----------------------------------
@@ -264,6 +293,8 @@ typically packaged as ``python-dbg``) is highly recommended.
.. _virtualenvwrapper: http://www.doughellmann.com/projects/virtualenvwrapper/
.. _Waf: https://code.google.com/p/waf/
.. _`match test names using python operators`: https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests
+.. _`Python Style Guide`: https://www.python.org/dev/peps/pep-0008/
+.. _`C Style Guide`: https://numpy.org/neps/nep-0045-c_style_guide.html
Understanding the code & getting started
----------------------------------------