From 4121f9ea304a47ba51fc99a70e5e8d5cde197126 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 12 Jul 2024 10:14:44 +0300 Subject: [PATCH] Start using isort --- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 1 + python/taitotalo/muodosta-parityo-parit.py | 6 +++--- python/taitotalo/turtle-suomenlippu.py | 3 +-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84cef79..a1a3ae6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,6 +69,12 @@ repos: hooks: - id: add-trailing-comma + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + name: isort (python) + - repo: https://github.com/psf/black rev: 24.4.2 hooks: diff --git a/pyproject.toml b/pyproject.toml index b6cdab9..e62db5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,5 +28,6 @@ disable = ["W0511"] # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html +# isort [tool.isort] profile = "black" diff --git a/python/taitotalo/muodosta-parityo-parit.py b/python/taitotalo/muodosta-parityo-parit.py index 1447796..a14733f 100644 --- a/python/taitotalo/muodosta-parityo-parit.py +++ b/python/taitotalo/muodosta-parityo-parit.py @@ -2,12 +2,12 @@ Sovellus tekee listasta pareja """ -# Tuodaan paketti tabulate. -import tabulate - # Tarvitaan parien muodostamiseen import random +# Tuodaan paketti tabulate. +import tabulate + # Määritetään pääfunktio def main(): diff --git a/python/taitotalo/turtle-suomenlippu.py b/python/taitotalo/turtle-suomenlippu.py index 6a1177f..a0790b2 100644 --- a/python/taitotalo/turtle-suomenlippu.py +++ b/python/taitotalo/turtle-suomenlippu.py @@ -1,8 +1,7 @@ # Tuodaan turtle -kirjasto -import turtle - # Satunnaislukuja import random +import turtle # ikkkuna = turtle.Screen()