Unused resource -> 'warning' not 'error'.

This commit is contained in:
Kris De Volder
2017-05-08 11:32:30 -07:00
parent 807bf5901a
commit cfbe735ad4
3 changed files with 23 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ public class ConcourseModel {
.filter(refNode -> defName.equals(NodeUtil.asScalar(refNode)))
.findAny();
if (!reference.isPresent()) {
problems.accept(YamlSchemaProblems.schemaProblem("Unused '"+entityTypeName+"'", node));
problems.accept(YamlSchemaProblems.problem(PipelineYmlSchemaProblems.UNUSED_RESOURCE, "Unused '"+entityTypeName+"'", node));
}
}
}

View File

@@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2017 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.concourse;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemSeverity;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemType;
import static org.springframework.ide.vscode.commons.yaml.reconcile.YamlSchemaProblems.*;
public class PipelineYmlSchemaProblems {
protected static final ProblemType UNUSED_RESOURCE = problemType("PipelineYamlUnusedResource", ProblemSeverity.WARNING);
}

View File

@@ -3582,7 +3582,8 @@ public class ConcourseEditorTest {
" plan:\n" +
" - get: version\n"
);
editor.assertProblems("source-repo|Unused 'Resource'");
Diagnostic p = editor.assertProblems("source-repo|Unused 'Resource'").get(0);
assertEquals(DiagnosticSeverity.Warning, p.getSeverity());
editor = harness.newEditor(
"resources:\n" +