From 7d2a223eea45793dc8a56906420411d0f30930ed Mon Sep 17 00:00:00 2001 From: Jeffrey Bouter Date: Wed, 13 Nov 2019 21:23:44 +0100 Subject: [PATCH 1/2] Update documentation - Add explanation regarding sed commands. - Change to assume salt is CWD Signed-off-by: Jeffrey Bouter --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 42cc9d8..ba54d56 100644 --- a/README.md +++ b/README.md @@ -174,16 +174,18 @@ Wish to create a `salt-lint` extension for your favourite editor? We're always l # Fix common issues -`sed` might be one of the better tools to fix common issues. +`sed` might be one of the better tools to fix common issues, as shown in commands below. + +**Note**: these commands assume your current working directory is the salt directory/repository. Fix spacing arround `{{ var_name }}`, eg. `{{env}}` --> `{{ env }}`:\ -`sed -i -E "s/\{\{\s?([^}]*[^} ])\s?\}\}/\{\{ \1 \}\}/g" $(find salt -name '*.sls')` +`sed -i -E "s/\{\{\s?([^}]*[^} ])\s?\}\}/\{\{ \1 \}\}/g" $(find . -name '*.sls')` Make the `dir_mode`, `file_mode` and `mode` arguments in the desired syntax:\ -`sed -i -E "s/\b(dir_|file_|)mode: 0?([0-7]{3})/\1mode: '0\2'/" $(find salt -name '*.sls')` +`sed -i -E "s/\b(dir_|file_|)mode: 0?([0-7]{3})/\1mode: '0\2'/" $(find . -name '*.sls')` Add quotes arround numeric values that start with a `0`:\ -`sed -i -E "s/\b(minute|hour): (0[0-7]?)\$/\1: '\2'/" $(find salt -name '*.sls')` +`sed -i -E "s/\b(minute|hour): (0[0-7]?)\$/\1: '\2'/" $(find . -name '*.sls')` # Authors From c66960f294f356f635c975e69938d8c247212c72 Mon Sep 17 00:00:00 2001 From: Jeffrey Bouter <6340770+jbouter@users.noreply.github.com> Date: Wed, 13 Nov 2019 21:25:25 +0100 Subject: [PATCH 2/2] Update README.md Add clarification on salt states. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba54d56..168aeec 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ Wish to create a `salt-lint` extension for your favourite editor? We're always l `sed` might be one of the better tools to fix common issues, as shown in commands below. -**Note**: these commands assume your current working directory is the salt directory/repository. +**Note**: these commands assume your current working directory is the salt (states) directory/repository. Fix spacing arround `{{ var_name }}`, eg. `{{env}}` --> `{{ env }}`:\ `sed -i -E "s/\{\{\s?([^}]*[^} ])\s?\}\}/\{\{ \1 \}\}/g" $(find . -name '*.sls')`