Skip to content

Commit

Permalink
Add yamllint to tox -elinters
Browse files Browse the repository at this point in the history
This is another step to ensuring our roles have a good score on galaxy.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
  • Loading branch information
pabelanger committed Dec 17, 2018
1 parent cf7efba commit e866233
Show file tree
Hide file tree
Showing 41 changed files with 142 additions and 96 deletions.
14 changes: 14 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends: default

ignore: |
.git/
.tox/

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable
28 changes: 14 additions & 14 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ pre_release_tag_re: '(?P<pre_release>(?:[ab]|rc)+\d*)$'
notesdir: fragments
prelude_section_name: release_summary
sections:
- ['major_changes', 'Major Changes']
- ['minor_changes', 'Minor Changes']
- ['deprecated_features', 'Deprecated Features']
- ['removed_features', 'Removed Features (previously deprecated)']
- ['new_lookup_plugins', 'New Lookup Plugins']
- ['new_callback_plugins', 'New Callback Plugins']
- ['new_connection_plugins', 'New Connection Plugins']
- ['new_test_plugins', 'New Test Plugins']
- ['new_filter_plugins', 'New Filter Plugins']
- ['new_modules', 'New Modules']
- ['new_tasks', 'New Tasks']
- ['bugfixes', 'Bugfixes']
- ['known_issues', 'Known Issues']
- ['docs', 'Documentation Updates']
- ['major_changes', 'Major Changes']
- ['minor_changes', 'Minor Changes']
- ['deprecated_features', 'Deprecated Features']
- ['removed_features', 'Removed Features (previously deprecated)']
- ['new_lookup_plugins', 'New Lookup Plugins']
- ['new_callback_plugins', 'New Callback Plugins']
- ['new_connection_plugins', 'New Connection Plugins']
- ['new_test_plugins', 'New Test Plugins']
- ['new_filter_plugins', 'New Filter Plugins']
- ['new_modules', 'New Modules']
- ['new_tasks', 'New Tasks']
- ['bugfixes', 'Bugfixes']
- ['known_issues', 'Known Issues']
- ['docs', 'Documentation Updates']
19 changes: 10 additions & 9 deletions changelogs/fragments/v0-initial-release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
major_changes:
- Initial release of the ``network-engine`` Ansible role.
- This role provides the foundation for building network roles by providing modules and plugins that are common to all Ansible Network roles. All of the artifacts in this role can be used independent of the platform that is being managed.
- Initial release of the ``network-engine`` Ansible role.
- This role provides the foundation for building network roles by providing modules and plugins that are common to all Ansible Network roles. All of the artifacts in this role can be used independent of the platform that is being managed.

new_modules:
- NEW ``text_parser`` Parses ASCII text into JSON facts using text_parser engine and YAML-formatted input.
Provides a rules-based text parser that is closely modeled after the Ansible
playbook language. This parser will iterate over the rules and parse the
output of structured ASCII text into a JSON data structure that can be
added to the inventory host facts.
- NEW ``textfsm`` Parses ASCII text into JSON facts using textfsm engine and Google TextFSM-formatted input.
Provides textfsm rules-based templates to parse data from text. The template acting as parser will iterate of the rules and parse the output of structured ASCII text into a JSON data structure that can be added to the inventory host facts.
- NEW ``text_parser`` Parses ASCII text into JSON facts using text_parser engine and YAML-formatted input.
Provides a rules-based text parser that is closely modeled after the Ansible
playbook language. This parser will iterate over the rules and parse the
output of structured ASCII text into a JSON data structure that can be
added to the inventory host facts.
- NEW ``textfsm`` Parses ASCII text into JSON facts using textfsm engine and Google TextFSM-formatted input.
Provides textfsm rules-based templates to parse data from text. The template acting as parser will iterate of the rules and parse the output of structured ASCII text into a JSON data structure that can be added to the inventory host facts.
7 changes: 4 additions & 3 deletions changelogs/fragments/v251-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
bugfixes:
- Fix ``command_parser`` Absolute path with tilde in src should work `network-engine#58 <https://github.com/ansible-network/network-engine/pull/58>`_
- Fix content mush only accepts string type `network-engine#72 <https://github.com/ansible-network/network-engine/pull/72>`_
- Fix StringIO to work with Python3 in addition to Python2 `network-engine#53 <https://github.com/ansible-network/network-engine/pull/53>`_
- Fix ``command_parser`` Absolute path with tilde in src should work `network-engine#58 <https://github.com/ansible-network/network-engine/pull/58>`_
- Fix content mush only accepts string type `network-engine#72 <https://github.com/ansible-network/network-engine/pull/72>`_
- Fix StringIO to work with Python3 in addition to Python2 `network-engine#53 <https://github.com/ansible-network/network-engine/pull/53>`_
3 changes: 2 additions & 1 deletion changelogs/fragments/v251-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
docs:
- User Guide `docs/user_guide <https://github.com/ansible-network/network-engine/tree/devel/docs/user_guide>`_.
- User Guide `docs/user_guide <https://github.com/ansible-network/network-engine/tree/devel/docs/user_guide>`_.
9 changes: 5 additions & 4 deletions changelogs/fragments/v251-terminology-changes.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
new_modules:
- New module ``command_parser`` (renamed from ``text_parser``)
- New module ``textfsm_parser`` (renamed from ``textfsm``)
- New module ``command_parser`` (renamed from ``text_parser``)
- New module ``textfsm_parser`` (renamed from ``textfsm``)

deprecated_features:
- Module ``text_parser`` renamed to ``command_parser``; original name deprecated; legacy use supported; will be removed in 2.6.0.
- Module ``textfsm`` renamed to ``textfsm_parser``; original name deprecated; legacy use supported; will be removed in 2.6.0.
- Module ``text_parser`` renamed to ``command_parser``; original name deprecated; legacy use supported; will be removed in 2.6.0.
- Module ``textfsm`` renamed to ``textfsm_parser``; original name deprecated; legacy use supported; will be removed in 2.6.0.
3 changes: 2 additions & 1 deletion changelogs/fragments/v252-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Fix AnsibleFilterError, deprecations, and unused imports `network-engine#82 <https://github.com/ansible-network/network-engine/pull/82>`_.
- Fix AnsibleFilterError, deprecations, and unused imports `network-engine#82 <https://github.com/ansible-network/network-engine/pull/82>`_.
9 changes: 5 additions & 4 deletions changelogs/fragments/v252-filter-plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
new_filter_plugins:
- New filter plugin ``interface_range``
- New filter plugin ``interface_split``
- New filter plugin ``vlan_compress``
- New filter plugin ``vlan_expand``
- New filter plugin ``interface_range``
- New filter plugin ``interface_split``
- New filter plugin ``vlan_compress``
- New filter plugin ``vlan_expand``
9 changes: 5 additions & 4 deletions changelogs/fragments/v252-lookup-plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
new_lookup_plugins:
- New lookup plugin ``json_template``
- New lookup plugin ``network_template``
- New lookup plugin ``yang2spec``
- New lookup plugin ``netcfg_diff``
- New lookup plugin ``json_template``
- New lookup plugin ``network_template``
- New lookup plugin ``yang2spec``
- New lookup plugin ``netcfg_diff``
5 changes: 3 additions & 2 deletions changelogs/fragments/v252-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
minor_changes:
- Add new directives extend `network-engine#91 <https://github.com/ansible-network/network-engine/pull/91>`_.
- Adds conditional support to nested template objects `network-engine#55 <https://github.com/ansible-network/network-engine/pull/55>`_.
- Add new directives extend `network-engine#91 <https://github.com/ansible-network/network-engine/pull/91>`_.
- Adds conditional support to nested template objects `network-engine#55 <https://github.com/ansible-network/network-engine/pull/55>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v252-tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
new_tasks:
- New task ``cli``
- New task ``cli``
3 changes: 2 additions & 1 deletion changelogs/fragments/v253-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
minor_changes:
- Templating the regex sent to the parser to allow us to use ansible variables in the regex string `network-engine#97 <https://github.com/ansible-network/network-engine/pull/97>`_.
- Templating the regex sent to the parser to allow us to use ansible variables in the regex string `network-engine#97 <https://github.com/ansible-network/network-engine/pull/97>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v253-removed-features.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
removed_features:
- Move yang2spec lookup to feature branch, till the right location for this plugin is identified `network-engine#100 <https://github.com/ansible-network/network-engine/pull/100>`_.
- Move yang2spec lookup to feature branch, till the right location for this plugin is identified `network-engine#100 <https://github.com/ansible-network/network-engine/pull/100>`_.
5 changes: 3 additions & 2 deletions changelogs/fragments/v254-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
bugfixes:
- Fix cli task parser undefined issue when only command is used `network-engine#103 <https://github.com/ansible-network/network-engine/pull/103>`_.
- Fix an issue with using the extend directive with a loop `network-engine#105 <https://github.com/ansible-network/network-engine/pull/105>`_.
- Fix cli task parser undefined issue when only command is used `network-engine#103 <https://github.com/ansible-network/network-engine/pull/103>`_.
- Fix an issue with using the extend directive with a loop `network-engine#105 <https://github.com/ansible-network/network-engine/pull/105>`_.
5 changes: 3 additions & 2 deletions changelogs/fragments/v254-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
minor_changes:
- Add parsers to search path `network-engine#89 <https://github.com/ansible-network/network-engine/pull/89>`_.
- Fix export_as templating vars `network-engine#104 <https://github.com/ansible-network/network-engine/pull/104>`_.
- Add parsers to search path `network-engine#89 <https://github.com/ansible-network/network-engine/pull/89>`_.
- Fix export_as templating vars `network-engine#104 <https://github.com/ansible-network/network-engine/pull/104>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v260-initial-release.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
major_changes:
- Initial release of 2.6.0 ``network-engine`` Ansible role that is supported with Ansible 2.6.0
- Initial release of 2.6.0 ``network-engine`` Ansible role that is supported with Ansible 2.6.0
3 changes: 2 additions & 1 deletion changelogs/fragments/v261-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Fixes bug when loading a dir of parsers `network-engine#113 <https://github.com/ansible-network/network-engine/pull/113>`_.
- Fixes bug when loading a dir of parsers `network-engine#113 <https://github.com/ansible-network/network-engine/pull/113>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v261-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
docs:
- The argument to end a block of text when searching with match_greedy was missing `network-engine#116 <https://github.com/ansible-network/network-engine/pull/116>`_.
- The argument to end a block of text when searching with match_greedy was missing `network-engine#116 <https://github.com/ansible-network/network-engine/pull/116>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v262-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Fix role path test dependency `network-engine#121 <https://github.com/ansible-network/network-engine/pull/121>`_.
- Fix role path test dependency `network-engine#121 <https://github.com/ansible-network/network-engine/pull/121>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v262-filter-plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
new_filter_plugins:
- NEW ``to_lines`` filter plugin
- NEW ``to_lines`` filter plugin
5 changes: 3 additions & 2 deletions changelogs/fragments/v262-lookup-plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
new_lookup_plugins:
- NEW ``config_template`` lookup plugin
- NEW ``yang_json2xml`` lookup plugin
- NEW ``config_template`` lookup plugin
- NEW ``yang_json2xml`` lookup plugin
1 change: 1 addition & 0 deletions changelogs/fragments/v262-modules.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
new_modules:
- NEW ``validate_role_spec`` handle validating facts required by the role
3 changes: 2 additions & 1 deletion changelogs/fragments/v263-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Task to fail if ansible_min_version isn't met `network-engine#130 <https://github.com/ansible-network/network-engine/pull/130>`_.
- Task to fail if ansible_min_version isn't met `network-engine#130 <https://github.com/ansible-network/network-engine/pull/130>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v263-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
minor_changes:
- Makes parser directive extend templatable `network-engine#132 <https://github.com/ansible-network/network-engine/pull/132>`_.
- Makes parser directive extend templatable `network-engine#132 <https://github.com/ansible-network/network-engine/pull/132>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v264-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Fix repeat_for in json_template `network-engine#139 <https://github.com/ansible-network/network-engine/pull/139>`_.
- Fix repeat_for in json_template `network-engine#139 <https://github.com/ansible-network/network-engine/pull/139>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v264-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
docs:
- Removes unnecessary details from README `network-engine#126 <https://github.com/ansible-network/network-engine/pull/126>`_.
- Removes unnecessary details from README `network-engine#126 <https://github.com/ansible-network/network-engine/pull/126>`_.
5 changes: 3 additions & 2 deletions changelogs/fragments/v264-removed-features.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
removed_features:
- Remove deprecated module ``text_parser``.
- Remove deprecated module ``textfsm``.
- Remove deprecated module ``text_parser``.
- Remove deprecated module ``textfsm``.
3 changes: 2 additions & 1 deletion changelogs/fragments/v265-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
bugfixes:
- Remove GenericLinux from supported platforms `network-engine#145 <https://github.com/ansible-network/network-engine/pull/145>`_.
- Remove GenericLinux from supported platforms `network-engine#145 <https://github.com/ansible-network/network-engine/pull/145>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v266-minor-changes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
minor_changes:
- Capability to filter AnsibleModule kwargs `network-engine#149 <https://github.com/ansible-network/network-engine/pull/149>`_.
- Capability to filter AnsibleModule kwargs `network-engine#149 <https://github.com/ansible-network/network-engine/pull/149>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v266-removed-features.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
removed_features:
- Remove deprecated module ``cli_get``
- Remove deprecated module ``cli_get``
7 changes: 4 additions & 3 deletions changelogs/fragments/v270-bugfixes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
bugfixes:
- Fix native type conversion in json_template `network-engine#154 <https://github.com/ansible-network/network-engine/pull/154>`_.
- Fix templating repeat_for `network-engine#190 <https://github.com/ansible-network/network-engine/pull/190>`_.
- Add missing boilerplate for net_facts module `network-engine#194 <https://github.com/ansible-network/network-engine/pull/194>`_.
- Fix native type conversion in json_template `network-engine#154 <https://github.com/ansible-network/network-engine/pull/154>`_.
- Fix templating repeat_for `network-engine#190 <https://github.com/ansible-network/network-engine/pull/190>`_.
- Add missing boilerplate for net_facts module `network-engine#194 <https://github.com/ansible-network/network-engine/pull/194>`_.
3 changes: 2 additions & 1 deletion changelogs/fragments/v270-initial-release.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
major_changes:
- Initial release of 2.7.0 ``network-engine`` Ansible role that is supported with Ansible 2.7.0
- Initial release of 2.7.0 ``network-engine`` Ansible role that is supported with Ansible 2.7.0
3 changes: 2 additions & 1 deletion changelogs/fragments/v271-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
minor_changes:
- Add support for nested spec validation in validate_role_spec `network-engine#198 <https://github.com/ansible-network/network-engine/pull/198>`_.
- Add support for nested spec validation in validate_role_spec `network-engine#198 <https://github.com/ansible-network/network-engine/pull/198>`_.
5 changes: 3 additions & 2 deletions changelogs/fragments/v272-minorchanges.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
minor_changes:
- Add name option for textfsm to create facts to key `network-engine#202 <https://github.com/ansible-network/network-engine/pull/202>`_.
- Document name option for textfsm in cli plugin and update cli task `network-engine#205 <https://github.com/ansible-network/network-engine/pull/205>`_.
- Add name option for textfsm to create facts to key `network-engine#202 <https://github.com/ansible-network/network-engine/pull/202>`_.
- Document name option for textfsm in cli plugin and update cli task `network-engine#205 <https://github.com/ansible-network/network-engine/pull/205>`_.
2 changes: 0 additions & 2 deletions handlers/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ galaxy_info:
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
# github_branch:

platforms:
- name: network
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ara
flake8
yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
template:
- key: "{{ item.name.matches.0 }}"
object:
- key: config
object:
- key: name
value: "{{ item.name.matches.0 }}"
- key: type
value: "{{ item.type.matches.0 }}"
- key: mtu
value: "{{ item.mtu.matches.0 }}"
- key: description
value: "{{ item.description.matches.0 }}"
- key: config
object:
- key: name
value: "{{ item.name.matches.0 }}"
- key: type
value: "{{ item.type.matches.0 }}"
- key: mtu
value: "{{ item.mtu.matches.0 }}"
- key: description
value: "{{ item.description.matches.0 }}"
loop: "{{ interfaces }}"
export: yes
export_as: "{{ export_type }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
template:
- key: "{{ item.name.matches.0 }}"
object:
- key: config
object:
- key: name
value: "{{ item.name.matches.0 }}"
- key: type
value: "{{ item.type.matches.0 }}"
- key: mtu
value: "{{ item.mtu.matches.0 }}"
- key: description
value: "{{ item.description.matches.0 }}"
- key: config
object:
- key: name
value: "{{ item.name.matches.0 }}"
- key: type
value: "{{ item.type.matches.0 }}"
- key: mtu
value: "{{ item.mtu.matches.0 }}"
- key: description
value: "{{ item.description.matches.0 }}"
loop: "{{ interfaces }}"
export: yes
register: interface_facts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
- "'Ethernet1/3' in result.msg"
- "'Ethernet1/4' in result.msg"
- "'Ethernet1/5' in result.msg"
- "'Ethernet1/8' in result.msg"
- "'Ethernet1/8' in result.msg"
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ setenv =
[testenv:linters]
basepython = python3
commands =
yamllint .
flake8 {posargs}

[testenv:venv]
Expand Down

0 comments on commit e866233

Please sign in to comment.