Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore dot-directories by default #4556

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pants.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ backend_packages: +[
pants_ignore: +[
# venv directories under build-support.
'/build-support/*.venv/',
'!.babelrc',
]


Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ def register_options(cls, register):
# e.g. '/dist/'
rel_distdir = '/{}/'.format(os.path.relpath(register.bootstrap.pants_distdir, get_buildroot()))
register('--ignore-patterns', advanced=True, type=list, fromfile=True,
default=['.*', rel_distdir, 'bower_components', 'node_modules', '*.egg-info'],
default=['.*/', rel_distdir, 'bower_components/', 'node_modules/', '*.egg-info/'],
removal_version='1.3.0.dev0', removal_hint='Use --build-ignore instead.',
mutually_exclusive_group='build_ignore', help='See help for --build-ignore.')
register('--build-ignore', advanced=True, type=list, fromfile=True,
default=['.*', rel_distdir, 'bower_components', 'node_modules', '*.egg-info'],
default=['.*/', rel_distdir, 'bower_components/', 'node_modules/', '*.egg-info/'],
help='Paths to ignore when identifying BUILD files. '
'This does not affect any other filesystem operations. '
'Patterns use the gitignore pattern syntax (https://git-scm.com/docs/gitignore).')
register('--pants-ignore', advanced=True, type=list, fromfile=True, default=['.*', rel_distdir],
register('--pants-ignore', advanced=True, type=list, fromfile=True, default=['.*/', rel_distdir],
help='Paths to ignore for all filesystem operations performed by pants '
'(e.g. BUILD file scanning, glob matching, etc). '
'Patterns use the gitignore syntax (https://git-scm.com/docs/gitignore). '
Expand Down
4 changes: 2 additions & 2 deletions tests/python/pants_test/option/test_options_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_pants_ignore_option(self):
'--no-colors',
'options'])
self.assert_success(pants_run)
self.assertIn("pants_ignore = ['.*', '/dist/', 'some/random/dir'] (from CONFIG)",
self.assertIn("pants_ignore = ['.*/', '/dist/', 'some/random/dir'] (from CONFIG)",
pants_run.stdout_data)

@ensure_engine
Expand All @@ -305,5 +305,5 @@ def test_pants_ignore_option_non_default_dist_dir(self):
'--no-colors',
'options'])
self.assert_success(pants_run)
self.assertIn("pants_ignore = ['.*', '/some/other/dist/dir/', 'some/random/dir'] (from CONFIG)",
self.assertIn("pants_ignore = ['.*/', '/some/other/dist/dir/', 'some/random/dir'] (from CONFIG)",
pants_run.stdout_data)