Here's some commands to help with code quality. You can use them as a one-time clean up and then use them as part of your regular build to maintain your coding rules.
Ahh, the age-old debate of tabs vs spaces. Make sure you have a solid discussion with your team and decide which one is correct (tabs, obviously!) and then use this command to implement it across your entire code base.
Removes trailing whitespace from the ends of your lines.
Makes sure the last line of every source file has an EOL character.
Another very common requirement for builds is generating checksums on your files. We've got you covered here now as well. Run checksum help
for even more options.
You can provide a file globbing pattern to receive a checksum for all files in a directory that match that pattern.
The checksum
command also supports some other popular formats for outputting checksums. The default format is checksum
.
The checksum
command will also write out a file that contains the hash which is a common requirement for builds that produce artifacts.
Write checksum(s) to a file named after the original file plus a new extension. This will create a file called myFile.zip.md5
.
Control the file extension like so. (--write
is optional when supplying an extension) This will create a file called myFile.zip.hash
.
You can check a file against an existing checksum to make sure the file hasn't changed.
Here are some helpful commands that can come in handy when writing task runners for automating builds via CFML. Of course, since these are just commands, they can be run directly from the CLI as well by you.