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

.cflintrc throwing errors with 1.4.0 #578

Closed
zspitzer opened this issue Jun 8, 2018 · 6 comments
Closed

.cflintrc throwing errors with 1.4.0 #578

zspitzer opened this issue Jun 8, 2018 · 6 comments
Milestone

Comments

@zspitzer
Copy link

zspitzer commented Jun 8, 2018

I just started getting heaps of warnings in vscode, looking into the vscode debug tool, it's running

C:\Program Files\Java\jdk1.8.0_162\bin\java.exe -jar c:\work\CFLint-1.4.0-all.jar -stdin s:\testGateway.cfc -q -e -json -stdout -configfile c:\work.cflintrc

trying this on command line, I get the following error.

also it just hangs and doesn't exit, requiring a to ctrl-c.

this configuration previously worked with the 1.3.x versions

Unable to load config file c:\work.cflintrc. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "rule" (class com.cflint.config.CFLintPluginInfo), not marked as ignorable (2 known properties: "ruleGroup", "ruleImpl"])
at [Source: java.io.FileInputStream@59ec2012; line: 2, column: 13] (through reference chain: com.cflint.config.CFLintPluginInfo["rule"])

{ "rule" : [ ], "excludes": [{"code":"ARGUMENT_ALLCAPS_NAME"},{"code":"ARGUMENT_HAS_PREFIX_OR_POSTFIX"},{"code":"ARGUMENT_INVALID_NAME"},{"code":"ARGUMENT_IS_TEMPORARY"}, {"code":"ARGUMENT_TOO_LONG"},{"code":"ARGUMENT_TOO_SHORT"},{"code":"ARG_DEFAULT_MISSING"},{"code":"ARG_HINT_MISSING"},{"code":"ARG_HINT_MISSING_SCRIPT"}, {"code":"ARG_TYPE_ANY"},{"code":"ARG_TYPE_MISSING"},{"code":"AVOID_USING_ARRAYNEW"},{"code":"AVOID_USING_CFABORT_TAG"},{"code":"AVOID_USING_CFDUMP_TAG"}, {"code":"AVOID_USING_CFINCLUDE_TAG"},{"code":"AVOID_USING_CFMODULE_TAG"},{"code":"AVOID_USING_CREATEOBJECT"},{"code":"AVOID_USING_DEBUG_ATTR"}, {"code":"AVOID_USING_ISDATE"},{"code":"AVOID_USING_STRUCTNEW"},{"code":"COMPONENT_HINT_MISSING"},{"code":"COMPONENT_INVALID_NAME"}, {"code":"COMPONENT_TOO_LONG"},{"code":"COMPONENT_TOO_WORDY"},{"code":"EXCESSIVE_ARGUMENTS"},{"code":"EXCESSIVE_FUNCTIONS"}, {"code":"EXCESSIVE_COMPONENT_LENGTH"},{"code":"EXCESSIVE_FUNCTION_LENGTH"}, {"code":"UNUSED_METHOD_ARGUMENT"}, {"code":"SQL_SELECT_STAR"}, {"code":"EXPLICIT_BOOLEAN_CHECK"},{"code":"FUNCTION_HINT_MISSING"},{"code":"FUNCTION_TOO_COMPLEX"}, {"code":"FUNCTION_TYPE_ANY"},{"code":"FUNCTION_TYPE_MISSING"},{"code":"GLOBAL_LITERAL_VALUE_USED_TOO_OFTEN"},{"code":"GLOBAL_VAR"}, {"code":"LOCAL_LITERAL_VALUE_USED_TOO_OFTEN"},{"code":"METHOD_INVALID_NAME"},{"code":"METHOD_IS_TEMPORARY"},{"code":"METHOD_TOO_LONG"}, {"code":"METHOD_TOO_WORDY"},{"code":"NESTED_CFOUTPUT"},{"code":"OUTPUT_ATTR"},{"code":"PACKAGE_CASE_MISMATCH"},{"code":"STRUCT_ARRAY_NOTATION"}, {"code":"UNQUOTED_STRUCT_KEY"},{"code":"VAR_ALLCAPS_NAME"},{"code":"VAR_HAS_PREFIX_OR_POSTFIX"},{"code":"VAR_INVALID_NAME"}, {"code":"VAR_IS_TEMPORARY"},{"code":"VAR_TOO_LONG"},{"code":"VAR_TOO_SHORT"},{"code":"VAR_TOO_WORDY"}, {"code":"SCOPE_ALLCAPS_NAME"}, {"code":"AVOID_USING_ABORT"}, {"code":"STRUCT_ARRAY_NOTATION"}, "includes" : [ ], "inheritParent" : false }

@KamasamaK
Copy link
Collaborator

The reason it hangs is because it is waiting for stdin. The VS Code extension uses stdin so that it can lint unsaved content. If you replace -stdin with -file it will complete.

Anyway, I also see this error. It appears that it is using the config file, though, so at least functionality is not affected.

@zspitzer
Copy link
Author

zspitzer commented Jun 9, 2018

I don't think it's being used, coz I'm seeing all the excludes showing up as problems?

that's why STRUCT_ARRAY_NOTATION appears twice in the above config and how I ended up filing this bug

@ryaneberly
Copy link
Contributor

Hmm. this is interesting.
You should not use -configfile, that is there to allow replacing the entire plugin definition set.

If you rename work.cflintrc to .cflintrc, and use -stdin c:\testGateway.cfc. CFLint will pick up the .cflintrc settings as part of the current source folder tree and apply it.

@ryaneberly ryaneberly added this to the 1.4.1 milestone Jun 10, 2018
@KamasamaK
Copy link
Collaborator

KamasamaK commented Jun 10, 2018

@ryaneberly Unless I am mistaken, -configfile could read the .cflintrc format as requested and changed in #362. I believe it was working fine before, as I recall testing it at the time and @zspitzer also says it was working before. If valid, the one passed into -configfile should take precedence.

@zspitzer My mistake. I was testing with a .cflintrc file in my project root, so it was actually picking it up that way instead. Although I do not see the relation with having STRUCT_ARRAY_NOTATION in there twice, which should be avoided. Maybe I'm misunderstanding something.

@zspitzer
Copy link
Author

@KamasamaK don't worry about the double STRUCT_ARRAY_NOTATION, it was merely explaining how I ended up filing the bug

@KamasamaK KamasamaK added the bug label Jun 23, 2018
ryaneberly added a commit that referenced this issue Sep 17, 2018
@ryaneberly
Copy link
Contributor

this is resolved in the dev branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants