Skip to content

Commit

Permalink
Code smell test for specifying both required and default in FieldAttr…
Browse files Browse the repository at this point in the history
…ibutes
  • Loading branch information
abadger committed Dec 9, 2015
1 parent de703f8 commit 04fc3f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ script:
- ./test/code-smell/replace-urlopen.sh .
- ./test/code-smell/use-compat-six.sh lib
- ./test/code-smell/boilerplate.sh
- ./test/code-smell/required-and-default-attributes.sh
- if test x"$TOXENV" != x'py24' ; then tox ; fi
- if test x"$TOXENV" = x'py24' ; then python2.4 -V && python2.4 -m compileall -fq -x 'module_utils/(a10|rax|openstack|ec2|gce).py' lib/ansible/module_utils ; fi
#- make -C docsite all
Expand Down
10 changes: 10 additions & 0 deletions test/code-smell/required-and-default-attributes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

BASEDIR=${1-"lib/ansible"}
cd "$BASEDIR"
grep -r FieldAttribute . |grep 'default' | grep 'required'
if test $? -eq 0 ; then
exit 1
fi
exit 0

0 comments on commit 04fc3f1

Please sign in to comment.