Skip to content

feat: integrate autoformatting in WriteFile and EditFile commands #273

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

Closed
wants to merge 4 commits into from

Conversation

ezyang
Copy link
Owner

@ezyang ezyang commented Apr 27, 2025

Stack from ghstack (oldest at bottom):

We're going to integrate autoformatting into the WriteFile and EditFile commands. After doing the file write with these commands, run the "format" command (as defined by RunCommand) if it exists. You should NOT run the pre/post commit associated with RunCommand (because the formatting should be directly integrated with the edit/write), so make sure you hook into the run command infrastructure at the correct spot.

3f698ba  (Base revision)
c56fb59  Add run_formatter_without_commit to __all__
3a9183d  Add run_formatter_without_commit function to format a specific file without commit operations
13c9c8d  Add run_formatter_without_commit import to write_file.py
d5459f2  Add autoformatting to write_file_content function
4d419ac  Add run_formatter_without_commit import to edit_file.py
2ac534f  Add autoformatting to edit_file_content function
77cf162  Improve run_formatter_without_commit to handle different formatter types
HEAD     Auto-commit format changes

codemcp-id: 280-feat-integrate-autoformatting-in-writefile-and-edi

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Apr 27, 2025
We're going to integrate autoformatting into the WriteFile and EditFile commands. After doing the file write with these commands, run the "format" command (as defined by RunCommand) if it exists. You should NOT run the pre/post commit associated with RunCommand (because the formatting should be directly integrated with the edit/write), so make sure you hook into the run command infrastructure at the correct spot.

```git-revs
3f698ba  (Base revision)
c56fb59  Add run_formatter_without_commit to __all__
3a9183d  Add run_formatter_without_commit function to format a specific file without commit operations
13c9c8d  Add run_formatter_without_commit import to write_file.py
d5459f2  Add autoformatting to write_file_content function
4d419ac  Add run_formatter_without_commit import to edit_file.py
2ac534f  Add autoformatting to edit_file_content function
77cf162  Improve run_formatter_without_commit to handle different formatter types
HEAD     Auto-commit format changes
```

codemcp-id: 280-feat-integrate-autoformatting-in-writefile-and-edi
ghstack-source-id: 5815be4
Pull-Request-resolved: #273
[ghstack-poisoned]
ezyang added a commit that referenced this pull request Apr 27, 2025
We're going to integrate autoformatting into the WriteFile and EditFile commands. After doing the file write with these commands, run the "format" command (as defined by RunCommand) if it exists. You should NOT run the pre/post commit associated with RunCommand (because the formatting should be directly integrated with the edit/write), so make sure you hook into the run command infrastructure at the correct spot.

```git-revs
3f698ba  (Base revision)
c56fb59  Add run_formatter_without_commit to __all__
3a9183d  Add run_formatter_without_commit function to format a specific file without commit operations
13c9c8d  Add run_formatter_without_commit import to write_file.py
d5459f2  Add autoformatting to write_file_content function
4d419ac  Add run_formatter_without_commit import to edit_file.py
2ac534f  Add autoformatting to edit_file_content function
77cf162  Improve run_formatter_without_commit to handle different formatter types
2bffaf4  Auto-commit format changes
HEAD     Replace code_command.py with a simplified implementation of run_formatter_without_commit
```

codemcp-id: 280-feat-integrate-autoformatting-in-writefile-and-edi
ghstack-source-id: af84f8e
Pull-Request-resolved: #273
@ezyang ezyang mentioned this pull request Apr 27, 2025
[ghstack-poisoned]
[ghstack-poisoned]
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.

1 participant