Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChinchilla committed Oct 12, 2020
1 parent 310ecf1 commit 69223ee
Show file tree
Hide file tree
Showing 13 changed files with 239 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: python
cache: bundler
python:
- "3.6"
install:
# Install the latest release of Vale:
- curl -sL https://install.goreleaser.com/github.com/ValeLint/vale.sh | bash
- export PATH=./bin:"$PATH"

- bundle install --jobs=3

- pip install yamllint
- pip install markdata
- pip install pyyaml
before_script:
- yamllint -c '.yamllint.yml' 18F
script:
- cucumber
- zip -r 18F.zip 18F -x "*.DS_Store"
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: 18F.zip
skip_cleanup: true
on:
tags: true
8 changes: 8 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rules:
# We only include a single document (without directives) in our rules, so
# the extra markup is unnecessary.
document-start: disable
# Many rules include a `link` key that can be relatively long.
#
# TODO: Should we change this?
line-length: disable
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'aruba', '~> 0.14.3'
83 changes: 83 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.3.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
aruba (0.14.14)
childprocess (>= 0.6.3, < 4.0.0)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9)
rspec-expectations (>= 2.99)
thor (>= 0.19, < 2.0)
builder (3.2.4)
childprocess (3.0.0)
concurrent-ruby (1.1.7)
contracts (0.16.0)
cucumber (5.1.3)
builder (~> 3.2, >= 3.2.4)
cucumber-core (~> 8.0, >= 8.0.1)
cucumber-create-meta (~> 2.0, >= 2.0.2)
cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
cucumber-gherkin (~> 15.0, >= 15.0.2)
cucumber-html-formatter (~> 9.0, >= 9.0.0)
cucumber-messages (~> 13.1, >= 13.1.0)
cucumber-wire (~> 4.0, >= 4.0.1)
diff-lcs (~> 1.4, >= 1.4.4)
multi_test (~> 0.1, >= 0.1.2)
sys-uname (~> 1.2, >= 1.2.1)
cucumber-core (8.0.1)
cucumber-gherkin (~> 15.0, >= 15.0.2)
cucumber-messages (~> 13.0, >= 13.0.1)
cucumber-tag-expressions (~> 2.0, >= 2.0.4)
cucumber-create-meta (2.0.2)
cucumber-messages (~> 13.0, >= 13.0.1)
sys-uname (~> 1.2, >= 1.2.1)
cucumber-cucumber-expressions (10.3.0)
cucumber-gherkin (15.0.2)
cucumber-messages (~> 13.0, >= 13.0.1)
cucumber-html-formatter (9.0.0)
cucumber-messages (~> 13.0, >= 13.0.1)
cucumber-messages (13.1.0)
protobuf-cucumber (~> 3.10, >= 3.10.8)
cucumber-tag-expressions (2.0.4)
cucumber-wire (4.0.1)
cucumber-core (~> 8.0, >= 8.0.1)
cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
cucumber-messages (~> 13.0, >= 13.0.1)
diff-lcs (1.4.4)
ffi (1.13.1)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
middleware (0.1.0)
minitest (5.14.2)
multi_test (0.1.2)
protobuf-cucumber (3.10.8)
activesupport (>= 3.2)
middleware
thor
thread_safe
rspec-expectations (3.9.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
sys-uname (1.2.1)
ffi (>= 1.0.0)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
zeitwerk (2.4.0)

PLATFORMS
ruby

DEPENDENCIES
aruba (~> 0.14.3)

BUNDLED WITH
2.1.4
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
# 18F
A Vale linter style that replicates the 18F style guide

Based on [18F](https://pages.18f.gov/content-guide/).
A Vale linter style that replicates the 18F [18F](https://pages.18f.gov/content-guide/).

__Not complete, and WIP, contributions welcome__.😁


[![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)

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/).

> This project is in the worldwide [public domain](LICENSE.md).
> As a work of the United States government, this project is in the public domain within the United States.
> Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
>
## Getting Started

> :exclamation: Requires Vale >= **1.7.0**. :exclamation:
Download the [latest release](https://github.com/testthedocs/18F/releases), copy the "18F" directory to your `StylesPath`, and include it in your configuration file:

```ini
# This goes in a file named either `.vale.ini` or `_vale.ini`.
StylesPath = path/to/some/directory
MinAlertLevel = warning # suggestion, warning or error

# Only Markdown and .txt files; change to whatever you're using.
[*.{md,txt}]
# List of styles to load.
BasedOnStyles = 18F
```

See [Usage](https://github.com/errata-ai/vale/#usage) for more information.
15 changes: 15 additions & 0 deletions features/rules.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Rules

Scenario: Basic test case
When I test "basic"
Then the output should contain exactly:
"""
fail.md:3:11:18F.Abbreviations:Use 'e.g.,' instead of 'eg'
fail.md:3:17:18F.Abbreviations:Use 'i.e.,' instead of 'ie'
fail.md:5:22:18F.Quotes:Punctuation should be inside the quotes.
fail.md:5:30:18F.Contractions:Use 'it's' instead of 'it is.'
fail.md:5:50:18F.Brands:Use 'bandage' instead of 'Band-Aid.'
fail.md:5:82:18F.Clarity:Avoid using 'agenda' (unless you’re talking about a meeting).
fail.md:5:90:18F.OxfordComma:Use the Oxford comma in a list of three or more items.
fail.md:5:157:18F.Terms:Prefer 'usability testing' over 'user testing.'
"""
6 changes: 6 additions & 0 deletions features/steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmd = 'vale --output=line --sort --normalize --relative'

When(/^I test "(.*)"$/) do |rule|
step %(I cd to "../../fixtures/#{rule}")
step %(I run `#{cmd} .`)
end
1 change: 1 addition & 0 deletions features/support/aruba.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'aruba/cucumber'
6 changes: 6 additions & 0 deletions fixtures/basic/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../

MinAlertLevel = suggestion

[*.md]
BasedOnStyles = 18F
5 changes: 5 additions & 0 deletions fixtures/basic/fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WELCOME!

Don't use eg or ie. And in a list of one, two, and three items don't use an oxford comma.

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.
5 changes: 5 additions & 0 deletions fixtures/basic/pass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Welcome

Don't use e.g., or i.e., And in a list of one, two, and three items don't use an oxford comma.

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.
5 changes: 5 additions & 0 deletions fixtures/basic/real.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Welcome

Don't use e.g., or i.e., And in a list of one, two, and three items don't use an oxford comma.

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 comments on commit 69223ee

Please sign in to comment.