update prettier. use travis docker

This commit is contained in:
Jason Poon 2018-01-27 16:51:17 +01:00 committed by Jason Poon
parent b9d06fb878
commit d0e1639490
7 changed files with 35 additions and 22 deletions

View File

@ -9,7 +9,7 @@ notifications:
on_cancel: never
on_error: never
sudo: true
sudo: false
os:
- linux
@ -17,7 +17,7 @@ os:
language: node_js
node_js:
- 8.9.1
- 8
env:
global:
@ -40,14 +40,11 @@ install:
- npm install;
script:
- git ls-tree -r HEAD --name-only | grep ".*.[t|j]s$" | xargs ./node_modules/prettier/bin/prettier.js --write --print-width 100 --single-quote --trailing-comma es5
- gulp forceprettier
- if [[ $(git diff-index HEAD --) ]]; then
./node_modules/prettier/bin/prettier.js -v;
git diff;
echo "Prettier Failed. Run `gulp` or `gulp forceprettier`";
exit 1;
else
echo "Prettier passed.";
fi
- gulp
- npm test --silent;

View File

@ -1,11 +1,10 @@
.github/**
.vscode/**
.vscode-test/**
typings/**
out/test/**
test/**
typings/**
**/*.ts
**/*.map
.gitignore
*.yml
tsconfig.json
*.yml

View File

@ -477,7 +477,7 @@ Status | Command | Default Value | Description
:white_check_mark:| smartcase (scs) | true | Override the 'ignorecase' option if the search pattern contains upper case characters.
:white_check_mark:| iskeyword (isk) | `@,48-57,_,128-167,224-235` | keywords contain alphanumeric characters and '_'. If there is no user setting for `iskeyword`, we use `editor.wordSeparators` properties.
:white_check_mark:| scroll (scr) | 20 | Number of lines to scroll with CTRL-U and CTRL-D commands.
:white_check_mark:| expandtab (et) | True. we use Code's default value `inserSpaces` instead of Vim | use spaces when <Tab> is inserted
:white_check_mark:| expandtab (et) | True. we use Code's default value `insertSpaces` instead of Vim | use spaces when <Tab> is inserted
:white_check_mark:| autoindent | true | Keep indentation when doing `cc` or `S` in normal mode to replace a line.
## Undo/Redo commands

6
package-lock.json generated
View File

@ -3971,9 +3971,9 @@
"dev": true
},
"prettier": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.9.2.tgz",
"integrity": "sha512-piXx9N2WT8hWb7PBbX1glAuJVIkEyUV9F5fMXFINpZ0x3otVOFKKeGmeuiclFJlP/UrgTckyV606VjH2rNK4bw==",
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.10.2.tgz",
"integrity": "sha512-TcdNoQIWFoHblurqqU6d1ysopjq7UX0oRcT/hJ8qvBAELiYWn+Ugf0AXdnzISEJ7vuhNnQ98N8jR8Sh53x4IZg==",
"dev": true
},
"pretty-hrtime": {

View File

@ -601,7 +601,7 @@
"gulp-typings": "^2.0.4",
"merge-stream": "^1.0.1",
"mocha": "^4.0.1",
"prettier": "^1.9.2",
"prettier": "^1.10.2",
"tslint": "^5.8.0",
"typescript": "^2.6.2",
"vscode": "^1.1.10"

View File

@ -1,10 +1,13 @@
import * as vscode from 'vscode';
import * as assert from 'assert';
import { getAndUpdateModeHandler } from '../../extension';
import { ModeHandler } from '../../src/mode/modeHandler';
import { Clipboard } from '../../src/util';
import { getTestingFunctions } from '../testSimplifier';
import { assertEqual, assertEqualLines, cleanUpWorkspace, setupWorkspace } from '../testUtils';
import { VimState } from '../../src/state/vimState';
import { Register, IRegisterContent } from '../../src/register/register';
suite('register', () => {
let modeHandler: ModeHandler;
@ -18,13 +21,6 @@ suite('register', () => {
teardown(cleanUpWorkspace);
newTest({
title: 'Can copy to a register',
start: ['|one', 'two'],
keysPressed: '"add"ap',
end: ['two', '|one'],
});
suite('clipboard', () => {
setup(async () => {
Clipboard.Copy('12345');
@ -45,6 +41,13 @@ suite('register', () => {
});
});
newTest({
title: 'Can copy to a register',
start: ['|one', 'two'],
keysPressed: '"add"ap',
end: ['two', '|one'],
});
newTest({
title: 'Can use two registers together',
start: ['|one', 'two'],
@ -194,4 +197,19 @@ suite('register', () => {
assertEqualLines(['test1', 'test2', 'test1test2']);
});
test('Can put and get to register', async () => {
const expected = 'text-to-put-on-register';
let vimState = new VimState(vscode.window.activeTextEditor!, false);
vimState.recordedState.registerName = '0';
let actual: IRegisterContent;
try {
Register.put(expected, vimState);
actual = await Register.get(vimState);
assert.equal(actual.text, expected);
} catch (err) {
assert.fail(err);
}
});
});

View File

@ -51,7 +51,6 @@
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": false,
"no-var-requires": false,