Skip to content

Commit 409e8bf

Browse files
committed
Add Gitter badge
1 parent ca792b7 commit 409e8bf

File tree

1 file changed

+55
-8
lines changed

1 file changed

+55
-8
lines changed

README.md

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,70 @@
1-
# xVimscript
1+
# Exercism Vim script Track
22

3-
![build status](https://travis-ci.org/exercism/xvimscript.svg?branch=master)
3+
[![Join the chat at https://gitter.im/exercism/vimscript](https://badges.gitter.im/exercism/vimscript.svg)](https://gitter.im/exercism/vimscript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

5-
Exercism exercises in Vim script.
6-
7-
## Contributing
5+
![build status](https://travis-ci.org/exercism/vimscript.svg?branch=master)
6+
[![Join the chat at https://gitter.im/exercism/xvimscript](https://badges.gitter.im/exercism/xvimscript.svg)](https://gitter.im/exercism/xvimscript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
87

98
We welcome any kind of contribution!
109

1110
If you have a suggestion or question, create a new
12-
[issue](https://github.com/exercism/xvimscript/issues).
11+
[issue](https://github.com/exercism/vimscript/issues).
1312

1413
For code or fixing typos and similar things, open a
15-
[pull request](https://github.com/exercism/xvimscript/pulls).
14+
[pull request](https://github.com/exercism/vimscript/pulls).
1615

17-
Look at recent [commits](https://github.com/exercism/xvimscript/commits/master)
16+
Look at recent [commits](https://github.com/exercism/vimscript/commits/master)
1817
to get a feeling on how to format your own ones.
1918

2019
Even if there are any uncertainties, go for it nevertheless. We can straighten
2120
out everything in the process.
2221

2322
Thank you for contributing! :tada:
23+
24+
## Linting Vim files
25+
26+
If you add or change a Vim file, the CI will use vint to ensure best practices.
27+
Therefore it's recommended idea to run it locally first, before creating a pull
28+
request.
29+
30+
1. Install [vint](https://github.com/Kuniwak/vint#quick-start).
31+
1. Recursively lint all Vim files:
32+
```
33+
$ vint .
34+
```
35+
36+
## Writing test files
37+
38+
#### Generating test files
39+
40+
Use the [generator](lib/generate.vim) to create Vader files from their canonical
41+
test data:
42+
43+
```vim
44+
" in Vim
45+
:source lib/generate.vim
46+
:Generate word-count
47+
```
48+
49+
This would fetch the [canonical test data](https://raw.githubusercontent.com/exercism/x-common/master/exercises/word-count/canonical-data.json),
50+
decode the JSON to Vim data types, iterate over the result, and put the tests in
51+
a new unnamed buffer.
52+
53+
_This script requires Vim 7.4.1304+ for `json_decode()`. It also relies on the
54+
netrw plugin (`:h netrw`), but that one is shipped and sourced by default._
55+
56+
#### Type mismatch exceptions
57+
58+
Older Vims don't like changing types for the same variable. If your tests use
59+
global variables, `unlet!` them in a `Before` block at the top of the Vader file.
60+
61+
When each test uses `let expected = ...`, then put this at the top:
62+
63+
```vim
64+
Before:
65+
unlet! expected
66+
```
67+
68+
This is patched as of
69+
[Vim 7.4.1546](https://github.com/vim/vim/commit/f6f32c38bf3319144a84a01a154c8c91939e7acf),
70+
but we shouldn't assume versions in favor of compatibility.

0 commit comments

Comments
 (0)