mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add a disabled test for accessing private attributes of other objects
Need to cleanup the code before we can enable this test.
This commit is contained in:
parent
566144461f
commit
74fe9d236a
1 changed files with 18 additions and 0 deletions
18
test/code-smell/inappropriately-private.sh
Executable file
18
test/code-smell/inappropriately-private.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Test that we do not access private attributes of other objects.
|
||||
#
|
||||
# * private attributes of ourself are okay: self._private.
|
||||
# * Private attributes of other objects are not: self.other._private
|
||||
#
|
||||
|
||||
# Currently the code has many places where we're violating this test so we need
|
||||
# to clean up the code before we can enable this. Maybe we'll need to
|
||||
# selectively blacklist modules so that we can work on this a piece at a time.
|
||||
#
|
||||
# Also need to implement whitelist for certain things like bundled libraries
|
||||
# that violate this.
|
||||
#
|
||||
# 23-10-2015: Count was 508 lines
|
||||
grep -Pri '(?<!self)\._(?!_)' $1|grep -v modules
|
Loading…
Add table
Reference in a new issue