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

Implement directory filter for extract #832

Merged
merged 2 commits into from
Jan 28, 2022

Conversation

akx
Copy link
Member

@akx akx commented Jan 27, 2022

This PR:

  • adds a directory_filter callback argument to extract_from_dir that defaults to the current behavior of ignoring dot and underscore directories
  • adds a frontend --ignore-dirs (that can be repeated) to replace the default .* / _* filtering with other patterns

Fixes #53 – set --ignore-dirs to disable the default dot and underscore filters
Fixes #402 – implements it :)

Refs #124 – there is still no way to set this in the mapping configuration file, though (that's #694)
Refs #253 – one could now --ignore-dirs=node_modules, for instance.
Refs #694 – could be reimplemented on top of this directory_filter?

Closes #447 – supersedes it
Closes #563 – supersedes it
Closes #761 – you can set --ignore-dirs='.*'
Closes #813 – supersedes it (thanks for the wording for the CLI parameter!)
Closes #793 – you can set --ignore-dirs='.* _* venv'

@akx
Copy link
Member Author

akx commented Jan 27, 2022

@kinshukdua Can I ask you to review this (as the last person to attempt implementing this in #813)? :) Just so I haven't made any extra silly mistakes here...

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #832 (1984ec7) into master (d3cea2a) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #832      +/-   ##
==========================================
+ Coverage   91.09%   91.13%   +0.03%     
==========================================
  Files          23       23              
  Lines        4123     4139      +16     
==========================================
+ Hits         3756     3772      +16     
  Misses        367      367              
Impacted Files Coverage Δ
babel/messages/extract.py 94.90% <100.00%> (+0.09%) ⬆️
babel/messages/frontend.py 87.03% <100.00%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3cea2a...1984ec7. Read the comment docs.

@akx akx added this to the Babel 2.10 milestone Jan 28, 2022
@kinshukdua
Copy link
Contributor

@akx Yes sure, I'll have a look at it!

Copy link
Contributor

@kinshukdua kinshukdua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@akx akx merged commit 89686fc into python-babel:master Jan 28, 2022
@akx akx deleted the extract-ignore-dirs branch January 28, 2022 11:50
m-aciek added a commit to m-aciek/babel that referenced this pull request Jan 29, 2023
akx pushed a commit that referenced this pull request Feb 3, 2023
Edwin18 added a commit to Edwin18/babel that referenced this pull request Dec 22, 2023
Previosly in function was passed raw value 'self.ignore_dirs', not a list as expected 'ignore_dirs'.

Fixes for python-babel#832
@Edwin18 Edwin18 mentioned this pull request Dec 22, 2023
Edwin18 added a commit to Edwin18/babel that referenced this pull request Dec 22, 2023
Adds multiple value for proper test.

Fixes for python-babel#832
akx pushed a commit to Edwin18/babel that referenced this pull request Apr 15, 2024
Previosly in function was passed raw value 'self.ignore_dirs', not a list as expected 'ignore_dirs'.

Fixes for python-babel#832
akx pushed a commit to Edwin18/babel that referenced this pull request Apr 15, 2024
Adds multiple value for proper test.

Fixes for python-babel#832
akx pushed a commit to Edwin18/babel that referenced this pull request Jul 11, 2024
Adds multiple value for proper test.

Fixes for python-babel#832
akx pushed a commit that referenced this pull request Jul 11, 2024
Adds multiple value for proper test.

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

Successfully merging this pull request may close these issues.

Add --ignore-dirs or similar to extract messages not extracted from folders starting with _ or .
2 participants