Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit c271fef

Browse files
authored
Merge pull request #93 from White-Oak/77-stable
Added beta and stable versions to proper JSON support mode
2 parents c40924e + b720caf commit c271fef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/linter-rust.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ XRegExp = require 'xregexp'
99
errorModes = require './mode'
1010

1111
class LinterRust
12-
patternRustcVersion: XRegExp('rustc (?<version>1.\\d+.\\d+)(?:(?:-(?<nightly>nightly)|(?:[^\\s]+))? \
12+
patternRustcVersion: XRegExp('rustc (?<version>1.\\d+.\\d+)(?:(?:-(?:(?<nightly>nightly)|(?<beta>beta.*?))|(?:[^\s]+))? \
1313
\\((?:[^\\s]+) (?<date>\\d{4}-\\d{2}-\\d{2})\\))?')
1414
cargoDependencyDir: "target/debug/deps"
1515

@@ -162,7 +162,8 @@ class LinterRust
162162
canUseIntermediateJSON = nightlyWithJSON or stableWithJSON
163163
switch commandMode
164164
when 'cargo'
165-
canUseProperCargoJSON = match.nightly and match.date >= '2016-10-10'
165+
canUseProperCargoJSON = (match.nightly and match.date >= '2016-10-10') or
166+
(match.beta or not match.nightly and semver.gte(match.version, '1.13.0'))
166167
if canUseProperCargoJSON
167168
errorModes.JSON_CARGO
168169
# this mode is used only through August till October, 2016

0 commit comments

Comments
 (0)