qltysh-archive/codeclimate-grep

Multi-line matching

Opened this issue ยท 1 comments

Hello ๐Ÿ‘‹

In our codebase we embed translation functions in JSX code blocks, using a translation function t, like so

  <p>
    {t('GREET_CODE_CLIMATE_KEY')}
  </p>

An error I commonly make is to forget the curly-braces (which puts the literal function rather than its results).

I can easily check this using grep like so

grep -Rz "[^=]>[[:space:]]*t(" *

The problem here is that the [[:space:]] character class needs to be able to capture newlines for this to work. This functionality is enabled by the -z flag.

Is there a way to do this with this plugin, as is? If not would such functionality be desirable/easy to add?

I'm happy to help add if such a change is valuable!

Hey @mjgpy3 we don't use much this plugin internally so it is hard for me to tell without digging deeper.
Contributions are always welcome! If you are willing to open a PR, feel free to tag me for review.