From 7d67109ca2ed7422cebe4a70f4c2d114634eb33c Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 10 Oct 2023 10:57:35 -0700 Subject: [PATCH] python,misc: Add `isort` to pre-commit Change-Id: I391a8948f0817bd5c6a9fe8a4c3e4fed07a98c49 --- .pre-commit-config.yaml | 4 ++++ pyproject.toml | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index debad8cc6a..5183f38110 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,6 +68,10 @@ repos: - id: check-symlinks - id: destroyed-symlinks - id: requirements-txt-fixer + - repo: https://github.com/PyCQA/isort + rev: 5.11.5 + hooks: + - id: isort - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3 hooks: diff --git a/pyproject.toml b/pyproject.toml index a06d464de7..d32cf5f06b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,12 @@ [tool.black] line-length = 79 include = '\.pyi?$' +[tool.isort] +profile = "black" +multi_line_output = 3 +line_length = 79 +force_grid_wrap = 2 +known_m5 = "m5" +known_underscore_m5 = "_m5,slicc" +known_gem5 = "gem5" +sections="FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,M5,UNDERSCORE_M5,GEM5,LOCALFOLDER"