diff --git a/.travis.yml b/.travis.yml index 476c875..89ef9fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,17 @@ -language: objective-c +language: generic +os: + - osx + +branches: + only: + - master +git: + depth: 10 + +env: + matrix: + - ATOM_CHANNEL=stable + - ATOM_CHANNEL=beta notifications: email: @@ -7,8 +20,10 @@ notifications: before_install: - brew update +install: - brew install python - pip install pylint - - pylint --version +before_script: + - pylint --version script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh' diff --git a/package.json b/package.json index c775cc4..68bca97 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "linter-pylint", - "linter-package": true, "main": "./lib/main", "version": "1.2.0", + "private": true, "description": "Lint python on the fly, using pylint", "repository": "https://github.com/AtomLinter/linter-pylint", "license": "MIT", @@ -10,7 +10,7 @@ "lint": "./node_modules/.bin/coffeelint lib" }, "engines": { - "atom": ">=1" + "atom": ">=1.0.0 <2.0.0" }, "providedServices": { "linter": { @@ -20,15 +20,15 @@ } }, "dependencies": { - "atom-linter": "^4.1.1", - "atom-package-deps": "^3.0.5", - "lodash": "^4.0.0" + "atom-linter": "^4.3.4", + "atom-package-deps": "^3.0.7", + "lodash": "^4.0.1" }, "devDependencies": { - "coffeelint": "^1.14.1", - "eslint": "^1.10.2", + "coffeelint": "^1.14.2", + "eslint": "^1.10.3", "babel-eslint": "^4.1.6", - "eslint-config-airbnb": "latest" + "eslint-config-airbnb": "^4.0.0" }, "package-deps": [ "linter" diff --git a/spec/linter-pylint-spec.js b/spec/linter-pylint-spec.js index 10c6345..bda0e28 100644 --- a/spec/linter-pylint-spec.js +++ b/spec/linter-pylint-spec.js @@ -1,76 +1,86 @@ 'use babel'; +import * as path from 'path'; + +const goodPath = path.join(__dirname, 'files', 'good.py'); +const badPath = path.join(__dirname, 'files', 'bad.py'); +const emptyPath = path.join(__dirname, 'files', 'empty.py'); + describe('The pylint provider for Linter', () => { const lint = require('../lib/main').provideLinter().lint; beforeEach(() => { - waitsForPromise(() => { - return Promise.all([ + waitsForPromise(() => + Promise.all([ atom.packages.activatePackage('linter-pylint'), atom.packages.activatePackage('language-python').then(() => - atom.workspace.open(__dirname + '/files/good.py') + atom.workspace.open(goodPath) ) - ]); - }); + ]) + ); }); - it('should be in the packages list', () => { - return expect(atom.packages.isPackageLoaded('linter-pylint')).toBe(true); - }); + it('should be in the packages list', () => + expect(atom.packages.isPackageLoaded('linter-pylint')).toBe(true) + ); - it('should be an active package', () => { - return expect(atom.packages.isPackageActive('linter-pylint')).toBe(true); - }); + it('should be an active package', () => + expect(atom.packages.isPackageActive('linter-pylint')).toBe(true) + ); describe('checks bad.py and', () => { let editor = null; beforeEach(() => { - waitsForPromise(() => { - return atom.workspace.open(__dirname + '/files/bad.py').then(openEditor => { + waitsForPromise(() => + atom.workspace.open(badPath).then(openEditor => { editor = openEditor; - }); - }); + }) + ); }); - it('finds at least one message', () => { - return lint(editor).then(messages => { - expect(messages.length).toBeGreaterThan(0); - }); - }); + it('finds at least one message', () => + waitsForPromise(() => + lint(editor).then(messages => { + expect(messages.length).toBeGreaterThan(0); + }) + ) + ); - it('verifies that message', () => { - return lint(editor).then(messages => { - expect(messages[0].type).toBeDefined(); - expect(messages[0].type).toEqual('convention'); - expect(messages[0].html).not.toBeDefined(); - expect(messages[0].text).toBeDefined(); - expect(messages[0].text).toEqual('C0111 Missing module docstring'); - expect(messages[0].filePath).toBeDefined(); - expect(messages[0].filePath).toMatch(/.+spec[\\\/]files[\\\/]bad\.py$/); - expect(messages[0].range).toBeDefined(); - expect(messages[0].range.length).toEqual(2); - expect(messages[0].range).toEqual([[0, 0], [0, 4]]); - }); - }); + it('verifies that message', () => + waitsForPromise(() => + lint(editor).then(messages => { + expect(messages[0].type).toBeDefined(); + expect(messages[0].type).toEqual('convention'); + expect(messages[0].html).not.toBeDefined(); + expect(messages[0].text).toBeDefined(); + expect(messages[0].text).toEqual('C0111 Missing module docstring'); + expect(messages[0].filePath).toBeDefined(); + expect(messages[0].filePath).toMatch(/.+spec[\\\/]files[\\\/]bad\.py$/); + expect(messages[0].range).toBeDefined(); + expect(messages[0].range.length).toEqual(2); + expect(messages[0].range).toEqual([[0, 0], [0, 4]]); + }) + ) + ); }); it('finds nothing wrong with an empty file', () => { - waitsForPromise(() => { - return atom.workspace.open(__dirname + '/files/empty.py').then(editor => { - return lint(editor).then(messages => { + waitsForPromise(() => + atom.workspace.open(emptyPath).then(editor => + lint(editor).then(messages => { expect(messages.length).toEqual(0); - }); - }); - }); + }) + ) + ); }); it('finds nothing wrong with a valid file', () => { - waitsForPromise(() => { - return atom.workspace.open(__dirname + '/files/good.py').then(editor => { - return lint(editor).then(messages => { + waitsForPromise(() => + atom.workspace.open(goodPath).then(editor => + lint(editor).then(messages => { expect(messages.length).toEqual(0); - }); - }); - }); + }) + ) + ); }); });