Skip to content

Commit b2b5c2f

Browse files
committed
Update developer toolset instructions in CONTRIBUTING.md
1 parent 71e8ed8 commit b2b5c2f

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

CONTRIBUTING.md

+8-17
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,12 @@ We want your work to be readable by others; therefore, we encourage you to note
7474

7575
- We encourage the use of Python [f-strings](https://realpython.com/python-f-strings/#f-strings-a-new-and-improved-way-to-format-strings-in-python) where they make the code easier to read.
7676

77-
- Please consider running [__psf/black__](https://github.com/python/black) on your Python file(s) before submitting your pull request. This is not yet a requirement but it does make your code more readable and automatically aligns it with much of [PEP 8](https://www.python.org/dev/peps/pep-0008/). There are other code formatters (autopep8, yapf) but the __black__ formatter is now hosted by the Python Software Foundation. To use it,
78-
79-
```bash
80-
python3 -m pip install black # only required the first time
81-
black .
82-
```
83-
84-
- All submissions will need to pass the test `flake8 . --ignore=E203,W503 --max-line-length=88` before they will be accepted so if possible, try this test locally on your Python file(s) before submitting your pull request.
85-
86-
```bash
87-
python3 -m pip install flake8 # only required the first time
88-
flake8 . --ignore=E203,W503 --max-line-length=88 --show-source
89-
```
77+
- Do not forget that running `pre-commit` checks locally will help you to follow code quality standards.
78+
It will run a set of tools including
79+
[black](https://github.com/psf/black),
80+
[isort](https://github.com/PyCQA/isort),
81+
[mypy](http://mypy-lang.org) and
82+
[flake8](https://flake8.pycqa.org/en/latest/).
9083

9184
- Original code submission require docstrings or comments to describe your work.
9285

@@ -148,15 +141,14 @@ We want your work to be readable by others; therefore, we encourage you to note
148141
starting_value = int(input("Please enter a starting value: ").strip())
149142
```
150143

151-
The use of [Python type hints](https://docs.python.org/3/library/typing.html) is encouraged for function parameters and return values. Our automated testing will run [mypy](http://mypy-lang.org) so run that locally before making your submission.
144+
The use of [Python type hints](https://docs.python.org/3/library/typing.html) is encouraged for function parameters and return values.
145+
Our automated testing will run [mypy](http://mypy-lang.org) so run that locally with pre-commit before making your submission.
152146

153147
```python
154148
def sum_ab(a: int, b: int) -> int:
155149
return a + b
156150
```
157151

158-
Instructions on how to install mypy can be found [here](https://github.com/python/mypy). Please use the command `mypy --ignore-missing-imports .` to test all files or `mypy --ignore-missing-imports path/to/file.py` to test a specific file.
159-
160152
- [__List comprehensions and generators__](https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions) are preferred over the use of `lambda`, `map`, `filter`, `reduce` but the important thing is to demonstrate the power of Python in code that is easy to read and maintain.
161153

162154
- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
@@ -172,7 +164,6 @@ We want your work to be readable by others; therefore, we encourage you to note
172164
- If you have modified/added documentation work, ensure your language is concise and contains no grammar errors.
173165
- Do not update the README.md or DIRECTORY.md file which will be periodically autogenerated by our GitHub Actions processes.
174166
- Add a corresponding explanation to [Algorithms-Explanation](https://github.com/TheAlgorithms/Algorithms-Explanation) (Optional but recommended).
175-
- All submissions will be tested with [__mypy__](http://www.mypy-lang.org) so we encourage you to add [__Python type hints__](https://docs.python.org/3/library/typing.html) where it makes sense to do so.
176167

177168
- Most importantly,
178169
- __Be consistent in the use of these guidelines when submitting.__

0 commit comments

Comments
 (0)