Skip to content

Instantly share code, notes, and snippets.

@EricCousineau-TRI
Last active December 17, 2021 20:15
Show Gist options
  • Save EricCousineau-TRI/611327fabba051e869966f3b3883cb45 to your computer and use it in GitHub Desktop.
Save EricCousineau-TRI/611327fabba051e869966f3b3883cb45 to your computer and use it in GitHub Desktop.
# Contains configuration settings for linting Python.
[tool.isort]
# Configuration file for `isort`.
#
# Invocation:
#
# cd {project}
# isort ./my_subdir
#
# For more information:
# - https://timothycrosley.github.io/isort/
# - (Permalink) https://github.com/timothycrosley/isort/blob/5.1.3/README.md
# Based on `profile = black`, but with customizations.
force_grid_wrap = false
force_sort_within_sections = true
honor_noqa = true
include_trailing_comma = true
multi_line_output = 3 # Vertical Hanging Indent
use_parentheses = true
# We turn this off because we want symbols like LCM to be simple sorted.
order_by_type = false
case_sensitive = true
# [ Sections ]
# See: https://github.com/timothycrosley/isort#custom-sections-and-ordering
# This determines the ordering of imports.
sections = [
# {builtin}
"FUTURE",
# known_preload
"PRELOAD",
# {builtin} + extra_standard_library
"STDLIB",
# known_third_party
"THIRDPARTY",
# known_drake
"DRAKE",
# known_first_party
"FIRSTPARTY",
# {builtin}
"LOCALFOLDER",
]
default_section = "THIRDPARTY"
extra_standard_library = [
# This is necessary for Python 3.6 (py36).
"dataclasses",
]
known_preload = [
]
known_third_party = [
# N.B. We need this because `wandb` will add junk folders, and we should
# explicitly ignore them.
"wandb",
]
known_drake = [
"drake",
"pydrake",
]
known_first_party = [
"my_project",
]
[tool.black]
line-length = 79
target-version = ['py36']
include = '\.pyi?$'
exclude = '''
(
/(
| \.git # root of the project
| \.mypy_cache
| \.tox
| \.venv
| build
| \bazel-.*
)
)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment