Skip to content

Commit

Permalink
ruboxcop
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Oct 7, 2024
1 parent 08273c5 commit 5eae938
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 106 deletions.
13 changes: 3 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
inherit_from:
inherit_from:
- https://raw.githubusercontent.com/decidim/decidim/release/0.28-stable/.rubocop.yml

Rails/BulkChangeTable:
Enabled: false

Rails/ThreeStateBooleanColumn:
Exclude:
- "db/migrate/**.rb"

Rails/DeprecatedActiveModelErrorsMethods:
AllCops:
Exclude:
- "app/jobs/decidim/civicrm/event_sync_job.rb"
- "spec/decidim_dummy_app*/**/*"
17 changes: 8 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@ gem "decidim", DECIDIM_VERSION
gem "decidim-civicrm", path: "."

gem "bootsnap", "~> 1.4"
gem "faker", "~> 3.2"
gem "rspec", "~> 3.0"
gem "puma", ">= 6.3.1"

group :development, :test do
gem "byebug", "~> 11.0", platform: :mri

gem "decidim-dev", DECIDIM_VERSION

gem "brakeman", "~> 5.4"
gem "net-imap", "~> 0.2.3"
gem "net-pop", "~> 0.1.1"
gem "net-smtp", "~> 0.3.1"
end

group :development do
gem "letter_opener_web"
gem "letter_opener_web", "~> 2.0"
gem "listen", "~> 3.1"
gem "rubocop-faker", "~> 1.1"
gem "spring", "~> 2.0"
gem "spring-watcher-listen", "~> 2.0"
gem "web-console"
end

group :test do
gem "codecov", require: false
gem "web-console", "~> 4.2"
end
99 changes: 43 additions & 56 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ GEM
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (5.4.1)
browser (2.7.1)
builder (3.3.0)
bullet (7.2.0)
Expand Down Expand Up @@ -129,9 +130,6 @@ GEM
charlock_holmes (0.7.9)
childprocess (5.1.0)
logger (~> 1.5)
codecov (0.2.12)
json
simplecov
commonmarker (0.23.10)
concurrent-ruby (1.3.4)
crack (1.0.0)
Expand All @@ -141,7 +139,6 @@ GEM
css_parser (1.19.0)
addressable
csv (3.3.0)
date (3.3.4)
date_validator (0.12.0)
activemodel (>= 3)
activesupport (>= 3)
Expand Down Expand Up @@ -332,6 +329,7 @@ GEM
devise (>= 4.6)
diff-lcs (1.5.1)
diffy (3.4.2)
digest (3.1.1)
doc2text (0.4.7)
nokogiri (>= 1.13.2, < 1.17.0)
rubyzip (~> 2.3.0)
Expand All @@ -350,7 +348,7 @@ GEM
temple
erubi (1.13.0)
escape_utils (1.2.2)
excon (0.111.0)
excon (0.112.0)
extended-markdown-filter (0.7.0)
html-pipeline (~> 2.9)
factory_bot (6.5.0)
Expand All @@ -360,8 +358,9 @@ GEM
railties (>= 5.0.0)
faker (3.4.2)
i18n (>= 1.8.11, < 2)
faraday (2.11.0)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
logger
faraday-net_http (3.3.0)
net-http
Expand Down Expand Up @@ -406,7 +405,7 @@ GEM
activesupport (>= 2)
nokogiri (>= 1.4)
htmlentities (4.3.4)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
activesupport (>= 4.0.2)
Expand All @@ -429,7 +428,7 @@ GEM
rails (>= 3.2.0)
io-console (0.7.2)
json (2.7.2)
jwt (2.8.2)
jwt (2.9.3)
base64
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand All @@ -448,15 +447,15 @@ GEM
childprocess (~> 5.0)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
actionmailer (>= 6.1)
letter_opener (~> 1.9)
railties (>= 6.1)
letter_opener_web (2.0.0)
actionmailer (>= 5.2)
letter_opener (~> 1.7)
railties (>= 5.2)
rexml
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.0)
logger (1.6.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -468,36 +467,29 @@ GEM
marcel (1.0.4)
matrix (0.4.2)
method_source (1.1.0)
mime-types (3.5.2)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0820)
mime-types-data (3.2024.1001)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.25.1)
msgpack (1.7.2)
multi_xml (0.6.0)
msgpack (1.7.3)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-http (0.4.1)
uri
net-imap (0.4.15)
date
net-imap (0.2.4)
digest
net-protocol
strscan
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.3.4)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86-linux)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
Expand All @@ -519,8 +511,8 @@ GEM
rack-protection
omniauth-facebook (5.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-google-oauth2 (1.1.2)
jwt (>= 2.0)
omniauth-google-oauth2 (1.2.0)
jwt (>= 2.9)
oauth2 (~> 2.0)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8)
Expand All @@ -546,7 +538,7 @@ GEM
parallel (1.26.3)
parallel_tests (4.7.2)
parallel
parser (3.3.4.2)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.4.6)
Expand Down Expand Up @@ -634,24 +626,23 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.6)
strscan
rexml (3.3.8)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-cells (0.3.9)
cells (>= 4.0.0, < 6.0.0)
rspec-rails (>= 3.0.0, < 6.2.0)
rspec-core (3.13.0)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.2)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-html-matchers (0.10.0)
nokogiri (~> 1)
rspec (>= 3.0.0.a)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.5)
Expand All @@ -677,7 +668,7 @@ GEM
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand All @@ -690,14 +681,9 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.31.0)
rubocop (~> 1.40)
rubocop-rspec (2.20.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.29.0)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
ruby-vips (2.2.2)
ffi (~> 1.12)
Expand Down Expand Up @@ -730,7 +716,7 @@ GEM
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
snaky_hash (2.0.1)
Expand All @@ -753,13 +739,13 @@ GEM
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
thor (1.3.2)
tilt (2.4.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uniform_notifier (1.16.0)
uri (0.13.1)
valid_email2 (4.0.6)
Expand Down Expand Up @@ -799,7 +785,7 @@ GEM
wkhtmltopdf-binary (0.12.6.8)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.17)
zeitwerk (2.6.18)

PLATFORMS
aarch64-linux
Expand All @@ -818,22 +804,23 @@ PLATFORMS

DEPENDENCIES
bootsnap (~> 1.4)
brakeman (~> 5.4)
byebug (~> 11.0)
codecov
decidim (= 0.28.3)
decidim-civicrm!
decidim-dev (= 0.28.3)
faker (~> 3.2)
letter_opener_web
letter_opener_web (~> 2.0)
listen (~> 3.1)
rspec (~> 3.0)
rubocop-faker (~> 1.1)
net-imap (~> 0.2.3)
net-pop (~> 0.1.1)
net-smtp (~> 0.3.1)
puma (>= 6.3.1)
spring (~> 2.0)
spring-watcher-listen (~> 2.0)
web-console
web-console (~> 4.2)

RUBY VERSION
ruby 3.1.6p260

BUNDLED WITH
2.5.10
2.5.20
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call
verify_oauth_signature!

begin
if @identity = existing_identity
if (@identity = existing_identity)
@user = existing_identity.user
verify_user_confirmed(@user)

Expand Down
2 changes: 1 addition & 1 deletion app/jobs/decidim/civicrm/event_sync_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def perform(event_name, data)
return unless parser

unless parser.valid?
Rails.logger.error "Parser invalid. Not publishing event ##{data[:resource]&.id} [#{event_name}] to CiviCRM API: #{parser.errors.values}"
Rails.logger.error "Parser invalid. Not publishing event ##{data[:resource]&.id} [#{event_name}] to CiviCRM API: #{parser.error_messages}"
return
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def change
t.integer :civicrm_uid
t.jsonb :extra, default: {}

t.boolean :marked_for_deletion, default: false
t.boolean :marked_for_deletion, default: false, null: false

t.timestamps

Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20210908095921_create_decidim_civicrm_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def change
t.string :description
t.jsonb :extra, default: {}

t.boolean :marked_for_deletion, default: false
t.boolean :auto_sync_members, default: false
t.boolean :marked_for_deletion, default: false, null: false
t.boolean :auto_sync_members, default: false, null: false

t.index %w(decidim_organization_id civicrm_group_id), name: "index_unique_civicrm_group_and_organization", unique: true
t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def change
t.references :group, null: false, foreign_key: { to_table: :decidim_civicrm_groups }, index: { name: :index_decidim_civicrm_group_memberships_on_group_id }
t.references :contact, foreign_key: { to_table: :decidim_civicrm_contacts }, index: { name: :index_decidim_civicrm_group_memberships_on_contact_id }
t.integer :civicrm_contact_id, index: true
t.boolean :marked_for_deletion, default: false
t.boolean :marked_for_deletion, default: false, null: false
t.jsonb :extra, default: {}

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def change
t.integer :civicrm_membership_type_id, null: false
t.string :name, null: false

t.boolean :marked_for_deletion, default: false
t.boolean :marked_for_deletion, default: false, null: false

t.timestamps
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def change
t.jsonb :extra, default: {}
t.jsonb :data

t.boolean :marked_for_deletion, default: false
t.boolean :marked_for_deletion, default: false, null: false

t.boolean :redirect_active, null: false, default: false
t.string :redirect_url
Expand Down
Loading

0 comments on commit 5eae938

Please sign in to comment.