goodcheck.yml
rules: - id: com.example.github pattern: Github message: | GitHub is GitHub, not Github
You may have misspelling the name of the service!
Result:
index.html:9:30: GitHub is GitHub, not Github
<a href="/signup">Signup via Github</a>
Commands
Goodcheck is written to be used on the command line. Learn about itβs usage here.
CLI detailsA Goodcheck rule
Define patterns with messages in a goodcheck.yml
file and run goodcheck within your repository. Any matching results will be displayed in the terminal.
goodcheck.yml
rules: - id: com.sample.no_blink pattern: <blink message: | Stop using <blink> tag.
Result:
index.html:50:5: Stop using <blink> tag.
<h3><blink>HTML5 Markup</blink></h3></a>
A rule with negated pattern
Goodcheck rules are usually to detect if something is included in a file. You can define the negated rules for the opposite, something is missing in a file.
goodcheck.yml
rules: - id: com.sample.negated not: pattern: <!DOCTYPE html> message: | Write a doctype on HTML files. glob: "**/*.html"
Result:
index.html:-:-: Write a doctype on HTML files.
<html lang="en">
A rule without pattern
You can define a rule without pattern. The rule emits an issue on each file specified with glob. You cannot omit glob from a rule definition without pattern.
goodcheck.yml
rules: - id: com.sample.without_pattern message: | Read the operation manual for DB migration.
See https://example.com/guides/123 glob: db/schema.rb
Result:
db/schema.rb:-:-: Read the operation manual for DB migration
# This file is auto-generated from the current state of the database.
Stop reviewing the same patterns.