Skip to content

Commit

Permalink
feat: add the sprocket format command. (#24)
Browse files Browse the repository at this point in the history
* feat: add the `sprocket format` command.

This commit adds the `format` command to `sprocket`.

The command will format a single WDL document.

Also updated the existing commands to the latest WDL API and corrected the
environment variable name for publishing crates.

Included the analysis rules in `sprocket explain`; the list of rules is now
sorted by id.

* chore: remove `unwrap` call in favor of an explicit error message.

* fix: fix `with-tabs` and `indentation-size` options.

Both options were missing `arg(long)`.

* Update src/commands/format.rs

Co-authored-by: Andrew Frantz <[email protected]>

* feat: add support for formatting directories.

This commit adds support for formatting directories.

By default, the `format` command will attempt to print a single formatted
document to stdout.

If the `--overwrite` option is specified, a directory may be specified and all
of the WDL documents recursively found in the directory will be overwritten
with the formatted contents.

* Update src/main.rs

* chore: run `rustfmt`.

* chore: bump to 0.9.1.

* Update src/commands/format.rs

Co-authored-by: Andrew Frantz <[email protected]>

---------

Co-authored-by: Andrew Frantz <[email protected]>
  • Loading branch information
peterhuene and a-frantz authored Oct 16, 2024
1 parent 592dfef commit 0923bec
Show file tree
Hide file tree
Showing 10 changed files with 661 additions and 265 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Publish to crates.io
run: cargo publish
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Create a GH release
uses: softprops/action-gh-release@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

* Added the `format` subcommand to sprocket ([#24](https://github.com/stjude-rust-labs/sprocket/pull/24)).
* Added the analysis rules to `sprocket explain` ([#24](https://github.com/stjude-rust-labs/sprocket/pull/24)).

## 0.7.0 - 09-16-2024

### Changed
Expand Down
Loading

0 comments on commit 0923bec

Please sign in to comment.