From bec9789649d6375fb49b2ceb5879c8833bbcb99e Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 7 Jun 2020 16:39:14 +0200 Subject: [PATCH] disable spellchecker for 'highlight' shortcodes --- .dictionary | 17 +---------------- docs/content/build_rules/standards_check.md | 2 ++ docs/content/build_rules/standards_file.md | 6 ++++++ docs/content/configuration/_index.md | 2 +- docs/content/configuration/cli.md | 2 ++ docs/content/configuration/defaults.md | 2 ++ docs/content/setup/pip.md | 2 ++ docs/content/setup/source.md | 2 ++ docs/content/usage/_index.md | 2 ++ 9 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.dictionary b/.dictionary index 606013d..bef79fc 100644 --- a/.dictionary +++ b/.dictionary @@ -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 diff --git a/docs/content/build_rules/standards_check.md b/docs/content/build_rules/standards_check.md index 99a1f41..a9549f9 100644 --- a/docs/content/build_rules/standards_check.md +++ b/docs/content/build_rules/standards_check.md @@ -5,6 +5,7 @@ title: Minimal standards checks A typical standards check will look like: + {{< 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 >}} + 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). diff --git a/docs/content/build_rules/standards_file.md b/docs/content/build_rules/standards_file.md index 95b3ee9..43eed9d 100644 --- a/docs/content/build_rules/standards_file.md +++ b/docs/content/build_rules/standards_file.md @@ -8,6 +8,7 @@ check those standards. Create a file called standards.py (this can import other modules) + {{< highlight Python "linenos=table" >}} from ansiblelater include Standard, Result @@ -26,15 +27,18 @@ standards = [ role_must_contain_meta_main, ] {{< /highlight >}} + 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. + {{< highlight INI "linenos=table" >}} # Standards: 1.2 {{< /highlight >}} + @@ -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. + {{< highlight Shell "linenos=table" >}} git ls-files | xargs ansible-later -s "bare words are deprecated for with_items" {{< /highlight >}} + You can see the name of the standards being checked for each different file by running `ansible-later` with the `-v` option. diff --git a/docs/content/configuration/_index.md b/docs/content/configuration/_index.md index c631f8c..365072d 100644 --- a/docs/content/configuration/_index.md +++ b/docs/content/configuration/_index.md @@ -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) diff --git a/docs/content/configuration/cli.md b/docs/content/configuration/cli.md index 0d501c8..b5fbcd1 100644 --- a/docs/content/configuration/cli.md +++ b/docs/content/configuration/cli.md @@ -5,6 +5,7 @@ title: CLI options You can get all available CLI options by running `ansible-later --help`: + {{< 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 >}} + diff --git a/docs/content/configuration/defaults.md b/docs/content/configuration/defaults.md index 37fa1c7..e839f55 100644 --- a/docs/content/configuration/defaults.md +++ b/docs/content/configuration/defaults.md @@ -4,6 +4,7 @@ title: Default settings + {{< highlight YAML "linenos=table" >}} --- ansible: @@ -65,5 +66,6 @@ yamllint: indent-sequences: True spaces: 2 {{< /highlight >}} + diff --git a/docs/content/setup/pip.md b/docs/content/setup/pip.md index 65546b9..a3fbcdf 100644 --- a/docs/content/setup/pip.md +++ b/docs/content/setup/pip.md @@ -4,6 +4,7 @@ title: Using pip + {{< 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 >}} + diff --git a/docs/content/setup/source.md b/docs/content/setup/source.md index a40fc73..7ccdcdc 100644 --- a/docs/content/setup/source.md +++ b/docs/content/setup/source.md @@ -4,11 +4,13 @@ title: From source + {{< 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 >}} + diff --git a/docs/content/usage/_index.md b/docs/content/usage/_index.md index 963bad4..2ed7d79 100644 --- a/docs/content/usage/_index.md +++ b/docs/content/usage/_index.md @@ -10,6 +10,7 @@ If you don't pass any file to ansible-later it will review all files including s + {{< 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 >}} +