Skip to content

Commit 8a6c98e

Browse files
committed
added linters in python good practices
1 parent e1e8054 commit 8a6c98e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/data_science_tools/python_good_practices.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ Returns
207207
- Frankly, I am only going to touch this topic with a long stick 🧹. There are already several [articles](https://softwareengineering.stackexchange.com/questions/57/tabs-versus-spaces-what-is-the-proper-indentation-character-for-everything-in-e), [reddit threads](https://www.reddit.com/r/learnpython/comments/8cann8/tabs_vs_spaces_i_dont_get_it/) and even tv series (Silicon valley 📺) where this topic has been discussed a lot!
208208
- Want my 2 cents? Pick any modern IDE *(like VSCode, Sublime, etc)*, set indentations to tabs, and set 1 tab = 4 spaces. Done 😏
209209

210+
### Linters
211+
212+
- Linters are tools that analyze your code to detect various types of errors. They can help you to maintain a consistent coding style and avoid common programming errors. Python has several linters available, like [pylint](https://www.pylint.org/), [flake8](https://flake8.pycqa.org/en/latest/), [pydocstyle](https://www.pydocstyle.org/en/stable/), etc. Using them is super easy, say for `pylint` - you can install it using `pip install pylint` and run using `pylint my_module.py`. That's it!
213+
- If you are using VSCode, you can install the `Python` extension by Microsoft, which comes with inbuilt linter support. Or you can install fast linters *(using VSCode extension)* like [Ruff](https://github.com/astral-sh/ruff) which is upto 10-100x faster than Flake8 and Black.
214+
210215
## Additional tips
211216

212217
- Till now we have discussed how to either structure the project or format the code. Next, we will cover a generic set of good practices which will save you some pain down the line 😬

0 commit comments

Comments
 (0)