Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt user to "config migrate" during init process #1409

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brynary
Copy link
Member

@brynary brynary commented Jan 7, 2025

WIP, but the airplane is landing. If a .codeclimate.yml file exists in the working directory, ask the user if they would like to migrate the Code Climate config into the qlty.toml config (default to yes).

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

qltysh bot commented Jan 7, 2025

Diff Coverage: The code coverage on the diff in this pull request is 0.0%.

Total Coverage: This PR will decrease coverage by 0.06%.

File Coverage Changes
Path File Coverage Δ Indirect
qlty-config/src/library.rs -0.5
qlty-cli/src/commands/init.rs -1.5
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Copy link
Contributor

qltysh bot commented Jan 29, 2025

❌ 1 blocking issue (1 total)

Tool Category Rule Count
clippy Lint this `if` statement can be collapsed 1

qlty successfully analyzed this pull request in 5m.

qlty-cli/src/commands/init.rs Outdated Show resolved Hide resolved
Add functionality to detect and migrate existing .codeclimate.yml
configurations during qlty initialization. The migration:
- Detects existing .codeclimate.yml in project root
- Prompts user for migration confirmation (respects --yes/--no flags)
- Executes migration using 'qlty config migrate'
- Provides success feedback to user

This helps users transition from CodeClimate to qlty while preserving
their existing configurations.
qlty-cli/src/commands/init.rs Outdated Show resolved Hide resolved
@larkinscott larkinscott marked this pull request as ready for review January 30, 2025 21:52
Comment on lines +284 to +305
if classic_config_path.exists() {
if !self.no
&& (self.yes
|| Confirm::with_theme(&ColorfulTheme::default())
.with_prompt(
"Would you like to migrate your .codeclimate.yml configuration?",
)
.default(true)
.show_default(true)
.interact()?)
{
let migration_settings = MigrationSettings::new(
&workspace.root,
workspace.config()?,
&workspace.config_path()?,
&classic_config_path,
self.dry_run,
)?;

MigrateConfig::new(migration_settings)?.migrate()?;
self.print_check("Migrated .codeclimate.yml configuration");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this if statement can be collapsed [clippy:collapsible_if]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants