Timple / ament_black

Python auto formatting tool ament package
Apache License 2.0
5 stars 5 forks source link

Support *.pyi files and allow a TOML config file to be specified #2

Closed asymingt closed 2 years ago

asymingt commented 2 years ago

This updates ament_black in two ways:

  1. It lints *.pyi files in addition to *.py files.
  2. It allows you to specify a --config file for your project.

The config file is a TOML file, which allows you to change things like target python version and default line length, More information can be found here: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file

Here's an example config file that applies stable checks for python3.8 and enforces a 100 character line limit:

[tool.black]
line-length = 100
target-version = ['py38']
include = '\.pyi?$'
preview = false
asymingt commented 2 years ago

@Timple -- any chance you can give this a review?