Initial commit: Add logistics and order_detail message types
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
86
rubocop/one_class_per_file.rb
Normal file
86
rubocop/one_class_per_file.rb
Normal file
@@ -0,0 +1,86 @@
|
||||
require 'rubocop'
|
||||
|
||||
# Enforces having only one class definition per file
|
||||
# Excludes common Ruby patterns:
|
||||
# - Nested Scope classes (Pundit pattern)
|
||||
# - Single-line exception classes inheriting from StandardError or other exceptions
|
||||
# - Nested classes within exception/error hierarchies
|
||||
class RuboCop::Cop::Style::OneClassPerFile < RuboCop::Cop::Base
|
||||
MSG = 'Define only one class per file.'.freeze
|
||||
|
||||
def on_new_investigation
|
||||
return unless processed_source.ast
|
||||
|
||||
class_nodes = processed_source.ast.each_node(:class).to_a
|
||||
return if class_nodes.size <= 1
|
||||
|
||||
class_nodes[1..].each do |node|
|
||||
next if allowed_nested_class?(node)
|
||||
|
||||
add_offense(node, message: MSG)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def allowed_nested_class?(node)
|
||||
# Allow nested Scope classes (Pundit pattern)
|
||||
return true if scope_class?(node)
|
||||
|
||||
# Allow nested Request classes (Rack::Attack pattern)
|
||||
return true if rack_attack_request_class?(node)
|
||||
|
||||
# Allow exception classes (single-line or multi-line)
|
||||
return true if exception_class?(node)
|
||||
|
||||
# Allow classes within CustomExceptions modules
|
||||
return true if in_custom_exceptions_module?(node)
|
||||
|
||||
# Allow common nested patterns: Builder, Factory, Result, Response, Params, etc.
|
||||
return true if common_nested_pattern?(node)
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
def scope_class?(node)
|
||||
class_name = node.identifier.source
|
||||
class_name == 'Scope'
|
||||
end
|
||||
|
||||
def rack_attack_request_class?(node)
|
||||
class_name = node.identifier.source
|
||||
return false unless class_name == 'Request'
|
||||
|
||||
# Check if we're inside a Rack::Attack class
|
||||
node.each_ancestor(:class).any? do |ancestor|
|
||||
ancestor.identifier.source.include?('Rack::Attack')
|
||||
end
|
||||
end
|
||||
|
||||
def exception_class?(node)
|
||||
# Check if the class inherits from StandardError or ends with 'Error'
|
||||
return false unless node.parent_class
|
||||
|
||||
parent_class = node.parent_class.source
|
||||
parent_class.include?('Error') || parent_class.include?('StandardError')
|
||||
end
|
||||
|
||||
def in_custom_exceptions_module?(node)
|
||||
# Check if any parent node is a module containing 'CustomExceptions'
|
||||
node.each_ancestor(:module).any? do |ancestor|
|
||||
ancestor.identifier.source.include?('CustomExceptions')
|
||||
end
|
||||
end
|
||||
|
||||
def common_nested_pattern?(node)
|
||||
class_name = node.identifier.source
|
||||
|
||||
# Common nested class patterns in Ruby/Rails
|
||||
nested_patterns = %w[Builder Factory Result Response Params Config Configuration
|
||||
Context Query Form Validator Serializer Presenter Decorator
|
||||
Command Handler]
|
||||
|
||||
# Check if class name ends with any of these patterns
|
||||
nested_patterns.any? { |pattern| class_name.end_with?(pattern) }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user