warder 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/lib/warder/version.rb +1 -1
  3. metadata +26 -214
  4. data/.gitignore +0 -20
  5. data/.travis.yml +0 -15
  6. data/Gemfile +0 -4
  7. data/LICENSE.txt +0 -22
  8. data/README.md +0 -130
  9. data/Rakefile +0 -53
  10. data/cucumber.yml +0 -4
  11. data/features/checks_for_all_issues.feature +0 -36
  12. data/features/checks_for_rails_best_practices.feature +0 -25
  13. data/features/checks_for_rails_related_issues.feature +0 -27
  14. data/features/checks_for_rails_security_issues.feature +0 -25
  15. data/features/checks_for_sandi_metz_rules.feature +0 -25
  16. data/features/checks_for_vulnerable_gems.feature +0 -25
  17. data/features/detects_code_complexity.feature +0 -29
  18. data/features/detects_code_duplication.feature +0 -32
  19. data/features/detects_code_smell.feature +0 -29
  20. data/features/detects_magick_numbers.feature +0 -29
  21. data/features/quiet.feature +0 -10
  22. data/features/run.feature +0 -9
  23. data/features/show_version.feature +0 -8
  24. data/features/statistics.feature +0 -22
  25. data/features/step_definitions/checks_for_rails_best_practices_steps.rb +0 -14
  26. data/features/step_definitions/checks_for_rails_security_issues_steps.rb +0 -24
  27. data/features/step_definitions/checks_for_sandi_metz_rules_step.rb +0 -7
  28. data/features/step_definitions/checks_for_vulnerable_gems_steps.rb +0 -15
  29. data/features/step_definitions/detects_code_complexity_steps.rb +0 -11
  30. data/features/step_definitions/detects_code_duplication_steps.rb +0 -7
  31. data/features/step_definitions/detects_code_smell_steps.rb +0 -7
  32. data/features/step_definitions/detects_magick_numbers_steps.rb +0 -7
  33. data/features/step_definitions/run_steps.rb +0 -38
  34. data/features/step_definitions/show_version_steps.rb +0 -3
  35. data/features/step_definitions/statistics_steps.rb +0 -4
  36. data/features/step_definitions/validates_coffeescript_style_guide_steps.rb +0 -12
  37. data/features/step_definitions/validates_ruby_style_guide_steps.rb +0 -7
  38. data/features/support/env.rb +0 -23
  39. data/features/validates_coffeescript_style_guide.feature +0 -29
  40. data/features/validates_ruby_style_guide.feature +0 -29
  41. data/spec/fixtures/invalid_code_complexity.rb +0 -13
  42. data/spec/fixtures/invalid_code_duplication.rb +0 -40
  43. data/spec/fixtures/invalid_code_smell.rb +0 -4
  44. data/spec/fixtures/invalid_coffee_lint.coffee +0 -6
  45. data/spec/fixtures/invalid_magick_numbers.rb +0 -1
  46. data/spec/fixtures/invalid_rails_app/Gemfile +0 -4
  47. data/spec/fixtures/invalid_rails_app/Gemfile_lock +0 -82
  48. data/spec/fixtures/invalid_rails_app/Rakefile +0 -6
  49. data/spec/fixtures/invalid_rails_app/app/assets/javascripts/invalid_coffee_lint.coffee +0 -6
  50. data/spec/fixtures/invalid_rails_app/app/controllers/application_controller.rb +0 -19
  51. data/spec/fixtures/invalid_rails_app/app/models/user.rb +0 -5
  52. data/spec/fixtures/invalid_rails_app/app/views/layouts/application.html.erb +0 -14
  53. data/spec/fixtures/invalid_rails_app/config.ru +0 -4
  54. data/spec/fixtures/invalid_rails_app/config/application.rb +0 -24
  55. data/spec/fixtures/invalid_rails_app/config/boot.rb +0 -4
  56. data/spec/fixtures/invalid_rails_app/config/database.yml +0 -25
  57. data/spec/fixtures/invalid_rails_app/config/environment.rb +0 -5
  58. data/spec/fixtures/invalid_rails_app/config/environments/development.rb +0 -29
  59. data/spec/fixtures/invalid_rails_app/config/environments/production.rb +0 -80
  60. data/spec/fixtures/invalid_rails_app/config/environments/test.rb +0 -36
  61. data/spec/fixtures/invalid_rails_app/config/initializers/backtrace_silencers.rb +0 -7
  62. data/spec/fixtures/invalid_rails_app/config/initializers/filter_parameter_logging.rb +0 -4
  63. data/spec/fixtures/invalid_rails_app/config/initializers/inflections.rb +0 -16
  64. data/spec/fixtures/invalid_rails_app/config/initializers/mime_types.rb +0 -5
  65. data/spec/fixtures/invalid_rails_app/config/initializers/secret_token.rb +0 -12
  66. data/spec/fixtures/invalid_rails_app/config/initializers/session_store.rb +0 -3
  67. data/spec/fixtures/invalid_rails_app/config/initializers/wrap_parameters.rb +0 -14
  68. data/spec/fixtures/invalid_rails_app/config/locales/en.yml +0 -23
  69. data/spec/fixtures/invalid_rails_app/config/routes.rb +0 -5
  70. data/spec/fixtures/invalid_rails_app/lib/invalid_code_complexity.rb +0 -13
  71. data/spec/fixtures/invalid_rails_app/lib/invalid_code_duplication.rb +0 -40
  72. data/spec/fixtures/invalid_style_guide.rb +0 -3
  73. data/spec/fixtures/strictly_invalid_style_guide.rb +0 -3
  74. data/spec/fixtures/valid.rb +0 -1
  75. data/spec/fixtures/valid_coffee_lint.coffee +0 -6
  76. data/spec/fixtures/valid_rails_app/Gemfile +0 -5
  77. data/spec/fixtures/valid_rails_app/Gemfile_lock +0 -105
  78. data/spec/fixtures/valid_rails_app/Rakefile +0 -7
  79. data/spec/fixtures/valid_rails_app/app/assets/javascripts/valid.coffee +0 -6
  80. data/spec/fixtures/valid_rails_app/app/controllers/application_controller.rb +0 -6
  81. data/spec/fixtures/valid_rails_app/app/views/layouts/application.html.erb +0 -14
  82. data/spec/fixtures/valid_rails_app/config.ru +0 -4
  83. data/spec/fixtures/valid_rails_app/config/application.rb +0 -29
  84. data/spec/fixtures/valid_rails_app/config/boot.rb +0 -4
  85. data/spec/fixtures/valid_rails_app/config/database.yml +0 -25
  86. data/spec/fixtures/valid_rails_app/config/environment.rb +0 -5
  87. data/spec/fixtures/valid_rails_app/config/environments/development.rb +0 -30
  88. data/spec/fixtures/valid_rails_app/config/environments/production.rb +0 -86
  89. data/spec/fixtures/valid_rails_app/config/environments/test.rb +0 -37
  90. data/spec/fixtures/valid_rails_app/config/initializers/filter_parameter_logging.rb +0 -4
  91. data/spec/fixtures/valid_rails_app/config/initializers/mime_types.rb +0 -5
  92. data/spec/fixtures/valid_rails_app/config/initializers/secret_token.rb +0 -13
  93. data/spec/fixtures/valid_rails_app/config/initializers/session_store.rb +0 -3
  94. data/spec/fixtures/valid_rails_app/config/initializers/wrap_parameters.rb +0 -15
  95. data/spec/fixtures/valid_rails_app/config/locales/en.yml +0 -23
  96. data/spec/fixtures/valid_rails_app/config/routes.rb +0 -2
  97. data/spec/spec_helper.rb +0 -8
  98. data/warder.gemspec +0 -38
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in warder.gemspec
4
- gemspec
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Yura Tolstik
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,130 +0,0 @@
1
- # Warder
2
-
3
- [![Build Status](https://travis-ci.org/yltsrc/warder.svg?branch=master)](https://travis-ci.org/yltsrc/warder)
4
- [![Code Climate](https://codeclimate.com/github/yltsrc/warder.svg)](https://codeclimate.com/github/yltsrc/warder)
5
- [![Dependency Status](https://gemnasium.com/yltsrc/warder.svg)](https://gemnasium.com/yltsrc/warder)
6
-
7
- ## Getting started
8
-
9
- Main goal of this project was to provide you tool, which will help make code
10
- better. I used these tools for a while and can provide some tips.
11
-
12
- Just to start with warder, it would be great to do something simple.
13
- And I will recommend to start with checking your bundle for security issues
14
-
15
- $ warder --bundle-audit
16
-
17
- Sooner or later you will start with code cleanup. There are two main ways to
18
- deal with it, depending what you plan to achieve. If you are interested in clean
19
- code, according to style guides, you may want to use
20
-
21
- $ warder --style-guide
22
-
23
- But if you want to see you code OOP-friendly, then you need different approach
24
-
25
- $ warder --code-smell
26
-
27
- Next steps for stylish code are:
28
-
29
- $ warder --magick-numbers
30
- $ warder --code-duplication
31
-
32
- And for OOP-style code next steps will be:
33
-
34
- $ warder --code-complexity
35
-
36
- Then you can apply everything is left. But I strongly recommend to add
37
- validations one by one, right after all issues are fixed from previous one.
38
- Now it is not possible to compare results on feature branches without scripting,
39
- so you must be careful, if you want to use all suitable validators and results
40
- are not as good as it can be.
41
-
42
- There are few rails specific validators, but the rules are the same. Security is
43
- the first priority:
44
-
45
- $ warder --rails-security
46
-
47
- You may also want to see some advice, regarding rails best practices:
48
-
49
- $ warder --rails-advice
50
-
51
- but be careful with it, some reported advices may conflict with another
52
- validators.
53
-
54
- You may also see, how your rails app meets Sandi Metz rules:
55
-
56
- $ warder --sandi-rules
57
-
58
- You can validate not only ruby files, but also coffeescript files:
59
-
60
- $ warder --coffee-lint
61
-
62
- ## Installation
63
-
64
- Add this line to your application's Gemfile:
65
-
66
- gem 'warder'
67
-
68
- And then execute:
69
-
70
- $ bundle
71
-
72
- Or install it yourself as:
73
-
74
- $ gem install warder
75
-
76
- ## Usage
77
-
78
- First of all, RTFM!
79
-
80
- $ warder --help
81
-
82
- to see all supported scanners.
83
- If you are too lazy, you will be confused with results.
84
-
85
- $ warder
86
-
87
- to see that everything is good (actually no one validator used) and you don't
88
- need to fix any issues :)
89
-
90
- You also can use shortcuts:
91
-
92
- $ warder --all
93
-
94
- to run all validations, even ones you don't really need.
95
-
96
- To run only rails related validations:
97
-
98
- $ warder --rails
99
-
100
- or to validate your ruby project:
101
-
102
- $ warder --all --no-rails
103
-
104
- if you so tired looking at your code issues, you can use silent mode
105
-
106
- $ warder --quiet
107
-
108
- and you just will get result by exit code.
109
-
110
- But if you, or your CI is really interested in statistics, there is statistics
111
- mode for you:
112
-
113
- $ warder --quiet --stats
114
-
115
- if you working on multiple projects, you can pass path to another project
116
- as an argument:
117
-
118
- $ warder --quiet /path/to/another/project
119
-
120
- The best thing I can do with warder is validate project itself, so anyone can
121
- see, that it is not so hard to write good ruby code. Just check build status on
122
- [Travis CI](https://travis-ci.org/yltsrc/warder).
123
-
124
- ## Contributing
125
-
126
- 1. Fork it
127
- 2. Create your feature branch (`git checkout -b my-new-feature`)
128
- 3. Commit your changes (`git commit -am 'Add some feature'`)
129
- 4. Push to the branch (`git push origin my-new-feature`)
130
- 5. Create new Pull Request
data/Rakefile DELETED
@@ -1,53 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'cucumber/rake/task'
4
-
5
- namespace :spec do
6
- desc 'Run specs that should pass'
7
- RSpec::Core::RakeTask.new(:ok) do |t|
8
- t.rspec_opts = '--tag ~wip'
9
- t.pattern = './spec/**/*_spec.rb'
10
- end
11
-
12
- desc 'Run specs that are being worked on'
13
- RSpec::Core::RakeTask.new(:wip) do |t|
14
- t.rspec_opts = '--color --tag wip'
15
- t.pattern = './spec/**/*_spec.rb'
16
- end
17
-
18
- desc 'Run all specs'
19
- RSpec::Core::RakeTask.new(:all) do |t|
20
- t.rspec_opts = '--color'
21
- t.pattern = './spec/**/*_spec.rb'
22
- end
23
- end
24
-
25
- namespace :cucumber do
26
- desc 'Run features that should pass'
27
- Cucumber::Rake::Task.new(:ok) do |t|
28
- t.fork = true # You may get faster startup if you set this to false
29
- t.profile = 'ok'
30
- end
31
-
32
- desc 'Run features that are being worked on'
33
- Cucumber::Rake::Task.new(:wip) do |t|
34
- t.fork = true # You may get faster startup if you set this to false
35
- t.profile = 'wip'
36
- end
37
-
38
- desc 'Run all features'
39
- Cucumber::Rake::Task.new(:all) do |t|
40
- t.fork = true # You may get faster startup if you set this to false
41
- t.profile = 'default'
42
- end
43
- end
44
-
45
- desc 'Alias for cucumber:ok'
46
- task cucumber: 'cucumber:ok'
47
-
48
- desc 'Alias for spec:ok'
49
- task spec: 'spec:ok'
50
-
51
- task wip: %w(spec:wip cucumber:wip)
52
- task all: %w(spec:all cucumber:all)
53
- task default: %w(spec cucumber)
@@ -1,4 +0,0 @@
1
- <% std_opts = "--color --format 'pretty'" %>
2
- default: <%= std_opts %> --strict features
3
- ok: <%= std_opts %> --strict --tags ~@wip features
4
- wip: <%= std_opts %> --tags @wip:1 --wip features
@@ -1,36 +0,0 @@
1
- Feature: checks for all issues
2
- In order to find all issues
3
- As a ruby developer
4
- I want to run warder with --all option
5
-
6
- Scenario: run warder with enabled all option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --all`
10
- Then warder detects style guide issues
11
- Then warder detects magick numbers issues
12
- Then warder detects code complexity issues
13
- Then warder detects code duplication issues
14
- Then warder detects code smell issues
15
- Then warder detects sandi rules violations
16
- Then warder detects rails best practices issues
17
- Then warder detects rails security issues
18
- Then warder detects gem freshness issues
19
- Then warder detects coffee lint issues
20
- Then the exit status should be 0
21
-
22
- Scenario: run warder with enabled rails option on invalid project
23
- Given I have invalid_rails_app project in directory
24
- And I am on project directory
25
- When I run `warder --all`
26
- Then warder detects style guide issues
27
- Then warder detects magick numbers issues
28
- Then warder detects code complexity issues
29
- Then warder detects code duplication issues
30
- Then warder detects code smell issues
31
- Then warder detects sandi rules violations
32
- Then warder detects rails best practices issues
33
- Then warder detects rails security issues
34
- Then warder detects gem freshness issues
35
- Then warder detects coffee lint issues
36
- Then the exit status should be 10
@@ -1,25 +0,0 @@
1
- Feature: checks for rails best practices advices
2
- In order to get rails advices
3
- As a ruby developer
4
- I want to run warder with --rails-advice option
5
-
6
- Scenario: run warder with enabled rails advice option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --rails-advice`
10
- Then warder detects rails best practices issues
11
- Then the exit status should be 0
12
-
13
- Scenario: run warder with enabled rails advice option on invalid project
14
- Given I have invalid_rails_app project in directory
15
- And I am on project directory
16
- When I run `warder --rails-advice`
17
- Then warder detects rails best practices issues
18
- Then the exit status should be 1
19
-
20
- Scenario: run warder with disabled rails advice option on invalid project
21
- Given I have invalid_rails_app project in directory
22
- And I am on project directory
23
- When I run `warder --no-rails-advice`
24
- Then warder does nothing
25
- Then the exit status should be 0
@@ -1,27 +0,0 @@
1
- Feature: checks for rails related issues
2
- In order to find rails related issues
3
- As a ruby developer
4
- I want to run warder with --rails option
5
-
6
- Scenario: run warder with enabled rails option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --rails`
10
- Then warder detects rails best practices issues
11
- Then warder detects rails security issues
12
- Then the exit status should be 0
13
-
14
- Scenario: run warder with enabled rails option on invalid project
15
- Given I have invalid_rails_app project in directory
16
- And I am on project directory
17
- When I run `warder --rails`
18
- Then warder detects rails best practices issues
19
- Then warder detects rails security issues
20
- Then the exit status should be 2
21
-
22
- Scenario: run warder with disabled rails option on invalid project
23
- Given I have invalid_rails_app project in directory
24
- And I am on project directory
25
- When I run `warder --no-rails`
26
- Then warder does nothing
27
- Then the exit status should be 0
@@ -1,25 +0,0 @@
1
- Feature: checks for rails related security issues
2
- In order to find security issues
3
- As a ruby developer
4
- I want to run warder with --rails-security option
5
-
6
- Scenario: run warder with enabled rails security option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --rails-security`
10
- Then warder detects rails security issues
11
- Then the exit status should be 0
12
-
13
- Scenario: run warder with enabled rails security option on invalid project
14
- Given I have invalid_rails_app project in directory
15
- And I am on project directory
16
- When I run `warder --rails-security`
17
- Then warder detects rails security issues
18
- Then the exit status should be 1
19
-
20
- Scenario: run warder with disabled rails security option on invalid project
21
- Given I have invalid_rails_app project in directory
22
- And I am on project directory
23
- When I run `warder --no-rails-security`
24
- Then warder does nothing
25
- Then the exit status should be 0
@@ -1,25 +0,0 @@
1
- Feature: checks for Sandi Metz rules violations
2
- In order to find Sandi Metz rules violations
3
- As a ruby developer
4
- I want to run warder with --sandi-rules option
5
-
6
- Scenario: run warder with enabled sandi rules option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --sandi-rules`
10
- Then warder detects sandi rules violations
11
- Then the exit status should be 0
12
-
13
- Scenario: run warder with enabled sandi rules option on invalid project
14
- Given I have invalid_rails_app project in directory
15
- And I am on project directory
16
- When I run `warder --sandi-rules`
17
- Then warder detects sandi rules violations
18
- Then the exit status should be 1
19
-
20
- Scenario: run warder with disabled sandi rules option on invalid project
21
- Given I have invalid_rails_app project in directory
22
- And I am on project directory
23
- When I run `warder --no-sandi-rules`
24
- Then warder does nothing
25
- Then the exit status should be 0
@@ -1,25 +0,0 @@
1
- Feature: checks for vulnerable gems
2
- In order to find vulnerable gems
3
- As a ruby developer
4
- I want to run warder with --bundle-audit option
5
-
6
- Scenario: run warder with enabled bundle audit option
7
- Given I have valid_rails_app project in directory
8
- And I am on project directory
9
- When I run `warder --bundle-audit`
10
- Then warder detects gem freshness issues
11
- Then the exit status should be 0
12
-
13
- Scenario: run warder with enabled bundle audit option on invalid file
14
- Given I have invalid_rails_app project in directory
15
- And I am on project directory
16
- When I run `warder --bundle-audit`
17
- Then warder detects gem freshness issues
18
- Then the exit status should be 1
19
-
20
- Scenario: run warder with disabled bundle audit option on invalid file
21
- Given I have invalid_rails_app project in directory
22
- And I am on project directory
23
- When I run `warder --no-bundle-audit`
24
- Then warder does nothing
25
- Then the exit status should be 0
@@ -1,29 +0,0 @@
1
- Feature: detects code complexity
2
- In order to find code complexity
3
- As a ruby developer
4
- I want to run warder with --code-complexity option
5
-
6
- Scenario: run warder with enabled code complexity option
7
- Given I have valid file in directory
8
- When I run `warder --code-complexity`
9
- Then warder detects code complexity issues
10
- Then the exit status should be 0
11
-
12
- Scenario: run warder with enabled code complexity option on invalid file
13
- Given I have invalid_code_complexity file in directory
14
- When I run `warder --code-complexity`
15
- Then warder detects code complexity issues
16
- Then the exit status should be 1
17
-
18
- Scenario: run warder with enabled code complexity option on valid file only
19
- Given I have valid file in directory
20
- And I have invalid_code_complexity file in directory
21
- When I run `warder --code-complexity valid.rb`
22
- Then warder does nothing
23
- Then the exit status should be 0
24
-
25
- Scenario: run warder with disabled code complexity option on invalid file
26
- Given I have invalid_code_complexity file in directory
27
- When I run `warder --no-code-complexity`
28
- Then warder does nothing
29
- Then the exit status should be 0
@@ -1,32 +0,0 @@
1
- Feature: detects code duplication
2
- In order to find code duplication
3
- As a ruby developer
4
- I want to run warder with --code-duplication option
5
-
6
- Scenario: run warder with enabled code duplication option
7
- Given I have valid file in directory
8
- When I run `warder --code-duplication`
9
- Then warder detects code duplication issues
10
- Then the exit status should be 0
11
-
12
- Scenario: run warder with enabled code duplication option on invalid file
13
- Given I have invalid_code_duplication file in directory
14
- When I set the environment variables to:
15
- | variable | value |
16
- | FLAY_SCORE | 15 |
17
- And I run `warder --code-duplication`
18
- Then warder detects code duplication issues
19
- Then the exit status should be 1
20
-
21
- Scenario: run warder with enabled code duplication option on valid file only
22
- Given I have valid file in directory
23
- And I have invalid_code_duplication file in directory
24
- When I run `warder --code-duplication valid.rb`
25
- Then warder does nothing
26
- Then the exit status should be 0
27
-
28
- Scenario: run warder with disabled code duplication option on invalid file
29
- Given I have invalid_code_duplication file in directory
30
- When I run `warder --no-code-duplication`
31
- Then warder does nothing
32
- Then the exit status should be 0