Skip to content

Commit

Permalink
Exclude minified js files and tests/jquery from 'mach grep'.
Browse files Browse the repository at this point in the history
  • Loading branch information
JayNakrani committed Aug 26, 2015
1 parent ab55e3e commit ecd7c8b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/servo/devenv_commands.py
Expand Up @@ -119,13 +119,16 @@ def grep(self, params):
params = []
# get all directories under tests/
tests_dirs = listdir('tests')
# Remove 'wpt' from obtained dir list
tests_dirs = filter(lambda dir: dir != 'wpt', tests_dirs)
# Directories to be excluded under tests/
excluded_tests_dirs = ['wpt', 'jquery']
tests_dirs = filter(lambda dir: dir not in excluded_tests_dirs, tests_dirs)
# Set of directories in project root
root_dirs = ['components', 'ports', 'python', 'etc', 'resources']
# Generate absolute paths for directories in tests/ and project-root/
tests_dirs_abs = [path.join(self.context.topdir, 'tests', s) for s in tests_dirs]
root_dirs_abs = [path.join(self.context.topdir, s) for s in root_dirs]
# Absolute paths for all directories to be considered
grep_paths = root_dirs_abs + tests_dirs_abs
return subprocess.call(["git"] + ["grep"] + params + ['--'] + grep_paths, env=self.build_env())
return subprocess.call(
["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js'],
env=self.build_env())

0 comments on commit ecd7c8b

Please sign in to comment.