Linter to follow Style Guide for Python Code - PEP8
This is a linter for python code.
Python has PEP-8 as the Style Standard for coding you can read more about it Python Software Foundation.
A code that follows a style is easier to read.
I decided to build this linter because Python is one of the most popular languages, personally I use it to make automatization with Raspberry Pi and web applications with Django
The coolest feature about this linter are the colors, I used some of the code posted here Colorize Console
The most valuable tool to build this linter was use regular expressions or Regex I used the info posted here in Rubular
This linter works for Python .py and Ruby .rb files.
It flags the following errors:
./bin/main.rb [PATH_WHERE_YOU_CLONED_THIS]/pep8-linter/samples
File: /py_code_1.py
File: /py_code_2.py
line: 6, col: 2: rule: erase unnecessary spaces before line terminator.
line: 6, col: 1: rule: unexpected indentation.
line: 13, col: 10: rule: there should be a line terminator on last line.
./bin/main.rb -r [PATH_WHERE_YOU_CLONED_THIS]/pep8-linter/samples
File: /rb_code_1.rb
line: 1, col: 22: rule: erase unnecessary spaces before line terminator
line: 1, col: 1: rule: indentation should use 2 spaces
line: 2, col: 32: rule: erase unnecessary spaces before line terminator
line: 3, col: 4: rule: indentation should use 2 spaces
line: 4, col: 8: rule: indentation should use 2 spaces
line: 6, col: 8: rule: indentation should use 2 spaces
line: 8, col: 5: rule: there should be a line terminator on last line
File: /rb_code_2.rb
👤 Franco Rosa
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.