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

Having trouble using filterFile #60

Closed
AntoineGagnon opened this issue Jun 11, 2015 · 7 comments
Closed

Having trouble using filterFile #60

AntoineGagnon opened this issue Jun 11, 2015 · 7 comments
Assignees

Comments

@AntoineGagnon
Copy link
Contributor

I am having some trouble using the filterFile argument, I am trying to ignore file names containing the & character. I tried using &, .&. and the same by escaping the & character using &

I don't get what kind of regural expression I am supposed to use ?

@ryaneberly
Copy link
Contributor

it uses the regex defined in http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
The following should work for you:

      .*&.*

@AntoineGagnon
Copy link
Contributor Author

I tried it already :

✘-1 ~/testFolder [master|✚ 12067…565]
14:39 $ ls CFlint/
dsp_hotel_drill_down.cfm  dsp_hotel_list&map.cfm
✔ ~/testFolder [master|✚ 12067…565]
14:41 $ java -jar CFLint-0.4-all.jar -folder CFlint/ -filterFile '.*&.*'
log4j:WARN No appenders could be found for logger (net.htmlparser.jericho).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Error in:         <cfset var local.passField = false> @ 655:
Error in:         <cfset var local.totalChars = 0> @ 820:
Error in:         <cfset var local.currentChars = 0> @ 821:
Error in:         <cfset var local.halfChars = 0> @ 822:
Error in:         <cfset var local.amenNames = ""> @ 823:
ERROR:  'The reference to entity "map.cfm" must end with the ';' delimiter.'
ERROR:  'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The reference to entity "map.cfm" must end with the ';' delimiter.'
Exception in thread "main" java.io.IOException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The reference to entity "map.cfm" must end with the ';' delimiter.
    at com.cflint.main.CFLintMain.execute(CFLintMain.java:298)
    at com.cflint.main.CFLintMain.main(CFLintMain.java:168)
Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The reference to entity "map.cfm" must end with the ';' delimiter.
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:755)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:357)
    at com.cflint.XMLOutput.outputFindBugs(XMLOutput.java:101)
    at com.cflint.HTMLOutput.output(HTMLOutput.java:34)
    at com.cflint.main.CFLintMain.execute(CFLintMain.java:296)
    ... 1 more
Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The reference to entity "map.cfm" must end with the ';' delimiter.
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:584)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:745)
    ... 5 more
Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The reference to entity "map.cfm" must end with the ';' delimiter.
    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:427)
    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:215)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:562)
    ... 6 more

@ryaneberly
Copy link
Contributor

Oops.. it's JSON
Try:

     .*&amp;.*

@AntoineGagnon
Copy link
Contributor Author

Not working either :/ Tried & too.. Should I place it between quotes or slashes ?

@ryaneberly
Copy link
Contributor

https://github.com/cflint/CFLint/blob/5dc8088d94a60bd8b1bf6a9be30226d43e3f49ca/src/main/java/com/cflint/tools/CFLintFilter.java

Line 85.
You could run in debug as see what the file name is it that point.

You should not need slashes, you'll see them in the filter tests b/c that
is how Java escapes characters in strings.

It should be something very much like:
{
file=".&."
}

I'll try to debug it this weekend if you don't figure it out.

On Thu, Jun 11, 2015 at 3:50 PM, AntoineGagnon [email protected]
wrote:

Not working either :/ Tried & too.. Should I place it between quotes or
slashes ?


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

@ryaneberly ryaneberly self-assigned this Jun 12, 2015
@ryaneberly
Copy link
Contributor

This is a bug. It is actually trying to write the & to the output file. It shouldn't be doing that.

ryaneberly added a commit that referenced this issue Jun 16, 2015
@ryaneberly
Copy link
Contributor

This works

        {"file":".*&.*"},

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