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

Docs for using linter via java #12

Closed
cfjedimaster opened this issue Jul 30, 2014 · 8 comments
Closed

Docs for using linter via java #12

cfjedimaster opened this issue Jul 30, 2014 · 8 comments

Comments

@cfjedimaster
Copy link

Less a bug and more a request for help. Given that I've got an instance of the linter, and I see there is a scan API:

linter = createObject("java","com.cflint.CFLint");
linter.scan(selection.path);

But it returns void. How do I get the results?

@cfjedimaster
Copy link
Author

Is at as simple as linter.getBugs()?

@cfjedimaster
Copy link
Author

Hmm. If I run getBugList on it, I get a struct based on the type of error, and then arrays in there. That works, but is there a way to get list as is, in the order found? I can easily convert a struct of arrays into one array, but just asking if there is something baked in.

@ryaneberly
Copy link
Contributor

Hmm. I didn't put much thought into making it a friendly java API to
consume.

You can get an array of arrays with
lint.getBugs().getBugList().values()

which isn't much a simplification over struct of arrays.

On Wed, Jul 30, 2014 at 3:09 PM, Raymond Camden [email protected]
wrote:

Hmm. If I run getBugList on it, I get a struct based on the type of error,
and then arrays in there. That works, but is there a way to get list as is,
in the order found? I can easily convert a struct of arrays into one array,
but just asking if there is something baked in.


Reply to this email directly or view it on GitHub
#12 (comment).

@cfjedimaster
Copy link
Author

i just mandhandled it myself. Want a copy of the extension before I blog it?

On Wed, Jul 30, 2014 at 3:41 PM, ryaneberly [email protected]
wrote:

Hmm. I didn't put much thought into making it a friendly java API to
consume.

You can get an array of arrays with
lint.getBugs().getBugList().values()

which isn't much a simplification over struct of arrays.

On Wed, Jul 30, 2014 at 3:09 PM, Raymond Camden [email protected]

wrote:

Hmm. If I run getBugList on it, I get a struct based on the type of
error,
and then arrays in there. That works, but is there a way to get list as
is,
in the order found? I can easily convert a struct of arrays into one
array,
but just asking if there is something baked in.


Reply to this email directly or view it on GitHub
#12 (comment).


Reply to this email directly or view it on GitHub
#12 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden

@ryaneberly
Copy link
Contributor

Great, glad you were able to roll it out. I don't have a local CFBuilder
install at the moment, just CFEclipse. I am interested in reading what you
put down about it though.

On Wed, Jul 30, 2014 at 4:54 PM, Raymond Camden [email protected]
wrote:

i just mandhandled it myself. Want a copy of the extension before I blog
it?

On Wed, Jul 30, 2014 at 3:41 PM, ryaneberly [email protected]
wrote:

Hmm. I didn't put much thought into making it a friendly java API to
consume.

You can get an array of arrays with
lint.getBugs().getBugList().values()

which isn't much a simplification over struct of arrays.

On Wed, Jul 30, 2014 at 3:09 PM, Raymond Camden <
[email protected]>

wrote:

Hmm. If I run getBugList on it, I get a struct based on the type of
error,
and then arrays in there. That works, but is there a way to get list
as
is,
in the order found? I can easily convert a struct of arrays into one
array,
but just asking if there is something baked in.


Reply to this email directly or view it on GitHub
#12 (comment).


Reply to this email directly or view it on GitHub
#12 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden


Reply to this email directly or view it on GitHub
#12 (comment).

@ryaneberly
Copy link
Contributor

Forgot to mention:
you can interrogate the version:
var version = createobject('java','com.cflint.Version').getVersion()
(static method - returns a string)

On Wed, Jul 30, 2014 at 7:34 PM, Ryan Eberly [email protected] wrote:

Great, glad you were able to roll it out. I don't have a local CFBuilder
install at the moment, just CFEclipse. I am interested in reading what you
put down about it though.

On Wed, Jul 30, 2014 at 4:54 PM, Raymond Camden [email protected]
wrote:

i just mandhandled it myself. Want a copy of the extension before I blog
it?

On Wed, Jul 30, 2014 at 3:41 PM, ryaneberly [email protected]
wrote:

Hmm. I didn't put much thought into making it a friendly java API to
consume.

You can get an array of arrays with
lint.getBugs().getBugList().values()

which isn't much a simplification over struct of arrays.

On Wed, Jul 30, 2014 at 3:09 PM, Raymond Camden <
[email protected]>

wrote:

Hmm. If I run getBugList on it, I get a struct based on the type of
error,
and then arrays in there. That works, but is there a way to get list
as
is,
in the order found? I can easily convert a struct of arrays into one
array,
but just asking if there is something baked in.


Reply to this email directly or view it on GitHub
#12 (comment).


Reply to this email directly or view it on GitHub
#12 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden


Reply to this email directly or view it on GitHub
#12 (comment).

@cfjedimaster
Copy link
Author

Ok, I'll blog it tomorrow.

On Wed, Jul 30, 2014 at 6:34 PM, ryaneberly [email protected]
wrote:

Great, glad you were able to roll it out. I don't have a local CFBuilder
install at the moment, just CFEclipse. I am interested in reading what you
put down about it though.

On Wed, Jul 30, 2014 at 4:54 PM, Raymond Camden [email protected]

wrote:

i just mandhandled it myself. Want a copy of the extension before I blog
it?

On Wed, Jul 30, 2014 at 3:41 PM, ryaneberly [email protected]
wrote:

Hmm. I didn't put much thought into making it a friendly java API to
consume.

You can get an array of arrays with
lint.getBugs().getBugList().values()

which isn't much a simplification over struct of arrays.

On Wed, Jul 30, 2014 at 3:09 PM, Raymond Camden <
[email protected]>

wrote:

Hmm. If I run getBugList on it, I get a struct based on the type of
error,
and then arrays in there. That works, but is there a way to get list
as
is,
in the order found? I can easily convert a struct of arrays into one
array,
but just asking if there is something baked in.


Reply to this email directly or view it on GitHub
<
https://github.com/ryaneberly/CFLint/issues/12#issuecomment-50664564>.


Reply to this email directly or view it on GitHub
#12 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden


Reply to this email directly or view it on GitHub
#12 (comment).


Reply to this email directly or view it on GitHub
#12 (comment).

Raymond Camden, Web Developer for Adobe

Email : [email protected]
Blog : www.raymondcamden.com
Twitter: raymondcamden

@ryaneberly
Copy link
Contributor

I enhanced the API to include a progress monitor, but you have to explicitly ask for it.

linter = createObject("java","com.cflint.CFLint");
linter.setShowProgress(true);
linter.scan(selection.path);

And added
linter.getBugs().getFlatBugList()
returns an array. (java list == CF array)

It will be available in the next version.

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

No branches or pull requests

2 participants