Skip to content

Commit

Permalink
Add db/schema.rb to default_ignores because Rails
Browse files Browse the repository at this point in the history
Fixes #27
  • Loading branch information
searls committed Dec 14, 2018
1 parent d19aff7 commit 7bf9a40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
20 changes: 12 additions & 8 deletions README.md
Expand Up @@ -117,14 +117,15 @@ are available creating a `.standard.yml` file in the root of your project.
Here's an example yaml file with every option set:

```yaml
fix: true
parallel: true
format: progress
ruby_version: 2.3.3
fix: true # default: false
parallel: true # default: false
format: progress # default: Standard::Formatter
ruby_version: 2.3.3 # default: RUBY_VERSION
default_ignores: false # default: true

ignore:
ignore: # default: []
- 'db/schema.rb'
- 'vendor/bundle/**/*'
- 'vendor/**/*'
- 'test/**/*':
- Layout/AlignHash
```
Expand Down Expand Up @@ -228,10 +229,13 @@ list of files and globs that should be excluded:

```yaml
ignore:
- 'db/schema.rb'
- 'vendor/bundle/**/*'
- 'some/file/in/particular.rb'
- 'a/whole/directory/**/*'
```

You can see the files Standard ignores by default
[here](https://github.com/testdouble/standard/blob/master/lib/standard/creates_config_store/configures_ignored_paths.rb#L3-L13)

## How do I hide a certain warning?

In rare cases, you'll need to break a rule and hide the warning generated by
Expand Down
4 changes: 2 additions & 2 deletions lib/standard/creates_config_store/configures_ignored_paths.rb
Expand Up @@ -2,12 +2,12 @@ class Standard::CreatesConfigStore
class ConfiguresIgnoredPaths
DEFAULT_IGNORES = [
# Match RuboCop's defaults: https://github.com/rubocop-hq/rubocop/blob/v0.61.1/config/default.yml#L60-L63
"node_modules/**/*",
"vendor/**/*",
".git/**/*",
"node_modules/**/*",
"vendor/**/*",
# Standard's own default ignores:
"bin/*",
"db/schema.rb",
"tmp/**/*",
].map { |path| [path, ["AllCops"]] }.freeze

Expand Down
1 change: 1 addition & 0 deletions test/fixture/project/a/db/schema.rb
@@ -0,0 +1 @@
useless_assignment = "LOL"
Expand Up @@ -16,10 +16,11 @@ def test_defaults
assert_equal({
"AllCops" => {
"Exclude" => [
".git/**/*",
"node_modules/**/*",
"vendor/**/*",
".git/**/*",
"bin/*",
"db/schema.rb",
"tmp/**/*",
].map { |path| File.expand_path(File.join(Dir.pwd, path)) },
},
Expand All @@ -38,10 +39,11 @@ def test_defaults_with_config_file_defined_somewhere_in_the_ancestry
assert_equal({
"AllCops" => {
"Exclude" => [
"/hi/project/.git/**/*",
"/hi/project/node_modules/**/*",
"/hi/project/vendor/**/*",
"/hi/project/.git/**/*",
"/hi/project/bin/*",
"/hi/project/db/schema.rb",
"/hi/project/tmp/**/*",
],
},
Expand Down

0 comments on commit 7bf9a40

Please sign in to comment.