Skip to content

make format command #221

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

Merged
merged 28 commits into from
May 6, 2025
Merged

make format command #221

merged 28 commits into from
May 6, 2025

Conversation

mshafer-NI
Copy link
Collaborator

We want a format command.

This format command supports:

  • no args (formats)
  • --diff prints the diff it would do
  • --check sys.exits if changes would be made

To accomplish this:

  • switch entirely to using isort and removing our own import sorting implementation.
  • bring in better-diff to make output that adds on top of the standard unified diff (notably, highlights changes in trailing whitespace or lines)

Note: to make the output of running nps format --diff consistent, calls to black had -q added to "1 file formatted" output (will also impact fix).

@mshafer-NI mshafer-NI requested review from irwand and neilvana as code owners May 6, 2025 18:13
Copy link
Contributor

github-actions bot commented May 6, 2025

Thank you for contributing! 👋

@mshafer-NI mshafer-NI force-pushed the dev/make_format_command branch from 005a488 to bd42241 Compare May 6, 2025 19:16
@mshafer-NI mshafer-NI merged commit 49c7dce into ni:main May 6, 2025
19 checks passed
@mshafer-NI mshafer-NI deleted the dev/make_format_command branch May 6, 2025 19:19
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.

2 participants