atxtechbro / atxtechbro/dotfiles

Sort Python imports throughout repository according to PEP 8 standard

Open
#845 3 comments 0 reactions 0 assignees View on GitHub
Amazon Q transform agent code-quality enhancement python
Dominant language
Shell
Stars
27
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Problem
Python imports throughout the repository are not consistently sorted according to PEP 8 standards, which affects code readability and maintainability.

## PEP 8 Import Ordering Standard
Imports should be grouped in the following order with blank lines between groups:

1. **Standard library imports** (built-in modules like `os`, `sys`, `logging`)
2. **Related third party imports** (installed packages like `git`, `pydantic`)
3. **Local application/library specific imports** (relative imports, local modules)

Within each group, imports should be sorted alphabetically.

## Current Issues
- Mixed ordering of standard library and third-party imports
- Missing blank lines between import groups
- Inconsistent alphabetical sorting within groups

## Example
**Before:**
```python
import logging
from enum import Enum
from pathlib import Path
from typing import Sequence

import git
from pydantic import BaseModel

from mcp.server import Server
```

**After:**
```python
import logging
import os
from enum import Enum
from pathlib import Path
from typing import Sequence

import git
from pydantic import BaseModel

from mcp.server import Server
```

## Scope
Apply PEP 8 import sorting to all Python files in:
- `mcp/servers/*/` - MCP server implementations
- `utils/` - Utility scripts
- Any other Python files in the repository

## Implementation Options
1. **Manual sorting** - Review and fix imports by hand
2. **Tool automation** - Use `isort` or similar tool to automatically sort imports
3. **Pre-commit hook** - Add import sorting to the development workflow

## Benefits
- Improved code readability
- Consistent codebase style
- Easier code review process
- Better developer experience

## Priority
Low - code quality improvement, no functional impact

Contributor guide

No contributing guide indexed for this repository

Research direction

Inventory the Python files under mcp/servers/*/, utils/, and elsewhere in the repository, then review their import groups against the PEP 8 ordering described in the issue. Consider the listed manual, automation, and pre-commit options; done means the repository’s Python imports are consistently grouped and alphabetically sorted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.