Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to Refactron will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.13] - 2026-01-29
## [1.0.14] - 2026-01-30

### Changed
- Refactored CLI startup sequence to display animation before authentication prompt.
- Improved dependency management (added `astroid`).
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency addition note is somewhat vague. Since astroid is added to pyproject.toml and requirements.txt but isn't actually used anywhere in the codebase (based on the diff), it would be helpful to clarify in the CHANGELOG why this dependency is being added. Is it preparation for future work, or is there an implicit need that's not obvious from the code changes?

Suggested change
- Improved dependency management (added `astroid`).
- Added `astroid` as the underlying AST analysis library to support advanced pattern learning and incremental analysis features.

Copilot uses AI. Check for mistakes.

## [1.0.13] - 2026-01-30
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both v1.0.14 and v1.0.13 have the same release date (2026-01-30). This is likely incorrect - consecutive releases typically have different dates. Please verify and update the date for v1.0.13 to reflect its actual release date.

Suggested change
## [1.0.13] - 2026-01-30
## [1.0.13] - 2026-01-29

Copilot uses AI. Check for mistakes.

### Added

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ result.show_diff()
## Development Status


Stable release (v1.0.13). Tested on Python 3.8-3.12.
Stable release (v1.0.14). Tested on Python 3.8-3.12.

- 669 tests, 78% code coverage
- Validated on 10,000+ lines of production code
Expand Down
Empty file added docs/v1.0.13_RELEASE_GUIDE.md
Empty file.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "refactron"
version = "1.0.13"
version = "1.0.14"
description = "Python code analysis and refactoring tool with security scanning, performance detection, and automated fixes"
readme = "README.md"
requires-python = ">=3.8"
Expand Down Expand Up @@ -34,6 +34,7 @@ dependencies = [
"rich>=13.0.0",
"radon>=6.0.0",
"requests>=2.25.0",
"astroid>=3.0.0",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion refactron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from refactron.core.refactor_result import RefactorResult
from refactron.core.refactron import Refactron

__version__ = "1.0.13"
__version__ = "1.0.14"
__author__ = "Om Sherikar"

__all__ = [
Expand Down
79 changes: 44 additions & 35 deletions refactron/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _auth_banner(title: str) -> None:
style="panel.border",
box=box.ROUNDED,
padding=(1, 2),
subtitle="[secondary]v1.0.13[/secondary]",
subtitle="[secondary]v1.0.14[/secondary]",
subtitle_align="right",
)
)
Expand Down Expand Up @@ -736,45 +736,54 @@ def main(ctx: click.Context) -> None:
# Check authentication for all commands except login/logout
exempt_commands = ["login", "logout", "auth"]

if ctx.invoked_subcommand not in exempt_commands:
creds = load_credentials()
is_authenticated = False
if creds and creds.access_token:
now = datetime.now(timezone.utc)
if not creds.expires_at or creds.expires_at > now:
is_authenticated = True
# 1. Pre-check authentication status
creds = load_credentials()
is_authenticated = False
if creds and creds.access_token:
now = datetime.now(timezone.utc)
if not creds.expires_at or creds.expires_at > now:
is_authenticated = True

# 2. Show animation if dashboard mode OR if auth is required and missing
should_show_animation = ctx.invoked_subcommand is None or (
ctx.invoked_subcommand not in exempt_commands and not is_authenticated
)

if not is_authenticated:
# If it's a subcommand, we might want a slightly different message
if ctx.invoked_subcommand:
console.print(
f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]"
if should_show_animation:
_run_startup_animation()

# 3. Handle authentication requirement
if ctx.invoked_subcommand not in exempt_commands and not is_authenticated:
# If it's a subcommand, we might want a slightly different message
if ctx.invoked_subcommand:
console.print(
f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]"
)
else:
console.print(Align.center(Text("\nAuthentication Required", style="bold")))

if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y":
try:
ctx.invoke(
login,
api_base_url=DEFAULT_API_BASE_URL,
no_browser=False,
timeout=300,
force=False,
)
else:
console.print(Align.center(Text("\nAuthentication Required", style="bold")))

if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y":
try:
ctx.invoke(
login,
api_base_url=DEFAULT_API_BASE_URL,
no_browser=False,
timeout=300,
force=False,
)
# Re-check credentials
creds = load_credentials()
if creds and creds.access_token:
is_authenticated = True
except SystemExit:
pass
# Re-check credentials
creds = load_credentials()
if creds and creds.access_token:
is_authenticated = True
except SystemExit:
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except SystemExit:
except SystemExit:
# Intentionally ignore SystemExit from the login command so that
# we can fall through and handle the unauthenticated case below.

Copilot uses AI. Check for mistakes.
pass

if not is_authenticated:
console.print("[dim]Exiting...[/dim]")
raise SystemExit(1)
if not is_authenticated:
console.print("[dim]Exiting...[/dim]")
raise SystemExit(1)

# 4. Handle default command (interactive dashboard)
if ctx.invoked_subcommand is None:
_run_startup_animation()
_run_minimal_loop(ctx)
pass
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an unnecessary pass statement at the end of the main function. Since the function already has substantive code, this pass statement serves no purpose and should be removed for cleaner code.

Suggested change
pass

Copilot uses AI. Check for mistakes.

Expand Down
Loading