Skip to content

Python style checker with Norminette-like output. Wraps Flake8 for 42 school students.

License

Notifications You must be signed in to change notification settings

Sbgodin/pyminette

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Pyminette 🐍

Python Norminette - PEP 8 style checker with familiar 42-style output

Python License

Pyminette checks your Python code against PEP 8 style guidelines using Flake8, with an output format familiar to 42 school students.

Why Pyminette?

"But VS Code has a Flake8 extension..."

True! But:

  • Universal: Works with any editor (Vim, Emacs, nano, VS Code)
  • Fast: Check multiple files instantly with pyminette .
  • Portable: No IDE required, works on SSH sessions
  • Scriptable: Perfect for Git hooks and CI/CD
  • Familiar: Same UX as 42's Norminette
  • Educational: Learn by building tools, not just using them

TL;DR: IDE linters are great for coding. Pyminette is great for validation, automation, and portability.

Installation

Quick Install

git clone https://github.com/tthouven/pyminette.git
pip install flake8

Manual Install

git clone https://github.com/tthouven/pyminette.git
cd pyminette
pip install flake8
python3 pyminette.py

Usage

# Check specific files (searched recursively in parent directory)
python3 pyminette.py file1.py file2.py

# Check all .py files in parent directory (auto-discovery)
python3 pyminette.py

Output Example

✅ Clean code

ex0/ft_hello_garden.py: OK!
ex1/ft_plot_area.py: OK!

❌ Code with errors

src/bad_style.py: Error!
Error: F401                     (line:   1, col:   1): 'os' imported but unused
Error: E302                     (line:   5, col:   1): expected 2 blank lines, found 0
Error: E501                     (line:   4, col:  80): line too long (111 > 79 characters)

Features

  • Check specific files or auto-discover all .py files
  • Recursive file search from parent directory (args and auto-discovery)
  • Clean relative paths in output
  • Norminette-style output with color-coded results
  • Validates .py extension
  • Excludes itself from auto-scan
  • Checks flake8 installation before running

Requirements

  • Python 3.10+
  • Flake8

Compatibility

  • ✅ Linux (bash/zsh/sh)
  • ✅ macOS (bash/zsh)
  • ✅ WSL
  • ✅ No sudo required

Why I Built This

"I'm learning to code."

This project taught me:

  • Subprocess integration and system calls
  • Output parsing and text processing
  • CLI tool architecture
  • Cross-platform compatibility
  • Installation and distribution

Using tools is easy. Building them is how you learn.

Resources

Documentation

AI Usage

AI was used to:

  • Understand Python concepts and best practices
  • Debug and troubleshoot issues
  • Explore design choices and architecture decisions

Contributing

This is a personal learning project, but suggestions and feedback are welcome!

License

MIT License - feel free to use, modify, and share.

Author

Tristan Thouvenot - 42 Luxembourg
GitHub: tthouven (https://github.com/tthouven)


"Because why just use tools when you can build them?" 🛠️

About

Python style checker with Norminette-like output. Wraps Flake8 for 42 school students.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%