summaryrefslogtreecommitdiff
path: root/test/sanity/code-smell/inappropriately-private.sh
blob: 9ee3342179a217cd8a7608023a7a0b04aab96010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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