Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md to include list of rules #82

Merged
merged 4 commits into from
Oct 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@ To use salt-lint with [pre-commit](https://pre-commit.com), just add the follow

# Rules


## List of rules

| Rule | Description |
|:-----------------------------------------------------|:-----------------------------------------------------------------------------|
roaldnefs marked this conversation as resolved.
Show resolved Hide resolved
| [201](https://github.com/warpnet/salt-lint/wiki/201) | Trailing whitespace |
| [202](https://github.com/warpnet/salt-lint/wiki/202) | Jinja statement should have spaces before and after: `{% statement %}` |
| [203](https://github.com/warpnet/salt-lint/wiki/203) | Most files should not contain tabs |
| [204](https://github.com/warpnet/salt-lint/wiki/204) | Lines should be no longer that 160 chars |
| [205](https://github.com/warpnet/salt-lint/wiki/205) | Use ".sls" as a Salt State file extension |
| [206](https://github.com/warpnet/salt-lint/wiki/206) | Jinja variables should have spaces before and after `{{ var_name }}` |
| [207](https://github.com/warpnet/salt-lint/wiki/207) | File modes should always be encapsulated in quotation marks |
| [208](https://github.com/warpnet/salt-lint/wiki/208) | File modes should always contain a leading zero |
| [209](https://github.com/warpnet/salt-lint/wiki/209) | Jinja comment should have spaces before and after: `{# comment #}` |
| [210](https://github.com/warpnet/salt-lint/wiki/210) | Numbers that start with `0` should always be encapsulated in quotation marks |
| [211](https://github.com/warpnet/salt-lint/wiki/211) | `pillar.get` or `grains.get` should be formatted differently |
| [212](https://github.com/warpnet/salt-lint/wiki/212) | Most files should not contain irregular spaces |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I believe issue #70 was about having more detailed explanations (the why). So all of the content here will probably have to be expanded.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this part is a non-issue, since the links lead to the wiki. It's funny, I didn't see the link immediately when looking at this from View file. Perhaps I wouldn't have missed it as easily if the main statement was the link? More noticeable, perhaps.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So perhaps the rule numbers in bold and the main text as the links? Just some thoughts for you to consider, feel free to ignore this suggestion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @myii for your suggestion, I will leave this one open for @jbouter to decide!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've based the table on how hadolint does it, and I find it quite easy and nice to use. If you could, please have a look how hadolint's table feels to you, @myii, and tell me. :-) If acceptable, I'd like to implement it how I've currently designed it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbouter Sure, keep it that way. I just didn't see the link at first, that's all! But I'm sure it will be fine.

The one thing that probably needs adjusting is whether to use leading and trailing bars (|) or not. So the line that has been modified should follow the same system as the rest of the table.

Thanks for providing this feature, by the way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @myii, thanks for your review. I've modified the table to be simpler to edit as per your suggestion. Could you review it once more?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbouter Sure, it looks nice and tidy, thanks!


## False Positives: Skipping Rules

Some rules are bit of a rule of thumb. To skip a specific rule for a specific task, inside your state add `# noqa [rule_id]` at the end of the line. You can skip multiple rules via a space-separated list. Example:
Expand Down