Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/tmp
/log
/public
/.idea
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
182 changes: 182 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
plugins:
- rubocop-minitest
- rubocop-performance
- rubocop-rspec
- rubocop-rails

AllCops:
SuggestExtensions: false
NewCops: enable
TargetRubyVersion: 3.4
Exclude:
- 'vendor/**/*'
- 'db/schema.rb'
- 'db/migrate/*'
- 'bin/*'
- 'node_modules/**/*'
- 'tmp/**/*'
- 'log/**/*'

# ОСНОВНЫЕ СТИЛЕВЫЕ ПРАВИЛА

# Предпочитаем ДВОЙНЫЕ кавычки
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

# Отключаем требование документации
Style/Documentation:
Enabled: false

# Разрешаем не-ASCII комментарии (русские комментарии)
Style/AsciiComments:
Enabled: false

# МЕТРИКИ И ДЛИНЫ

Layout/LineLength:
Max: 200
AllowURI: true
AllowHeredoc: true

Metrics/MethodLength:
Max: 100
CountAsOne: ['array', 'hash', 'heredoc']

Metrics/ClassLength:
Max: 200
CountAsOne: ['array', 'hash', 'heredoc']

Metrics/ModuleLength:
Max: 200

Metrics/BlockLength:
Max: 100
CountAsOne: ['array', 'hash', 'heredoc']
Exclude:
- 'spec/**/*'
- 'config/routes.rb'

Metrics/AbcSize:
Max: 20

Metrics/CyclomaticComplexity:
Max: 15

Metrics/PerceivedComplexity:
Max: 15

# LAYOUT И ФОРМАТИРОВАНИЕ

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented

# RAILS-СПЕЦИФИЧНЫЕ ПРАВИЛА

Rails/FilePath:
Enabled: false

Rails/UnknownEnv:
Environments:
- production
- development
- test

Rails/SkipsModelValidations:
Enabled: false # Для bulk import операций

# RSPEC-СПЕЦИФИЧНЫЕ ПРАВИЛА

RSpec/ExampleLength:
Max: 20

RSpec/MultipleExpectations:
Max: 5

RSpec/NestedGroups:
Max: 4

RSpec/DescribeClass:
Enabled: false

# PERFORMANCE ПРАВИЛА

Performance/StringReplacement:
Enabled: true

Performance/RedundantBlockCall:
Enabled: true

Performance/StringInclude:
Enabled: true

# БЕЗОПАСНОСТЬ

Security/Open:
Enabled: true

Security/YAMLLoad:
Enabled: true

# ИМЕНОВАНИЕ

Naming/PredicatePrefix:
Enabled: true
AllowedMethods:
- is_a?
- has_key?

Naming/MemoizedInstanceVariableName:
Enabled: false

# STYLE ПРАВИЛА

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: false # Может конфликтовать с некоторыми регексами

Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always

Style/SymbolArray:
Enabled: true
EnforcedStyle: brackets

Style/WordArray:
Enabled: true
EnforcedStyle: brackets
Exclude:
- 'app/models/**/*'

# Разрешаем trailing запятые
Style/TrailingCommaInArguments:
Enabled: true
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
Enabled: true
EnforcedStyleForMultiline: comma
7 changes: 7 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# and is meant to be a temporary file to ease migration to stricter rules.
# Remove or comment out rules as you fix the violations.

# Uncomment below if you have many violations and want to fix them gradually
# inherit_from: .rubocop_todo.yml
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optimization
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
3.4.4
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"ruby.useLanguageServer": true,
"ruby.format": "rubocop",
"ruby.lint": {
"rubocop": true,
"ruby": false
},
"ruby.rubocop.executePath": "bundle exec rubocop",
"ruby.rubocop.configFilePath": ".rubocop.yml",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"[ruby]": {
"editor.defaultFormatter": "rebornix.Ruby",
"editor.formatOnSave": true,
"editor.rulers": [200],
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"emmet.includeLanguages": {
"erb": "html"
}
}
58 changes: 49 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
source 'https://rubygems.org'
# frozen_string_literal: true

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby file: '.ruby-version'
ruby file: ".ruby-version"

# Core Rails gems
gem "bootsnap"
gem "listen"
gem "pg"
gem "puma"
gem "rails", "~> 8.0.1"
gem "sprockets-rails"

gem 'rails', '~> 8.0.1'
gem 'pg'
gem 'puma'
gem 'listen'
gem 'bootsnap'
gem 'rack-mini-profiler'
# Core application dependencies
gem "activerecord-import"
gem "oj"
gem "ruby-progressbar"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

group :development do
# Database monitoring and optimization
gem "bullet"
gem "pghero"
gem "pg_query", ">= 2"
gem "strong_migrations"
end

group :development, :test do
# Code quality and linting
gem "rubocop", require: false
gem "rubocop-minitest", require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false

# Profiling tools
gem "memory_profiler", require: false
gem "pry"
gem "rack-mini-profiler", require: false
gem "ruby-prof", require: false
gem "stackprof", require: false
gem "test-prof", "~> 1.4.4"
gem "vernier", "~> 1.7", require: false
end

group :test do
gem "profile-viewer", require: false
gem "rspec-rails"
gem "rspec-sqlimit"
end
Loading