Skip to content

Commit

Permalink
Adds editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
harman28 committed Oct 8, 2018
1 parent b44d021 commit 87d8f26
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org

root = true
[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
max_line_length = 180
insert_final_newline = true
trim_trailing_whitespace = true
8 changes: 5 additions & 3 deletions lib/rubycritic/analysers/helpers/ast_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def recursive_children
end

def get_module_names
children_modules = children
.select { |child| child.is_a?(Parser::AST::Node) }
.flat_map(&:get_module_names)
ast_node_children = children.select do |child|
child.is_a?(Parser::AST::Node)
end

children_modules = ast_node_children.flat_map(&:get_module_names)

if MODULE_TYPES.include?(type)
if children_modules.empty?
Expand Down
14 changes: 10 additions & 4 deletions lib/rubycritic/core/analysed_modules_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ def limited_cost_for(mod)
end

def build_analysed_module(analysed_module)
AnalysedModule.new(pathname: analysed_module.pathname, name: analysed_module.name,
smells: analysed_module.smells, churn: analysed_module.churn,
committed_at: analysed_module.committed_at, complexity: analysed_module.complexity,
duplication: analysed_module.duplication, methods_count: analysed_module.methods_count)
AnalysedModule.new(
pathname: analysed_module.pathname,
name: analysed_module.name,
smells: analysed_module.smells,
churn: analysed_module.churn,
committed_at: analysed_module.committed_at,
complexity: analysed_module.complexity,
duplication: analysed_module.duplication,
methods_count: analysed_module.methods_count
)
end
end
end
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/html/templates/overview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="row">
<!--Page Title -->
<div class="Page_Title">
<h3>Overview</h3>
<h3>Overview</h3>
</div>
<!--End Page Title -->
<div class="Content_Wrapper">
Expand Down
4 changes: 2 additions & 2 deletions lib/rubycritic/source_control_systems/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def self.create
supported_system.new
else
puts 'RubyCritic can provide more feedback if you use '\
"a #{connected_system_names} repository. "\
'Churn will not be calculated.'
"a #{connected_system_names} repository. "\
'Churn will not be calculated.'
Double.new
end
end
Expand Down

0 comments on commit 87d8f26

Please sign in to comment.