immosquare-cleaner 0.1.59 → 0.1.60

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: 3341c32f8a15be7665c8ea125281cc2e91ebc2649781237b25a15f71aedc1f4e
4
- data.tar.gz: eff42e9a0160fa952d77f715f25730f22f7f426eb66bdd5b54174156c33bf367
3
+ metadata.gz: f42a6090a21cedef11f6b6a09cc27050ec6e182aca43969e97d4825d82d7c385
4
+ data.tar.gz: c3181a36566b7ee884c4428eabebe23f500df0075406fdae8291b1eb648daeee
5
5
  SHA512:
6
- metadata.gz: 6e2b64c29aac62206c6a83c2021fa71f875d13e936dec9ebec1b15435dd3208c19fc7a30e270171e2bf9f31628ed9ad0362217de9fd4c8abe584d1329aaa81ce
7
- data.tar.gz: 62beacc324874476d9d7c5834007e62a3a5b2946c11b59d6fe3c603afaa4b5238060a4e1f4438540eb867414f55c2c408fa8632f943498f46b0b0a4db8ba9d39
6
+ metadata.gz: ba511b4ad743d37223bc62c0513e13aa83c207026a1180d960798def83562880e3087da111f71ef140c5e059ab820bafcd4fba426b18a033c4074f4fad3466a2
7
+ data.tar.gz: 290b7dc88820456e17e361f4174097154dea535d11b33f8cf04ce031fd5668becd5ca7497553456db2241d8939f85c0c0d4bb3a1cc20fcc6ab2d9d8ca6cb4e15
@@ -1,12 +1,13 @@
1
1
  module ImmosquareCleaner
2
2
  class Configuration
3
3
 
4
- attr_accessor :rubocop_options, :htmlbeautifier_options, :erblint_options
4
+ attr_accessor :rubocop_options, :htmlbeautifier_options, :erblint_options, :exclude_files
5
5
 
6
6
  def initialize
7
7
  @rubocop_options = nil
8
8
  @htmlbeautifier_options = nil
9
9
  @erblint_options = nil
10
+ @exclude_files = []
10
11
  end
11
12
 
12
13
 
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCleaner
2
- VERSION = "0.1.59".freeze
2
+ VERSION = "0.1.60".freeze
3
3
  end
@@ -41,6 +41,19 @@ module ImmosquareCleaner
41
41
  ##============================================================##
42
42
  options = {}.merge(options)
43
43
 
44
+
45
+ ##============================================================##
46
+ ## On charge le fichier de configuration s'il existe
47
+ ##============================================================##
48
+ config_file = File.join(Dir.pwd, "config/initializers/immosquare-cleaner.rb")
49
+ load(config_file) if File.exist?(config_file)
50
+
51
+ ##============================================================##
52
+ ## On retourne si le fichier est dans la liste des fichiers à exclure
53
+ ##============================================================##
54
+ exclude_files = ImmosquareCleaner.configuration.exclude_files.map {|file| File.join(Dir.pwd, file) }
55
+ return if exclude_files.include?(file_path)
56
+
44
57
  begin
45
58
  ##============================================================##
46
59
  ## .html.erb files
@@ -56,21 +69,8 @@ module ImmosquareCleaner
56
69
 
57
70
  ##============================================================##
58
71
  ## Ruby Files
59
- ## We create a rubocop config file with the ruby version
60
- ## if it does not exist...Normally rubocop does it alone
61
- ## of this based on .ruby-version file but it doesn't work
62
- ## in our case where rubocop is in a gem which is called
63
- ## in a project...
64
72
  ##============================================================##
65
73
  if file_path.end_with?(*RUBY_FILES) || File.open(file_path, &:gets)&.include?(SHEBANG)
66
- rubocop_config_with_version_path = "#{gem_root}/linters/rubocop-#{RUBY_VERSION}.yml"
67
-
68
- if !File.exist?(rubocop_config_with_version_path)
69
- rubocop_config = YAML.load_file("#{gem_root}/linters/rubocop.yml")
70
- rubocop_config["AllCops"] ||= {}
71
- rubocop_config["AllCops"]["TargetRubyVersion"] = RUBY_VERSION
72
- File.write(rubocop_config_with_version_path, rubocop_config.to_yaml)
73
- end
74
74
 
75
75
  ##============================================================##
76
76
  ## --autocorrect-all : Auto-correct all offenses that RuboCop can correct, and leave all other offenses unchanged.
@@ -78,7 +78,7 @@ module ImmosquareCleaner
78
78
  ##============================================================##
79
79
  rubocop_options = ImmosquareCleaner.configuration.rubocop_options || "--autocorrect-all --no-parallel"
80
80
 
81
- cmds = ["bundle exec rubocop -c #{rubocop_config_with_version_path} \"#{file_path}\" #{rubocop_options}"]
81
+ cmds = ["bundle exec rubocop -c #{gem_root}/linters/rubocop.yml \"#{file_path}\" #{rubocop_options}"]
82
82
  launch_cmds(cmds)
83
83
  File.normalize_last_line(file_path)
84
84
  return
@@ -47,7 +47,7 @@ module RuboCop
47
47
  def find_comment_blocks(comments)
48
48
  blocks = []
49
49
  current_block = []
50
- filtered_comments = comments.select {|comment| line_content(comment).strip.start_with?("##") || comment.text.start_with?("#=") }
50
+ filtered_comments = comments.select {|comment| line_content(comment).strip.start_with?("##") }
51
51
 
52
52
  filtered_comments.each do |comment|
53
53
  if current_block.empty? || comment.location.line == current_block.last.location.line + 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.59
4
+ version: 0.1.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - immosquare
@@ -130,8 +130,6 @@ files:
130
130
  - linters/eslint.config.mjs
131
131
  - linters/jscodeshift/arrow-function-transform.js
132
132
  - linters/prettier.yml
133
- - linters/rubocop-3.3.6.yml
134
- - linters/rubocop-3.4.1.yml
135
133
  - linters/rubocop.yml
136
134
  - linters/rubocop/cop/custom_cops/style/comment_normalization.rb
137
135
  - linters/rubocop/cop/style/method_call_with_args_parentheses_override.rb
@@ -1,100 +0,0 @@
1
- ---
2
- require:
3
- - rubocop/cop/style/method_call_with_args_parentheses_override
4
- - rubocop/cop/custom_cops/style/use_credentials_instead_of_env
5
- - rubocop/cop/custom_cops/style/comment_normalization
6
- AllCops:
7
- NewCops: enable
8
- EnabledByDefault: false
9
- UseCache: true
10
- SuggestExtensions: false
11
- ActiveSupportExtensionsEnabled: true
12
- TargetRubyVersion: 3.3.6
13
- Metrics:
14
- Enabled: false
15
- Lint/UselessAssignment:
16
- Enabled: false
17
- Lint/RescueException:
18
- Enabled: false
19
- Lint/UnusedMethodArgument:
20
- Enabled: false
21
- Naming/VariableNumber:
22
- Enabled: false
23
- Naming/FileName:
24
- Enabled: false
25
- Naming/MethodParameterName:
26
- MinNameLength: 1
27
- Layout/LeadingEmptyLines:
28
- Enabled: false
29
- Layout/InitialIndentation:
30
- Enabled: false
31
- Layout/TrailingEmptyLines:
32
- Enabled: false
33
- Layout/ExtraSpacing:
34
- Enabled: false
35
- Layout/LineLength:
36
- Enabled: false
37
- Layout/TrailingWhitespace:
38
- Enabled: true
39
- Layout/EmptyLines:
40
- Enabled: false
41
- Layout/SpaceInsideBlockBraces:
42
- SpaceBeforeBlockParameters: false
43
- Layout/EmptyLinesAroundClassBody:
44
- EnforcedStyle: empty_lines
45
- Layout/FirstHashElementIndentation:
46
- EnforcedStyle: consistent
47
- Layout/ArgumentAlignment:
48
- EnforcedStyle: with_fixed_indentation
49
- Layout/HashAlignment:
50
- EnforcedHashRocketStyle: table
51
- Layout/MultilineAssignmentLayout:
52
- EnforcedStyle: same_line
53
- Layout/SpaceInsideHashLiteralBraces:
54
- EnforcedStyle: no_space
55
- Layout/MultilineMethodCallIndentation:
56
- EnforcedStyle: indented
57
- Style/CombinableLoops:
58
- Enabled: false
59
- Style/SingleArgumentDig:
60
- Enabled: false
61
- Style/RedundantBegin:
62
- Enabled: false
63
- Style/MultilineTernaryOperator:
64
- Enabled: false
65
- Style/NestedTernaryOperator:
66
- Enabled: false
67
- Style/MultilineIfModifier:
68
- Enabled: false
69
- Style/FrozenStringLiteralComment:
70
- Enabled: false
71
- Style/Next:
72
- Enabled: false
73
- Style/Documentation:
74
- Enabled: false
75
- Style/IfUnlessModifierOfIfUnless:
76
- Enabled: false
77
- Style/NegatedIf:
78
- Enabled: false
79
- Style/FormatStringToken:
80
- EnforcedStyle: template
81
- Style/NumericPredicate:
82
- EnforcedStyle: comparison
83
- Style/StringLiterals:
84
- EnforcedStyle: double_quotes
85
- Style/StringLiteralsInInterpolation:
86
- EnforcedStyle: double_quotes
87
- Style/HashSyntax:
88
- EnforcedStyle: hash_rockets
89
- Style/WordArray:
90
- EnforcedStyle: brackets
91
- Style/SymbolArray:
92
- EnforcedStyle: brackets
93
- Style/MethodCallWithArgsParentheses:
94
- Enabled: true
95
- CustomCops/Style/UseCredentialsInsteadOfEnv:
96
- Enabled: true
97
- CustomCops/Style/CommentNormalization:
98
- Enabled: true
99
- Gemspec/RequireMFA:
100
- Enabled: false
@@ -1,97 +0,0 @@
1
- ---
2
- require:
3
- - rubocop/cop/style/method_call_with_args_parentheses_override
4
- - rubocop/cop/custom_cops/style/comment_normalization
5
- AllCops:
6
- NewCops: enable
7
- EnabledByDefault: false
8
- UseCache: true
9
- SuggestExtensions: false
10
- ActiveSupportExtensionsEnabled: true
11
- TargetRubyVersion: 3.4.1
12
- Metrics:
13
- Enabled: false
14
- Lint/UselessAssignment:
15
- Enabled: false
16
- Lint/RescueException:
17
- Enabled: false
18
- Lint/UnusedMethodArgument:
19
- Enabled: false
20
- Naming/VariableNumber:
21
- Enabled: false
22
- Naming/FileName:
23
- Enabled: false
24
- Naming/MethodParameterName:
25
- MinNameLength: 1
26
- Layout/LeadingEmptyLines:
27
- Enabled: false
28
- Layout/InitialIndentation:
29
- Enabled: false
30
- Layout/TrailingEmptyLines:
31
- Enabled: false
32
- Layout/ExtraSpacing:
33
- Enabled: false
34
- Layout/LineLength:
35
- Enabled: false
36
- Layout/TrailingWhitespace:
37
- Enabled: true
38
- Layout/EmptyLines:
39
- Enabled: false
40
- Layout/SpaceInsideBlockBraces:
41
- SpaceBeforeBlockParameters: false
42
- Layout/EmptyLinesAroundClassBody:
43
- EnforcedStyle: empty_lines
44
- Layout/FirstHashElementIndentation:
45
- EnforcedStyle: consistent
46
- Layout/ArgumentAlignment:
47
- EnforcedStyle: with_fixed_indentation
48
- Layout/HashAlignment:
49
- EnforcedHashRocketStyle: table
50
- Layout/MultilineAssignmentLayout:
51
- EnforcedStyle: same_line
52
- Layout/SpaceInsideHashLiteralBraces:
53
- EnforcedStyle: no_space
54
- Layout/MultilineMethodCallIndentation:
55
- EnforcedStyle: indented
56
- Style/CombinableLoops:
57
- Enabled: false
58
- Style/SingleArgumentDig:
59
- Enabled: false
60
- Style/RedundantBegin:
61
- Enabled: false
62
- Style/MultilineTernaryOperator:
63
- Enabled: false
64
- Style/NestedTernaryOperator:
65
- Enabled: false
66
- Style/MultilineIfModifier:
67
- Enabled: false
68
- Style/FrozenStringLiteralComment:
69
- Enabled: false
70
- Style/Next:
71
- Enabled: false
72
- Style/Documentation:
73
- Enabled: false
74
- Style/IfUnlessModifierOfIfUnless:
75
- Enabled: false
76
- Style/NegatedIf:
77
- Enabled: false
78
- Style/FormatStringToken:
79
- EnforcedStyle: template
80
- Style/NumericPredicate:
81
- EnforcedStyle: comparison
82
- Style/StringLiterals:
83
- EnforcedStyle: double_quotes
84
- Style/StringLiteralsInInterpolation:
85
- EnforcedStyle: double_quotes
86
- Style/HashSyntax:
87
- EnforcedStyle: hash_rockets
88
- Style/WordArray:
89
- EnforcedStyle: brackets
90
- Style/SymbolArray:
91
- EnforcedStyle: brackets
92
- Style/MethodCallWithArgsParentheses:
93
- Enabled: true
94
- CustomCops/Style/CommentNormalization:
95
- Enabled: true
96
- Gemspec/RequireMFA:
97
- Enabled: false