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

Abstract component #736

Open
boris-schwarz opened this issue May 16, 2024 · 0 comments
Open

Abstract component #736

boris-schwarz opened this issue May 16, 2024 · 0 comments

Comments

@boris-schwarz
Copy link

Scenario

  • I'm using CFLint-1.5.0-all.jar with the VS Code extension CFLint v0.3.6
  • I created an abstract ColdFusion component aFoo.cfc with the following contents:
abstract component {

	/**
	 * @hint Gets a dummy string
	 */
	public string function getBar() output=false {
		return 'baz';
	}

}

Expected behaviour

CFLint should see no problems with this file.

Effective behaviour

  • CFLint gives me an error on line 1: End of statement(;) expected after abstract
  • CFLint gives me an error on line 12: End of statement(;) expected after function
  • CFLint gives me an error on line 12: End of statement(;) expected after false (This one is not visible in VS Code due being on the same line as the previous one. It can be seen by running CFLint manually, see below.)

Possible workaround

  • Remove abstract from the component during development. In my case this causes problems with depencendy injection tho.
  • Rewrite all abstract components in the cftag syntax, where it works.

Additional Information

  • Windows 11
  • Lucee 5.3.10.97
    Generated JSON from running CFLint-1.5.0-all.jar directly on the file with java -jar D:\CFLint\CFLint-1.5.0-all.jar -file D:\my-project\webroot\model\services\aFoo.cfc -json in the Windows Terminal
{
  "version" : "1.5.0",
  "timestamp" : 1715869816,
  "issues" : [ {
    "severity" : "ERROR",
    "id" : "MISSING_SEMI",
    "message" : "MISSING_SEMI",
    "category" : "CFLINT",
    "abbrev" : "MS",
    "locations" : [ {
      "file" : "D:\\my-project\\webroot\\model\\services\\aFoo.cfc",
      "fileName" : "aFoo.cfc",
      "function" : "",
      "offset" : 7,
      "column" : 7,
      "line" : 1,
      "message" : "End of statement(;) expected after abstract",
      "variable" : "abstract",
      "expression" : ""
    } ]
  }, {
    "severity" : "ERROR",
    "id" : "MISSING_SEMI",
    "message" : "MISSING_SEMI",
    "category" : "CFLINT",
    "abbrev" : "MS",
    "locations" : [ {
      "file" : "D:\\my-project\\webroot\\model\\services\\aFoo.cfc",
      "fileName" : "aFoo.cfc",
      "function" : "",
      "offset" : 261,
      "column" : 22,
      "line" : 12,
      "message" : "End of statement(;) expected after function",
      "variable" : "function",
      "expression" : ""
    } ]
  }, {
    "severity" : "ERROR",
    "id" : "MISSING_SEMI",
    "message" : "MISSING_SEMI",
    "category" : "CFLINT",
    "abbrev" : "MS",
    "locations" : [ {
      "file" : "D:\\my-project\\webroot\\model\\services\\aFoo.cfc",
      "fileName" : "aFoo.cfc",
      "function" : "",
      "offset" : 284,
      "column" : 45,
      "line" : 12,
      "message" : "End of statement(;) expected after false",
      "variable" : "false",
      "expression" : ""
    } ]
  } ],
  "counts" : {
    "totalFiles" : 1,
    "totalLines" : 18,
    "countByCode" : [ {
      "code" : "MISSING_SEMI",
      "count" : 3
    } ],
    "countBySeverity" : [ {
      "severity" : "ERROR",
      "count" : 3
    } ]
  }
}
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

1 participant