mumukit 2.37.1 → 2.38.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc343e3684b7298db67776bc5173eca318387a04b1fc24f127c0e2fe33a00a37
4
- data.tar.gz: cda123be4cfaf6f0fe6f83c33f6f397a6d02e78b3af32d73143b576884d4b498
3
+ metadata.gz: b3876e1a398e3f2e0cf33f7aa1a4df85979cca7ffef37b4070d5344c2072e952
4
+ data.tar.gz: 9dcde120df168b2898461e08cb08ca26c219fdaf0791bc38a133891a7dba51ad
5
5
  SHA512:
6
- metadata.gz: c58571a713afbcf18b29ca925697db526232d7d7ccd7b7a885e242929e89aef24387ae94e0cafd7962d2d8ef335c1f646105e9fb0b9b9d00b955fc7924e069df
7
- data.tar.gz: 1650c1dab328188894024f2a36d1c96f4ed922bd31a89a5419190956f44814eecba35387361da9525890f5991ca00acbe0d7cd5e04a4fe1aa8db9c10df254300
6
+ metadata.gz: 6863a908811d9df5f390827c8c3fdea11d0c3de67b07435658d037d8b5ba9ae9d9c13cb92236bbab0e29bf942d7d668468112295ca1ce9f6cda2312cc1e0c328
7
+ data.tar.gz: 2ab1f2822e74a9b7c0a628f4661749a6e1d87e2c69c833844a34cc434ba626e61026a7f61e554a8dfccd9dc60e414b1836ad143fbfeafcbc2199e3b01801e63c
@@ -2,12 +2,12 @@ require 'mulang'
2
2
 
3
3
  module Mumukit
4
4
  class Templates::MulangExpectationsHook < Mumukit::Templates::ExpectationsHook
5
- LOGIC_SMELLS = %w(UsesCut UsesFail UsesUnificationOperator HasRedundantReduction)
6
- FUNCTIONAL_SMELLS = %w(HasRedundantParameter HasRedundantGuards)
7
- OBJECT_ORIENTED_SMELLS = %w(DoesNullTest ReturnsNull)
8
- IMPERATIVE_SMELLS = %w(HasRedundantLocalVariableReturn HasAssignmentReturn)
9
- EXPRESSIVENESS_SMELLS = %w(HasTooShortIdentifiers HasWrongCaseIdentifiers HasMisspelledIdentifiers)
10
- GENERIC_SMELLS = %w(IsLongCode HasCodeDuplication HasRedundantLambda HasRedundantIf DoesTypeTest HasRedundantBooleanComparison HasEmptyIfBranches)
5
+ LOGIC_SMELLS = Mulang::Expectation::LOGIC_SMELLS
6
+ FUNCTIONAL_SMELLS = Mulang::Expectation::FUNCTIONAL_SMELLS
7
+ OBJECT_ORIENTED_SMELLS = Mulang::Expectation::OBJECT_ORIENTED_SMELLS
8
+ IMPERATIVE_SMELLS = Mulang::Expectation::IMPERATIVE_SMELLS
9
+ EXPRESSIVENESS_SMELLS = Mulang::Expectation::EXPRESSIVENESS_SMELLS
10
+ GENERIC_SMELLS = Mulang::Expectation::GENERIC_SMELLS
11
11
 
12
12
  required :language, 'You have to provide a Mulang-compatible language in order to use this hook'
13
13
 
@@ -16,14 +16,15 @@ module Mumukit
16
16
  end
17
17
 
18
18
  def compile_mulang_analysis(request, expectations)
19
- mulang_code(request).analysis(
19
+ mulang_code(request).analysis({
20
20
  expectations: expectations[:ast],
21
21
  customExpectations: expectations[:custom],
22
22
  smellsSet: {
23
23
  tag: 'AllSmells',
24
24
  exclude: (expectations[:exceptions] + default_smell_exceptions)
25
25
  },
26
- domainLanguage: domain_language)
26
+ domainLanguage: domain_language
27
+ }.merge({normalizationOptions: normalization_options(request).presence}.compact))
27
28
  end
28
29
 
29
30
  def run_mulang_analysis(analysis)
@@ -41,6 +42,10 @@ module Mumukit
41
42
  }
42
43
  end
43
44
 
45
+ def normalization_options(request)
46
+ request.dig(:settings, :normalization_options) || {}
47
+ end
48
+
44
49
  def default_smell_exceptions
45
50
  []
46
51
  end
@@ -1,3 +1,3 @@
1
1
  module Mumukit
2
- VERSION = '2.37.1'
2
+ VERSION = '2.38.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.37.1
4
+ version: 2.38.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: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -212,28 +212,28 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '5.1'
215
+ version: '6.0'
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '5.1'
222
+ version: '6.0'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: mumukit-inspection
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '5.0'
229
+ version: '6.0'
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '5.0'
236
+ version: '6.0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: mumukit-core
239
239
  requirement: !ruby/object:Gem::Requirement