-
Notifications
You must be signed in to change notification settings - Fork 84
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
Config file usage #362
Comments
@KamasamaK,
backstory: |
@ryaneberly Adding the JSON config support for the command line for 1.2.0 would be great! |
The configuration reads .cflintrc in the current folder and it's parent folders relative to the -folder argument now. |
@ryaneberly Great. Is that also relative to the |
Yes. the -file and -folder argument are aliases.
…On Sat, Jul 22, 2017 at 3:56 PM, KamasamaK ***@***.***> wrote:
@ryaneberly <https://github.com/ryaneberly> Great. Is that also relative
to the -file argument?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#362 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFtZu1KnT6XZzpFl3nlMg44xr1Ioixlhks5sQlPsgaJpZM4Od-CL>
.
|
@ryaneberly Thanks! I have confirmed that passing the JSON config file into the command line works, so consider 2. fixed. In my test using |
@KamasamaK, |
@ryaneberly I am seeing the same functionality between |
Hmm.. that helps. is the .cflintrc above the relative path ? That might be an ok functionality |
@ryaneberly Yes, it is. To makes things simple, I placed To be clear, now that I know this only affects relative path usage, this no longer falls into the functionality that I requested for 1.2.0. It would obviously be nice to have, but not a blocker in my opinion. |
After some additional testing, I've noticed that the |
Hmm... Are you piping a directory (not a file) to stdin? I wouldn't |
I'm piping the contents of a file and passing the path to that file. Here's an example of what's executed through the command line: I was expecting it to check for a config file based on the path passed. For now, I will continue to have the extension handle checking and passing a |
Interesting. I agree, the could/should work. #373 added. |
Can we close this one? |
Since stdin has its own issue, the only one mentioned here that I believe is still unresolved is checking for |
If you pass
-file myfile.cfc
no .cflintrc files picked up
for
-file .\myfile.cfc
.cflintrc files in current directory included.
for
-file foo\bar\myfile.cfc
.cflintrc files in foo and bar directories are included (but no further up
the tree).
I think... I haven't tested that scenario much.
…On Sat, Jul 29, 2017 at 3:09 PM, KamasamaK ***@***.***> wrote:
Since stdin has its own issue, the only one mentioned here that I believe
is still unresolved is checking for .cflintrc from the command line when
passed a relative path. Is that something you think should work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#362 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFtZuxInu69I5xsRp0IO6VtXnyO8f08yks5sS4NbgaJpZM4Od-CL>
.
|
I had tested and confirmed those first two. That last one I hadn't tested, but I guess that makes sense. |
@ryaneberly to follow up what happened to this fix :) |
Found the problem. java File.getParent() will return null for relative paths. Changed to File.getAbsoluteFile().getParent() will return the parent folder regardless. |
I was struggling a bit with getting the JSON configuration file to work, and here is what I found.
configfile
?My take:
I would say that the way it should work is that it should always look for that file when scanning regardless of whether it's a file or folder. Also, I would expect that if you passed a file as the
configfile
through the command line that it would process like the project config.This is what I've found looking briefly through the code:
According to
com.cflint.config.CFLintConfig
, bothexcludes
andincludes
are lists ofcom.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage
. This is also somewhat supported by the documentation. I've been unable to get it to work this way through the command line. From what I can gather, the reason that didn't work and to address item 2. above is that it looks like the JSON config file is unmarshalled tocom.cflint.config.CFLintPluginInfo
from the command line, whereas the XML format can be either.Correct me on anything I got wrong, but let's discuss how it does and should work. I think we need to address all of these before deprecating the XML formatted config and certainly should make it clear if the command line's config file is different.
The text was updated successfully, but these errors were encountered: