Comments (5)
Thanks for the bug report! I added a test reproducing the issue and will try to fix as soon as I can 👍
from credo.
I thank you for your work for the community :)
from credo.
@rrrene I just looked at this issue and think it is best to just remove the regex before applying the checks. But this lead to the next problem: how to properly detect the end of the regex? Instead of trying to detect the end of the regex, I propose to just strip everything following the ~r
prefix.
So I came up with a simple but working solution by inserting
line = line |> String.replace(~r/\~r.*$/, "")
before this line:
https://github.com/rrrene/credo/blob/master/lib/credo/check/consistency/space_in_parentheses/with_space.ex#L19
Yes, it is far from being optimal and may remove too much code that could contain problems, but until we find a better solution it should work. What do you think?
from credo.
@hojgr I re-opened this issue since it is not fixed, yet.
@c-rack I agree something like that will be the way to go. There is also the Credo.Code.Sigils module, which was introduced to strip sigils from source code. That way we could at least remove the ~r
sigils cleanly.
from credo.
@hojgr v0.3.3
contains a fix. Thx again for reporting! 👍
from credo.
Related Issues (20)
- Add list of standard checks to docs HOT 2
- Credo.Check.Warning.Dbg does not detect `dbg` HOT 8
- #FIXME fails silently HOT 6
- Credo wrongly reports about macro name HOT 2
- Credo.Check.Warning.MissedMetadataKeyInLoggerConfig reporting false errors since 1.7.2 upgrade HOT 8
- Elixir version check fails with Credo.Check.Warning.LazyLogging HOT 1
- Credo warning /test/add_credo_plugin_to_project.exs:121:6 HOT 2
- Code readability: Predicate function names should not start with 'is', and should end in a question mark. HOT 1
- Command line switch `--read-from-stdin` doesn't respect config files HOT 4
- Predicate callbacks from behavior are not ignored HOT 2
- Issue with Unused variables confused about the strategy HOT 1
- missing spec on unquoted function raise error HOT 3
- Credo.Check.Warning.WrongTestFileExtension displayed in non-test module in v1.7.4 HOT 8
- NoAmbiguousAliases fails on function param with name alias HOT 3
- "Most of the time you are using the multi-alias/require/import/use syntax..." with compile_env HOT 4
- Gracefully handle output of bitstring `:message` in `%Credo.Issue{}` HOT 8
- False positive: spec in quoted HOT 3
- False Positive: Macro sigils with uppercase words HOT 4
- `UnusedKeywordOperation` check should ignore `Keyword.validate!/2` HOT 4
- Arguable advice from `Credo.Check.Refactor.AppendSingleItem` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from credo.