Skip to content

Commit 27a2718

Browse files
committed
Fix linting issues after copier update
- Remove duplicate frigid import in __/imports.py - Fix import ordering with isort - Fix pyright errors for patiencediff imports
1 parent bb5dea9 commit 27a2718

File tree

7 files changed

+17
-10
lines changed

7 files changed

+17
-10
lines changed

sources/mimeogram/__/imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import typing_extensions as typx
5050
# --- BEGIN: Injected by Copier ---
5151
import dynadoc as ddoc
52-
import frigid as immut
5352
import tyro
5453
# --- END: Injected by Copier ---
5554

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ruff: noqa: F403
22

3-
from .icecream import *
43
from .builtins import *
5-
# from .builtins import install, uninstall
4+
from .icecream import *
5+
6+
# from .builtins import install, uninstall

sources/mimeogram/exceptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
''' Family of exceptions for package API. '''
2222

2323

24-
from . import __
25-
2624
import contextlib as _contextlib
2725
import logging as _logging
2826

2927
import exceptiongroup as _exceptiongroup
3028

29+
from . import __
30+
31+
3132
class Omniexception( __.immut.exceptions.Omniexception ):
3233
''' Base for all exceptions raised by package API. '''
3334

sources/mimeogram/interactions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
async def _display_content( target: _parts.Target, content: str ) -> None:
3030
''' Displays content in system pager. '''
3131
from .display import display_content
32+
3233
# Suffix from location for proper syntax highlighting.
3334
suffix = __.Path( target.part.location ).suffix or '.txt'
3435
display_content( content, suffix = suffix )
@@ -61,6 +62,7 @@ async def _display_differences(
6162
async def _edit_content( target: _parts.Target, content: str ) -> str:
6263
''' Edits content in system editor. '''
6364
from .edit import edit_content
65+
6466
# Suffix from location for proper syntax highlighting.
6567
suffix = __.Path( target.destination ).suffix or '.txt'
6668
return edit_content( content, suffix = suffix )
@@ -70,6 +72,7 @@ def _prompt_action(
7072
target: _parts.Target, content: str, protect: bool
7173
) -> str:
7274
from readchar import readkey
75+
7376
from .exceptions import UserOperateCancellation
7477
menu = _produce_actions_menu( target.part, content, protect )
7578
print( f"\n{menu} > ", end = '' )
@@ -153,8 +156,8 @@ def _calculate_differences(
153156
original: __.Absential[ str ] = __.absent,
154157
) -> list[ str ]:
155158
''' Generates unified diff between contents. '''
156-
from patiencediff import (
157-
unified_diff, PatienceSequenceMatcher ) # pyright: ignore
159+
from patiencediff import PatienceSequenceMatcher # pyright: ignore
160+
from patiencediff import unified_diff # pyright: ignore
158161
from_lines = (
159162
original.split( '\n' ) if not __.is_absent( original ) else [ ] )
160163
to_lines = revision.split( '\n' )

tests/test_000_mimeogram/test_210_formatters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
''' Tests for formatters module. '''
2222

2323

24-
import pytest
2524
import re
2625

26+
import pytest
27+
2728
from . import PACKAGE_NAME, cache_import_module
2829

2930

tests/test_000_mimeogram/test_500_acquirers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
''' Tests for content acquisition module. '''
2222

2323

24-
import exceptiongroup
2524
import os
2625
import sys
2726

27+
import exceptiongroup
2828
import pytest
2929

3030
from . import (
@@ -39,6 +39,7 @@
3939
def provide_auxdata( provide_tempdir, provide_tempenv ):
4040
''' Provides test auxiliary data. '''
4141
import accretive as accret
42+
4243
from platformdirs import PlatformDirs
4344

4445
__ = cache_import_module( f"{PACKAGE_NAME}.__" )

tests/test_000_mimeogram/test_510_updaters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
from pathlib import Path
2828
from unittest.mock import patch
2929

30+
import accretive as accret
3031
import pytest
3132

32-
import accretive as accret
3333
from exceptiongroup import ExceptionGroup
3434

3535
from . import (
@@ -77,6 +77,7 @@ def provide_test_interactor( ):
7777
def produce_mock_auxdata( config = None ):
7878
''' Creates a mock Globals object for testing. '''
7979
from contextlib import AsyncExitStack
80+
8081
from platformdirs import PlatformDirs
8182

8283
__ = cache_import_module( f"{PACKAGE_NAME}.__" )

0 commit comments

Comments
 (0)