Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdf9636
commit 286725d
Showing
4 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# Runs all linters. | ||
|
||
|
||
# CoffeeScript linter | ||
coffeelint ./src | ||
|
||
# Ensure the docs about CLI are up-to-date | ||
coffee ./scripts/lint-cli-docs.coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Ensures the CLI docs are up to date. | ||
|
||
|
||
fs = require 'fs' | ||
{assert} = require 'chai' | ||
execSync = require 'sync-exec' | ||
|
||
|
||
usageDocs = fs.readFileSync 'docs/usage.md', 'utf-8' | ||
|
||
helpOutput = execSync('bin/dredd --help')?.stderr?.trim?() or '' | ||
helpOutput = (line.trimRight() for line in helpOutput.split(/\n/)).join('\n') # without trailing whitespace | ||
helpOutput = """```\n#{helpOutput}\n```""" # turning to Markdown code block | ||
|
||
|
||
try | ||
assert.include usageDocs, helpOutput | ||
catch e | ||
console.error 'Documentation of CLI in docs/usage.md is not up to date.' | ||
process.exit 1 |