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)
- Custom Check Testing Documentation
- False positive on unused path value HOT 4
- Alias order doesn't respect case. HOT 4
- Numbers larger than 9999 should be written with underscores HOT 3
- Exception naming consistency check produces unexpected reasoning HOT 3
- oom/runs infinitely on with having when guard HOT 2
- Checking multiple files (not all the project) does not work
- In Windows folder path with ending `\` does not work with `--format json` HOT 4
- Credo segfaults (Elixir 1.14.2, Credo 1.6.7, Ubuntu 22.04) HOT 3
- False positive on NestedFunctionCalls check HOT 2
- False positive on MultiAliasImportRequireUse when using multiple modules in same file HOT 1
- False positive of `Credo.Check.Warning.UnusedStringOperation` HOT 3
- False positive: Identical sub-expression of || and && operator HOT 4
- False positive: snake_case warning for operators HOT 6
- MissedMetadataKeyInLoggerConfig shouldn't warn if you don't use the console logger backend HOT 6
- mix credo diff --from-git-ref master showing issues in files not modified HOT 5
- Warning on Elixir v1.14 HOT 2
- FunctionNames readability check does not recognize an acronym when followed by a symbol HOT 2
- False positive on Credo.Check.Refactor.Apply when piped HOT 1
- Readability.AliasOrder error for ordered prefixed modules HOT 2
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.