Skip to content

adamghill/woof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

woof

Checks or formats Python files according to some arbitrary blank line formatting rules that are not possible with ruff.

Usage

# Show diff without modifying the file
uvx --from git+https://github.com/adamghill/woof woof format file.py --diff

# Format a file in place
uvx --from git+https://github.com/adamghill/woof woof format file.py

# Recursively format all Python files in the current directory
find . -name "*.py" | xargs -I{} uvx --from git+https://github.com/adamghill/woof woof format {}

# Check if a file is already formatted (non-zero exit if not)
uvx --from git+https://github.com/adamghill/woof woof check file.py

# Recursively check all Python files in the current directory
find . -name "*.py" | xargs -I{} uvx --from git+https://github.com/adamghill/woof woof check {}

Rules

  • Docstrings — adds a blank line after function docstrings
  • Return/Yield — adds a blank line before return and yield statements
  • Block statements — adds a blank line before if, for, while, with, try, and match blocks (when not the first statement in a function)

License

MIT

About

Re-format Python according to some arbitrary formatting rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors