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

findinfiles: Don't exclude any files if exclude pattern is empty #7815

Closed
wants to merge 3 commits into from

Conversation

ehabkost
Copy link
Contributor

@ehabkost ehabkost commented Sep 2, 2018

Pull Request Checklist

  • Read and followed this repo's Contributing Guidelines
  • Based your PR on the latest version of the correct branch (master or 3.x)
  • Followed PEP8 for code style
  • Ensured your pull request hasn't eliminated unrelated blank lines/spaces,
    modified the spyder/defaults directory, or added new icons/assets
  • Wrote at least one-line docstrings for any new functions
  • Added at least one unit test covering the changes, if at all possible
  • Described your changes and the motivation for them below
  • Noted what issue(s) this pull request resolves, creating one if needed
  • Included a screenshot, if this PR makes any visible changes to the UI

Description of Changes

This addresses issue #7811, making findinfiles not ignore all files if the exclude pattern is empty.

Issue(s) Resolved

Fixes #7811

Move the code that translates a exclude pattern outside the block
that that validates the pattern.

This way the code is easier to follow, with the translation and
validation steps clearly separated from each other.
If the exclude regexp is empty, don't try to compile it. Change
SearchThread so an empty string will make no file be excluded
from the search.

This fixes issue spyder-ide#7811 when exclude_re is true.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
When building the regexp for file patterns when exclude_re is
false, skip empty strings.

This fixes issue spyder-ide#7811 when exclude_re is false.
@ehabkost
Copy link
Contributor Author

ehabkost commented Sep 2, 2018

I just found the right spot for widget test cases (I was looking at plugins/tests/test_findinfiles.py instead of widgets/tests/test_findinfiles.py). I will close this pull request temporarily and reopen it after I write the test cases.

@ehabkost ehabkost closed this Sep 2, 2018
@ccordoba12
Copy link
Member

Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants