Skip to content

Commit

Permalink
do not consider return code=1 as error
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMoresmau committed Dec 26, 2012
1 parent bd6eb0c commit 8311741
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions net.sf.eclipsefp.haskell-feature/feature.xml
Expand Up @@ -2,7 +2,7 @@
<feature
id="net.sf.eclipsefp.haskell"
label="%bundleName"
version="2.4.1"
version="2.4.2"
provider-name="%bundleVendor">

<description>
Expand Down Expand Up @@ -151,7 +151,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.hlint"
download-size="0"
install-size="0"
version="2.3.2"
version="2.4.2"
unpack="false"/>

<plugin
Expand Down
2 changes: 1 addition & 1 deletion net.sf.eclipsefp.haskell.hlint/META-INF/MANIFEST.MF
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.hlint;singleton:=true
Bundle-Version: 2.3.2
Bundle-Version: 2.4.2
Bundle-Activator: net.sf.eclipsefp.haskell.hlint.HLintPlugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
Expand Down
Expand Up @@ -35,11 +35,18 @@ public List<Suggestion> run(IPath path) {
if (exe==null || exe.length()==0){
exe="hlint"; // hope it's in the path
}
// code is 1 if we have errors!
int code=new ProcessRunner().executeBlocking(path.toFile().getParentFile(), out, err, exe, path.toOSString());
if (code==0){
OutputParser parser = new OutputParser(new StringReader(out.toString()));
return parser.suggestions();

OutputParser parser = new OutputParser(new StringReader(out.toString()));
List<Suggestion> sugs= parser.suggestions();
if(err.toString().length()>0){
HLintPlugin.logError(NLS.bind(HLintText.error_run,err.toString()),null);
} else if (code!=0 && sugs.size()==0){
HLintPlugin.logError(NLS.bind(HLintText.error_run,out.toString()),null);
}
return sugs;

} catch (Throwable ex) {
String msg=err.toString().length()>0?err.toString():out.toString();
HLintPlugin.logError(NLS.bind(HLintText.error_run,msg), ex);
Expand Down

0 comments on commit 8311741

Please sign in to comment.