diffcrystalformat
Version, currently main branch1 version
- main branchlatestDec 11, 2021
github.com/hisashim/diffcrystalformat
DiffCrystalFormat is a Crystal formatting previewer.
Installation
# Add this to your shard.yml
dependencies:
diffcrystalformat:
github: hisashim/diffcrystalformat
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.2.1- License
- MIT
- Author
- Hisashi Morita
- Target
diff_crystal_formatfrom src/diff_crystal_format.cr
Dependencies
This version declares no dependencies.
README
DiffCrystalFormat
DiffCrystalFormat is a Crystal formatting previewer.
Crystal's built-in formatter (crystal tool format) is very useful and
helpful. Its dry-run mode (crystal tool format --check), however, tells us
only the file names which will produce changes and not the changes
themselves (as of Crystal 1.2.1). DiffCrystalFormat shows the changes the
formatter will make, in diff format.
Requirements
- Build time
- Crystal
- Shards (usually bundled with Crystal)
- Run time
- GNU diff
Installation
-
Install requirements (if needed).
$ sudo apt install crystal diffutils -
Obtain the source.
$ git clone https://github.com/hisashim/diffcrystalformat $ cd diffcrystalformat -
Build an executable, and copy it to somewhere in your
$PATH.$ make $ cp bin/diff_crystal_format ~/bin/
Usage
diff_crystal_format [FILES] [DIRS]
Examples
$ echo "[0,1,2].map{|n| n+1}" > test.cr
$ cat test.cr
[0,1,2].map{|n| n+1}
$ diff_crystal_format
--- /tmp/...diff_crystal_format_..test_cr_orig ...
+++ /tmp/...diff_crystal_format_..test_cr ...
@@ -1 +1 @@
-[0,1,2].map{|n| n+1}
+[0, 1, 2].map { |n| n + 1 }
$
Known Issues
- File names displayed are not human-friendly, as slashes (
/) are just replaced with dots (.), due to my laziness.
License
This software is distributed under the MIT License. See the LICENSE file.
Contributing
- Fork it (https://github.com/hisashim/diffcrystalformat/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Hisashi Morita -- creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Dec 11, 2021
- Crystal
1.2.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/hisashim/diffcrystalformat
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1