mumukit-inspection 3.6.2 → 5.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eee225cdc6402627f59ef3c3ee6b2836ca1ab689e62604fc24d19cae88f6aef9
4
- data.tar.gz: 4db88cc5cfb767abf7a9032d093dcbdd4a3b67a4c579d799946379f6177e0176
3
+ metadata.gz: cd19d9b02be4c4299a532621f5de1874a26e0ec2acdcd3744066b8f96fa7f72a
4
+ data.tar.gz: cdfecb5ce6bd98fe9a1666793ec9bf83b61a6d7d85c92d13520211b04133b03e
5
5
  SHA512:
6
- metadata.gz: d85712bf42f4b77d4544faeefbe64e053faf791c248b3ea254b3023b8a1d3a0d5c15a08b8ad15454238b7ec7f1d01889a0bd06e3629f308b412775f179c98b0b
7
- data.tar.gz: 21e049e9826a632e08b6c944423e804c03e00a59ed6000d38e5e3bbf9ab1e7b88118b2156170e646439c6b1c22e9181eaac8ad42c3abe8b8a5db815d51ecbbd3
6
+ metadata.gz: 2a3888189acbb6e93e752700411e5041345abe9272db0d8076e22b2a51ce606515c5c835541ce962df7f89d20c34d8f2f4ea39f7bb98791423f820be7c9c1833
7
+ data.tar.gz: 78e30a2ce9fde63f548d56667cf938334ef4efaaca044494d55616bfedacd5a8c262a81173b689af39b7318eff3871314c399a658f7d945e958951b7f2918c13
@@ -1,47 +1,38 @@
1
- require 'mumukit/core'
1
+ require 'mulang'
2
2
 
3
- I18n.load_translations_path File.join(__dir__, '..', 'locales', '*.yml')
4
-
5
- require_relative '../mumukit/inspection/version'
3
+ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
6
4
 
7
5
  module Mumukit
8
- class Inspection
9
- attr_accessor :type, :target, :negated
10
- alias negated? negated
11
-
12
- def initialize(type, target, negated=false)
13
- @type = type
14
- @target = target
15
- @negated = negated
16
- end
17
-
18
- def to_s
19
- "#{negated_to_s}#{type}#{target_to_s}"
6
+ module Inspection
7
+ module Extension
8
+ def new_inspection(match)
9
+ if match
10
+ Mulang::Inspection.new match['type'],
11
+ Mulang::Inspection::Target.new(:unknown, match['target']),
12
+ negated: match['negation'].present?,
13
+ i18n_namespace: 'mumukit.inspection'
14
+ end
15
+ end
20
16
  end
21
17
 
22
- def negated_to_s
23
- negated ? 'Not:' : nil
24
- end
18
+ module Css
19
+ extend Mumukit::Inspection::Extension
25
20
 
26
- def target_to_s
27
- target ? ":#{target.to_s}" : nil
28
- end
21
+ REGEXP = /^(?<negation>Not:)?(?<type>DeclaresStyle|DeclaresTag):(?<target>.*)$/
29
22
 
30
- def self.parse_binding_name(binding_s)
31
- if binding_s.start_with? 'Intransitive:'
32
- binding_s[13..-1]
33
- else
34
- binding_s
23
+ def self.parse(inspection_s)
24
+ new_inspection REGEXP.match(inspection_s)
35
25
  end
36
26
  end
37
27
 
38
- def self.parse(insepection_s)
39
- raise "Invalid inspection #{insepection_s}" unless insepection_s =~ /^(Not\:)?([^\:]+)\:?(.+)?$/
40
- Inspection.new($2, Mumukit::Inspection::Target.parse($3), $1.present?)
28
+ module Source
29
+ extend Mumukit::Inspection::Extension
30
+
31
+ REGEXP = /^(?<negation>Not:)?(?<type>SourceRepeats|SourceContains|SourceEquals|SourceEqualsIgnoreSpaces):(?<target>.*)$/
32
+
33
+ def self.parse(inspection_s)
34
+ new_inspection REGEXP.match(inspection_s)
35
+ end
41
36
  end
42
37
  end
43
38
  end
44
-
45
- require_relative '../mumukit/inspection/target'
46
- require_relative '../mumukit/inspection/expectation'
47
- require_relative '../mumukit/inspection/i18n'
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
- class Inspection
3
- VERSION = '3.6.2'
2
+ module Inspection
3
+ VERSION = '5.0.0'
4
4
  end
5
5
  end
@@ -0,0 +1,16 @@
1
+ ---
2
+ en:
3
+ mumukit:
4
+ inspection:
5
+ DeclaresStyle_except: '%{binding} %{must} declare style distinct from %{target}'
6
+ DeclaresStyle_like: '%{binding} %{must} declare a style similar to %{target}'
7
+ DeclaresStyle_named: '%{binding} %{must} declare a style %{target}'
8
+ DeclaresStyle: '%{binding} %{must} declare styles'
9
+ DeclaresTag_except: '%{binding} %{must} declare a tag distinct from %{target}'
10
+ DeclaresTag_like: '%{binding} %{must} declare a tag similar to %{target}'
11
+ DeclaresTag_named: '%{binding} %{must} declare a tag %{target}'
12
+ DeclaresTag: '%{binding} %{must} declare a tag'
13
+ SourceContains_named: 'solution %{must} use %{target}'
14
+ SourceEquals_named: 'solution %{must} be equal to %{target}'
15
+ SourceEqualsIgnoreSpaces_named: 'solution %{must} be equal to %{target}'
16
+ SourceRepeats_named: 'solution %{must} use %{target} more than one time'
@@ -0,0 +1,16 @@
1
+ ---
2
+ es:
3
+ mumukit:
4
+ inspection:
5
+ DeclaresStyle_except: '%{binding} %{must} declarar un estilo diferente a %{target}'
6
+ DeclaresStyle_like: '%{binding} %{must} declarar un estilo parecido a %{target}'
7
+ DeclaresStyle_named: '%{binding} %{must} declarar un estilo %{target}'
8
+ DeclaresStyle: '%{binding} %{must} declarar un estilo'
9
+ DeclaresTag_except: '%{binding} %{must} declarar un elemento diferente a %{target}'
10
+ DeclaresTag_like: '%{binding} %{must} declarar un elemento parecido a %{target}'
11
+ DeclaresTag_named: '%{binding} %{must} declarar un elemento %{target}'
12
+ DeclaresTag: '%{binding} %{must} declarar un elemento'
13
+ SourceContains_named: 'la solución %{must} usar %{target}'
14
+ SourceEquals_named: 'la solución %{must} ser igual a %{target}'
15
+ SourceEqualsIgnoreSpaces_named: 'la solución %{must} ser igual a %{target}'
16
+ SourceRepeats_named: 'la solución %{must} usar %{target} más de una vez'
@@ -0,0 +1,16 @@
1
+ ---
2
+ pt:
3
+ mumukit:
4
+ inspection:
5
+ DeclaresStyle_except: '%{binding} %{must} declarar um estilo diferentes de %{target}'
6
+ DeclaresStyle_like: '%{binding} %{must} declarar um estilo semelhante a %{target}'
7
+ DeclaresStyle_named: '%{binding} %{must} declarar um estilo %{target}'
8
+ DeclaresStyle: '%{binding} %{must} declarar um estilo'
9
+ DeclaresTag_except: '%{binding} %{must} declarar uma etiqueta diferente de %{target}'
10
+ DeclaresTag_like: '%{binding} %{must} declarar uma etiqueta similar a %{target}'
11
+ DeclaresTag_named: '%{binding} %{must} declarar uma etiqueta %{target}'
12
+ DeclaresTag: '%{binding} %{must} declarar uma etiqueta'
13
+ SourceContains_named: 'a solução %{must} usar %{target}'
14
+ SourceEquals_named: 'a solução %{must} ser igual a %{target}'
15
+ SourceEqualsIgnoreSpaces_named: 'a solução %{must} ser igual a %{target}'
16
+ SourceRepeats_named: 'a solução %{must} usar %{target} mais de uma vez'
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-inspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.2
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '1.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2'
@@ -24,68 +24,102 @@ dependencies:
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ">"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.1'
29
+ version: '1.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2'
33
33
  - !ruby/object:Gem::Dependency
34
- name: bundler
34
+ name: mulang
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '5.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '5.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
38
52
  - !ruby/object:Gem::Version
39
53
  version: '1.7'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '3'
40
57
  type: :development
41
58
  prerelease: false
42
59
  version_requirements: !ruby/object:Gem::Requirement
43
60
  requirements:
44
- - - "~>"
61
+ - - ">="
45
62
  - !ruby/object:Gem::Version
46
63
  version: '1.7'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '3'
47
67
  - !ruby/object:Gem::Dependency
48
- name: rake
68
+ name: codeclimate-test-reporter
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: activesupport
49
83
  requirement: !ruby/object:Gem::Requirement
50
84
  requirements:
51
85
  - - "~>"
52
86
  - !ruby/object:Gem::Version
53
- version: '10.0'
87
+ version: '5.0'
54
88
  type: :development
55
89
  prerelease: false
56
90
  version_requirements: !ruby/object:Gem::Requirement
57
91
  requirements:
58
92
  - - "~>"
59
93
  - !ruby/object:Gem::Version
60
- version: '10.0'
94
+ version: '5.0'
61
95
  - !ruby/object:Gem::Dependency
62
- name: rspec
96
+ name: rake
63
97
  requirement: !ruby/object:Gem::Requirement
64
98
  requirements:
65
- - - '='
99
+ - - "~>"
66
100
  - !ruby/object:Gem::Version
67
- version: '2.13'
101
+ version: '10.0'
68
102
  type: :development
69
103
  prerelease: false
70
104
  version_requirements: !ruby/object:Gem::Requirement
71
105
  requirements:
72
- - - '='
106
+ - - "~>"
73
107
  - !ruby/object:Gem::Version
74
- version: '2.13'
108
+ version: '10.0'
75
109
  - !ruby/object:Gem::Dependency
76
- name: codeclimate-test-reporter
110
+ name: rspec
77
111
  requirement: !ruby/object:Gem::Requirement
78
112
  requirements:
79
- - - ">="
113
+ - - "~>"
80
114
  - !ruby/object:Gem::Version
81
- version: '0'
115
+ version: '3.0'
82
116
  type: :development
83
117
  prerelease: false
84
118
  version_requirements: !ruby/object:Gem::Requirement
85
119
  requirements:
86
- - - ">="
120
+ - - "~>"
87
121
  - !ruby/object:Gem::Version
88
- version: '0'
122
+ version: '3.0'
89
123
  description:
90
124
  email:
91
125
  - flbulgarelli@yahoo.com.ar
@@ -93,14 +127,11 @@ executables: []
93
127
  extensions: []
94
128
  extra_rdoc_files: []
95
129
  files:
96
- - lib/locales/en.yml
97
- - lib/locales/es.yml
98
- - lib/locales/pt.yml
99
130
  - lib/mumukit/inspection.rb
100
- - lib/mumukit/inspection/expectation.rb
101
- - lib/mumukit/inspection/i18n.rb
102
- - lib/mumukit/inspection/target.rb
103
131
  - lib/mumukit/inspection/version.rb
132
+ - lib/mumukit/locales/en.yml
133
+ - lib/mumukit/locales/es.yml
134
+ - lib/mumukit/locales/pt.yml
104
135
  homepage: ''
105
136
  licenses:
106
137
  - MIT
@@ -120,7 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
151
  - !ruby/object:Gem::Version
121
152
  version: '0'
122
153
  requirements: []
123
- rubygems_version: 3.0.3
154
+ rubyforge_project:
155
+ rubygems_version: 2.7.7
124
156
  signing_key:
125
157
  specification_version: 4
126
158
  summary: Minimal library for parsing Mumuki inspection language
data/lib/locales/en.yml DELETED
@@ -1,183 +0,0 @@
1
- ---
2
- en:
3
- mumukit:
4
- expectation:
5
- must_not: must not
6
- must: must
7
- solution: solution
8
- inspection:
9
- Assigns_except: '%{binding} %{must} assign something distinct from %{target}'
10
- Assigns_like: '%{binding} %{must} assign something similar to %{target}'
11
- Assigns_named: '%{binding} %{must} assign %{target}'
12
- Assigns: '%{binding} %{must} perform assignments'
13
- Calls_except: '%{binding} %{must} delegate to something distinct from %{target}'
14
- Calls_like: '%{binding} %{must} delegate to something similar to %{target}'
15
- Calls_named: '%{binding} %{must} use %{target}'
16
- Calls: '%{binding} %{must} delegate'
17
- Declares_except: '%{binding} %{must} contain declarations distinct from %{target}'
18
- Declares_like: '%{binding} %{must} declare an identifier similar to %{target}'
19
- Declares_named: '%{binding} %{must} declare %{target}'
20
- Declares: '%{binding} %{must} contain declarations'
21
- DeclaresAttribute_except: '%{binding} %{must} declare attributes distinct from %{target}'
22
- DeclaresAttribute_like: '%{binding} %{must} declare an attribute similar to %{target}'
23
- DeclaresAttribute_named: '%{binding} %{must} declare an attribute %{target}'
24
- DeclaresAttribute: '%{binding} %{must} declare attributes'
25
- DeclaresClass_except: '%{binding} %{must} declare classes distinct from %{target}'
26
- DeclaresClass_like: '%{binding} %{must} declare a class similar to %{target}'
27
- DeclaresClass_named: '%{binding} %{must} declare a class %{target}'
28
- DeclaresClass: '%{binding} %{must} declare classes'
29
- DeclaresComputation_except: '%{binding} %{must} declare computations distinct from %{target}'
30
- DeclaresComputation_like: '%{binding} %{must} declare a computation similar to %{target}'
31
- DeclaresComputation_named: '%{binding} %{must} declare a computation %{target}'
32
- DeclaresComputation: '%{binding} %{must} declare computations'
33
- DeclaresComputationWithArity0_named: '%{target} %{must} have zero parameters'
34
- DeclaresComputationWithArity1_named: '%{target} %{must} have one parameter'
35
- DeclaresComputationWithArity2_named: '%{target} %{must} have 2 parameters'
36
- DeclaresComputationWithArity3_named: '%{target} %{must} have 3 parameters'
37
- DeclaresComputationWithArity4_named: '%{target} %{must} have 4 parameters'
38
- DeclaresComputationWithArity5_named: '%{target} %{must} have 5 parameters'
39
- DeclaresEntryPoint: '%{binding} %{must} declare an entry point'
40
- DeclaresEnumeration_except: '%{binding} %{must} declare enumerations distinct from %{target}'
41
- DeclaresEnumeration_like: '%{binding} %{must} declare an enumeration like %{target}'
42
- DeclaresEnumeration_named: '%{binding} %{must} declare an enumeration %{target}'
43
- DeclaresEnumeration: '%{binding} %{must} declare enumerations'
44
- DeclaresFact_except: '%{binding} %{must} declare facts distinct from %{target}'
45
- DeclaresFact_like: '%{binding} %{must} declare a fact similar to %{target}'
46
- DeclaresFact_named: '%{binding} %{must} declare a fact %{target}'
47
- DeclaresFact: '%{binding} %{must} declare facts'
48
- DeclaresFunction_except: '%{binding} %{must} declare functions distinct from %{target}'
49
- DeclaresFunction_like: '%{binding} %{must} declare a function similar to %{target}'
50
- DeclaresFunction_named: '%{binding} %{must} declare a function %{target}'
51
- DeclaresFunction: '%{binding} %{must} debe declare functions'
52
- DeclaresInterface_except: '%{binding} %{must} declare interfaces distinct from %{target}'
53
- DeclaresInterface_like: '%{binding} %{must} declare an interface like %{target}'
54
- DeclaresInterface_named: '%{binding} %{must} declare an interface %{target}'
55
- DeclaresInterface: '%{binding} %{must} declare interfaces'
56
- DeclaresMethod_except: '%{binding} %{must} declare methods distinct from %{target}'
57
- DeclaresMethod_like: '%{binding} %{must} declare a method similar to %{target}'
58
- DeclaresMethod_named: '%{binding} %{must} declare a method %{target}'
59
- DeclaresMethod: '%{binding} %{must} declare methods'
60
- DeclaresObject_except: '%{binding} %{must} declare objects distinct from %{target}'
61
- DeclaresObject_like: '%{binding} %{must} declare an object similar to %{target}'
62
- DeclaresObject_named: '%{binding} %{must} declare an object %{target}'
63
- DeclaresObject: '%{binding} %{must} declare objects'
64
- DeclaresPredicate_except: '%{binding} %{must} declare a predicate distinct from %{target}'
65
- DeclaresPredicate_like: '%{binding} %{must} declare a predicate similar to %{target}'
66
- DeclaresPredicate_named: '%{binding} %{must} declare predicates %{target}'
67
- DeclaresPredicate: '%{binding} %{must} declare predicates'
68
- DeclaresProcedure_except: '%{binding} %{must} declare procedures distinct from %{target}'
69
- DeclaresProcedure_like: '%{binding} %{must} declare a procedure similar to %{target}'
70
- DeclaresProcedure_named: '%{binding} %{must} declare a procedure %{target}'
71
- DeclaresProcedure: '%{binding} %{must} declare procedures'
72
- DeclaresRecursively_named: '%{target} %{must} declared recursively'
73
- DeclaresRule_except: '%{binding} %{must} declare rules distinct from %{target}'
74
- DeclaresRule_like: '%{binding} %{must} declare a rule similar to %{target}'
75
- DeclaresRule_named: '%{binding} %{must} declare a rule %{target}'
76
- DeclaresRule: '%{binding} %{must} debe declare rules'
77
- DeclaresStyles_except: '%{binding} %{must} declare style distinct from %{target}'
78
- DeclaresStyles_like: '%{binding} %{must} declare a style similar to %{target}'
79
- DeclaresStyles_named: '%{binding} %{must} declare a style %{target}'
80
- DeclaresStyles: '%{binding} %{must} declare styles'
81
- DeclaresTag_except: '%{binding} %{must} declare a tag distinct from %{target}'
82
- DeclaresTag_like: '%{binding} %{must} declare a tag similar to %{target}'
83
- DeclaresTag_named: '%{binding} %{must} declare a tag %{target}'
84
- DeclaresTag: '%{binding} %{must} declare a tag'
85
- DeclaresTypeAlias_except: '%{binding} %{must} declare type aliases distinct from %{target}'
86
- DeclaresTypeAlias_like: '%{binding} %{must} declare a type alias similar to %{target}'
87
- DeclaresTypeAlias_named: '%{binding} %{must} declare a type alias %{target}'
88
- DeclaresTypeAlias: '%{binding} %{must} declare type aliases'
89
- DeclaresTypeSignature_except: '%{binding} %{must} declare a type signature distinct from %{target}'
90
- DeclaresTypeSignature_like: '%{binding} %{must} declare a type signature for something like %{target}'
91
- DeclaresTypeSignature_named: '%{binding} %{must} declare a type signature %{target}'
92
- DeclaresTypeSignature: '%{binding} %{must} decarar type signatures'
93
- DeclaresVariable_except: '%{binding} %{must} declare variables distinct from %{target}'
94
- DeclaresVariable_like: '%{binding} %{must} declare a variable similar to %{target}'
95
- DeclaresVariable_named: '%{binding} %{must} declare a variable %{target}'
96
- DeclaresVariable: '%{binding} %{must} debe declare variables'
97
- DiscardsExceptions: '%{binding} is ignoring exceptions silently'
98
- DoesConsolePrint: '%{binding} is printing to the console'
99
- DoesNilTest: '%{binding} does <i>%{keyword_null}</i> tests'
100
- DoesNullTest: '%{binding} does <i>%{keyword_null}</i> tests'
101
- DoesTypeTest: '%{binding} string type tests'
102
- HasAssignmentReturn: '%{binding} returns the result of an assignment'
103
- HasCodeDuplication: '%{binding} has code duplication'
104
- HasEmptyIfBranches: '%{binding} has empty <i>%{keyword_if}</i> branches'
105
- HasLongParameterList: '%{binding} has too many parameters. You may be missing an abstraction.'
106
- HasMisspelledBindings: '%{binding} is misspelled'
107
- HasMisspelledIdentifiers: '%{binding} is misspelled'
108
- HasRedundantBooleanComparison: '%{binding} makes unnecesary boolean comparisons'
109
- HasRedundantGuards: '%{binding} has unnecessary guards'
110
- HasRedundantIf: '%{binding} has unnecessary <i>%{keyword_if}</i>s'
111
- HasRedundantLambda: '%{binding} has unnecessary lambdas'
112
- HasRedundantLocalVariableReturn: '%{binding} has unnecesary local variables; please try returning the expression directly'
113
- HasRedundantParameter: '%{binding} has unnecessary parameters, that can be removed using point-free'
114
- HasRedundantReduction: '%{binding} uses <i>%{keyword_is}</i>, but it does not artihmetic'
115
- HasTooManyMethods: '%{binding} has too many methods'
116
- HasTooShortBindings: '%{binding} is a too short identifier'
117
- HasTooShortIdentifiers: '%{binding} is a too short identifier'
118
- HasUnreachableCode: '%{binding} has unreachable code'
119
- HasWrongCaseBindings: '%{binding} does not honor case conventions'
120
- HasWrongCaseIdentifiers: '%{binding} does not honor case conventions'
121
- Implements_except: '%{binding} %{must} implement interfaces distinct from %{target}'
122
- Implements_like: '%{binding} %{must} implement interfaces like %{target}'
123
- Implements_named: '%{binding} %{must} implement %{target}'
124
- Implements: '%{binding} %{must} implement intefaces'
125
- Includes_except: '%{binding} %{must} include mixins distinct from %{target}'
126
- Includes_like: '%{binding} %{must} include a mixin similar to %{target}'
127
- Includes_named: '%{binding} %{must} include the %{target} mixin'
128
- Includes: '%{binding} %{must} include mixins'
129
- Instantiates_except: '%{binding} %{must} instantiate classes distinct from %{target}'
130
- Instantiates_like: '%{binding} %{must} instantiate classes like %{target}'
131
- Instantiates_named: '%{binding} %{must} instantiate %{target}'
132
- Instantiates: '%{binding} %{must} instantiate objects'
133
- IsLongCode: '%{binding} is too long'
134
- OverridesEqualOrHashButNotBoth: '%{binding} overrides <i>equals</i> or <i>hash</i> methods, but not both'
135
- Raises_except: '%{binding} %{must} throw exceptions distinct from %{target}'
136
- Raises_like: '%{binding} %{must} throw exceptions like %{target}'
137
- Raises_named: '%{binding} %{must} throw %{target}'
138
- Raises: '%{binding} %{must} throw exceptions'
139
- ReturnsNil: '%{binding} retuns <i>%{keyword_null}</i>, which is a bad practice'
140
- ReturnsNull: '%{binding} retuns <i>%{keyword_null}</i>, which is a bad practice'
141
- SourceContains_named: 'solution %{must} use %{target}'
142
- SourceEquals_named: 'solution %{must} be equal to %{target}'
143
- SourceEqualsIgnoreSpaces_named: 'solution %{must} be equal to %{target}'
144
- SourceRepeats_named: 'solution %{must} use %{target} more than one time'
145
- TypesAs_named: '%{binding} %{must} type as %{target}'
146
- TypesAs: '%{binding} %{must} type'
147
- TypesParameterAs_except: '%{binding} %{must} type parameters with a type distinct from %{target}'
148
- TypesParameterAs_like: '%{binding} %{must} type parameters with a type similar to %{target}'
149
- TypesParameterAs_named: '%{binding} %{must} type parameters with type %{target}'
150
- TypesParameterAs: '%{binding} %{must} type parameters'
151
- TypesReturnAs_named: '%{binding} %{must} type its return value as %{target}'
152
- TypesReturnAs: '%{binding} %{must} type its return value'
153
- Uses_except: '%{binding} %{must} delegate to something distinct from %{target}'
154
- Uses_like: '%{binding} %{must} delegate to something similar to %{target}'
155
- Uses_named: '%{binding} %{must} use %{target}'
156
- Uses: '%{binding} %{must} delegate'
157
- UsesAnonymousVariable: '%{binding} %{must} use an annonymous variable'
158
- UsesComposition: '%{binding} %{must} use composition'
159
- UsesComprehension: '%{binding} %{must} use comprehensions'
160
- UsesConditional: '%{binding} %{must} use conditionals'
161
- UsesCut: '%{binding} uses <i>!</li> operator, which is a bad practice'
162
- UsesDyamicPolymorphism: '%{binding} %{must} use polymorphism'
163
- UsesDynamicMethodOverload: '%{binding} %{must} use overload'
164
- UsesFail: '%{binding} uses <i>%{keyword_fail}</li>, which is a bad practice'
165
- UsesFindall: '%{binding} %{must} use <i>%{keyword_findall}</i>'
166
- UsesForall: '%{binding} %{must} use <i>%{keyword_forall}</i>'
167
- UsesForeach: '%{binding} %{must} use <i>%{keyword_foreach}</i>'
168
- UsesGuards: '%{binding} %{must} use guards'
169
- UsesIf: '%{binding} %{must} use <i>%{keyword_if}</i>'
170
- UsesLambda: '%{binding} %{must} use lambda expressions'
171
- UsesLoop: '%{binding} %{must} use a loop'
172
- UsesMixin: '%{binding} %{must} use mixins'
173
- UsesNot: '%{binding} %{must} use not'
174
- UsesObjectComposition: '%{binding} %{must} use composition'
175
- UsesPatternMatching: '%{binding} %{must} use pattern matching'
176
- UsesRepeat: '%{binding} %{must} use <i>%{keyword_repeat}</i>'
177
- UsesRepeatOf: '%{binding} %{must} use <i>%{keyword_repeat}</i>'
178
- UsesStaticMethodOverload: '%{binding} %{must} use overload'
179
- UsesStaticPolymorphism: '%{binding} %{must} use polymorphism'
180
- UsesSwitch: '%{binding} %{must} use a <i>%{keyword_switch}</i>'
181
- UsesTemplateMethod: '%{binding} %{must} use a template method'
182
- UsesUnificationOperator: '%{binding} uses the unification operator (=)'
183
- UsesWhile: '%{binding} %{must} use <i>%{keyword_while}</i>'
data/lib/locales/es.yml DELETED
@@ -1,199 +0,0 @@
1
- ---
2
- es:
3
- mumukit:
4
- expectation:
5
- must_not: no debe
6
- must: debe
7
- solution: la solución
8
- inspection:
9
- Assigns_except: '%{binding} %{must} asignar a algo diferente a %{target}'
10
- Assigns_like: '%{binding} %{must} asignar algo parecido a %{target}'
11
- Assigns_named: '%{binding} %{must} asignar %{target}'
12
- Assigns: '%{binding} %{must} realizar asignaciones'
13
- Calls_except: '%{binding} %{must} delegar en algo diferente a %{target}'
14
- Calls_like: '%{binding} %{must} delegar en algo parecido a %{target}'
15
- Calls_named: '%{binding} %{must} utilizar %{target}'
16
- Calls: '%{binding} %{must} delegar'
17
- Declares_except: '%{binding} %{must} contener declaraciones distintas a %{target}'
18
- Declares_like: '%{binding} %{must} declarar un identificador parecido a %{target}'
19
- Declares_named: '%{binding} %{must} declarar %{target}'
20
- Declares: '%{binding} %{must} contener declaraciones'
21
- DeclaresAttribute_except: '%{binding} %{must} declarar atributos diferentes a %{target}'
22
- DeclaresAttribute_like: '%{binding} %{must} declarar un atributo parecido a %{target}'
23
- DeclaresAttribute_named: '%{binding} %{must} declarar un atributo %{target}'
24
- DeclaresAttribute: '%{binding} %{must} declarar atributos'
25
- DeclaresClass_except: '%{binding} %{must} declarar clases diferentes a %{target}'
26
- DeclaresClass_like: '%{binding} %{must} declarar una clase parecida a %{target}'
27
- DeclaresClass_named: '%{binding} %{must} declarar una clase %{target}'
28
- DeclaresClass: '%{binding} %{must} declarar clases'
29
- DeclaresComputation_except: '%{binding} %{must} declarar computaciones diferentes a %{target}'
30
- DeclaresComputation_like: '%{binding} %{must} declarar una computación parecida a %{target}'
31
- DeclaresComputation_named: '%{binding} %{must} declarar una computación %{target}'
32
- DeclaresComputation: '%{binding} %{must} declarar computaciones'
33
- DeclaresComputationWithArity0_named: '%{target} %{must} declarar cero parametros'
34
- DeclaresComputationWithArity1_named: '%{target} %{must} tener un parámetro'
35
- DeclaresComputationWithArity2_named: '%{target} %{must} tener dos parámetros'
36
- DeclaresComputationWithArity3_named: '%{target} %{must} tener tres parámetros'
37
- DeclaresComputationWithArity4_named: '%{target} %{must} tener cuatro parámetros'
38
- DeclaresComputationWithArity5_named: '%{target} %{must} tener cinco parámetros'
39
- DeclaresEntryPoint: '%{binding} %{must} declarar un punto de entrada'
40
- DeclaresEnumeration_except: '%{binding} %{must} declarar enumeraciones que no se llamen %{target}'
41
- DeclaresEnumeration_like: '%{binding} %{must} declarar una enumeracion de nombre parecido a %{target}'
42
- DeclaresEnumeration_named: '%{binding} %{must} declarar una enumeracion %{target}'
43
- DeclaresEnumeration: '%{binding} %{must} declarar enumeraciones'
44
- DeclaresFact_except: '%{binding} %{must} declarar hechos diferentes a %{target}'
45
- DeclaresFact_like: '%{binding} %{must} declarar un hecho parecido a %{target}'
46
- DeclaresFact_named: '%{binding} %{must} declarar un hecho %{target}'
47
- DeclaresFact: '%{binding} %{must} declarar hechos'
48
- DeclaresFunction_except: '%{binding} %{must} declarar funciones diferentes a %{target}'
49
- DeclaresFunction_like: '%{binding} %{must} declarar una función parecida a %{target}'
50
- DeclaresFunction_named: '%{binding} %{must} declarar una función %{target}'
51
- DeclaresFunction: '%{binding} %{must} debe declarar funciones'
52
- DeclaresInterface_except: '%{binding} %{must} declarar interfaces que no se llamen %{target}'
53
- DeclaresInterface_like: '%{binding} %{must} declarar una interfaz de nombre parecido a %{target}'
54
- DeclaresInterface_named: '%{binding} %{must} declarar una interfaz %{target}'
55
- DeclaresInterface: '%{binding} %{must} declarar interfaces'
56
- DeclaresMethod_except: '%{binding} %{must} declarar métodos diferentes a %{target}'
57
- DeclaresMethod_like: '%{binding} %{must} declarar un método parecido a %{target}'
58
- DeclaresMethod_named: '%{binding} %{must} declarar un método %{target}'
59
- DeclaresMethod: '%{binding} %{must} declarar métodos'
60
- DeclaresObject_except: '%{binding} %{must} declarar objetos diferentes a %{target}'
61
- DeclaresObject_like: '%{binding} %{must} declarar un objeto parecido a%{target}'
62
- DeclaresObject_named: '%{binding} %{must} declarar un objeto %{target}'
63
- DeclaresObject: '%{binding} %{must} declarar objetos'
64
- DeclaresPredicate_except: '%{binding} %{must} declarar predicados diferentes a %{target}'
65
- DeclaresPredicate_like: '%{binding} %{must} declarar un predicados parecido a %{target}'
66
- DeclaresPredicate_named: '%{binding} %{must} declarar un predicados %{target}'
67
- DeclaresPredicate: '%{binding} %{must} declarar predicados'
68
- DeclaresProcedure_except: '%{binding} %{must} declarar procedimientos diferentes a %{target}'
69
- DeclaresProcedure_like: '%{binding} %{must} declarar un procedimiento parecido a %{target}'
70
- DeclaresProcedure_named: '%{binding} %{must} declarar un procedimiento %{target}'
71
- DeclaresProcedure: '%{binding} %{must} declarar procedimientos'
72
- DeclaresRecursively_named: '%{target} %{must} estar declarado recursivamente'
73
- DeclaresRule_except: '%{binding} %{must} declarar reglas diferentes a %{target}'
74
- DeclaresRule_like: '%{binding} %{must} declarar una regla parecida a %{target}'
75
- DeclaresRule_named: '%{binding} %{must} declarar una regla %{target}'
76
- DeclaresRule: '%{binding} %{must} debe declarar reglas'
77
- DeclaresStyle_except: '%{binding} %{must} declarar un estilo diferente a %{target}'
78
- DeclaresStyle_like: '%{binding} %{must} declarar un estilo parecido a %{target}'
79
- DeclaresStyle_named: '%{binding} %{must} declarar un estilo %{target}'
80
- DeclaresStyle: '%{binding} %{must} declarar un estilo'
81
- DeclaresSuperclass_except: '%{binding} %{must} declarar una superclase distinta de %{target}'
82
- DeclaresSuperclass_like: '%{binding} %{must} declarar una superclase parecida a %{target}'
83
- DeclaresSuperclass_named: '%{binding} %{must} declarar una superclase %{target}'
84
- DeclaresSuperclass: '%{binding} %{must} declarar una superclase'
85
- DeclaresTag_except: '%{binding} %{must} declarar un elemento diferente a %{target}'
86
- DeclaresTag_like: '%{binding} %{must} declarar un elemento parecido a %{target}'
87
- DeclaresTag_named: '%{binding} %{must} declarar un elemento %{target}'
88
- DeclaresTag: '%{binding} %{must} declarar un elemento'
89
- DeclaresTypeAlias_except: '%{binding} %{must} declarar sinónimos de tipo diferentes a %{target}'
90
- DeclaresTypeAlias_like: '%{binding} %{must} declarar un sinónimo de tipo parecido a %{target}'
91
- DeclaresTypeAlias_named: '%{binding} %{must} declarar un sinónimo de tipo %{target}'
92
- DeclaresTypeAlias: '%{binding} %{must} declarar sinónimos de tipo'
93
- DeclaresTypeSignature_except: '%{binding} %{must} declarar firmas de tipos diferentes a %{target}'
94
- DeclaresTypeSignature_like: '%{binding} %{must} declarar una firma para algo parecido %{target}'
95
- DeclaresTypeSignature_named: '%{binding} %{must} declarar una firma %{target}'
96
- DeclaresTypeSignature: '%{binding} %{must} declarar firmas de tipos'
97
- DeclaresVariable_except: '%{binding} %{must} declarar variables diferentes a %{target}'
98
- DeclaresVariable_like: '%{binding} %{must} declarar una variable parecida a %{target}'
99
- DeclaresVariable_named: '%{binding} %{must} declarar una variable %{target}'
100
- DeclaresVariable: '%{binding} %{must} debe declarar variables'
101
- DiscardsExceptions: '%{binding} está ignorando excepciones silenciosamiente'
102
- DoesConsolePrint: '%{binding} está realizando impresiones por pantalla'
103
- DoesNilTest: '%{binding} hace comparaciones contra <i>%{keyword_null}</i>'
104
- DoesNullTest: '%{binding} hace comparaciones contra <i>%{keyword_null}</i>'
105
- DoesTypeTest: '%{binding} hace comparaciones contra strings'
106
- HasAssignmentReturn: '%{binding} devuelve el resultado de una asignación'
107
- HasCodeDuplication: '%{binding} tiene código repetido'
108
- HasEmptyIfBranches: '%{binding} tiene ramas de <i>%{keyword_if}</i> vacías'
109
- HasLongParameterList: '%{binding} tiene demasiados parámetros. Te podría estar faltando una abstracción'
110
- HasMisspelledBindings: '%{binding} está mal escrito. Revisá la ortografía y procurá no usar abreviaturas'
111
- HasMisspelledIdentifiers: '%{binding} está mal escrito. Revisá la ortografía y procurá no usar abreviaturas'
112
- HasRedundantBooleanComparison: '%{binding} hace comparaciones booleanas innecesarias'
113
- HasRedundantGuards: '%{binding} tiene guardas innecesarias'
114
- HasRedundantIf: '%{binding} tiene ifs innecesarios'
115
- HasRedundantLambda: '%{binding} tiene lambdas innecesarias'
116
- HasRedundantLocalVariableReturn: '%{binding} usa variables locales innecesarias; podés retornar directamente la expresión'
117
- HasRedundantParameter: '%{binding} tiene parámetros innecesarios (se pueden eliminar mediante point-free)'
118
- HasRedundantReduction: '%{binding} usa <i>%{keyword_is}</i>, pero no realiza cálculos'
119
- HasTooManyMethods: '%{binding} tiene demasiados métodos'
120
- HasTooShortBindings: '%{binding} es un identificador muy corto'
121
- HasTooShortIdentifiers: '%{binding} es un identificador muy corto'
122
- HasUnreachableCode: '%{binding} tiene código inalcanzable'
123
- HasWrongCaseBindings: '%{binding} no respeta la convención de nombres'
124
- HasWrongCaseIdentifiers: '%{binding} no respeta la convención de nombres'
125
- Implements_except: '%{binding} %{must} implementar interfaces distintas de %{target}'
126
- Implements_like: '%{binding} %{must} implementar insterfaces parecidas a %{target}'
127
- Implements_named: '%{binding} %{must} implementar %{target}'
128
- Implements: '%{binding} %{must} implementar intefaces'
129
- Includes_except: '%{binding} %{must} incluir mixins diferentes a %{target}'
130
- Includes_like: '%{binding} %{must} incluir un mixin parecido a %{target}'
131
- Includes_named: '%{binding} %{must} incluir el mixin %{target}'
132
- Includes: '%{binding} %{must} incluir mixins'
133
- Inherits_except: '%{binding} %{must} declarar una superclase distinta de %{target}'
134
- Inherits_like: '%{binding} %{must} declarar una superclase parecida a %{target}'
135
- Inherits_named: '%{binding} %{must} declarar una superclase %{target}'
136
- Inherits: '%{binding} %{must} declarar una superclase'
137
- Instantiates_except: '%{binding} %{must} instanciar clases distintas de %{target}'
138
- Instantiates_like: '%{binding} %{must} instanciar clases parecidas a %{target}'
139
- Instantiates_named: '%{binding} %{must} instanciar %{target}'
140
- Instantiates: '%{binding} %{must} instanciar objetos'
141
- IsLongCode: '%{binding} es muy largo. Tratá de delegar más'
142
- OverridesEqualOrHashButNotBoth: '%{binding} redefine los métodos <i>equals</i> o <i>hash</i>, pero no ambos'
143
- Raises_except: '%{binding} %{must} lanzar excepciones diferentes a %{target}'
144
- Raises_like: '%{binding} %{must} lanzar excepciones parecidas a %{target}'
145
- Raises_named: '%{binding} %{must} lanzar %{target}'
146
- Raises: '%{binding} %{must} lanzar excepciones'
147
- Rescues_except: '%{binding} %{must} capturar excepciones diferentes a %{target}'
148
- Rescues_like: '%{binding} %{must} capturar excepciones parecidas a %{target}'
149
- Rescues_named: '%{binding} %{must} capturar %{target}'
150
- Rescues: '%{binding} %{must} capturar excepciones'
151
- ReturnsNil: '%{binding} retorna null, lo cual es una mala práctica'
152
- ReturnsNull: '%{binding} retorna null, lo cual es una mala práctica'
153
- SourceContains_named: 'la solución %{must} usar %{target}'
154
- SourceEquals_named: 'la solución %{must} ser igual a %{target}'
155
- SourceEqualsIgnoreSpaces_named: 'la solución %{must} ser igual a %{target}'
156
- SourceRepeats_named: 'la solución %{must} usar %{target} más de una vez'
157
- TypesAs_named: '%{binding} %{must} ser de tipo %{target}'
158
- TypesAs: '%{binding} %{must} tipar'
159
- TypesParameterAs_except: '%{binding} %{must} tipar parámetros con un tipo diferente a %{target}'
160
- TypesParameterAs_like: '%{binding} %{must} tipar parámetros con un tipo parecido a %{target}'
161
- TypesParameterAs_named: '%{binding} %{must} tipar parámetros con el tipo %{target}'
162
- TypesParameterAs: '%{binding} %{must} tipar parámetros'
163
- TypesReturnAs_named: '%{binding} %{must} tipar su valor de retorno como %{target}'
164
- TypesReturnAs: '%{binding} %{must} tipar su valor de retorno'
165
- Uses_except: '%{binding} %{must} delegar en algo diferente a %{target}'
166
- Uses_like: '%{binding} %{must} delegar en algo parecido a %{target}'
167
- Uses_named: '%{binding} %{must} utilizar %{target}'
168
- Uses: '%{binding} %{must} delegar'
169
- UsesAnonymousVariable: '%{binding} %{must} utilizar una variable anónima'
170
- UsesComposition: '%{binding} %{must} usar composición'
171
- UsesComprehension: '%{binding} %{must} emplear listas por comprensión'
172
- UsesConditional: '%{binding} %{must} utilizar condicionales'
173
- UsesCut: '%{binding} usa el operador !, lo cual es una mala práctica'
174
- UsesDyamicPolymorphism: '%{binding} %{must} usar polimorfismo'
175
- UsesDynamicMethodOverload: '%{binding} %{must} usar sobrecarga'
176
- UsesExceptionHandling: '%{binding} %{must} realizar manejo de excepciones'
177
- UsesExceptions: '%{binding} %{must} usar excepciones'
178
- UsesFail: '%{binding} usa <i>%{keyword_fail}</li>, lo cual es una mala práctica'
179
- UsesFindall: '%{binding} %{must} utilizar <i>%{keyword_findall}</i>'
180
- UsesForall: '%{binding} %{must} utilizar <i>%{keyword_forall}</i>'
181
- UsesForeach: '%{binding} %{must} usar <i>%{keyword_foreach}</i>'
182
- UsesGuards: '%{binding} %{must} usar guardas'
183
- UsesIf: '%{binding} %{must} usar <i>%{keyword_if}</i>'
184
- UsesInheritance: '%{binding} %{must} usar herencia'
185
- UsesLambda: '%{binding} %{must} emplear expresiones lambda'
186
- UsesLoop: '%{binding} %{must} usar un bucle'
187
- UsesMixin: '%{binding} %{must} utilizar mixins'
188
- UsesMixins: '%{binding} %{must} usar mixins'
189
- UsesNot: '%{binding} %{must} utilizar <i>%{keyword_not}</i>'
190
- UsesObjectComposition: '%{binding} %{must} usar composición'
191
- UsesPatternMatching: '%{binding} %{must} utilizar pattern matching'
192
- UsesRepeat: '%{binding} %{must} usar <i>%{keyword_repeat}</i>'
193
- UsesRepeatOf: '%{binding} %{must} usar un <i>%{keyword_repeat}</i> de %{target}'
194
- UsesStaticMethodOverload: '%{binding} %{must} usar sobrecarga'
195
- UsesStaticPolymorphism: '%{binding} %{must} usar polimorfismo'
196
- UsesSwitch: '%{binding} %{must} utilizar un <i>%{keyword_switch}</i>'
197
- UsesTemplateMethod: '%{binding} %{must} usar un método plantilla'
198
- UsesUnificationOperator: '%{binding} usa el operador de unificación (=)'
199
- UsesWhile: '%{binding} %{must} utilizar un <i>%{keyword_while}</i>'
data/lib/locales/pt.yml DELETED
@@ -1,190 +0,0 @@
1
- ---
2
- pt:
3
- mumukit:
4
- expectation:
5
- must_not: 'não deve'
6
- must: 'deve'
7
- solution: 'a solução'
8
- inspection:
9
- Assigns_except: '%{binding} %{must} atribuir algo diferente a %{target}'
10
- Assigns_like: '%{binding} %{must} atribuir algo semelhante ao %{target}'
11
- Assigns_named: '%{binding} %{must} atribuir %{target}'
12
- Assigns: '%{binding} %{must} fazer atribuições'
13
- Calls_except: '%{binding} %{must} delegar algo diferente para %{target}'
14
- Calls_like: '%{binding} %{must} delegar algo semelhante ao %{target}'
15
- Calls_named: '%{binding} %{must} usar %{target}'
16
- Calls: '%{binding} %{must} delegate'
17
- Declares_except: '%{binding} %{must} contém instruções diferentes de %{target}'
18
- Declares_like: '%{binding} %{must} declarar um identificador semelhante a %{target}'
19
- Declares_named: '%{binding} %{must} declarar %{target}'
20
- Declares: '%{binding} %{must} contém declarações'
21
- DeclaresAttribute_except: '%{binding} %{must} declarar atributos diferentes de %{target}'
22
- DeclaresAttribute_like: '%{binding} %{must} declarar um atributo semelhante a %{target}'
23
- DeclaresAttribute_named: '%{binding} %{must} declarar um atributo %{target}'
24
- DeclaresAttribute: '%{binding} %{must} declarar atributos'
25
- DeclaresClass_except: '%{binding} %{must} declarar classes diferentes para %{target}'
26
- DeclaresClass_like: '%{binding} %{must} declarar uma classe semelhante a %{target}'
27
- DeclaresClass_named: '%{binding} %{must} declarar uma classe %{target}'
28
- DeclaresClass: '%{binding} %{must} declarar classes'
29
- DeclaresComputation_except: '%{binding} %{must} declarar cálculos diferentes de %{target}'
30
- DeclaresComputation_like: '%{binding} %{must} declarar uma computação semelhante a %{target}'
31
- DeclaresComputation_named: '%{binding} %{must} declarar uma computação %{target}'
32
- DeclaresComputation: '%{binding} %{must} declarar cálculos'
33
- DeclaresComputationWithArity0_named: '%{target} %{must} declarar parâmetros zero'
34
- DeclaresComputationWithArity1_named: '%{target} %{must} tem um parâmetro'
35
- DeclaresComputationWithArity2_named: '%{target} %{must} tem dois parâmetros'
36
- DeclaresComputationWithArity3_named: '%{target} %{must} tem três parâmetros'
37
- DeclaresComputationWithArity4_named: '%{target} %{must} tem quatro parâmetros'
38
- DeclaresComputationWithArity5_named: '%{target} %{must} tem cinco parâmetros'
39
- DeclaresEntryPoint: '%{binding} %{must} declarar um ponto de entrada'
40
- DeclaresEnumeration_except: '%{binding} %{must} declarar enumerações que não são chamadas %{target}'
41
- DeclaresEnumeration_like: '%{binding} %{must} declarar uma enumeração de nome semelhante a %{target}'
42
- DeclaresEnumeration_named: '%{binding} %{must} declarar uma enumeração %{target}'
43
- DeclaresEnumeration: '%{binding} %{must} declarar enumerações'
44
- DeclaresFact_except: '%{binding} %{must} declarar fatos diferentes de %{target}'
45
- DeclaresFact_like: '%{binding} %{must} declarar um fato semelhante a %{target}'
46
- DeclaresFact_named: '%{binding} %{must} declarar um fato %{target}'
47
- DeclaresFact: '%{binding} %{must} declarar fatos'
48
- DeclaresFunction_except: '%{binding} %{must} declarar funções diferentes de %{target}'
49
- DeclaresFunction_like: '%{binding} %{must} declarar uma função semelhante a %{target}'
50
- DeclaresFunction_named: '%{binding} %{must} declarar uma função %{target}'
51
- DeclaresFunction: '%{binding} %{must} deve declarar funções'
52
- DeclaresInterface_except: '%{binding} %{must} declarar interfaces que não são chamadas %{target}'
53
- DeclaresInterface_like: '%{binding} %{must} declarar uma interface de nome semelhante a %{target}'
54
- DeclaresInterface_named: '%{binding} %{must} declarar uma interface %{target}'
55
- DeclaresInterface: '%{binding} %{must} declarar interfaces'
56
- DeclaresMethod_except: '%{binding} %{must} declarar métodos diferentes de %{target}'
57
- DeclaresMethod_like: '%{binding} %{must} declarar um método semelhante a %{target}'
58
- DeclaresMethod_named: '%{binding} %{must} declarar um método %{target}'
59
- DeclaresMethod: '%{binding} %{must} declarar métodos'
60
- DeclaresObject_except: '%{binding} %{must} declarar objetos diferentes de %{target}'
61
- DeclaresObject_like: '%{binding} %{must} declarar um objeto semelhante a %{target}'
62
- DeclaresObject_named: '%{binding} %{must} declarar um objeto %{target}'
63
- DeclaresObject: '%{binding} %{must} declarar objetos'
64
- DeclaresPredicate_except: '%{binding} %{must} declarar predicados diferentes para %{target}'
65
- DeclaresPredicate_like: '%{binding} %{must} declarar um predicado semelhante ao %{target}'
66
- DeclaresPredicate_named: '%{binding} %{must} declarar um predicado %{target}'
67
- DeclaresPredicate: '%{binding} %{must} declarar predicados'
68
- DeclaresProcedure_except: '%{binding} %{must} declarar procedimentos diferentes de %{target}'
69
- DeclaresProcedure_like: '%{binding} %{must} declarar um procedimento semelhante a %{target}'
70
- DeclaresProcedure_named: '%{binding} %{must} declarar um procedimento %{target}'
71
- DeclaresProcedure: '%{binding} %{must} declarar procedimentos'
72
- DeclaresRecursively_named: '%{target} %{must} deve ser declarado recursivamente'
73
- DeclaresRule_except: '%{binding} %{must} declarar regras diferentes de %{target}'
74
- DeclaresRule_like: '%{binding} %{must} declarar uma regra semelhante a %{target}'
75
- DeclaresRule_named: '%{binding} %{must} declarar uma regra %{target}'
76
- DeclaresRule: '%{binding} %{must} deve declarar regras'
77
- DeclaresStyle_except: '%{binding} %{must} declarar um estilo diferentes de %{target}'
78
- DeclaresStyle_like: '%{binding} %{must} declarar um estilo semelhante a %{target}'
79
- DeclaresStyle_named: '%{binding} %{must} declarar um estilo %{target}'
80
- DeclaresStyle: '%{binding} %{must} declarar um estilo'
81
- DeclaresSuperclass_except: '%{binding} %{must} declarar uma superclasse diferente de %{target}'
82
- DeclaresSuperclass_like: '%{binding} %{must} declarar uma superclasse semelhante a %{target}'
83
- DeclaresSuperclass_named: '%{binding} %{must} declarar uma superclasse %{target}'
84
- DeclaresSuperclass: '%{binding} %{must} declarar uma superclasse'
85
- DeclaresTag_except: '%{binding} %{must} declarar uma etiqueta diferente de %{target}'
86
- DeclaresTag_like: '%{binding} %{must} declarar uma etiqueta similar a %{target}'
87
- DeclaresTag_named: '%{binding} %{must} declarar uma etiqueta %{target}'
88
- DeclaresTag: '%{binding} %{must} declarar uma etiqueta'
89
- DeclaresTypeAlias_except: '%{binding} %{must} declarar sinônimos de tipo diferente de %{target}'
90
- DeclaresTypeAlias_like: '%{binding} %{must} declarar um sinônimo de tipo similar a %{target}'
91
- DeclaresTypeAlias_named: '%{binding} %{must} declarar um sinônimo do tipo %{target}'
92
- DeclaresTypeAlias: '%{binding} %{must} declarar o tipo de sinônimos'
93
- DeclaresTypeSignature_except: '%{binding} %{must} declarar assinaturas de tipos diferentes de %{target}'
94
- DeclaresTypeSignature_like: '%{binding} %{must} declarar uma assinatura para algo semelhante %{target}'
95
- DeclaresTypeSignature_named: '%{binding} %{must} declarar uma assinatura %{target}'
96
- DeclaresTypeSignature: '%{binding} %{must} excluir assinaturas de tipo'
97
- DeclaresVariable_except: '%{binding} %{must} declarar variáveis ​​diferentes de %{target}'
98
- DeclaresVariable_like: '%{binding} %{must} declarar uma variável semelhante a %{target}'
99
- DeclaresVariable_named: '%{binding} %{must} declarar uma variável %{target}'
100
- DeclaresVariable: '%{binding} %{must} deve declarar variáveis'
101
- DiscardsExceptions: '%{binding} está silenciosamente ignorando exceções'
102
- DoesConsolePrint: '%{binding} está fazendo impressões na tela'
103
- DoesNilTest: '%{binding} faz comparações contra <i>%{keyword_null}</i>'
104
- DoesNullTest: '%{binding} faz comparações contra <i>%{keyword_null}</i>'
105
- DoesTypeTest: '%{binding} faz comparações contra strings'
106
- HasAssignmentReturn: '%{binding} retorna o resultado de uma tarefa'
107
- HasCodeDuplication: '%{binding} tem código repetido'
108
- HasEmptyIfBranches: '%{binding} tem vazio <i>%{keyword_if}</i> ramos'
109
- HasLongParameterList: '%{binding} tem muitos parâmetros. Você pode estar perdendo uma abstração.'
110
- HasMisspelledBindings: '%{binding} está incorreto. Verifique a ortografia e tente não usar abreviaturas'
111
- HasMisspelledIdentifiers: '%{binding} está incorreto. Verifique a ortografia e tente não usar abreviaturas'
112
- HasRedundantBooleanComparison: '%{binding} faz comparações booleanas desnecessárias'
113
- HasRedundantGuards: '%{binding} possui protetores desnecessários'
114
- HasRedundantIf: '%{binding} tem desnecessário ifs'
115
- HasRedundantLambda: '%{binding} possui lambdas desnecessários'
116
- HasRedundantLocalVariableReturn: '%{binding} usa variáveis ​​locais desnecessárias; você pode retornar a expressão diretamente'
117
- HasRedundantParameter: '%{binding} possui parâmetros desnecessários (pode ser removido por ponto-livre)'
118
- HasRedundantReduction: '%{binding} usa <i>%{keyword_is}</i>, mas não executa cálculos'
119
- HasTooManyMethods: '%{binding} tem muitos métodos'
120
- HasTooShortBindings: '%{binding} é um identificador muito curto'
121
- HasTooShortIdentifiers: '%{binding} é um identificador muito curto'
122
- HasUnreachableCode: '%{binding} tem código inacessível'
123
- HasWrongCaseBindings: '%{binding} não respeita a convenção de nomenclatura'
124
- HasWrongCaseIdentifiers: '%{binding} não respeita a convenção de nomenclatura'
125
- Implements_except: '%{binding} %{must} implementar interfaces diferentes de %{target}'
126
- Implements_like: '%{binding} %{must} implementar interfaces semelhantes a %{target}'
127
- Implements_named: '%{binding} %{must} implementar %{target}'
128
- Implements: '%{binding} %{must} implementar interfaces'
129
- Inherits_except: '%{binding} %{must} declarar uma superclasse diferente de %{target}'
130
- Inherits_like: '%{binding} %{must} declarar uma superclasse semelhante a %{target}'
131
- Inherits_named: '%{binding} %{must} declarar uma superclasse %{target}'
132
- Inherits: '%{binding} %{must} declarar uma superclasse'
133
- Instantiates_except: '%{binding} %{must} instanciar classes diferentes de %{target}'
134
- Instantiates_like: '%{binding} %{must} instanciar classes semelhantes a %{target}'
135
- Instantiates_named: '%{binding} %{must} instantiate %{target}'
136
- Instantiates: '%{binding} %{must} instanciar objetos'
137
- IsLongCode: '%{binding} é muito longo. Tente delegar mais'
138
- OverridesEqualOrHashButNotBoth: '%{binding} redefine os métodos <i>equals</i> ou <i>hash </i>, mas não ambos'
139
- Raises_except: '%{binding} %{must} lançar exceções diferentes de %{target}'
140
- Raises_like: '%{binding} %{must} lançar exceções semelhantes a %{target}'
141
- Raises_named: '%{binding} %{must} launch %{target}'
142
- Raises: '%{binding} %{must} lançar exceções'
143
- Rescues_except: '%{binding} %{must} capturar exceções que não sejam %{target}'
144
- Rescues_like: '%{binding} %{must} capturar exceções semelhantes a %{target}'
145
- Rescues_named: '%{binding} %{must} capture %{target}'
146
- Rescues: '%{binding} %{must} capturar exceções'
147
- ReturnsNil: '%{binding} retorna nulo, o que é uma prática ruim'
148
- ReturnsNull: '%{binding} retorna nulo, o que é uma prática ruim'
149
- SourceContains_named: 'a solução %{must} usar %{target}'
150
- SourceEquals_named: 'a solução %{must} ser igual a %{target}'
151
- SourceEqualsIgnoreSpaces_named: 'a solução %{must} ser igual a %{target}'
152
- SourceRepeats_named: 'a solução %{must} usar %{target} mais de uma vez'
153
- TypesAs_named: '%{binding} %{must} é do tipo %{target}'
154
- TypesAs: '%{binding} %{must} tem tipo'
155
- TypesReturnAs_named: '%{binding} %{must} tem tipo de valor de retorno %{target}'
156
- TypesReturnAs: '%{binding} %{must} tem tipo de valor de retorno'
157
- Uses_except: '%{binding} %{must} delegar algo diferente para %{target}'
158
- Uses_like: '%{binding} %{must} delegar algo semelhante ao %{target}'
159
- Uses_named: '%{binding} %{must} usar %{target}'
160
- Uses: '%{binding} %{must} delegar'
161
- UsesAnonymousVariable: '%{binding} %{must} usar uma variável anônima'
162
- UsesComposition: '%{binding} %{must} usar a composição'
163
- UsesComprehension: '%{binding} %{must} usar listas pelo entendimento'
164
- UsesConditional: '%{binding} %{must} usar conditional'
165
- UsesCut: '%{binding} usa o operador !, que é uma má prática'
166
- UsesDyamicPolymorphism: '%{binding} %{must} usar polimorfismo'
167
- UsesDynamicMethodOverload: '%{binding} %{must} usar sobrecarga'
168
- UsesExceptionHandling: '%{binding} %{must} executar o tratamento de exceção'
169
- UsesExceptions: '%{binding} %{must} usar exceções'
170
- UsesFail: '%{binding} usa <i>%{keyword_fail}</li>, o que é uma prática ruim'
171
- UsesFindall: '%{binding} %{must} usar <i>%{keyword_findall}</i>'
172
- UsesForall: '%{binding} %{must} usar <i>%{keyword_forall}</i>'
173
- UsesForeach: '%{binding} %{must} usar <i>%{keyword_foreach}</i>'
174
- UsesGuards: '%{binding} %{must} usar guardas'
175
- UsesIf: '%{binding} %{must} usar <i>%{keyword_if}</i>'
176
- UsesInheritance: '%{binding} %{must} usar herança'
177
- UsesLambda: '%{binding} %{must} usar expressões lambda'
178
- UsesLoop: '%{binding} %{must} usar um loop'
179
- UsesMixins: '%{binding} %{must} usar mixins'
180
- UsesNot: '%{binding} %{must} usar <i>%{keyword_not}</i>'
181
- UsesObjectComposition: '%{binding} %{must} usar composição'
182
- UsesPatternMatching: '%{binding} %{must} usar o padrão de correspondência'
183
- UsesRepeat: '%{binding} %{must} usar <i>%{keyword_repeat}</i>'
184
- UsesRepeatOf: '%{binding} %{must} usar uma <i>%{keyword_repeat}</i> de %{target}'
185
- UsesStaticMethodOverload: '%{binding} %{must} usar sobrecarga'
186
- UsesStaticPolymorphism: '%{binding} %{must} usar polimorfismo'
187
- UsesSwitch: '%{binding} %{must} usar um <i>%{keyword_switch}</i>'
188
- UsesTemplateMethod: '%{binding} %{must} usar um _template method_'
189
- UsesUnificationOperator: '%{binding} usa o operador de unificação (=)'
190
- UsesWhile: '%{binding} %{must} usar um <i>%{keyword_while}</i>'
@@ -1,107 +0,0 @@
1
- class Mumukit::Inspection::Expectation
2
-
3
- SMELLS = %w(DiscardsExceptions DoesConsolePrint DoesNilTest DoesNullTest DoesTypeTest
4
- HasAssignmentReturn HasCodeDuplication HasEmptyIfBranches HasLongParameterList
5
- HasMisspelledBindings HasMisspelledIdentifiers
6
- HasRedundantBooleanComparison HasRedundantGuards HasRedundantIf
7
- HasRedundantLambda HasRedundantLocalVariableReturn HasRedundantParameter
8
- HasRedundantReduction HasTooManyMethods HasTooShortBindings HasTooShortIdentifiers HasUnreachableCode
9
- HasWrongCaseBinding HasWrongCaseIdentifiers IsLongCode OverridesEqualOrHashButNotBoth
10
- ReturnsNil ReturnsNull UsesCut UsesFail UsesUnificationOperator)
11
-
12
- attr_accessor :binding, :inspection
13
-
14
- def initialize(binding, inspection)
15
- @binding = binding
16
- @inspection = inspection
17
- end
18
-
19
- def check!
20
- raise "Wrong binding in #{to_h}" unless binding?
21
- raise "Wrong inspection #{to_h}" unless inspection?
22
- end
23
-
24
- def translate(keywords = nil)
25
- Mumukit::Inspection::I18n.translate self, keywords
26
- end
27
-
28
- def to_h
29
- {binding: binding, inspection: inspection.to_s}
30
- end
31
-
32
- def self.guess_type(expectation)
33
- if expectation[:inspection] =~ /(Not\:)?Has.*/ && !has_smell?(expectation[:inspection])
34
- V0
35
- else
36
- V2
37
- end
38
- end
39
-
40
- def self.has_smell?(smell)
41
- SMELLS.include? smell
42
- end
43
-
44
- def self.parse(expectation)
45
- guess_type(expectation).new(
46
- expectation[:binding],
47
- Mumukit::Inspection.parse(expectation[:inspection]))
48
- end
49
-
50
- class V0 < Mumukit::Inspection::Expectation
51
- INSPECTIONS = %w(HasBinding HasTypeDeclaration HasTypeSignature HasVariable HasArity HasDirectRecursion
52
- HasComposition HasComprehension HasForeach HasIf HasGuards HasConditional HasLambda HasRepeat HasWhile
53
- HasUsage HasAnonymousVariable HasNot HasForall HasFindall)
54
-
55
-
56
- def binding?
57
- binding.present?
58
- end
59
-
60
- def inspection?
61
- inspection.present? && INSPECTIONS.include?(inspection.type)
62
- end
63
-
64
- def as_v2
65
- if has? 'Binding' then as_v2_declare ''
66
- elsif has? 'TypeDeclaration' then as_v2_declare 'TypeAlias'
67
- elsif has? 'TypeSignature' then as_v2_declare 'TypeSignature'
68
- elsif has? 'Variable' then as_v2_declare 'Variable'
69
- elsif has? 'Arity' then as_v2_declare "ComputationWithArity#{inspection.target.value}"
70
- elsif has? 'DirectRecursion' then as_v2_declare "Recursively"
71
- elsif has? 'Usage'
72
- V2.new binding, new_inspection('Uses', Mumukit::Inspection::Target.named(inspection.target.value))
73
- else as_v2_use
74
- end
75
- end
76
-
77
- def has?(simple_type)
78
- inspection.type == "Has#{simple_type}"
79
- end
80
-
81
- def as_v2_use
82
- V2.new binding, new_inspection(inspection.type.gsub('Has', 'Uses'), nil)
83
- end
84
-
85
- def as_v2_declare(simple_type)
86
- V2.new '*', new_inspection("Declares#{simple_type}", Mumukit::Inspection::Target.named(binding))
87
- end
88
-
89
- def new_inspection(type, target)
90
- Mumukit::Inspection.new(type, target, inspection.negated?)
91
- end
92
- end
93
-
94
- class V2 < Mumukit::Inspection::Expectation
95
- def binding?
96
- true
97
- end
98
-
99
- def inspection?
100
- true
101
- end
102
-
103
- def as_v2
104
- self
105
- end
106
- end
107
- end
@@ -1,53 +0,0 @@
1
- module Mumukit::Inspection::I18n
2
- class << self
3
- DEFAULT_KEYWORDS = {
4
- keyword_null: :null,
5
- keyword_if: :if,
6
- keyword_is: :is,
7
- keyword_fail: :fail,
8
- keyword_findall: :findall,
9
- keyword_forall: :forall,
10
- keyword_foreach: :foreach,
11
- keyword_not: :not,
12
- keyword_repeat: :repeat,
13
- keyword_switch: :switch,
14
- keyword_while: :while,
15
- }
16
-
17
- def translate(e, keywords = nil)
18
- e = e.as_v2
19
- key = key_for e.binding, e.inspection
20
- ::I18n.t key, translation_params(e, keywords)
21
- rescue
22
- '<unknown expectation>'
23
- end
24
-
25
- alias t translate
26
-
27
- private
28
-
29
- def translation_params(e, keywords)
30
- {
31
- binding: t_binding(e.binding),
32
- target: t_target(e.inspection),
33
- must: t_must(e.inspection)
34
- }.merge(DEFAULT_KEYWORDS).merge(keywords || {})
35
- end
36
-
37
- def key_for(binding, inspection)
38
- "mumukit.inspection.#{inspection.type}#{inspection.target ? inspection.target.i18n_suffix : nil}"
39
- end
40
-
41
- def t_binding(binding)
42
- binding == '*' ? ::I18n.t("mumukit.expectation.solution") : "<strong>#{Mumukit::Inspection.parse_binding_name binding}</strong>"
43
- end
44
-
45
- def t_must(parsed)
46
- ::I18n.t("mumukit.expectation.#{parsed.negated? ? 'must_not' : 'must' }")
47
- end
48
-
49
- def t_target(parsed)
50
- "<strong>#{parsed.target.value}</strong>" if parsed.target
51
- end
52
- end
53
- end
@@ -1,68 +0,0 @@
1
- class Mumukit::Inspection::Target
2
- attr_accessor :type, :value
3
-
4
- def initialize(type, value=nil)
5
- @type = type
6
- @value = value
7
- end
8
-
9
- def self.parse(target_s)
10
- if target_s.blank?
11
- nil
12
- elsif target_s == '*'
13
- anyone
14
- elsif target_s.start_with? '^'
15
- new :except, target_tail(target_s)
16
- elsif target_s.start_with? '~'
17
- new :like, target_tail(target_s)
18
- elsif target_s.start_with? '='
19
- named target_tail(target_s)
20
- else
21
- unknown target_s
22
- end
23
- end
24
-
25
- def to_s
26
- case type
27
- when :anyone
28
- '*'
29
- when :except
30
- "^#{value}"
31
- when :like
32
- "~#{value}"
33
- when :named
34
- "=#{value}"
35
- else
36
- value
37
- end
38
- end
39
-
40
- def i18n_suffix
41
- case type
42
- when :anyone
43
- nil
44
- when :except
45
- "_except"
46
- when :like
47
- "_like"
48
- else
49
- "_named"
50
- end
51
- end
52
-
53
- def self.target_tail(target_s)
54
- target_s[1..-1]
55
- end
56
-
57
- def self.unknown(value)
58
- new(:unknown, value)
59
- end
60
-
61
- def self.named(value)
62
- new(:named, value)
63
- end
64
-
65
- def self.anyone
66
- new(:anyone)
67
- end
68
- end