diffcrystalformat
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
Repository
diffcrystalformat
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- over 3 years ago
- December 1, 2021
License
MIT License
Links
Synced at
Mon, 23 Jun 2025 00:20:11 GMT
Languages