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

AVOID_EMPTY_FILES being reported if file doesn't exist #336

Closed
TheRealAgentK opened this issue Jul 4, 2017 · 3 comments
Closed

AVOID_EMPTY_FILES being reported if file doesn't exist #336

TheRealAgentK opened this issue Jul 4, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@TheRealAgentK
Copy link
Collaborator

Running CFLint on the command line with -file against a file that doesn't exist and AVOID_EMPTY_FILES is enabled, it will report AVOID_EMPTY_FILES against that file.

Probably it should in this case not report but spit out a message on the command line and not even go into processing. This might be connected to the change in #291 .

<?xml version="1.0" encoding="UTF-8" ?>
<issues version="1.1.0" timestamp="1499135713">
  <issue severity="WARNING" id="AVOID_EMPTY_FILES" message="AVOID_EMPTY_FILES" category="CFLint" abbrev="AE">
    <location file="/Users/kai/Documents/Code/something/idontexist.cfc" fileName="idontexist.cfc" function="" column="1" line="1" message="CF file is empty: ${file}" variable="">
      <Expression><![CDATA[]]></Expression>
    </location>
  </issue>
  <counts totalfiles="1" totalsize="0">
    <count code="AVOID_EMPTY_FILES" count="1"></count>
    <count severity="WARNING" count="1"></count>
  </counts>
</issues>
ryaneberly added a commit that referenced this issue Jul 11, 2017
@ryaneberly
Copy link
Contributor

@TheRealAgentK , this is implemented.

@ryaneberly ryaneberly added this to the 1.2.0 milestone Jul 11, 2017
@TheRealAgentK
Copy link
Collaborator Author

Hmmm, still seeing this :(

java -jar CFLint-1.2.0-SNAPSHOT-all.jar -file /Users/kai/Documents/Code/doesntexist.cfc -xml -xmlfile something.xml -text -textfile something.txt -html -htmlfile something.html -htmlstyle default -json -jsonfile something.json -includeRule CFQUERYPARAM_REQ,QUERYPARAM_REQ,MISSING_VAR,AVOID_EMPTY_FILES -v

XML Output true
Text Output true
JSON Output true
HTML Output true
[main] INFO com.cflint.tools.CFLintFilter - No cflintexclude.json on classpath.
File /Users/kai/Documents/Code/doesntexist.cfc does not exist.
Writing XML to something.xml
Writing text to something.txt
Writing HTML (style: default.xsl) to something.html
Writing JSON to something.json
Total files scanned: 1
Total size: 0

In the JSON file I find:

[ {
  "severity" : "WARNING",
  "id" : "AVOID_EMPTY_FILES",
  "message" : "AVOID_EMPTY_FILES",
  "category" : "CFLINT",
  "abbrev" : "AE",
  "locations" : [ {
    "file" : "/Users/kai/Documents/Code/doesntexist.cfc",
    "fileName" : "doesntexist.cfc",
    "function" : "",
    "column" : 1,
    "line" : 1,
    "message" : "CF file is empty: ${file}",
    "variable" : "",
    "expression" : ""
  } ]
}, {
  "totalfiles" : 1
}, {
  "totalsize" : 0
}, {
  "code" : "AVOID_EMPTY_FILES",
  "count" : 1
}, {
  "severity" : "WARNING",
  "count" : 1
} ]

@TheRealAgentK TheRealAgentK reopened this Jul 11, 2017
ryaneberly added a commit that referenced this issue Jul 17, 2017
resolved
@ryaneberly
Copy link
Contributor

I see that. Try now.

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

No branches or pull requests

2 participants