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

Can't use exclude option without explicit include #137

Closed
jmuheim opened this issue Mar 24, 2015 · 2 comments
Closed

Can't use exclude option without explicit include #137

jmuheim opened this issue Mar 24, 2015 · 2 comments
Milestone

Comments

@jmuheim
Copy link

jmuheim commented Mar 24, 2015

I don't want i18n-tasks to search for translations in abstract controllers and helpers like ApplicationHelper, where I have this method for example:

  def default_page_heading(options = {})
    t '.title', options
  end

I tried

search:
  exclude:
    - '*/application_helper.rb'

But this resulted in

josh@Macbuech:~/Documents/Work/MuheimWebdesign/base/src (features/accessibility *)$ i18n-tasks unused
/Users/josh/.rvm/gems/ruby-2.1.0@base/gems/i18n-tasks-0.7.13/lib/i18n/tasks/scanners/pattern_scanner.rb:14:in `scan': invalid byte sequence in UTF-8 (ArgumentError)

I had to explicitly also add include to make it work:

search:
  include:
    - '*.rb'
    - '*.html.*'
    - '*.text.*'

  exclude:
    - '*/application_helper.rb'

Is this expected behaviour?

@glebm
Copy link
Owner

glebm commented Mar 24, 2015

Currently, setting exclude overrides the default exclude that is set to ["*.jpg", "*.png", "*.gif", "*.svg", "*.ico", "*.eot", "*.ttf", "*.woff", "*.woff2", "*.pdf"]. Perhaps exclude option should add to the default list instead of setting it, but then it would be impossible to un-exclude the default excludes with just configuration. What do you think?

@jmuheim
Copy link
Author

jmuheim commented Mar 25, 2015

I think one never needs to look through the default files, so one should simply add to the list.

@glebm glebm added this to the 0.8.0 milestone Mar 26, 2015
@glebm glebm closed this as completed Mar 31, 2015
jmuheim pushed a commit to jmuheim/base that referenced this issue Apr 1, 2015
bartimaeus added a commit to bartimaeus/i18n-tasks that referenced this issue Apr 30, 2015
* upstream/master: (58 commits)
  Bump to 0.8.3
  ActiveSupport < 4 compat
  Bump to 0.8.2
  Fix failure on nil values in the data config glebm#142
  Bump to 0.8.1
  bump to 0.8.0
  Update the default config file, edit the Readme
  Config  appends to and not overrides the list glebm#137
  Update CHANGES.md
  Don't require spec_helper where you don't need to.
  Add missing keys detected in source to all locales glebm#134
  cli
  cli.rb: extract help_option
  Verbose option help
  improve CLI DSL
  update template defaults to match
  cli.rb codeclimate
  minor fixes
  test-infra
  slop -> optparse
  ...
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

No branches or pull requests

2 participants