coffeelint 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 532d82c2d2fe20d9f07bff65000dbc91ed408336
4
- data.tar.gz: 0cc1a24400c1af0eae57410387d7701d6919f06d
3
+ metadata.gz: b7a4a2035e21315450af30547f9240faafc6b22f
4
+ data.tar.gz: e360a0cc21d61d9cab4875b8e21158608b61ac9b
5
5
  SHA512:
6
- metadata.gz: c3e602fc00f1c43c67697aa734fff50bb353d2a894114139e533876724cf50338a8e43767a149e852c51adebf2bdd53dcf102d9326696142a77126b6de552866
7
- data.tar.gz: 4734c6006186eaef06a21ec1d9fcb0d050657526ab0f05af472a551924f4a0bebf356962a29e2d0bc9f9ef4500da5805c354b540fa30783e8a0ea2baed0119f2
6
+ metadata.gz: d25210e7bfdf55cea135038df5388dc12242219a4c23fcf70d6e0f3471b0d95351d3d8ebbfd6b9ea884a433ef76cdce0fa0121f4e12c565db7d87a7e4617d4dd
7
+ data.tar.gz: 4885fca9294e012e30e2cce5b9b4ecef08e32726e8482e2dd7adeff1ef002e905006840d400bcec983e73cd96044a0ebe9675ea6941ea0011da1ebc497e97a03
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Coffeelint [![Build Status](https://travis-ci.org/zmbush/coffeelint-ruby.svg?branch=master)](https://travis-ci.org/zmbush/coffeelint-ruby) [![Gem Version](https://badge.fury.io/rb/coffeelint.png)](http://badge.fury.io/rb/coffeelint)
2
2
 
3
- Using coffeelint version: v1.16.0
3
+ Using coffeelint version: v1.16.1
4
4
 
5
5
  Coffeelint is a set of simple ruby bindings for [coffeelint](https://github.com/clutchski/coffeelint).
6
6
 
@@ -22,6 +22,6 @@ Gem::Specification.new do |gem|
22
22
  gem.add_dependency "json"
23
23
  gem.add_dependency "execjs"
24
24
 
25
- gem.add_development_dependency 'rspec', '~> 3.1.0'
25
+ gem.add_development_dependency 'rspec', '~> 3.4.0'
26
26
  gem.add_development_dependency 'rake', '~>11.3.0'
27
27
  end
@@ -2,7 +2,7 @@
2
2
  module.exports={
3
3
  "name": "coffeelint",
4
4
  "description": "Lint your CoffeeScript",
5
- "version": "1.16.0",
5
+ "version": "1.16.1",
6
6
  "homepage": "http://www.coffeelint.org",
7
7
  "keywords": [
8
8
  "lint",
@@ -1685,21 +1685,37 @@ module.exports = Indentation = (function() {
1685
1685
 
1686
1686
  Indentation.prototype.tokens = ['INDENT', '[', ']', '.'];
1687
1687
 
1688
- Indentation.prototype.keywords = ['->', '=>', '@', 'CATCH', 'CLASS', 'ELSE', 'FINALLY', 'FOR', 'FORIN', 'FOROF', 'IDENTIFIER', 'IF', 'LEADING_WHEN', 'LOOP', 'RETURN', 'SWITCH', 'THROW', 'TRY', 'UNTIL', 'WHEN', 'WHILE', 'YIELD'];
1688
+ Indentation.prototype.keywords = ['->', '=>', '@', 'CATCH', 'CLASS', 'ELSE', 'FINALLY', 'FOR', 'FORIN', 'FOROF', 'IDENTIFIER', 'IF', 'LEADING_WHEN', 'LOOP', 'PROPERTY', 'RETURN', 'SWITCH', 'THROW', 'TRY', 'UNTIL', 'WHEN', 'WHILE', 'YIELD'];
1689
1689
 
1690
1690
  function Indentation() {
1691
1691
  this.arrayTokens = [];
1692
1692
  }
1693
1693
 
1694
1694
  Indentation.prototype.lintToken = function(token, tokenApi) {
1695
- var currentLine, expected, ignoreIndent, isArrayIndent, isMultiline, lineNumber, lines, numIndents, previous, previousSymbol, ref, ref1, ref2, type;
1696
- type = token[0], numIndents = token[1], (ref = token[2], lineNumber = ref.first_line);
1695
+ var chain, currentLine, dotIndent, expected, got, ignoreIndent, isArrayIndent, isMultiline, lineNumber, lines, next, numIndents, previous, previousSymbol, ref, ref1, ref2, startsWith, type;
1696
+ type = token[0], numIndents = token[1];
1697
+ dotIndent = token[2].first_column;
1697
1698
  lines = tokenApi.lines, lineNumber = tokenApi.lineNumber;
1698
1699
  expected = tokenApi.config[this.rule.name].value;
1699
1700
  if (type === '.') {
1700
1701
  currentLine = lines[lineNumber];
1701
- if (((ref1 = currentLine.match(/\S/)) != null ? ref1[0] : void 0) === '.') {
1702
- return this.handleChain(tokenApi, expected);
1702
+ if (((ref = currentLine.match(/\S/)) != null ? ref[0] : void 0) === '.') {
1703
+ next = tokenApi.peek(1);
1704
+ if (next[0] === 'PROPERTY') {
1705
+ chain = '.' + next[1];
1706
+ startsWith = new RegExp('\\S{' + chain.length + '}');
1707
+ if (((ref1 = currentLine.match(startsWith)) != null ? ref1[0] : void 0) === chain) {
1708
+ got = dotIndent;
1709
+ if (dotIndent - expected > expected) {
1710
+ got %= expected;
1711
+ }
1712
+ if (dotIndent % expected !== 0) {
1713
+ return {
1714
+ context: "Expected " + expected + " got " + got
1715
+ };
1716
+ }
1717
+ }
1718
+ }
1703
1719
  }
1704
1720
  return void 0;
1705
1721
  }
@@ -1736,43 +1752,6 @@ module.exports = Indentation = (function() {
1736
1752
  return null;
1737
1753
  };
1738
1754
 
1739
- Indentation.prototype.handleChain = function(tokenApi, expected) {
1740
- var callStart, checkNum, currIsIndent, currentLine, currentSpaces, findCallStart, lastCheck, lineNumber, lines, numIndents, prevIsIndent, prevLine, prevNum, prevSpaces, ref, ref1;
1741
- lastCheck = 1;
1742
- callStart = 1;
1743
- prevNum = 1;
1744
- lineNumber = tokenApi.lineNumber, lines = tokenApi.lines;
1745
- currentLine = lines[lineNumber];
1746
- findCallStart = tokenApi.peek(-callStart);
1747
- while (findCallStart && findCallStart[0] !== 'TERMINATOR') {
1748
- lastCheck = findCallStart[2].first_line;
1749
- callStart += 1;
1750
- findCallStart = tokenApi.peek(-callStart);
1751
- }
1752
- while ((lineNumber - prevNum > lastCheck) && !/^\s*\./.test(lines[lineNumber - prevNum])) {
1753
- prevNum += 1;
1754
- }
1755
- checkNum = lineNumber - prevNum;
1756
- if (checkNum >= 0) {
1757
- prevLine = lines[checkNum];
1758
- if (prevLine.match(/\S/)[0] === '.' || checkNum === lastCheck) {
1759
- currentSpaces = (ref = currentLine.match(/\S/)) != null ? ref.index : void 0;
1760
- prevSpaces = (ref1 = prevLine.match(/\S/)) != null ? ref1.index : void 0;
1761
- numIndents = currentSpaces - prevSpaces;
1762
- prevIsIndent = prevSpaces % expected !== 0;
1763
- currIsIndent = currentSpaces % expected !== 0;
1764
- if (prevIsIndent && currIsIndent) {
1765
- numIndents = currentSpaces;
1766
- }
1767
- if (numIndents % expected !== 0) {
1768
- return {
1769
- context: "Expected " + expected + " got " + numIndents
1770
- };
1771
- }
1772
- }
1773
- }
1774
- };
1775
-
1776
1755
  Indentation.prototype.grabLineTokens = function(tokenApi, lineNumber, all) {
1777
1756
  var i, k, len, len1, ref, ref1, results, results1, tok, tokensByLine;
1778
1757
  if (all == null) {
@@ -1,3 +1,3 @@
1
1
  module Coffeelint
2
- VERSION = "1.16.0"
2
+ VERSION = "1.16.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffeelint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Bush
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.1.0
61
+ version: 3.4.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.1.0
68
+ version: 3.4.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement