disable spellchecker for 'highlight' shortcodes

This commit is contained in:
Robert Kaussow 2020-06-07 16:39:14 +02:00
parent b0b8e825d3
commit bec9789649
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
9 changed files with 20 additions and 17 deletions

View File

@ -1,25 +1,10 @@
([a-zA-Z0-9]+[_=])+\S+
@\S+
.py
.yml
CLI
CONFIG_FILE
config
Codecov
INI
Kaussow
PYTHONPATH
CLI
PyPI
YAML
Ansible
ansible-.+
ansiblelater
lineno
sudo
xargs
yaml
yamllint
yml
dotfiles
parsable
JSON

View File

@ -5,6 +5,7 @@ title: Minimal standards checks
A typical standards check will look like:
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< highlight Python "linenos=table" >}}
def check_playbook_for_something(candidate, settings):
result = Result(candidate.path) # empty result is a success with no output
@ -15,6 +16,7 @@ def check_playbook_for_something(candidate, settings):
result.errors.append(Error(lineno+1, "Line is dodgy: reasons"))
return result
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
All standards check take a candidate object, which has a path attribute. The type can be inferred from the class name (i.e. `type(candidate).__name__`) or from the table [here](#candidates).

View File

@ -8,6 +8,7 @@ check those standards.
Create a file called standards.py (this can import other modules)
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< highlight Python "linenos=table" >}}
from ansiblelater include Standard, Result
@ -26,15 +27,18 @@ standards = [
role_must_contain_meta_main,
]
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
When you add new standards, you should increment the version of your standards. Your playbooks and roles should declare what version of standards you are using, otherwise ansible-later assumes you're using the latest. The declaration is done by adding standards version as first line in the file.
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight INI "linenos=table" >}}
# Standards: 1.2
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
@ -45,9 +49,11 @@ An example standards file is available [here](https://github.com/xoxys/ansible-l
If you only want to check one or two standards quickly (perhaps you want to review your entire code base for deprecated bare words), you can use the `-s` flag with the name of your standard. You can pass `-s` multiple times.
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< highlight Shell "linenos=table" >}}
git ls-files | xargs ansible-later -s "bare words are deprecated for with_items"
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
You can see the name of the standards being checked for each different file by running `ansible-later` with the `-v` option.

View File

@ -4,7 +4,7 @@ title: Configuration
ansible-later comes with some default settings which should be sufficient for most users to start, but you can adjust most settings to your needs.
Changes can be made in a yaml configuration file or through CLI options which will be processed in the following order (last wins):
Changes can be made in a YAML configuration file or through CLI options which will be processed in the following order (last wins):
- default configuration (build-in)
- global configuration file (this will depend on your operating system)

View File

@ -5,6 +5,7 @@ title: CLI options
You can get all available CLI options by running `ansible-later --help`:
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< highlight Shell "linenos=table" >}}
$ ansible-later --help
usage: ansible-later [-h] [-c CONFIG_FILE] [-r RULES.STANDARDS]
@ -30,4 +31,5 @@ optional arguments:
-q decrease log level
--version show program's version number and exit
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->

View File

@ -4,6 +4,7 @@ title: Default settings
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight YAML "linenos=table" >}}
---
ansible:
@ -65,5 +66,6 @@ yamllint:
indent-sequences: True
spaces: 2
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

View File

@ -4,6 +4,7 @@ title: Using pip
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight Shell "linenos=table" >}}
# From pip as user
pip install ansible-later --user
@ -11,5 +12,6 @@ pip install ansible-later --user
# .. or as root
sudo pip install ansible-later
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

View File

@ -4,11 +4,13 @@ title: From source
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight Shell "linenos=table" >}}
# Install dependency
git clone https://github.com/xoxys/ansible-later
export PYTHONPATH=$PYTHONPATH:`pwd`/ansible-later/ansiblelater
export PATH=$PATH:`pwd`/ansible-later/bin
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

View File

@ -10,6 +10,7 @@ If you don't pass any file to ansible-later it will review all files including s
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{< highlight Shell "linenos=table" >}}
# Review single files
ansible-later meta/main.yml tasks/install.yml
@ -17,6 +18,7 @@ ansible-later meta/main.yml tasks/install.yml
# Review all yml files (including sub-directories)
ansible-later **/*.yml
{{< /highlight >}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->