Skip to content

Commit 69223ee

Browse files
Refactor
1 parent 310ecf1 commit 69223ee

File tree

13 files changed

+239
-2
lines changed

13 files changed

+239
-2
lines changed

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/pkg/
7+
/spec/reports/
8+
/spec/examples.txt
9+
/test/tmp/
10+
/test/version_tmp/
11+
/tmp/
12+
13+
# Used by dotenv library to load environment variables.
14+
# .env
15+
16+
## Specific to RubyMotion:
17+
.dat*
18+
.repl_history
19+
build/
20+
*.bridgesupport
21+
build-iPhoneOS/
22+
build-iPhoneSimulator/
23+
24+
## Specific to RubyMotion (use of CocoaPods):
25+
#
26+
# We recommend against adding the Pods directory to your .gitignore. However
27+
# you should judge for yourself, the pros and cons are mentioned at:
28+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29+
#
30+
# vendor/Pods/
31+
32+
## Documentation cache and generated files:
33+
/.yardoc/
34+
/_yardoc/
35+
/doc/
36+
/rdoc/
37+
38+
## Environment normalization:
39+
/.bundle/
40+
/vendor/bundle
41+
/lib/bundler/man/
42+
43+
# for a library or gem, you might want to ignore these files since the code is
44+
# intended to run in multiple environments; otherwise, check them in:
45+
# Gemfile.lock
46+
# .ruby-version
47+
# .ruby-gemset
48+
49+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50+
.rvmrc

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: python
2+
cache: bundler
3+
python:
4+
- "3.6"
5+
install:
6+
# Install the latest release of Vale:
7+
- curl -sL https://install.goreleaser.com/github.com/ValeLint/vale.sh | bash
8+
- export PATH=./bin:"$PATH"
9+
10+
- bundle install --jobs=3
11+
12+
- pip install yamllint
13+
- pip install markdata
14+
- pip install pyyaml
15+
before_script:
16+
- yamllint -c '.yamllint.yml' 18F
17+
script:
18+
- cucumber
19+
- zip -r 18F.zip 18F -x "*.DS_Store"
20+
deploy:
21+
provider: releases
22+
api_key: $GITHUB_TOKEN
23+
file: 18F.zip
24+
skip_cleanup: true
25+
on:
26+
tags: true

.yamllint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rules:
2+
# We only include a single document (without directives) in our rules, so
3+
# the extra markup is unnecessary.
4+
document-start: disable
5+
# Many rules include a `link` key that can be relatively long.
6+
#
7+
# TODO: Should we change this?
8+
line-length: disable

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'aruba', '~> 0.14.3'

Gemfile.lock

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activesupport (6.0.3.4)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (>= 0.7, < 2)
7+
minitest (~> 5.1)
8+
tzinfo (~> 1.1)
9+
zeitwerk (~> 2.2, >= 2.2.2)
10+
aruba (0.14.14)
11+
childprocess (>= 0.6.3, < 4.0.0)
12+
contracts (~> 0.9)
13+
cucumber (>= 1.3.19)
14+
ffi (~> 1.9)
15+
rspec-expectations (>= 2.99)
16+
thor (>= 0.19, < 2.0)
17+
builder (3.2.4)
18+
childprocess (3.0.0)
19+
concurrent-ruby (1.1.7)
20+
contracts (0.16.0)
21+
cucumber (5.1.3)
22+
builder (~> 3.2, >= 3.2.4)
23+
cucumber-core (~> 8.0, >= 8.0.1)
24+
cucumber-create-meta (~> 2.0, >= 2.0.2)
25+
cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
26+
cucumber-gherkin (~> 15.0, >= 15.0.2)
27+
cucumber-html-formatter (~> 9.0, >= 9.0.0)
28+
cucumber-messages (~> 13.1, >= 13.1.0)
29+
cucumber-wire (~> 4.0, >= 4.0.1)
30+
diff-lcs (~> 1.4, >= 1.4.4)
31+
multi_test (~> 0.1, >= 0.1.2)
32+
sys-uname (~> 1.2, >= 1.2.1)
33+
cucumber-core (8.0.1)
34+
cucumber-gherkin (~> 15.0, >= 15.0.2)
35+
cucumber-messages (~> 13.0, >= 13.0.1)
36+
cucumber-tag-expressions (~> 2.0, >= 2.0.4)
37+
cucumber-create-meta (2.0.2)
38+
cucumber-messages (~> 13.0, >= 13.0.1)
39+
sys-uname (~> 1.2, >= 1.2.1)
40+
cucumber-cucumber-expressions (10.3.0)
41+
cucumber-gherkin (15.0.2)
42+
cucumber-messages (~> 13.0, >= 13.0.1)
43+
cucumber-html-formatter (9.0.0)
44+
cucumber-messages (~> 13.0, >= 13.0.1)
45+
cucumber-messages (13.1.0)
46+
protobuf-cucumber (~> 3.10, >= 3.10.8)
47+
cucumber-tag-expressions (2.0.4)
48+
cucumber-wire (4.0.1)
49+
cucumber-core (~> 8.0, >= 8.0.1)
50+
cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
51+
cucumber-messages (~> 13.0, >= 13.0.1)
52+
diff-lcs (1.4.4)
53+
ffi (1.13.1)
54+
i18n (1.8.5)
55+
concurrent-ruby (~> 1.0)
56+
middleware (0.1.0)
57+
minitest (5.14.2)
58+
multi_test (0.1.2)
59+
protobuf-cucumber (3.10.8)
60+
activesupport (>= 3.2)
61+
middleware
62+
thor
63+
thread_safe
64+
rspec-expectations (3.9.2)
65+
diff-lcs (>= 1.2.0, < 2.0)
66+
rspec-support (~> 3.9.0)
67+
rspec-support (3.9.3)
68+
sys-uname (1.2.1)
69+
ffi (>= 1.0.0)
70+
thor (1.0.1)
71+
thread_safe (0.3.6)
72+
tzinfo (1.2.7)
73+
thread_safe (~> 0.1)
74+
zeitwerk (2.4.0)
75+
76+
PLATFORMS
77+
ruby
78+
79+
DEPENDENCIES
80+
aruba (~> 0.14.3)
81+
82+
BUNDLED WITH
83+
2.1.4

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
11
# 18F
2-
A Vale linter style that replicates the 18F style guide
32

4-
Based on [18F](https://pages.18f.gov/content-guide/).
3+
A Vale linter style that replicates the 18F [18F](https://pages.18f.gov/content-guide/).
4+
5+
__Not complete, and WIP, contributions welcome__.😁
6+
7+
8+
[![Build Status](https://travis-ci.org/testthedocs/18F.svg?branch=master)](https://travis-ci.org/testthedocs/18F) ![Vale version](https://img.shields.io/badge/vale-%3E%3D%20v1.7.0-blue.svg) ![license](https://img.shields.io/github/license/mashape/apistatus.svg)
9+
10+
This repository contains a [Vale-compatible](https://github.com/errata-ai/vale) implementation of the guidelines enforced by the [18F](https://pages.18f.gov/content-guide/).
511

612
> This project is in the worldwide [public domain](LICENSE.md).
713
814
> As a work of the United States government, this project is in the public domain within the United States.
915
1016
> Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
17+
>
18+
## Getting Started
19+
20+
> :exclamation: Requires Vale >= **1.7.0**. :exclamation:
21+
22+
Download the [latest release](https://github.com/testthedocs/18F/releases), copy the "18F" directory to your `StylesPath`, and include it in your configuration file:
23+
24+
```ini
25+
# This goes in a file named either `.vale.ini` or `_vale.ini`.
26+
StylesPath = path/to/some/directory
27+
MinAlertLevel = warning # suggestion, warning or error
28+
29+
# Only Markdown and .txt files; change to whatever you're using.
30+
[*.{md,txt}]
31+
# List of styles to load.
32+
BasedOnStyles = 18F
33+
```
1134

35+
See [Usage](https://github.com/errata-ai/vale/#usage) for more information.

features/rules.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Feature: Rules
2+
3+
Scenario: Basic test case
4+
When I test "basic"
5+
Then the output should contain exactly:
6+
"""
7+
fail.md:3:11:18F.Abbreviations:Use 'e.g.,' instead of 'eg'
8+
fail.md:3:17:18F.Abbreviations:Use 'i.e.,' instead of 'ie'
9+
fail.md:5:22:18F.Quotes:Punctuation should be inside the quotes.
10+
fail.md:5:30:18F.Contractions:Use 'it's' instead of 'it is.'
11+
fail.md:5:50:18F.Brands:Use 'bandage' instead of 'Band-Aid.'
12+
fail.md:5:82:18F.Clarity:Avoid using 'agenda' (unless you’re talking about a meeting).
13+
fail.md:5:90:18F.OxfordComma:Use the Oxford comma in a list of three or more items.
14+
fail.md:5:157:18F.Terms:Prefer 'usability testing' over 'user testing.'
15+
"""

features/steps.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cmd = 'vale --output=line --sort --normalize --relative'
2+
3+
When(/^I test "(.*)"$/) do |rule|
4+
step %(I cd to "../../fixtures/#{rule}")
5+
step %(I run `#{cmd} .`)
6+
end

features/support/aruba.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'aruba/cucumber'

fixtures/basic/.vale.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
StylesPath = ../../
2+
3+
MinAlertLevel = suggestion
4+
5+
[*.md]
6+
BasedOnStyles = 18F

fixtures/basic/fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# WELCOME!
2+
3+
Don't use eg or ie. And in a list of one, two, and three items don't use an oxford comma.
4+
5+
If you are 1-3 don't "join", it is not much of a Band-Aid and has too much of an agenda. It's better that you do one, two and three. One space please when user testing. And use your API properly.

fixtures/basic/pass.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Welcome
2+
3+
Don't use e.g., or i.e., And in a list of one, two, and three items don't use an oxford comma.
4+
5+
If you are between one and three don't "join," it's not much of a fix and has too much hidden meaning. It's better that you do one, two, and three. One space please when user-testing. And use your API (application programming interface) properly.

fixtures/basic/real.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Welcome
2+
3+
Don't use e.g., or i.e., And in a list of one, two, and three items don't use an oxford comma.
4+
5+
If you are between one and three don't "join," it's not much of a fix and has too much hidden meaning. It's better that you do one, two, and three. One space please when user-testing. And use your API (application programming interface) properly.

0 commit comments

Comments
 (0)