-
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
How can I update the version of CFLint installed with the ColdFusion Builder extension? #327
Comments
Great question. I don't use CF Builder myself, and that extension hasn't been updated in a while. But you should be able replace ALL the jars in cflint_lib with the all jar from maven. https://search.maven.org/remotecontent?filepath=com/github/cflint/CFLint/1.1.0/CFLint-1.1.0-all.jar |
Try changing line 4 of runlinter.cfm from: That should fix it. CFLint has grown significantly since that extension was implemented. |
@ccsimmons When you get it going, could you PR the necessary changes to Ray's project and would you mind writing up a brief setup documentation for CFBuilder / CFLint on our wiki? |
@TheRealAgentK sure thing... @ryaneberly suggestion gets it running (after adding a closing parenthesis)... but I don't think it is actually finding "issues". See the attached little example where it should have returned avoid-using-cfdump-tag and avoid-using-cfabort-tag. CFLint in Atom returns them. I poked around in Ray's runlint.cfm but didn't really see anything that was obvious to me. |
Is runlint.cfm specifically setting certain rules to be used/not used maybe?
…On Sun, 2 Jul 2017 at 12:13 PM, Chris Simmons ***@***.***> wrote:
@TheRealAgentK <https://github.com/therealagentk> sure thing...
@ryaneberly <https://github.com/ryaneberly> suggestion gets it running
(after adding a closing parenthesis)... but I don't think it is actually
finding "issues". See the attached little example where it should have
returned avoid-using-cfdump-tag and avoid-using-cfabort-tag. CFLint in Atom
returns them. I poked around in Ray's runlint.cfm but didn't really see
anything that was obvious to me.
[image: screen shot 2017-07-01 at 8 02 36 pm]
<https://user-images.githubusercontent.com/1590940/27766257-851cc7b6-5e98-11e7-90ec-2700fd6ccf29.png>
[image: screen shot 2017-07-01 at 8 02 53 pm]
<https://user-images.githubusercontent.com/1590940/27766260-885504b6-5e98-11e7-9f8b-991000ed8c3c.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#327 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AATrRDbLuh0VF6KwoGABZ7lX_bPMpAfXks5sJuCRgaJpZM4OLWhO>
.
|
That's kind of what I wondered but I don't see anything obviously specifying it.
It looks like this bit above does the scan and then there is a loop over the bugStruct to append to bugArr (which is looped over to display the issues). If I dump bugStruct it's empty. |
Hmm... I don't have CFBuilder - hard to properly test. I'll try to whip up a simple CFML page trying to run the essence of calling CFLint through CFML and see if I can reproduce it. |
In a nutshell: the issue is that there's no empty CFLint constructor anymore. You'll need to pass in a configuration object and because CF is really clunky when it comes to calling Java, it's a bit messy. I believe something like this should work from a code point of view (at least as a starting point):
However, when I run it in my ACF 11 locally, I get an exception in my logs that point towards some logging issue/conflict:
|
Don't know if this helps... but it works if I copy the jar from the Atom plugin (.atom/packages/linter-cflint/bin/CFLint-0.10.0-all.jar) to cflint_lib instead of the one from https://search.maven.org/remotecontent?filepath=com/github/cflint/CFLint/1.1.0/CFLint-1.1.0-all.jar |
Sorry, I must have been writing my comment as you were posting yours. |
@ccsimmons Re the older version - I'm pretty sure that'd be the case because the way how CFLint gets executed and setup seems to have changed quite a bit between 0.10 and 1.0/1.1. See my other post re the setup - but I don't know what to do about the logging exception. That might be an issue on CF11 specifically, not sure how CFBuilder executes this and deals with library requirements. |
@ccsimmons It seems that if I put CFLint-1.1.0-all.jar in cfusion/runtime/lib instead of cfusion/lib it'll execute just fine and not throw the exception. You will need to add Also: What I've pieced together up there is just a very, very simple default config. If you want to mimic what all the configuration options can do (with .cflintrc for directories, command-line config etc) I'm pretty sure you'd need to do more than that. It might be worthwhile to go through CFLintMain (.main() as well as .execute()) to see and understand how that's all pieced together now. I strongly recommend you do that in the dev branch as we're releasing 1.2.0 from it very soon. |
If you could manage to put together something that's working and configurable based on the code I gave you, I wonder if we could put together "an entry" point into the CFLint system that can be called in an easier way from CFBuilder. For instance com.cflint.ide.CFLintCFBuilder --- in a similar way to how there is a CFLintTask as an entry point for Ant. @ryaneberly ??? |
Why was the no-argument constructor removed from |
@TheRealAgentK so would the parsing of .cflintrc need to be something done in the ColdFusion Builder extension, or would ColdFusion Builder check for the existence of .cflintrc in the project and pass the file into CFLinter for parsing (and if the file does not exist use the code above for the default settings)? |
I think rather than CFLintCFBuilder, we just need to generically support an api, just like we support the CLI. |
@ccsimmons I'm not 100% sure how CFBuilder works - does it trigger cflint for the current file or for a path? I think in general cflintrc would be checked by CFLint and not by the extension, but I'm pretty sure that the code I've pulled together would not deal with anything else but a default config. |
@ryaneberly yes! |
The CFBuilder extension checks to see if the "selection" is a file or folder but really only for the purpose of customizing the header of the resulting output to the user. It uses |
@ccsimmons If I'm understanding the |
How are you going with this? |
Sorry for the delay. I submitted a PR to Ray a few minutes ago for an update that uses the new jar and the default configuration. What Wiki page would you like me to put the "brief setup documentation for CFBuilder / CFLint" on? |
We just talked about where to put those IDE integrations and we prefer to - in general - get people to include/host them with the respective project. The CFLint Wiki will eventually go away and all the content will be delivered via the README and associated .md files. So, ideally a paragraph with some basic info would continue to live on our end here and ideally the instructions on how to get CFBuilder going with CFLint would live on the CFBuilder-CFLint-Extension README. Maybe you could build it into the README and PR that to Ray too? |
I see the PR was accepted by Ray - closing ticket now. |
Been meaning to comment on this. Unrelated to the CFB extension, the next version of the eclipse plugin for CFLint (that CFEclipse uses) can be used with CFB too. It's nice in that it has a UI for configuring rules, and eventually will have "quick fixes" that you can do to add ignores and stuff, the way you can do when editing Java. |
@denuno Thanks! I was going to ask about this. I installed it from here, but didn't see how it was supposed to work. I'm very interested in this "quick fixes" too. I've seen other IDE linters have this functionality as well. I will have to check it out once you've done it to see if it can be integrated into the Atom or VS Code plugins since those platforms appear to support that. |
Each IDE has it's own way of doing the "quick fix" stuff (of course-- standardization is for the weak and timid!) but I'll aim to keep the implementation as agnostic as possible. You can also do teeny Eclipse programs that only have what they need to run, which would sorta give us a GUI of sorts with what's there now, but I'd love to support more than just Eclipse, and thus make "quick fixes" and such as plug-in-able to other stuphs as possible. |
That would be a pretty interesting thing to have in CFLint itself, actually, along with a mode where you could enable auto-fixing (or maybe auto-ignoring)... e.g. instead of just warning about an unscoped var, optionally have it var scope it... yeah, something like enabling "suggestions", where it says what rule is broke and then also (if it is easy to figure out) shows a proposed fix. Something to think about at least. For sure would want it to be optional, as something like that would slow things down a bit I reckon. |
@denuno Exactly! Perhaps you could create a new issue with your thoughts on this feature. |
Autofix would be interesting. Some scenarios would be easier to assume the right answer than others. |
Sure, and perhaps in some cases you might even have more than one suggestion. Not all rules would be conducive to having that at all. But this should really have its own issue. |
Agree. #374
…On Thu, Jul 27, 2017 at 8:09 PM, KamasamaK ***@***.***> wrote:
Sure, and perhaps in some cases you might even have more than one
suggestion. Not all rules would be conducive to having that at all. But
this should really have its own issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#327 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFtZu5JFq0C6n1ByJtZYKS_H5aDhTXfPks5sSSacgaJpZM4OLWhO>
.
|
I looked at the post here: https://github.com/cfjedimaster/CFLint-Extension. The instructions indicate:
I'm not sure exactly where/which jars I'm supposed to copy after I download CFLint.
I apologize if this is a stupid question.
The text was updated successfully, but these errors were encountered: