neeto-commons-backend 1.0.89
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.eslintignore +14 -0
- data/.eslintrc.js +87 -0
- data/.husky/helpers/verify_neeto_audit.sh +18 -0
- data/.husky/pre-push +5 -0
- data/.neetoci/neetoci.yml +26 -0
- data/.prettierrc.js +15 -0
- data/.rubocop.yml +626 -0
- data/.ruby-version +1 -0
- data/.semaphore/semaphore.yml +32 -0
- data/.semaphore/staging-deploy.yml +23 -0
- data/Gemfile +92 -0
- data/Gemfile.lock +461 -0
- data/README.md +286 -0
- data/Rakefile +18 -0
- data/app/controllers/api/base_controller.rb +6 -0
- data/app/controllers/neeto_commons_backend/api/base_controller.rb +9 -0
- data/app/controllers/neeto_commons_backend/api/direct_uploads_controller.rb +57 -0
- data/app/controllers/neeto_commons_backend/app_versions_controller.rb +20 -0
- data/app/controllers/neeto_commons_backend/failures_controller.rb +29 -0
- data/app/controllers/neeto_commons_backend/health_check_controller.rb +9 -0
- data/app/controllers/neeto_commons_backend/well_knowns_controller.rb +13 -0
- data/app/mailers/neeto_commons_backend/application_mailer.rb +22 -0
- data/app/models/concerns/neeto_commons_backend/sluggable.rb +27 -0
- data/app/models/concerns/neeto_commons_backend/soft_deletable.rb +20 -0
- data/app/services/neeto_commons_backend/sample_data/common/admin_service.rb +26 -0
- data/app/services/neeto_commons_backend/sample_data/common/app_organization_service.rb +11 -0
- data/app/services/neeto_commons_backend/sample_data/common/base.rb +49 -0
- data/app/services/neeto_commons_backend/sample_data/common/database_cleanup_service.rb +13 -0
- data/app/services/neeto_commons_backend/sample_data/common/loader_service.rb +30 -0
- data/app/services/neeto_commons_backend/sample_data/common/neeto_team_members_service.rb +16 -0
- data/app/services/neeto_commons_backend/sample_data/common/organization_base.rb +36 -0
- data/app/services/neeto_commons_backend/sample_data/common/organization_service.rb +11 -0
- data/app/services/neeto_commons_backend/source_map_publish_service.rb +47 -0
- data/app/views/neeto_commons_backend/failures/show.html.erb +1 -0
- data/app/views/shared/_common.html.erb +8 -0
- data/app/views/shared/_neeto_engineering_replay_widget.html.erb +31 -0
- data/app/views/shared/_neeto_widget.html.erb +30 -0
- data/app/workers/neeto_commons_backend/base_workers/auth.rb +9 -0
- data/app/workers/neeto_commons_backend/base_workers/base.rb +52 -0
- data/app/workers/neeto_commons_backend/base_workers/default.rb +8 -0
- data/app/workers/neeto_commons_backend/base_workers/low.rb +9 -0
- data/app/workers/neeto_commons_backend/base_workers/urgent.rb +9 -0
- data/app/workers/neeto_commons_backend/purge_unattached_files_worker.rb +11 -0
- data/babel.config.js +47 -0
- data/bin/console +15 -0
- data/bin/rails +16 -0
- data/bin/setup +8 -0
- data/config/brakeman.ignore +52 -0
- data/config/locales/en.yml +5 -0
- data/docs/carriers/README.md +5 -0
- data/docs/controller_concerns/README.md +34 -0
- data/docs/controllers/README.md +27 -0
- data/docs/gemfiles/README.md +5 -0
- data/docs/helpers/README.md +21 -0
- data/docs/mailers/README.md +5 -0
- data/docs/model_concerns/README.md +39 -0
- data/docs/routes/README.md +44 -0
- data/docs/scripts/README.md +5 -0
- data/docs/semaphore/README.md +5 -0
- data/docs/services/README.md +23 -0
- data/docs/workers/README.md +32 -0
- data/docs/workflows/README.md +9 -0
- data/lib/Rakefile +4 -0
- data/lib/neeto-commons-backend.rb +62 -0
- data/lib/neeto_commons_backend/.circleci/config.yml +84 -0
- data/lib/neeto_commons_backend/.slugignore +17 -0
- data/lib/neeto_commons_backend/carriers/app_url_carrier.rb +71 -0
- data/lib/neeto_commons_backend/common_files/.bundler-version +1 -0
- data/lib/neeto_commons_backend/common_files/.editorconfig +10 -0
- data/lib/neeto_commons_backend/common_files/.erb-lint.yml +20 -0
- data/lib/neeto_commons_backend/common_files/.eslintignore +14 -0
- data/lib/neeto_commons_backend/common_files/.eslintrc.js +2 -0
- data/lib/neeto_commons_backend/common_files/.gitignore +132 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/lint_staged.sh +5 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/prevent_conflict_markers.sh +35 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh +24 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/verify_neeto_audit.sh +17 -0
- data/lib/neeto_commons_backend/common_files/.husky/pre-commit +9 -0
- data/lib/neeto_commons_backend/common_files/.husky/pre-push +7 -0
- data/lib/neeto_commons_backend/common_files/.node-version +1 -0
- data/lib/neeto_commons_backend/common_files/.nvmrc +1 -0
- data/lib/neeto_commons_backend/common_files/.postcssrc.yml +6 -0
- data/lib/neeto_commons_backend/common_files/.prettierrc.js +1 -0
- data/lib/neeto_commons_backend/common_files/.rubocop.yml +625 -0
- data/lib/neeto_commons_backend/common_files/.ruby-version +1 -0
- data/lib/neeto_commons_backend/common_files/.semaphore/commands/run_eslint_on_modified_files.sh +5 -0
- data/lib/neeto_commons_backend/common_files/.vscode/extensions.json +10 -0
- data/lib/neeto_commons_backend/common_files/.vscode/settings.json +21 -0
- data/lib/neeto_commons_backend/common_files/Dockerfile.dev +50 -0
- data/lib/neeto_commons_backend/common_files/app/javascript/jsconfig.json +62 -0
- data/lib/neeto_commons_backend/common_files/app/javascript/src/types.d.ts +36 -0
- data/lib/neeto_commons_backend/common_files/babel.config.js +1 -0
- data/lib/neeto_commons_backend/common_files/bin/bundle +5 -0
- data/lib/neeto_commons_backend/common_files/bin/rails +6 -0
- data/lib/neeto_commons_backend/common_files/bin/rake +6 -0
- data/lib/neeto_commons_backend/common_files/bin/setup +40 -0
- data/lib/neeto_commons_backend/common_files/bin/update +33 -0
- data/lib/neeto_commons_backend/common_files/bin/webpacker +17 -0
- data/lib/neeto_commons_backend/common_files/bin/webpacker-dev-server +17 -0
- data/lib/neeto_commons_backend/common_files/bin/yarn +19 -0
- data/lib/neeto_commons_backend/common_files/cypress-tests/.eslintrc.js +57 -0
- data/lib/neeto_commons_backend/common_files/cypress-tests/cypress/plugins/index.js +63 -0
- data/lib/neeto_commons_backend/common_files/github/workflows/auto_update_prs_with_latest_master.yml +21 -0
- data/lib/neeto_commons_backend/common_files/neeto_gems/github/workflows/bump_version.yml +51 -0
- data/lib/neeto_commons_backend/common_files/newrelic.yml +31 -0
- data/lib/neeto_commons_backend/common_files/package-common.json +119 -0
- data/lib/neeto_commons_backend/common_files/roles.yml +34 -0
- data/lib/neeto_commons_backend/common_files/semaphore/semaphore.yml +58 -0
- data/lib/neeto_commons_backend/common_files/sitemap.xml +15 -0
- data/lib/neeto_commons_backend/common_files/test/support/assertion_support.rb +9 -0
- data/lib/neeto_commons_backend/common_files/webpacker.yml +90 -0
- data/lib/neeto_commons_backend/config/secrets.yml +169 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_exceptions.rb +83 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_helpers.rb +9 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_responders.rb +33 -0
- data/lib/neeto_commons_backend/controllers/concerns/authenticatable.rb +51 -0
- data/lib/neeto_commons_backend/controllers/concerns/honeybadger_context.rb +17 -0
- data/lib/neeto_commons_backend/controllers/concerns/store_user_location.rb +23 -0
- data/lib/neeto_commons_backend/cypress/cypress.review.json +13 -0
- data/lib/neeto_commons_backend/cypress/jsconfig.json +17 -0
- data/lib/neeto_commons_backend/cypress/package.json +51 -0
- data/lib/neeto_commons_backend/cypress/resolve.js +16 -0
- data/lib/neeto_commons_backend/cypress/webpack.config.js +21 -0
- data/lib/neeto_commons_backend/engine.rb +6 -0
- data/lib/neeto_commons_backend/environments/application.rb +33 -0
- data/lib/neeto_commons_backend/environments/development.rb +46 -0
- data/lib/neeto_commons_backend/environments/heroku.rb +35 -0
- data/lib/neeto_commons_backend/environments/production.rb +45 -0
- data/lib/neeto_commons_backend/environments/staging.rb +43 -0
- data/lib/neeto_commons_backend/environments/test.rb +29 -0
- data/lib/neeto_commons_backend/gemfiles/Gemfile.common.rb +240 -0
- data/lib/neeto_commons_backend/helpers/auth_server_api.rb +92 -0
- data/lib/neeto_commons_backend/helpers/favicon.rb +18 -0
- data/lib/neeto_commons_backend/helpers/global_props.rb +76 -0
- data/lib/neeto_commons_backend/helpers/neeto_widget_helper.rb +19 -0
- data/lib/neeto_commons_backend/helpers/test_helper.rb +90 -0
- data/lib/neeto_commons_backend/initializers/_enable_extension_hack.rb +32 -0
- data/lib/neeto_commons_backend/initializers/assets.rb +11 -0
- data/lib/neeto_commons_backend/initializers/bullet.rb +26 -0
- data/lib/neeto_commons_backend/initializers/cache_store.rb +27 -0
- data/lib/neeto_commons_backend/initializers/common.rb +33 -0
- data/lib/neeto_commons_backend/initializers/cookies_serializer.rb +11 -0
- data/lib/neeto_commons_backend/initializers/cors.rb +16 -0
- data/lib/neeto_commons_backend/initializers/database_cleaner.rb +11 -0
- data/lib/neeto_commons_backend/initializers/datetime.rb +14 -0
- data/lib/neeto_commons_backend/initializers/email_setup.rb +25 -0
- data/lib/neeto_commons_backend/initializers/filter_parameter_logging.rb +11 -0
- data/lib/neeto_commons_backend/initializers/honeybadger.rb +23 -0
- data/lib/neeto_commons_backend/initializers/kaminari_config.rb +13 -0
- data/lib/neeto_commons_backend/initializers/mime_types.rb +12 -0
- data/lib/neeto_commons_backend/initializers/mini_profiler.rb +14 -0
- data/lib/neeto_commons_backend/initializers/neeto_email_prefixer.rb +40 -0
- data/lib/neeto_commons_backend/initializers/neeto_mail_interceptor.rb +35 -0
- data/lib/neeto_commons_backend/initializers/post_compilation.rb +17 -0
- data/lib/neeto_commons_backend/initializers/rack_attack.rb +38 -0
- data/lib/neeto_commons_backend/initializers/rack_deflater.rb +11 -0
- data/lib/neeto_commons_backend/initializers/rack_timeout.rb +15 -0
- data/lib/neeto_commons_backend/initializers/rails_email_preview.rb +21 -0
- data/lib/neeto_commons_backend/initializers/redis_client_patch.rb +18 -0
- data/lib/neeto_commons_backend/initializers/remove_backtrace_silencers.rb +11 -0
- data/lib/neeto_commons_backend/initializers/session_store.rb +21 -0
- data/lib/neeto_commons_backend/initializers/shared_redis.rb +13 -0
- data/lib/neeto_commons_backend/initializers/sidekiq.rb +46 -0
- data/lib/neeto_commons_backend/initializers/strong_migrations.rb +13 -0
- data/lib/neeto_commons_backend/initializers/wrap_parameters.rb +13 -0
- data/lib/neeto_commons_backend/models/concerns/devise_validator.rb +19 -0
- data/lib/neeto_commons_backend/railtie.rb +20 -0
- data/lib/neeto_commons_backend/routes/catch_all.rb +9 -0
- data/lib/neeto_commons_backend/routes/devise.rb +16 -0
- data/lib/neeto_commons_backend/routes/direct_uploads.rb +9 -0
- data/lib/neeto_commons_backend/routes/draw.rb +29 -0
- data/lib/neeto_commons_backend/routes/email_previews.rb +5 -0
- data/lib/neeto_commons_backend/routes/errors.rb +7 -0
- data/lib/neeto_commons_backend/routes/health.rb +8 -0
- data/lib/neeto_commons_backend/routes/letter_opener.rb +5 -0
- data/lib/neeto_commons_backend/routes/sidekiq.rb +22 -0
- data/lib/neeto_commons_backend/routes/well_knowns.rb +10 -0
- data/lib/neeto_commons_backend/scripts/sync_with_wheel.sh +54 -0
- data/lib/neeto_commons_backend/secrets_management.rb +41 -0
- data/lib/neeto_commons_backend/services/custom_domain_service.rb +40 -0
- data/lib/neeto_commons_backend/tasks/assets.rake +27 -0
- data/lib/neeto_commons_backend/tasks/before_assets_precompile.rake +13 -0
- data/lib/neeto_commons_backend/tasks/simplecov_coverage.rake +25 -0
- data/lib/neeto_commons_backend/version.rb +5 -0
- data/neeto-commons-backend.gemspec +52 -0
- data/package.json +31 -0
- data/yarn.lock +2530 -0
- metadata +497 -0
@@ -0,0 +1,625 @@
|
|
1
|
+
# cspell:Disable
|
2
|
+
require:
|
3
|
+
- rubocop-rails
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 3.2.2
|
7
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
8
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
9
|
+
DisabledByDefault: true
|
10
|
+
# From time to time rubocop adds new cops to say rails etc.
|
11
|
+
# So rather than disabling them it's better to enable them,
|
12
|
+
# try it out and then disable them manually one by one.
|
13
|
+
NewCops: enable
|
14
|
+
Exclude:
|
15
|
+
- "app/javascript/**/*"
|
16
|
+
- "app/assets/**/*"
|
17
|
+
- "app/views/**/*.erb"
|
18
|
+
- "lib/tasks/**/*"
|
19
|
+
- ".vscode/**/*"
|
20
|
+
- ".husky/**/*"
|
21
|
+
- ".bundle/**/*"
|
22
|
+
- ".circleci/**/*"
|
23
|
+
- ".semaphore/**/*"
|
24
|
+
- "**/log/**/*"
|
25
|
+
- "**/public/**/*"
|
26
|
+
- "**/tmp/**/*"
|
27
|
+
- "**/templates/**/*"
|
28
|
+
- "**/vendor/**/*"
|
29
|
+
- "node_modules/**/*"
|
30
|
+
- "bin/**/*"
|
31
|
+
- "config/webpack/**/*"
|
32
|
+
- "db/schema.rb"
|
33
|
+
- "*.gemspec"
|
34
|
+
- "*.yml"
|
35
|
+
|
36
|
+
# ====================================================================================================
|
37
|
+
# All access modifier related rules
|
38
|
+
# ====================================================================================================
|
39
|
+
# Add a newline before and after private keyword or other access modifiers
|
40
|
+
Layout/EmptyLinesAroundAccessModifier:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
# This cop checks for redundant access modifiers, including those with no code,
|
44
|
+
# those which are repeated, and leading `public` modifiers in a class or module body.
|
45
|
+
Lint/UselessAccessModifier:
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
# Checks for debug calls
|
49
|
+
Lint/Debugger:
|
50
|
+
Enabled: true
|
51
|
+
|
52
|
+
# # bad
|
53
|
+
# class Foo
|
54
|
+
# private def bar; end
|
55
|
+
# private def baz; end
|
56
|
+
# end
|
57
|
+
# # good
|
58
|
+
# class Foo
|
59
|
+
# private
|
60
|
+
#
|
61
|
+
# def bar; end
|
62
|
+
# def baz; end
|
63
|
+
# end
|
64
|
+
Style/AccessModifierDeclarations:
|
65
|
+
Enabled: true
|
66
|
+
|
67
|
+
# # bad
|
68
|
+
# class Plumbus
|
69
|
+
# private
|
70
|
+
# def smooth; end
|
71
|
+
# end
|
72
|
+
# # good
|
73
|
+
# class Plumbus
|
74
|
+
# private
|
75
|
+
# def smooth; end
|
76
|
+
# end
|
77
|
+
Layout/AccessModifierIndentation:
|
78
|
+
Enabled: true
|
79
|
+
|
80
|
+
# ====================================================================================================
|
81
|
+
# All comment related rules
|
82
|
+
# ====================================================================================================
|
83
|
+
# Align comments with method definitions.
|
84
|
+
Layout/CommentIndentation:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
# Requires an empty line after frozen_string_literal: true comment
|
88
|
+
Layout/EmptyLineAfterMagicComment:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
# frozen_string_literal: true magic comment is required on the top of files
|
92
|
+
Style/FrozenStringLiteralComment:
|
93
|
+
Enabled: true
|
94
|
+
EnforcedStyle: always
|
95
|
+
SafeAutoCorrect: true
|
96
|
+
|
97
|
+
# ====================================================================================================
|
98
|
+
# All Class related rules
|
99
|
+
# ====================================================================================================
|
100
|
+
# Helps in brining the include statements etc to top of the class definition
|
101
|
+
Layout/ClassStructure:
|
102
|
+
Enabled: true
|
103
|
+
Description: "Enforces a canonical order of definitions within a class body."
|
104
|
+
StyleGuide: "https://github.com/rubocop/rails-style-guide#macro-style-methods"
|
105
|
+
Categories:
|
106
|
+
module_inclusions:
|
107
|
+
- include
|
108
|
+
- prepend
|
109
|
+
- extend
|
110
|
+
third_party:
|
111
|
+
- neeto_sso_track_widget_tokens
|
112
|
+
- devise
|
113
|
+
- serialize
|
114
|
+
scopes:
|
115
|
+
- default_scope
|
116
|
+
- scope
|
117
|
+
attributes:
|
118
|
+
- attribute
|
119
|
+
- attr_reader
|
120
|
+
- attr_writer
|
121
|
+
- attr_accessor
|
122
|
+
enum:
|
123
|
+
- enum
|
124
|
+
store:
|
125
|
+
# https://api.rubyonrails.org/classes/ActiveRecord/Store.html
|
126
|
+
- store
|
127
|
+
other_macros:
|
128
|
+
- delegate
|
129
|
+
- delegate_missing_to
|
130
|
+
- accepts_nested_attributes_for
|
131
|
+
validations:
|
132
|
+
- validate
|
133
|
+
- validates
|
134
|
+
- validates_acceptance_of
|
135
|
+
- validates_associated
|
136
|
+
- validates_confirmation_of
|
137
|
+
- validates_exclusion_of
|
138
|
+
- validates_format_of
|
139
|
+
- validates_inclusion_of
|
140
|
+
- validates_length_of
|
141
|
+
- validates_numericality_of
|
142
|
+
- validates_presence_of
|
143
|
+
- validates_uniqueness_of
|
144
|
+
- validates_each
|
145
|
+
- validate_with
|
146
|
+
callbacks:
|
147
|
+
- before_validation
|
148
|
+
- after_validation
|
149
|
+
- before_save
|
150
|
+
- around_save
|
151
|
+
- after_save
|
152
|
+
- before_update
|
153
|
+
- around_update
|
154
|
+
- after_update
|
155
|
+
- before_create
|
156
|
+
- after_create
|
157
|
+
- before_destroy
|
158
|
+
- around_destroy
|
159
|
+
- after_destroy
|
160
|
+
- after_commit
|
161
|
+
- after_update_commit
|
162
|
+
- after_create_commit
|
163
|
+
ExpectedOrder:
|
164
|
+
- module_inclusions
|
165
|
+
- third_party
|
166
|
+
- scopes
|
167
|
+
- constants
|
168
|
+
- attributes
|
169
|
+
- enum
|
170
|
+
- store
|
171
|
+
- associations
|
172
|
+
- validations
|
173
|
+
- callbacks
|
174
|
+
- other_macros
|
175
|
+
- initializer
|
176
|
+
- public_class_methods
|
177
|
+
- public_methods
|
178
|
+
- protected_methods
|
179
|
+
- private_methods
|
180
|
+
|
181
|
+
# In a regular class definition, no empty lines around the body.
|
182
|
+
# bad
|
183
|
+
# class Foo
|
184
|
+
#
|
185
|
+
# def bar
|
186
|
+
# # ...
|
187
|
+
# end
|
188
|
+
#
|
189
|
+
# end
|
190
|
+
#
|
191
|
+
# good
|
192
|
+
# class Foo
|
193
|
+
# def bar
|
194
|
+
# # ...
|
195
|
+
# end
|
196
|
+
# end
|
197
|
+
Layout/EmptyLinesAroundClassBody:
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
# ====================================================================================================
|
201
|
+
# All Method related rules
|
202
|
+
# ====================================================================================================
|
203
|
+
# This cop checks whether class/module/method definitions are separated by one or more empty lines.
|
204
|
+
Layout/EmptyLineBetweenDefs:
|
205
|
+
Enabled: true
|
206
|
+
|
207
|
+
# This cop checks the . position in multi-line method calls.
|
208
|
+
# The dot should be leading rather than trailing.
|
209
|
+
Layout/DotPosition:
|
210
|
+
Enabled: true
|
211
|
+
EnforcedStyle: leading
|
212
|
+
|
213
|
+
# No space in method name and the arguments
|
214
|
+
Lint/ParenthesesAsGroupedExpression:
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg,
|
218
|
+
# when a boolean operator, && or ||, is chained along with this method/argument
|
219
|
+
Lint/RequireParentheses:
|
220
|
+
Enabled: true
|
221
|
+
|
222
|
+
# avoid redundant `return` expressions
|
223
|
+
Style/RedundantReturn:
|
224
|
+
Enabled: true
|
225
|
+
AllowMultipleReturnValues: true
|
226
|
+
|
227
|
+
# Ensures that exactly one space is used between a method name and the
|
228
|
+
# first argument for method calls without parentheses
|
229
|
+
Layout/SpaceBeforeFirstArg:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
# Methods that doesn't take any parameters shouldn't have paranthesis in its definition
|
233
|
+
Style/DefWithParentheses:
|
234
|
+
Enabled: true
|
235
|
+
|
236
|
+
# Defining a method with parameters needs parentheses.
|
237
|
+
Style/MethodDefParentheses:
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
# # bad
|
241
|
+
# def some_method(arg1=:default, arg2=nil, arg3=[])
|
242
|
+
# # good
|
243
|
+
# def some_method(arg1 = :default, arg2 = nil, arg3 = [])
|
244
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
245
|
+
Enabled: true
|
246
|
+
|
247
|
+
# This cop checks for a line break before the first argument in a multi-line method call.
|
248
|
+
# # bad
|
249
|
+
# method(foo, bar,
|
250
|
+
# baz)
|
251
|
+
# # good
|
252
|
+
# method(
|
253
|
+
# foo, bar,
|
254
|
+
# baz)
|
255
|
+
Layout/FirstMethodArgumentLineBreak:
|
256
|
+
Enabled: true
|
257
|
+
|
258
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
259
|
+
# extra level of indentation.
|
260
|
+
Layout/IndentationConsistency:
|
261
|
+
Enabled: true
|
262
|
+
EnforcedStyle: indented_internal_methods
|
263
|
+
|
264
|
+
# This cop checks the indentation of the method name part in method calls that span more than one line.
|
265
|
+
# # bad
|
266
|
+
# while myvariable
|
267
|
+
# .instance_method_call1
|
268
|
+
# .instance_method_call2
|
269
|
+
# # do something
|
270
|
+
# end
|
271
|
+
#
|
272
|
+
# # good
|
273
|
+
# while myvariable
|
274
|
+
# .instance_method_call1
|
275
|
+
# .instance_method_call2
|
276
|
+
#
|
277
|
+
# # do something
|
278
|
+
# end
|
279
|
+
Layout/MultilineMethodCallIndentation:
|
280
|
+
Enabled: true
|
281
|
+
EnforcedStyle: indented
|
282
|
+
|
283
|
+
# This cop ensures the indentation of the first parameter in a method definition.
|
284
|
+
Layout/FirstParameterIndentation:
|
285
|
+
Enabled: true
|
286
|
+
EnforcedStyle: consistent
|
287
|
+
|
288
|
+
# When we write method arguments in next line, indent it.
|
289
|
+
Layout/FirstArgumentIndentation:
|
290
|
+
Enabled: true
|
291
|
+
EnforcedStyle: consistent
|
292
|
+
|
293
|
+
# Alignment of args from second argument onwards should be indented
|
294
|
+
# # bad
|
295
|
+
# json.extract! comment,
|
296
|
+
# :id,
|
297
|
+
# :content,
|
298
|
+
# :created_at
|
299
|
+
# # good
|
300
|
+
# json.extract! comment,
|
301
|
+
# :id,
|
302
|
+
# :content,
|
303
|
+
# :created_at
|
304
|
+
Layout/ArgumentAlignment:
|
305
|
+
Enabled: true
|
306
|
+
EnforcedStyle: with_fixed_indentation
|
307
|
+
|
308
|
+
# In a regular method definition, no empty lines around the body.
|
309
|
+
Layout/EmptyLinesAroundMethodBody:
|
310
|
+
Enabled: true
|
311
|
+
|
312
|
+
# ====================================================================================================
|
313
|
+
# All Hash related rules
|
314
|
+
# ====================================================================================================
|
315
|
+
# EnforcedColonStyle: key
|
316
|
+
# # bad
|
317
|
+
# {
|
318
|
+
# foo: bar,
|
319
|
+
# ba: baz
|
320
|
+
# }
|
321
|
+
# {
|
322
|
+
# foo: bar,
|
323
|
+
# ba: baz
|
324
|
+
# }
|
325
|
+
# # good
|
326
|
+
# {
|
327
|
+
# foo: bar,
|
328
|
+
# ba: baz
|
329
|
+
# }
|
330
|
+
# EnforcedLastArgumentHashStyle: always_inspect
|
331
|
+
# # bad
|
332
|
+
# do_something({foo: 1,
|
333
|
+
# bar: 2})
|
334
|
+
# # good
|
335
|
+
# do_something(foo: 1,
|
336
|
+
# bar: 2)
|
337
|
+
Layout/HashAlignment:
|
338
|
+
Enabled: true
|
339
|
+
EnforcedColonStyle: key
|
340
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
341
|
+
|
342
|
+
# This cop checks for a line break before the first element in a multi-line hash.
|
343
|
+
# # bad
|
344
|
+
# { a: 1,
|
345
|
+
# b: 2}
|
346
|
+
# # good
|
347
|
+
# {
|
348
|
+
# a: 1,
|
349
|
+
# b: 2 }
|
350
|
+
Layout/FirstHashElementLineBreak:
|
351
|
+
Enabled: true
|
352
|
+
|
353
|
+
# When using the `new_line` style:
|
354
|
+
# The closing brace of a multi-line hash literal must be on
|
355
|
+
# the line after the last element of the hash.
|
356
|
+
Layout/MultilineHashBraceLayout:
|
357
|
+
Enabled: true
|
358
|
+
EnforcedStyle: new_line
|
359
|
+
|
360
|
+
# # bad
|
361
|
+
# hash = {
|
362
|
+
# key: :value
|
363
|
+
# }
|
364
|
+
# but_in_a_method_call({
|
365
|
+
# its_like: :this
|
366
|
+
# })
|
367
|
+
# # good
|
368
|
+
# hash = {
|
369
|
+
# key: :value
|
370
|
+
# }
|
371
|
+
# and_in_a_method_call({
|
372
|
+
# no: :difference
|
373
|
+
# })
|
374
|
+
Layout/FirstHashElementIndentation:
|
375
|
+
Enabled: true
|
376
|
+
EnforcedStyle: consistent
|
377
|
+
|
378
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
379
|
+
Style/HashSyntax:
|
380
|
+
Enabled: true
|
381
|
+
|
382
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
383
|
+
Layout/SpaceInsideHashLiteralBraces:
|
384
|
+
Enabled: true
|
385
|
+
|
386
|
+
# `no_comma`: Does not requires a comma after the last item in a hash
|
387
|
+
Style/TrailingCommaInHashLiteral:
|
388
|
+
Enabled: true
|
389
|
+
|
390
|
+
# ====================================================================================================
|
391
|
+
# All misc whitespace related rules
|
392
|
+
# ====================================================================================================
|
393
|
+
# bad
|
394
|
+
# def f(a:, b:2); {a:3}; end
|
395
|
+
# good
|
396
|
+
# def f(a:, b: 2); {a: 3}; end
|
397
|
+
Layout/SpaceAfterColon:
|
398
|
+
Enabled: true
|
399
|
+
|
400
|
+
# Ensures comma (,) is followed by some kind of space.
|
401
|
+
Layout/SpaceAfterComma:
|
402
|
+
Enabled: true
|
403
|
+
|
404
|
+
# Every ruby keyword should be surrounded by spaces
|
405
|
+
Layout/SpaceAroundKeyword:
|
406
|
+
Enabled: true
|
407
|
+
|
408
|
+
# Requires proper spacing around ruby operator symbols.
|
409
|
+
Layout/SpaceAroundOperators:
|
410
|
+
Enabled: true
|
411
|
+
## Allows multiple spaces for keeping alignment
|
412
|
+
# {
|
413
|
+
# 1 => 2,
|
414
|
+
# 11 => 3
|
415
|
+
# }
|
416
|
+
AllowForAlignment: true
|
417
|
+
|
418
|
+
# Ensures comma symbol is not preceded by space
|
419
|
+
Layout/SpaceBeforeComma:
|
420
|
+
Enabled: true
|
421
|
+
|
422
|
+
# Use `foo {}` not `foo{}`.
|
423
|
+
Layout/SpaceBeforeBlockBraces:
|
424
|
+
Enabled: true
|
425
|
+
|
426
|
+
# Use `foo { bar }` not `foo {bar}`.
|
427
|
+
Layout/SpaceInsideBlockBraces:
|
428
|
+
Enabled: true
|
429
|
+
|
430
|
+
# enforces that parentheses do not have spaces
|
431
|
+
Layout/SpaceInsideParens:
|
432
|
+
Enabled: true
|
433
|
+
|
434
|
+
# No trailing whitespace.
|
435
|
+
Layout/TrailingWhitespace:
|
436
|
+
Enabled: true
|
437
|
+
|
438
|
+
# Require a space after comment
|
439
|
+
Layout/LeadingCommentSpace:
|
440
|
+
Enabled: true
|
441
|
+
|
442
|
+
# ====================================================================================================
|
443
|
+
# All empty lines related rules
|
444
|
+
# ====================================================================================================
|
445
|
+
# The `lf` style means that LF (Line Feed) is enforced on
|
446
|
+
# all platforms.
|
447
|
+
# # bad
|
448
|
+
# puts 'Hello' # Return character is CR+LF on all platfoms.
|
449
|
+
#
|
450
|
+
# # good
|
451
|
+
# puts 'Hello' # Return character is LF on all platfoms.
|
452
|
+
Layout/EndOfLine:
|
453
|
+
Enabled: true
|
454
|
+
EnforcedStyle: lf
|
455
|
+
|
456
|
+
# In a regular module definition, no empty lines around the body.
|
457
|
+
Layout/EmptyLinesAroundModuleBody:
|
458
|
+
Enabled: true
|
459
|
+
|
460
|
+
# # bad
|
461
|
+
# def foo
|
462
|
+
# return if need_return?
|
463
|
+
# bar
|
464
|
+
# end
|
465
|
+
#
|
466
|
+
# # good
|
467
|
+
# def foo
|
468
|
+
# return if need_return?
|
469
|
+
#
|
470
|
+
# bar
|
471
|
+
# end
|
472
|
+
Layout/EmptyLineAfterGuardClause:
|
473
|
+
Enabled: true
|
474
|
+
|
475
|
+
# Requires a single final blank line to the file.
|
476
|
+
# `final_blank_line` ensures a blank line before EOF.
|
477
|
+
# # bad
|
478
|
+
# class Foo; end # EOF
|
479
|
+
#
|
480
|
+
# # good
|
481
|
+
# class Foo; end
|
482
|
+
#
|
483
|
+
# # EOF
|
484
|
+
Layout/TrailingEmptyLines:
|
485
|
+
Enabled: true
|
486
|
+
|
487
|
+
# This cop checks for two or more consecutive blank lines.
|
488
|
+
# This rule is not same as TrailingEmptyLines, because:
|
489
|
+
# 1) It looks for empty lines throughout the file. Not just the end.
|
490
|
+
# # bad - It has two empty lines.
|
491
|
+
# some_method
|
492
|
+
# # one empty line
|
493
|
+
# # two empty lines
|
494
|
+
# some_method
|
495
|
+
#
|
496
|
+
# # good
|
497
|
+
# some_method
|
498
|
+
# # one empty line
|
499
|
+
# some_method
|
500
|
+
Layout/EmptyLines:
|
501
|
+
Enabled: true
|
502
|
+
|
503
|
+
# ====================================================================================================
|
504
|
+
# All naming convetion related rules for variables
|
505
|
+
# ====================================================================================================
|
506
|
+
# Refer: https://www.bigbinary.com/learn-rubyonrails-book/n+1-queries-and-memoization#bb-generated-p-id-44
|
507
|
+
# Sadly this cannot be auto-corrected.
|
508
|
+
Naming/MemoizedInstanceVariableName:
|
509
|
+
Enabled: true
|
510
|
+
EnforcedStyleForLeadingUnderscores: required
|
511
|
+
Severity: info
|
512
|
+
|
513
|
+
# ====================================================================================================
|
514
|
+
# All misc rules that don't fall into other categories
|
515
|
+
# ====================================================================================================
|
516
|
+
# Prefer &&/|| over and/or.
|
517
|
+
Style/AndOr:
|
518
|
+
Enabled: true
|
519
|
+
|
520
|
+
# Align `when` with `case`.
|
521
|
+
Layout/CaseIndentation:
|
522
|
+
Enabled: true
|
523
|
+
|
524
|
+
Layout/LineLength:
|
525
|
+
Enabled: true
|
526
|
+
Max: 120
|
527
|
+
AllowedPatterns: [
|
528
|
+
'^\s*#', # line that begins with comment
|
529
|
+
'^\s*"', # line that begins with double quote (long string literal)
|
530
|
+
'^\s*%{', # line that begins with percent literals (long string literal)
|
531
|
+
"^\\s*'", # line that begins with single quote (long string literal)
|
532
|
+
'"$', # line that ends with double quote (long string variable assignment)
|
533
|
+
"'$", # line that ends with single quote (long string variable assignment)
|
534
|
+
'}$', # line that ends with percent literals (long regex variable assignment)
|
535
|
+
'\/$', # line that ends with slash (long regex variable assignment)
|
536
|
+
]
|
537
|
+
|
538
|
+
# Indent using two spaces
|
539
|
+
Layout/IndentationWidth:
|
540
|
+
Enabled: true
|
541
|
+
Width: 2
|
542
|
+
|
543
|
+
# Use spaces for indentation. Not tabs
|
544
|
+
Layout/IndentationStyle:
|
545
|
+
Enabled: true
|
546
|
+
EnforcedStyle: spaces
|
547
|
+
|
548
|
+
# Remove extra/unnecessary whitespace which's used for alignment.
|
549
|
+
# A developer shouldn't waste time indenting code with whitespaces.
|
550
|
+
Layout/ExtraSpacing:
|
551
|
+
Enabled: true
|
552
|
+
AllowForAlignment: false
|
553
|
+
|
554
|
+
# Helps in removing unwanted parentheses.
|
555
|
+
# # bad
|
556
|
+
# x += 1 while (x < 10)
|
557
|
+
# foo unless (bar || baz)
|
558
|
+
#
|
559
|
+
# if (x > 10)
|
560
|
+
# elsif (x < 3)
|
561
|
+
# end
|
562
|
+
#
|
563
|
+
# # good
|
564
|
+
# x += 1 while x < 10
|
565
|
+
# foo unless bar || baz
|
566
|
+
#
|
567
|
+
# if x > 10
|
568
|
+
# elsif x < 3
|
569
|
+
# end
|
570
|
+
Style/ParenthesesAroundCondition:
|
571
|
+
Enabled: true
|
572
|
+
|
573
|
+
# Enforce string literals to use double quotes everywhere
|
574
|
+
Style/StringLiterals:
|
575
|
+
Enabled: true
|
576
|
+
EnforcedStyle: double_quotes
|
577
|
+
|
578
|
+
# Use quotes for string literals when they are enough.
|
579
|
+
Style/RedundantPercentQ:
|
580
|
+
Enabled: true
|
581
|
+
|
582
|
+
# Align `end` with the matching keyword or starting expression except for
|
583
|
+
# assignments, where it should be aligned with the LHS.
|
584
|
+
Layout/EndAlignment:
|
585
|
+
Enabled: true
|
586
|
+
EnforcedStyleAlignWith: variable
|
587
|
+
|
588
|
+
# avoid lines terminated with a semicolon.
|
589
|
+
Style/Semicolon:
|
590
|
+
Enabled: true
|
591
|
+
# disallow multiple statements in a line
|
592
|
+
AllowAsExpressionSeparator: false
|
593
|
+
|
594
|
+
# Corrects usage of :true/:false to true/false
|
595
|
+
Lint/BooleanSymbol:
|
596
|
+
Enabled: true
|
597
|
+
|
598
|
+
# ====================================================================================================
|
599
|
+
# All flow(if/while/for/until) statements related
|
600
|
+
# ====================================================================================================
|
601
|
+
Lint/AssignmentInCondition:
|
602
|
+
Enabled: true
|
603
|
+
AllowSafeAssignment: true
|
604
|
+
|
605
|
+
# ====================================================================================================
|
606
|
+
# All Bundler cop rules
|
607
|
+
# ====================================================================================================
|
608
|
+
Bundler/OrderedGems:
|
609
|
+
Enabled: true
|
610
|
+
TreatCommentsAsGroupSeparators: true
|
611
|
+
|
612
|
+
# ====================================================================================================
|
613
|
+
# All Rails cop rules
|
614
|
+
# ====================================================================================================
|
615
|
+
# Enabled Rails cops for the command for VSCode linting and while running rubocop -a
|
616
|
+
Rails:
|
617
|
+
Enabled: false
|
618
|
+
|
619
|
+
# Correct usage of Date methods in Rails. Use Time.zone.today over Date.today
|
620
|
+
Rails/Date:
|
621
|
+
Enabled: true
|
622
|
+
|
623
|
+
# Correct usage of TimeZone methods in Rails
|
624
|
+
Rails/TimeZone:
|
625
|
+
Enabled: true
|
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/lib/neeto_commons_backend/common_files/.semaphore/commands/run_eslint_on_modified_files.sh
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
checkout
|
2
|
+
git fetch --unshallow 2> /dev/null
|
3
|
+
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
|
4
|
+
git fetch origin main
|
5
|
+
git diff-tree --diff-filter=a -r --no-commit-id --name-only HEAD remotes/origin/main | grep --color=none -i -e "\.js$" -e "\.jsx$"| awk '!/.eslintrc.js/ {print}' | xargs npx eslint --no-error-on-unmatched-pattern
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"[ruby]": {
|
3
|
+
"editor.autoClosingBrackets": "beforeWhitespace",
|
4
|
+
"editor.formatOnSave": true,
|
5
|
+
"editor.defaultFormatter": "rebornix.ruby"
|
6
|
+
},
|
7
|
+
"files.trimTrailingWhitespace": true,
|
8
|
+
"files.trimFinalNewlines": true,
|
9
|
+
"editor.formatOnSave": true,
|
10
|
+
"yaml.format.enable": true,
|
11
|
+
"ruby.useBundler": true, //run non-lint commands with bundle exec
|
12
|
+
"ruby.useLanguageServer": true, // use the internal language server (see below)
|
13
|
+
"ruby.lint": {
|
14
|
+
"rubocop": {
|
15
|
+
"useBundler": true,
|
16
|
+
"lint": true, // enable lint cops
|
17
|
+
"rails": true // requires rubocop-rails gem for RuboCop >= 0.72.0
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"ruby.format": "rubocop",
|
21
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
FROM neeto/ruby-3.2.2:node18.12
|
2
|
+
|
3
|
+
ENV APP_PATH /var/app
|
4
|
+
ENV BUNDLE_VERSION 2.2.32
|
5
|
+
ENV RAILS_PORT 3000
|
6
|
+
ENV LAUNCHY_DRY_RUN true
|
7
|
+
ENV BROWSER /dev/null
|
8
|
+
ENV BUNDLE_PATH /usr/local/bundle
|
9
|
+
ENV GEM_PATH /usr/local/bundle
|
10
|
+
ENV GEM_HOME /usr/local/bundle
|
11
|
+
|
12
|
+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
13
|
+
|
14
|
+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
15
|
+
|
16
|
+
# install dependencies for M1 Macs
|
17
|
+
RUN apk add --update --no-cache curl py-pip python3
|
18
|
+
|
19
|
+
# install dependencies for application
|
20
|
+
RUN apk -U add --no-cache \
|
21
|
+
make \
|
22
|
+
gcc \
|
23
|
+
build-base \
|
24
|
+
git \
|
25
|
+
postgresql-dev \
|
26
|
+
postgresql-client \
|
27
|
+
libxml2-dev \
|
28
|
+
libxslt-dev \
|
29
|
+
nodejs-current \
|
30
|
+
npm \
|
31
|
+
yarn \
|
32
|
+
tzdata \
|
33
|
+
&& rm -rf /var/cache/apk/* \
|
34
|
+
&& mkdir -p $APP_PATH
|
35
|
+
|
36
|
+
|
37
|
+
RUN gem install bundler --version "$BUNDLE_VERSION"
|
38
|
+
|
39
|
+
# navigate to app directory
|
40
|
+
WORKDIR $APP_PATH
|
41
|
+
|
42
|
+
COPY Gemfile Gemfile.common.rb Gemfile.lock ./
|
43
|
+
COPY package.json yarn.lock ./
|
44
|
+
|
45
|
+
RUN bundle check || bundle install --jobs=8
|
46
|
+
RUN yarn install --check-files
|
47
|
+
|
48
|
+
COPY . .
|
49
|
+
|
50
|
+
EXPOSE $RAILS_PORT
|