0.3.1 • Published 2 years ago
prettier-plugin-awk v0.3.1
Prettier AWK Plugin
An opinionated formatter for AWK language built as a plugin for Prettier with help of tree-sitter and tree-sitter-awk.
How to install and use
Globally
npm install --global prettier@^2 prettier-plugin-awkThen run:
prettier --write /path/to/your/awesome_script.awkPer project
First you need to init new node project with:
npm init -yThen add development dependencies:
npm add --save-dev prettier@^2 prettier-plugin-awkThen run with:
npx prettier --write ./awesome_script.awkYou can then create pre-commit hook with something like husky or incorporate such check as CI step.
Ignoring Code
To ignore node in a syntax tree prepend it with # prettier-ignore comment like this:
# prettier-ignore
BEGIN{x=12}Configuring
Although most of the options are unsupported or make no sense in regard to AWK you can still configure tab or print width.
To do so create .prettierrc in your project directory with following content:
{
"printWidth": 80,
"tabWidth": 4
}