Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feature(xtask): git integration for formatter codegen #2116

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Feb 16, 2022

Summary

This is a followup to #2031 and QoL improvement related to #1997:

  • It removes the now-unused migration code from the old folder structure to the new
  • The formatter codegen is now integrated with git and will automatically stage modified files, as well as avoid to overwrite files that have uncommitted modifications by default (can be overridden with the --allow-staged and --allow-dirty CLI flags)
  • Rust files that are no longer imported into the auto-generated module tree are now automatically removed

@github-actions
Copy link

Parser conformance results on ubuntu-latest

T262

Test result main count This PR count Difference
Total 45250 45250 0
Passed 44130 44130 0
Failed 1120 1120 0
Panics 0 0 0
Coverage 97.52% 97.52% 0.00%

TS

Test result main count This PR count Difference
Total 15976 15976 0
Passed 11920 11920 0
Failed 4056 4056 0
Panics 0 0 0
Coverage 74.61% 74.61% 0.00%

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

In Rome classic we had already something to deal with repos: https://github.com/rome/tools/blob/archived-js/internal/vcs/index.ts

And our CLI had a --allow-dirty when using format or lint or other commands. I think we can safely create a new crate called rome_vsc and have your new code moved there.

This will be useful for cases like: running rome auto-config

@MichaReiser
Copy link
Contributor

In Rome classic we had already something to deal with repos: https://github.com/rome/tools/blob/archived-js/internal/vcs/index.ts

And our CLI had a --allow-dirty when using format or lint or other commands. I think we can safely create a new crate called rome_vsc and have your new code moved there.

This will be useful for cases like: running rome auto-config

I recommend moving the code once it is needed because that would also require better error handling that isn't required for the codegen use case.

Thanks @leops for these improvements. I love that it now detects no longer needed fails. I always had to be extra careful when changing the AST to make sure I delete any no longer needed files manually. That was hard, my brain isn't good at these kind of tasks :D

@ematipico ematipico merged commit 57bb046 into main Feb 16, 2022
@ematipico ematipico deleted the feature/codegen-git branch February 16, 2022 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants