question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Could you please provide a syntax example for multi item phabricator-lint file?

See original GitHub issue

Hi, I followed your advanced guide and tried to build a phabricator-lint file for multiple src file:

These is the syntax I tried:

{ 
    {
        "name":  "PSAvoidUsingCmdletAliases",
        "code":  "PSAvoidUsingCmdletAliases",
        "severity":  "warning",
        "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
        "line":  139,
        "char":  50,
        "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
    },
    {
        "name":  "PSAvoidUsingCmdletAliases",
        "code":  "PSAvoidUsingCmdletAliases",
        "severity":  "warning",
        "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
        "line":  145,
        "char":  46,
        "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
    }
}
[ 
    {
        "name":  "PSAvoidUsingCmdletAliases",
        "code":  "PSAvoidUsingCmdletAliases",
        "severity":  "warning",
        "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
        "line":  139,
        "char":  50,
        "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
    },
    {
        "name":  "PSAvoidUsingCmdletAliases",
        "code":  "PSAvoidUsingCmdletAliases",
        "severity":  "warning",
        "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
        "line":  145,
        "char":  46,
        "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
    }
]
{
    [ 
        {
            "name":  "PSAvoidUsingCmdletAliases",
            "code":  "PSAvoidUsingCmdletAliases",
            "severity":  "warning",
            "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
            "line":  139,
            "char":  50,
            "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
        },
        {
            "name":  "PSAvoidUsingCmdletAliases",
            "code":  "PSAvoidUsingCmdletAliases",
            "severity":  "warning",
            "path":  "C:\\Jenkins\\workspace\\VMWARE\\src\\Backup\\Backup-VCSAToFile.ps1",
            "line":  145,
            "char":  46,
            "description":  "\u0027Select\u0027 is an alias of \u0027Select-Object\u0027. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content."
        }
    ]
}

But unfortunately I alway run into this error:

Archiving artifacts
[phabricator:plugin-provider] 'cobertura' plugin not installed.
[phabricator:process-build-result] No unit results available.
[phabricator:process-build-result] No coverage provider available.
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of {
	at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
	at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:919)
	at net.sf.json.JSONObject._fromString(JSONObject.java:1145)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:162)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:132)
	at com.uber.jenkins.phabricator.BuildResultProcessor.processLintResults(BuildResultProcessor.java:153)
	at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:203)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
	at hudson.model.Run.execute(Run.java:1760)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anonfriesecommented, Feb 9, 2018

According to https://github.com/uber/phabricator-jenkins-plugin/blob/master/docs/advanced.md#custom-lint the lintfile shouldn’t actually contain a valid JSON List/Dict but instead every Line should consist of a single JSON Dict in itself. This means every Line must be a valid JSON-Dict with the needed Keys, but the file itself won’t be valid JSON.

With that knowledge I got so far as to get 5 Lines parsed and shown up in Phabricator. Unfortunately on line no. 6 it fails with net.sf.json.JSONException: Found starting '{' but missing '}' at the end. at character 0 of null and i haven’t got a clue as to why. The Lint-Result that seems to fail is indeed the same as the previous line, same description, code, file etc., only a different Line 😦

0reactions
OCram85commented, Oct 31, 2018

To be honest: I did not get it. But its fine you can close this issue.

Thanks for all the advice!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Computing Multi-Item Scales in SPSS (SPSS Tutorial Video #3b)
In this video, I cover the details of how how to compute a multi - item scale using real world data. I 'll...
Read more >
Week 4 - Multi-Item Scales - YouTube
0:00 · New! Watch ads now so you can enjoy fewer interruptions. Got it ...
Read more >
The Syntax of Whether/Q… Or Questions : Ellipsis Combined ...
ABSTRACT. In this paper, we argue that the syntax of whether/Q . . . or questions involves both movement of whether/Q and ellipsis...
Read more >
Syntax I Checklist
Open class: you can make up new words in these categories ... which is an entity; How do you tell the difference between...
Read more >
Chapter 4. Analyzing Sentences – York Syntax
For example, if you can identify the subject of a sentence, you have analyzed the sentence and identified the role of one important...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found