Package com.puppetlabs.geppetto.diagnostic

Examples of com.puppetlabs.geppetto.diagnostic.FileDiagnostic


            forgeDeps = new ArrayList<Dependency>();
          forgeDeps.add(forgeDep);
        }
      }
      catch(InvalidVersionSpecificationException e) {
        result.addChild(new FileDiagnostic(
          Diagnostic.WARNING, ValidationService.GEPPETTO, e.getMessage(), mavenProject.getFile()));
      }
    }
    metadata.setDependencies(forgeDeps);
    return metadata;
View Full Code Here


          new LenientMetadataJsonParser(this).parse(path.toFile(), document.get(), chain);
        }
        for(Dependency dep : dependencies) {
          boolean resolved = isResolved(dep);
          if(!resolved) {
            FileDiagnostic diag = new FileDiagnostic(
              Diagnostic.ERROR, FORGE, getUnresolvedMessage(dep), path.toFile());
            diag.setLineNumber(dep.getLine());
            chain.addChild(diag);
            dependencyErrors = true;
          }
          dep.setResolved(resolved);
        }
View Full Code Here

      builder.append(d.getIssue());
      builder.append(" msg='");
      builder.append(d.getMessage());
      builder.append('\'');
      if(d instanceof FileDiagnostic) {
        FileDiagnostic fd = (FileDiagnostic) d;
        builder.append(" file=");
        builder.append(fd.getFile());
        builder.append(" line=");
        builder.append(fd.getLineNumber());
        if(fd instanceof DetailedFileDiagnostic) {
          DetailedFileDiagnostic dfd = (DetailedFileDiagnostic) fd;
          builder.append(" offset=");
          builder.append(dfd.getOffset());
          builder.append(" length=");
View Full Code Here

    "METADATA_JSON", MetadataJsonParser.class.getName());

  protected abstract void call(CallSymbol key, int line, int offset, int length, List<JElement> arguments);

  protected Diagnostic createDiagnostic(JElement element, int severity, String message) {
    FileDiagnostic diag = new FileDiagnostic(severity, METADATA_JSON, message, element.getFile());
    diag.setLineNumber(element.getLine());
    return diag;
  }
View Full Code Here

        chain.addChild(createDiagnostic(entry, ERROR, "Unrecognized call: " + entry.getKey()));
      }
    }

    if(!nameSeen || fullName != null && (fullName.getOwner() == null || fullName.getName() == null)) {
      chain.addChild(new FileDiagnostic(ERROR, PACKAGE, "A full name (user-module) must be specified", file));
    }

    if(!versionSeen) {
      chain.addChild(new FileDiagnostic(ERROR, PACKAGE, "A version must be specified", file));
    }
  }
View Full Code Here

        }
      });
  }

  private Diagnostic convertPuppetLintDiagnostic(File moduleRoot, Issue issue) {
    FileDiagnostic diagnostic = new FileDiagnostic(
      getSeverity(issue), PuppetLintService.PUPPET_LINT, issue.getMessage(), new File(getRelativePath(new File(
        moduleRoot, issue.getPath()))));
    diagnostic.setLineNumber(issue.getLineNumber());
    return diagnostic;
  }
View Full Code Here

  public static FileDiagnostic createSyntaxErrorDiagnostic(SyntaxException syntaxException, String id) {
    SourcePosition pos = syntaxException.getPosition();
    String msg = syntaxException.getMessage();
    if(msg == null)
      msg = "syntax error";
    FileDiagnostic fd = new FileDiagnostic(ERROR, PARSE_FAILURE, msg, new File(id == null
        ? pos.getFile()
        : id));
    fd.setLineNumber(pos.getStartLine() + 1);
    return fd;
  }
View Full Code Here

  private boolean nameSeen;

  private boolean versionSeen;

  protected void addDiagnostic(int severity, SourcePosition pos, String message) {
    FileDiagnostic diag = new FileDiagnostic(severity, FORGE, message, new File(pos.getFile()));
    diag.setLineNumber(pos.getEndLine() + 1);
    diagnostics.addChild(diag);
  }
View Full Code Here

      call(callSymbol, pos, arguments);
    }

    if(file != null) {
      if(!nameSeen || fullName != null && (fullName.getOwner() == null || fullName.getName() == null)) {
        diagnostics.addChild(new FileDiagnostic(
          ERROR, PACKAGE, "A full name (user-module) must be specified", file));
      }

      if(!versionSeen) {
        diagnostics.addChild(new FileDiagnostic(ERROR, PACKAGE, "A version must be specified", file));
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.diagnostic.FileDiagnostic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.