kamasamak / vscode-cflint Goto Github PK
View Code? Open in Web Editor NEWAn extension to integrate CFLint into Visual Studio Code.
License: MIT License
An extension to integrate CFLint into Visual Studio Code.
License: MIT License
I had the wrong cflint.jarPath set and while the extension complains if there isn't a cflint.jarPath set, it doesn't appear to validate that the jar configured in cflint.jarPath exists
If you have a .cflintrc
in the root of your project, will it use it?
I've run into an issue where it appears as if the root .cflintrc file is being ignored by the VS code plugin.
I am currently using: CFLint-1.4.1-all.jar
My .cflintrc file looks like this: https://pastebin.com/d7GXVgLR and is located in the project root.
For example, I configured the "FUNCTION_TYPE_MISSING" to be ignored, yet I still get the following in the editor:
I opened the VS Code console and only see the following:
[Extension Host] [2019-03-24 12:56:23] C:\ProgramData\Oracle\Java\javapath\java.exe -jar D:\Dropbox\Settings\CFLint\CFLint-1.4.1-all.jar -stdin d:\Repositories\test-repo\models\agent\AgentForm.cfc -q -e -json -stdout
Hey KamasamaK,
if I create an empty ordered struct, your linter shows a message, that newStruct()
shouldn't be used. Instead I should use {}
but I don't think newStruct('ordered')
has such an equivalent, does it?
Best regards
At the moment, I can't make cflint working with a relative path like this
~/.local/share/cflint/cflint.jar
or
$XDG_DATA_HOME/cflint/cflint.jar
or
$HOME/me/.local/share/cflint/cflint.jar
I need to use this path:
/Users/me/.local/share/cflint/cflint.jar
And the problem is that I've the same config on my MacBook Pro than my ThinkPad with ArchLinux.
If this problem take you too much time I can look at it and make a PR.
Hi,
after the recent update to VSCode v1.38 the popups, that appear when I hover over an ColdFusion tag with the mouse, look differently. I'm pretty sure before they contained the CFLint result and an explanation of the CF keyword. Now, the CFLint result is missing and the explanations displays a placeholder for images.
When attempting to clear the existing problems found by CFLint, the message is returned that "command 'cflint.clearAllProblems' not found". Reviewed configuration and documentation and unable to see what could be causing this. Thanks!
After updating to VSCode 1.20.1 I noticed that the CFLint extension will no longer run. Anytime I open a .CFC file, I get the following error:
You must set cflint.jarPath to a valid path in your settings
Before this update, I did not have to do such a step. Any idea where this CFLint JAR file would be?
When using the "Save All" command or find and replacing across many files (which in turn opens every file) this extension attempts to lint. While, I like the linting onOpen and onSave, it would be nice if it could throttle itself and check if the file is still open before running.
Consider this desired effect:
I did this with a 200+ file batch the other day, it was painful. lol
//cflint ignore:FUNCTION_TYPE_MISSING
Applied line based rules and the rules still fire.
Whenever I save a CF file, having enabled the CFLint extension, I get the error:
There was a problem with CFLint. spawn java.exe ENOENT
I have made sure that the jar file is in my PATH and have specified the following in my settings file:
"cflint.enabled": true,
"cflint.jarPath": "C:\\The\\Path\\To\\My\\CFLint-1.3.0-all.jar",
Any idea what this problem could be? If you need any more information just ask!
Thanks
Most likely this has to do with Info and Warnings. Are they treated differently with excludes?
If I do this in vscode config:
"cflint.ignoreInfo": true,
"cflint.ignoreWarnings": true
they Info and Warning messages disappear. But I don't want to turn all of them off, just the rules I picked in excludes...
I've tried this with 1.2.3 and 1.2.0 jar files, at first I thought maybe it was related to the issue you mentioned in 1.2.2 that hasn't been resolved yet.
But when I add a .cflintrc file with the following, it seems to continue to report all those rules.
{
"rule" : [ ],
"excludes" : [
{"code": "VAR_HAS_PREFIX_OR_POSTFIX"},
{"code": "MISSING_VAR"},
{"code": "VAR_INVALID_NAME"},
{"code": "MISSING_VAR"},
{"code": "FUNCTION_TOO_COMPLEX"},
{"code": "VAR_IS_TEMPORARY"},
{"code": "SCOPE_ALLCAPS_NAME"}
],
"includes": [ ],
"inheritParent" : true
}
EDITED: Fixed formatting (KamasamaK)
Hello,
I have just update to v0.3.2 and it does not appear to be executing the CFlint jar. I have check the config paths and that I am using the Cflint v1.4.1. When watching the task manager I am not seeing the JAR being executed on a file open or a file save. I am not sure what more information I can give to help troubleshoot. I have 7 other co-workers that have report the same issues.
Let me know what information it any that I can give that might help resolve this issue.
VS Code v1.30.2(user setup)
OS: Windows 10
Getting this error but not sure how to fix it.
Hi!
I installed everything, and restarted VSCode.
The linter works when going through the commands, "Manually run CFLint on currently opened file". It does work, and outputs the errors correctly.
But even though the settings seem to be correct, the lint is not done if not asked manually.
I even tried the onChange, but to no avail.
"cflint.runModes": {
"onOpen": true,
"onSave": true,
"onChange": true
}
I do not see anything specific in the Debug Console of VSCode.
Thanks for any advice or input!
VSC : 1.48.0
Extension version : 0.3.4 (from Marketplace)
Using CFLint-1.5.0-all.jar (but should not be an issue because linting works when launched manually).
Hi,
I look at the files I modified, click on one and the the local version and the previous version of that file appera in a split view. In Windows Taskmanager I see the linter runs on both files. (Two JAVA processes) I have a .cflintrc
file in my project root. As far as I understand Code copies the file versions to a tmp
folder. Is cflint run there? Is the .cflintrc
considered, that is supposed to limit the number of tests, or does it run a full scan?
Best,
Bernhard
I have discovered that CFLint has stopped running, this is after it would work on save/on open and running manually. Furthermore, it would appear that when I tell it to run and output to a specific format, I can see the output of the command it attempt to run when using the Debugger Console and it appears similar to the following:
java.exe -jar \CFLint-1.5.0-all.jar -stdin \MyCFC.cfc -q -e -json -jsonfile \cflint-results-MyCFC-1611540759554.json
Yet even running in this mode never generates the json output file.
I do have your CFML extension installed as well and as noted, it was running fine up until recently and no other changes/extensions were installed/etc.
I also did further testing, attempting to use OpenJDK (I was running on the standard Oracle JVM before), and no differences were observed, it would just not run.
Finally, I attempted to run the cflint jar via the command line directly and the same behavior occurred there, where with "-stdin" it would just hang and never complete. I then discovered that the command line also offers the option to run with "-file" and when I ran with that parameter, the linter finally ran and generated expected output.
I have tested this on a few different systems and have observed this behavior across multiple systems (different OSes even) and am unsure what next steps to take might be. I'm unsure why the use of "-stdin" is not letting it complete and am curious if the extension could be updated to use "-file" instead. It does not appear to cause any undue issues and allows the linter to run and generate the output as expected.
Thanks again.
Hello, thank you very much for your extension. I am try to use cflint.exclude
in my project settings to exclude the builds
directory from being processed by cflint extension, and no matter what I do, cflint processes the files when I build my project into the builds
directory.
{
"cflint.exclude": ["builds/*"]
}
I have tried these variations and none seem to work:
"builds"
"builds/*"
"builds/*/*"
"builds/**/*"
"builds/**/*.*"
"/builds/**.cf*"
"/builds/**/*"
Incidentally the project is being built with Gulp. When the files are built, cflint starts processing all of them immediately.
Your help/ideas are appreciated.
VS Code version: 1.34.0 (Mac)
Extension version: 0.3.3
CFLint version: 1.4.1
Is there a way to export the results in some kind of file (like HTML when you run CFLINT from command line? also txt is ok)
It looks like CFLint stopped working for me in the latest VS Code 1.37.1
When I open a CFM page, I see the following in the dev console:
[Extension Host] [2019-09-05 12:15:36] cflint is active! console.ts:137 [Extension Host] TypeError: Cannot read property 'getAPI' of undefined at activate (C:\Users\Henweigh\.vscode\extensions\kamasamak.vscode-cflint-0.3.4\out\src\extension.js:695:43) at Function._callActivateOptional (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:764:518) at Function._callActivate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:764:207) at define._doActivateExtension.Promise.all.then.e (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:763:245) t.log @ console.ts:137 $logExtensionHostMessage @ mainThreadConsole.ts:38 _doInvokeHandler @ rpcProtocol.ts:394 _invokeHandler @ rpcProtocol.ts:379 _receiveRequest @ rpcProtocol.ts:299 _receiveOneMessage @ rpcProtocol.ts:226 _protocol.onMessage.e @ rpcProtocol.ts:101 fire @ event.ts:572 a @ ipc.net.ts:421 e @ ipc.net.ts:428 fire @ event.ts:572 _receiveMessage @ ipc.net.ts:715 S._socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:578 fire @ event.ts:572 acceptChunk @ ipc.net.ts:236 _register._socket.onData.e @ ipc.net.ts:197 t @ ipc.net.ts:28 emit @ events.js:182 addChunk @ _stream_readable.js:283 readableAddChunk @ _stream_readable.js:264 Readable.push @ _stream_readable.js:219 onStreamRead @ internal/stream_base_commons.js:94
Screenshot attached:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.