mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
* Resolve newly added tests as filters * Add code smell to test for ansible provided jinja tests as filters syntax * Add docs for no-tests-as-filters code smell test * Address tests as filters in new integration tests * Address feedback * Address feedback 2
This commit is contained in:
parent
2616f9d713
commit
57575d1cfa
6 changed files with 121 additions and 21 deletions
|
@ -0,0 +1,10 @@
|
|||
Sanity Tests » no-tests-as-filters
|
||||
==================================
|
||||
|
||||
Using Ansible provided Jinja2 tests as filters will be removed in Ansible 2.9.
|
||||
|
||||
Prior to Ansible 2.5, Jinja2 tests included within Ansible were most often used as filters. The large difference in use is that filters are referenced as ``variable | filter_name`` where as Jinja2 tests are refereced as ``variable is test_name``.
|
||||
|
||||
Jinja2 tests are used for comparisons, whereas filters are used for data manipulation, and have different applications in Jinja2. This change is to help differentiate the concepts for a better understanding of Jinja2, and where each can be appropriately used.
|
||||
|
||||
As of Ansible 2.5 using an Ansible provided Jinja2 test with filter syntax will display a deprecation error.
|
Loading…
Add table
Add a link
Reference in a new issue