Skip to content

Commit

Permalink
Change rule descriptions to be frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
John Backus committed Oct 5, 2015
1 parent a06a0d4 commit f2e1f98
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/flay.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
threshold: 9
total_score: 172
threshold: 12
total_score: 173
10 changes: 6 additions & 4 deletions lib/yardstick/rules/api_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ApiTag
# Checks if @api tag is present
#
class Presence < Rule
self.description = 'The @api tag should be specified'
self.description = 'The @api tag should be specified'.freeze

# @see class description
#
Expand All @@ -26,7 +26,7 @@ def valid?
class Inclusion < Rule
VALID_VALUES = %w[public semipublic private].freeze

self.description = 'The @api tag must be either public, semipublic or private'
self.description = 'The @api tag must be either public, semipublic or private'.freeze

# @see class description
#
Expand All @@ -42,7 +42,8 @@ def valid?
# Checks if protected method has correct @api visibility
#
class ProtectedMethod < Rule
self.description = 'A method with protected visibility must have an @api tag of semipublic or private'
self.description =
'A method with protected visibility must have an @api tag of semipublic or private'.freeze

# @see Rule::validatable?
#
Expand All @@ -68,7 +69,8 @@ def valid?
# Checks if private method has correct @api visibility
#
class PrivateMethod < Rule
self.description = 'A method with private visibility must have an @api tag of private'
self.description =
'A method with private visibility must have an @api tag of private'.freeze

# @see Rule::validatable?
#
Expand Down
2 changes: 1 addition & 1 deletion lib/yardstick/rules/example_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Rules
# This applies only for public methods
#
class ExampleTag < Rule
self.description = 'The public/semipublic method should have an example specified'
self.description = 'The public/semipublic method should have an example specified'.freeze

# @see class description
#
Expand Down
2 changes: 1 addition & 1 deletion lib/yardstick/rules/return_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Rules
# Checks if method has a @return tag
#
class ReturnTag < Rule
self.description = 'The @return tag should be specified'
self.description = 'The @return tag should be specified'.freeze

# @see class description
#
Expand Down
9 changes: 5 additions & 4 deletions lib/yardstick/rules/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Summary
# Checks if method summary is present
#
class Presence < Rule
self.description = 'The method summary should be specified'
self.description = 'The method summary should be specified'.freeze

# @see Rule::validatable?
#
Expand Down Expand Up @@ -36,7 +36,8 @@ def valid?
class Length < Rule
MAXIMUM_LINE_LENGTH = 79

self.description = 'The method summary should be less than or equal to 79 characters in length'
self.description =
'The method summary should be less than or equal to 79 characters in length'.freeze

# @see class description
#
Expand All @@ -52,7 +53,7 @@ def valid?
# Checks that method summary doesn't end with a period
#
class Delimiter < Rule
self.description = 'The method summary should not end in a period'
self.description = 'The method summary should not end in a period'.freeze

# @see class description
#
Expand All @@ -70,7 +71,7 @@ def valid?
class SingleLine < Rule
LINE_BREAK_CHARACTER = "\n"

self.description = 'The method summary should be a single line'
self.description = 'The method summary should be a single line'.freeze

# @see class description
#
Expand Down

0 comments on commit f2e1f98

Please sign in to comment.