goodcheck 2.4.4 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -2
  3. data/README.md +107 -50
  4. data/lib/goodcheck.rb +4 -3
  5. data/lib/goodcheck/buffer.rb +44 -1
  6. data/lib/goodcheck/cli.rb +78 -54
  7. data/lib/goodcheck/commands/check.rb +20 -1
  8. data/lib/goodcheck/commands/config_loading.rb +19 -2
  9. data/lib/goodcheck/commands/init.rb +4 -2
  10. data/lib/goodcheck/commands/pattern.rb +2 -1
  11. data/lib/goodcheck/commands/test.rb +5 -4
  12. data/lib/goodcheck/config_loader.rb +6 -5
  13. data/lib/goodcheck/error.rb +3 -0
  14. data/lib/goodcheck/exit_status.rb +6 -0
  15. data/lib/goodcheck/glob.rb +14 -3
  16. data/lib/goodcheck/import_loader.rb +42 -10
  17. data/lib/goodcheck/version.rb +1 -1
  18. metadata +8 -70
  19. data/.gitignore +0 -13
  20. data/.rubocop.yml +0 -5
  21. data/.travis.yml +0 -11
  22. data/Dockerfile +0 -13
  23. data/Gemfile +0 -6
  24. data/Rakefile +0 -50
  25. data/bin/console +0 -14
  26. data/bin/setup +0 -8
  27. data/cheatsheet.pdf +0 -0
  28. data/docusaurus/.dockerignore +0 -2
  29. data/docusaurus/.gitignore +0 -12
  30. data/docusaurus/Dockerfile +0 -10
  31. data/docusaurus/docker-compose.yml +0 -18
  32. data/docusaurus/docs/commands.md +0 -69
  33. data/docusaurus/docs/configuration.md +0 -300
  34. data/docusaurus/docs/development.md +0 -15
  35. data/docusaurus/docs/getstarted.md +0 -46
  36. data/docusaurus/docs/rules.md +0 -79
  37. data/docusaurus/website/README.md +0 -193
  38. data/docusaurus/website/core/Footer.js +0 -100
  39. data/docusaurus/website/package.json +0 -14
  40. data/docusaurus/website/pages/en/index.js +0 -207
  41. data/docusaurus/website/pages/en/versions.js +0 -118
  42. data/docusaurus/website/sidebars.json +0 -11
  43. data/docusaurus/website/siteConfig.js +0 -171
  44. data/docusaurus/website/static/css/code-block-buttons.css +0 -39
  45. data/docusaurus/website/static/css/custom.css +0 -245
  46. data/docusaurus/website/static/img/favicon.ico +0 -0
  47. data/docusaurus/website/static/js/code-block-buttons.js +0 -47
  48. data/docusaurus/website/versioned_docs/version-1.0.0/commands.md +0 -70
  49. data/docusaurus/website/versioned_docs/version-1.0.0/configuration.md +0 -296
  50. data/docusaurus/website/versioned_docs/version-1.0.0/development.md +0 -16
  51. data/docusaurus/website/versioned_docs/version-1.0.0/getstarted.md +0 -47
  52. data/docusaurus/website/versioned_docs/version-1.0.0/rules.md +0 -81
  53. data/docusaurus/website/versioned_docs/version-1.0.2/rules.md +0 -79
  54. data/docusaurus/website/versioned_docs/version-2.4.0/configuration.md +0 -301
  55. data/docusaurus/website/versioned_docs/version-2.4.3/rules.md +0 -80
  56. data/docusaurus/website/versioned_sidebars/version-1.0.0-sidebars.json +0 -11
  57. data/docusaurus/website/versioned_sidebars/version-1.0.2-sidebars.json +0 -11
  58. data/docusaurus/website/versioned_sidebars/version-2.4.0-sidebars.json +0 -11
  59. data/docusaurus/website/versions.json +0 -8
  60. data/docusaurus/website/yarn.lock +0 -6844
  61. data/goodcheck.gemspec +0 -36
  62. data/goodcheck.yml +0 -10
  63. data/logo/GoodCheck Horizontal.pdf +0 -899
  64. data/logo/GoodCheck Horizontal.png +0 -0
  65. data/logo/GoodCheck Horizontal.svg +0 -55
  66. data/logo/GoodCheck logo.png +0 -0
  67. data/logo/GoodCheck vertical.png +0 -0
  68. data/sample.yml +0 -57
@@ -1,100 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- const React = require('react');
9
-
10
- class Footer extends React.Component {
11
- docUrl(doc) {
12
- const baseUrl = this.props.config.baseUrl;
13
- const docsUrl = this.props.config.docsUrl;
14
- const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
15
- return `${baseUrl}${docsPart}${doc}`;
16
- }
17
-
18
- pageUrl(doc, language) {
19
- const baseUrl = this.props.config.baseUrl;
20
- return baseUrl + (language ? `${language}/` : '') + doc;
21
- }
22
-
23
- render() {
24
- return (
25
- <footer className="nav-footer" id="footer">
26
- <section className="sitemap">
27
- <a href={this.props.config.baseUrl} className="nav-home">
28
- {this.props.config.footerIcon && (
29
- <img
30
- src={this.props.config.baseUrl + this.props.config.footerIcon}
31
- alt={this.props.config.title}
32
- width="40"
33
- height="39"
34
- />
35
- )}
36
- </a>
37
- <div>
38
- <h5>Docs</h5>
39
- <a href={this.docUrl('getstarted.html')}>
40
- Getting Started
41
- </a>
42
- <a href={this.docUrl('configuration.html')}>
43
- Configuration
44
- </a>
45
- <a href={this.docUrl('rules.html')}>
46
- Rules
47
- </a>
48
- <a href={this.docUrl('commands.html')}>
49
- Commands
50
- </a>
51
- <a href={this.docUrl('development.html')}>
52
- Development
53
- </a>
54
- </div>
55
- <div>
56
- <h5>More</h5>
57
- <a href="https://github.com/sider/goodcheck">GitHub</a>
58
- <a
59
- className="github-button"
60
- href={this.props.config.repoUrl}
61
- data-icon="octicon-star"
62
- data-count-href="/sider/goodcheck/stargazers"
63
- data-show-count="true"
64
- data-count-aria-label="# stargazers on GitHub"
65
- aria-label="Star this project on GitHub">
66
- Star
67
- </a>
68
- {this.props.config.twitterUsername && (
69
- <div className="social">
70
- <a
71
- href={`https://twitter.com/${
72
- this.props.config.twitterUsername
73
- }`}
74
- className="twitter-follow-button">
75
- Follow @{this.props.config.twitterUsername}
76
- </a>
77
- </div>
78
- )}
79
- {this.props.config.facebookAppId && (
80
- <div className="social">
81
- <div
82
- className="fb-like"
83
- data-href={this.props.config.url}
84
- data-colorscheme="dark"
85
- data-layout="standard"
86
- data-share="true"
87
- data-width="225"
88
- data-show-faces="false"
89
- />
90
- </div>
91
- )}
92
- </div>
93
- </section>
94
- <section className="copyright">{this.props.config.copyright}</section>
95
- </footer>
96
- );
97
- }
98
- }
99
-
100
- module.exports = Footer;
@@ -1,14 +0,0 @@
1
- {
2
- "scripts": {
3
- "examples": "docusaurus-examples",
4
- "start": "docusaurus-start",
5
- "build": "docusaurus-build",
6
- "publish-gh-pages": "docusaurus-publish",
7
- "write-translations": "docusaurus-write-translations",
8
- "version": "docusaurus-version",
9
- "rename-version": "docusaurus-rename-version"
10
- },
11
- "devDependencies": {
12
- "docusaurus": "^1.14.0"
13
- }
14
- }
@@ -1,207 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- const React = require('react');
9
-
10
- class Splash extends React.Component {
11
- render() {
12
- return (
13
- <div className="feature-container">
14
- <FeatureDescription
15
- title={this.props.info.title}
16
- description={this.props.info.description}
17
- button={this.props.info.button}
18
- />
19
- <FeatureCodeBoxExtended info={this.props.info} />
20
- </div>
21
- );
22
- }
23
- }
24
-
25
- const Button = props => (
26
- <div className="plugin-wrapper button-wrapper">
27
- <a className="button" href={props.href} target={props.target}>
28
- {props.children}
29
- </a>
30
- </div>
31
- );
32
-
33
- class Section extends React.Component {
34
- render() {
35
-
36
- return (
37
- <div className="section-container">
38
- <div className="section-grid">
39
- <div className="section-card">
40
- <div>
41
- <h2>Configuration</h2>
42
- <p>Learn the patterns and syntax to make custom rules. </p>
43
- <Button href="./docs/configuration">Syntax details</Button>
44
- </div>
45
- </div>
46
- <div className="section-card">
47
- <div>
48
- <h2>Rules</h2>
49
- <p>
50
- Want to see some pre-defined rules? Check out some rules here.
51
- </p>
52
- <Button href="./docs/rules">See rules</Button>
53
- </div>
54
- </div>
55
- <div className="section-card">
56
- <div>
57
- <h2>Commands</h2>
58
- <p>
59
- Goodcheck is written to be used on the command line. Learn about
60
- it’s usage here.
61
- </p>
62
- <Button href="./docs/commands">CLI details</Button>
63
- </div>
64
- </div>
65
- </div>
66
- </div>
67
- );
68
- }
69
- }
70
-
71
- class Feature extends React.Component {
72
- render() {
73
- return (
74
- <div className="center-container">
75
- <div className="feature-container">
76
- <FeatureDescription
77
- title={this.props.info.title}
78
- description={this.props.info.description}
79
- />
80
- <FeatureCodeBoxExtended info={this.props.info} />
81
- </div>
82
- </div>
83
- );
84
- }
85
- }
86
-
87
- class FeatureDescription extends React.Component {
88
- render() {
89
- return (
90
- <div className="description-container">
91
- <h1>{this.props.title}</h1>
92
- <p>{this.props.description}</p>
93
- {this.props.button && (
94
- <Button href="./docs/getstarted">{this.props.button}</Button>
95
- )}
96
- </div>
97
- );
98
- }
99
- }
100
-
101
- class FeatureCodeBoxExtended extends React.Component {
102
- render() {
103
- const info = this.props.info;
104
- return (
105
- <div className="code-container">
106
- <header className="code-top">goodcheck.yml</header>
107
- <section className="code-content">
108
- <pre className="yaml">
109
- <span className="yaml-key">rules</span>
110
- <span className="yaml-syntax">: </span>
111
- <br />
112
- <span className="yaml-syntax">{` - `}</span>
113
- <span className="yaml-key">id</span>
114
- <span className="yaml-syntax">: </span>
115
- <span className="yaml-value">{info.id}</span>
116
- <br />
117
- {info.not && (
118
- <div>
119
- <span className="yaml-key">{` not`}</span>
120
- <span className="yaml-syntax">: </span>
121
- <br />
122
- <span className="yaml-key">{` pattern`}</span>
123
- <span className="yaml-syntax">: </span>
124
- <span className="yaml-value">{info.pattern}</span>
125
- <br />
126
- </div>
127
- )}
128
- {!info.not && (
129
- <div>
130
- {info.pattern && (
131
- <div>
132
- <span className="yaml-key">{` pattern`}</span>
133
- <span className="yaml-syntax">: </span>
134
- <span className="yaml-value">{info.pattern}</span>
135
- </div>
136
- )}
137
- </div>
138
- )}
139
- <span className="yaml-key">{` message`}</span>
140
- <span className="yaml-syntax">: </span>
141
- <span className="yaml-value">{`${info.message}`}</span>
142
- <br />
143
- {info.glob && (
144
- <div>
145
- <span className="yaml-key">{` glob`}</span>
146
- <span className="yaml-syntax">: </span>
147
- <span className="yaml-value">{`${info.glob}`}</span>
148
- </div>
149
- )}
150
- </pre>
151
- </section>
152
- <header className="code-result">Result</header>
153
- <section className="code-terminal">
154
- <p className="yaml">
155
- {`${info.resultFront}`}
156
- {info.match && (
157
- <span className="terminal-highlight"> {info.match} </span>
158
- )}
159
- {info.resultEnd && `${info.resultEnd}`}
160
- </p>
161
- </section>
162
- </div>
163
- );
164
- }
165
- }
166
-
167
- class Index extends React.Component {
168
- render() {
169
- const { config: siteConfig } = this.props;
170
-
171
- const Showcase = () => {
172
-
173
- return (
174
- <div className="productShowcaseSection paddingBottom showcaseBackground">
175
- <br />
176
- <h2>Stop reviewing the same patterns.</h2>
177
- <Button href="./docs/getstarted">Start using {siteConfig.title}</Button>
178
- </div>
179
- );
180
- };
181
-
182
- const MainContainer = () => {
183
- return (
184
- <div className="index-container">
185
- <div className="splash-container">
186
- <Splash info={siteConfig.splash} />
187
- </div>
188
- <div className="three-features-container">
189
- <Section />
190
- <Feature info={siteConfig.featureOne} />
191
- <Feature info={siteConfig.featureTwo} />
192
- <Feature info={siteConfig.featureThree} />
193
- </div>
194
- </div>
195
- );
196
- }
197
-
198
- return (
199
- <div>
200
- <MainContainer />
201
- <Showcase />
202
- </div>
203
- );
204
- }
205
- }
206
-
207
- module.exports = Index;
@@ -1,118 +0,0 @@
1
- /**
2
- * Copyright (c) 2017-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- const React = require('react');
9
-
10
- const CompLibrary = require('../../core/CompLibrary');
11
-
12
- const Container = CompLibrary.Container;
13
-
14
- const CWD = process.cwd();
15
-
16
- const versions = require(`${CWD}/versions.json`);
17
-
18
- function Versions(props) {
19
- const { config: siteConfig } = props;
20
- const latestVersion = versions[0];
21
- const repoUrl = `https://github.com/${siteConfig.organizationName}/${
22
- siteConfig.projectName
23
- }`;
24
- return (
25
- <div className="docMainWrapper wrapper">
26
- <Container className="mainContainer versionsContainer">
27
- <div className="post">
28
- <header className="postHeader">
29
- <h1>{siteConfig.title} Versions</h1>
30
- </header>
31
- <p>New versions of this project are released every so often.</p>
32
- <h3 id="latest">Current version (Stable)</h3>
33
- <table className="versions">
34
- <tbody>
35
- <tr>
36
- <th>{latestVersion}</th>
37
- <td>
38
- {/* You are supposed to change this href where appropriate
39
- Example: href="<baseUrl>/docs(/:language)/:id" */}
40
- <a
41
- href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
42
- props.language ? props.language + '/' : ''
43
- }configuration`}>
44
- Documentation
45
- </a>
46
- </td>
47
- <td>
48
- <a href="https://github.com/sider/goodcheck/releases">Release Notes</a>
49
- </td>
50
- </tr>
51
- </tbody>
52
- </table>
53
- <p>
54
- This is the version that is configured automatically when you first
55
- install this project.
56
- </p>
57
- <h3 id="rc">Pre-release versions</h3>
58
- <table className="versions">
59
- <tbody>
60
- <tr>
61
- <th>master</th>
62
- <td>
63
- {/* You are supposed to change this href where appropriate
64
- Example: href="<baseUrl>/docs(/:language)/next/:id" */}
65
- <a
66
- href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
67
- props.language ? props.language + '/' : ''
68
- }next/configuration`}>
69
- Documentation
70
- </a>
71
- </td>
72
- <td>
73
- <a href={repoUrl}>Source Code</a>
74
- </td>
75
- </tr>
76
- </tbody>
77
- </table>
78
- <p>Other text describing this section.</p>
79
- <h3 id="archive">Past Versions</h3>
80
- <p>Here you can find previous versions of the documentation.</p>
81
- <table className="versions">
82
- <tbody>
83
- {versions.map(
84
- version =>
85
- version !== latestVersion && (
86
- <tr>
87
- <th>{version}</th>
88
- <td>
89
- {/* You are supposed to change this href where appropriate
90
- Example: href="<baseUrl>/docs(/:language)/:version/:id" */}
91
- <a
92
- href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${
93
- props.language ? props.language + '/' : ''
94
- }${version}/configuration`}>
95
- Documentation
96
- </a>
97
- </td>
98
- <td>
99
- <a href={`${repoUrl}/releases/tag/v${version}`}>
100
- Release Notes
101
- </a>
102
- </td>
103
- </tr>
104
- ),
105
- )}
106
- </tbody>
107
- </table>
108
- <p>
109
- You can find past versions of this project on{' '}
110
- <a href={repoUrl}>GitHub</a>.
111
- </p>
112
- </div>
113
- </Container>
114
- </div>
115
- );
116
- }
117
-
118
- module.exports = Versions;
@@ -1,11 +0,0 @@
1
- {
2
- "Goodcheck": {
3
- "Docs": [
4
- "getstarted",
5
- "configuration",
6
- "rules",
7
- "commands",
8
- "development"
9
- ]
10
- }
11
- }