Skip to content

Commit 76917d3

Browse files
authored
set up CircleCI (#594)
1 parent 7eb94d0 commit 76917d3

File tree

2 files changed

+198
-17
lines changed

2 files changed

+198
-17
lines changed

.circleci/config.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
version: 2.1
2+
3+
orbs:
4+
browser-tools: circleci/[email protected]
5+
node: circleci/[email protected]
6+
7+
jobs:
8+
build:
9+
parallelism: 1
10+
docker:
11+
- image: cimg/ruby:2.7.5-browsers
12+
environment:
13+
BUNDLE_JOBS: 3
14+
BUNDLE_RETRY: 3
15+
BUNDLE_PATH: vendor/bundle
16+
PGHOST: 127.0.0.1
17+
PGUSER: postgres
18+
RAILS_ENV: test
19+
- image: cimg/postgres:10.18
20+
environment:
21+
POSTGRES_USER: postgres
22+
POSTGRES_DB: app_test
23+
POSTGRES_PASSWORD:
24+
25+
working_directory: ~/app
26+
27+
steps:
28+
- checkout
29+
- browser-tools/install-browser-tools
30+
31+
# - node/install:
32+
# node-version: 16.13.1
33+
# install-yarn: true
34+
35+
- run:
36+
name: Which bundler?
37+
command: bundle -v
38+
39+
# https://circleci.com/docs/2.0/caching/
40+
- restore_cache:
41+
keys:
42+
- bundle-{{ checksum "Gemfile.lock" }}
43+
- bundle-
44+
45+
- run: # Install Ruby dependencies
46+
name: Bundle Install
47+
command: bundle check || bundle install
48+
49+
# - run:
50+
# name: Bundler Audit
51+
# command: bundle exec bundle audit
52+
53+
- save_cache:
54+
key: bundle-{{ checksum "Gemfile.lock" }}
55+
paths:
56+
- vendor/bundle
57+
58+
# - restore_cache:
59+
# keys:
60+
# - yarn-{{ checksum "yarn.lock" }}
61+
# - yarn-
62+
63+
# - run:
64+
# name: Yarn Install
65+
# command: yarn install --cache-folder ~/.cache/yarn
66+
67+
# - save_cache:
68+
# key: yarn-{{ checksum "yarn.lock" }}
69+
# paths:
70+
# - ~/.cache/yarn
71+
72+
- run:
73+
name: Wait for DB
74+
command: dockerize -wait tcp://localhost:5432 -timeout 1m
75+
76+
- run:
77+
name: Database setup
78+
command: bundle exec rake db:create db:schema:load --trace
79+
80+
# - run:
81+
# name: Brakeman
82+
# command: bundle exec brakeman
83+
84+
# - run:
85+
# name: Stylelint
86+
# command: yarn stylelint
87+
88+
- run:
89+
name: Rubocop
90+
command: bundle exec rubocop
91+
92+
- run:
93+
name: Run rspec in parallel
94+
command: |
95+
bundle exec rspec
96+
# bundle exec rspec --profile 10 \
97+
# --format RspecJunitFormatter \
98+
# --out test_results/rspec.xml \
99+
# --format progress \
100+
# $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
101+
102+
- store_test_results: # https://circleci.com/docs/2.0/collect-test-data/
103+
path: test_results

.rubocop_todo.yml

Lines changed: 95 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2021-03-28 01:11:19 UTC using RuboCop version 1.10.0.
2+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
3+
# on 2022-01-15 20:13:59 UTC using RuboCop version 1.23.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 41
9+
# Offense count: 40
1010
# Configuration parameters: Include, IgnoredGems, OnlyFor.
1111
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
1212
Bundler/GemComment:
1313
Exclude:
1414
- 'Gemfile'
1515

16+
# Offense count: 40
17+
# Configuration parameters: Include, AllowedGems.
18+
# SupportedStyles: required, forbidden
19+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
20+
Bundler/GemVersion:
21+
EnforcedStyle: forbidden
22+
1623
# Offense count: 9
1724
# Cop supports --auto-correct.
1825
Layout/FirstMethodArgumentLineBreak:
@@ -24,6 +31,14 @@ Layout/FirstMethodArgumentLineBreak:
2431
- 'spec/repositories/story_repository_spec.rb'
2532
- 'spec/tasks/fetch_feed_spec.rb'
2633

34+
# Offense count: 1
35+
# Cop supports --auto-correct.
36+
# Configuration parameters: EnforcedStyle, IndentationWidth.
37+
# SupportedStyles: aligned, indented
38+
Layout/LineEndStringConcatenationIndentation:
39+
Exclude:
40+
- 'spec/helpers/url_helpers_spec.rb'
41+
2742
# Offense count: 4
2843
# Cop supports --auto-correct.
2944
# Configuration parameters: EnforcedStyle.
@@ -44,7 +59,29 @@ Layout/MultilineMethodArgumentLineBreaks:
4459
- 'spec/controllers/sessions_controller_spec.rb'
4560
- 'spec/javascript/test_controller.rb'
4661

47-
# Offense count: 744
62+
# Offense count: 40
63+
# Cop supports --auto-correct.
64+
# Configuration parameters: InspectBlocks.
65+
Layout/RedundantLineBreak:
66+
Enabled: false
67+
68+
# Offense count: 8
69+
# Cop supports --auto-correct.
70+
Layout/SingleLineBlockChain:
71+
Exclude:
72+
- 'app/tasks/change_password.rb'
73+
- 'spec/integration/feed_importing_spec.rb'
74+
- 'spec/models/story_spec.rb'
75+
- 'spec/tasks/fetch_feeds_spec.rb'
76+
77+
# Offense count: 2
78+
# Cop supports --auto-correct.
79+
Lint/AmbiguousOperatorPrecedence:
80+
Exclude:
81+
- 'spec/factories/feed_factory.rb'
82+
- 'spec/factories/group_factory.rb'
83+
84+
# Offense count: 754
4885
# Configuration parameters: Only, Ignore.
4986
Lint/ConstantResolution:
5087
Enabled: false
@@ -58,6 +95,7 @@ Lint/EmptyBlock:
5895
# Offense count: 13
5996
# Cop supports --auto-correct.
6097
# Configuration parameters: IgnoredMethods, IgnoredClasses.
98+
# IgnoredMethods: ago, from_now, second, seconds, minute, minutes, hour, hours, day, days, week, weeks, fortnight, fortnights, in_milliseconds
6199
# IgnoredClasses: Time, DateTime
62100
Lint/NumberConversion:
63101
Exclude:
@@ -132,7 +170,7 @@ RSpec/DescribeClass:
132170
- 'spec/integration/feed_importing_spec.rb'
133171
- 'spec/utils/i18n_support_spec.rb'
134172

135-
# Offense count: 132
173+
# Offense count: 141
136174
# Cop supports --auto-correct.
137175
# Configuration parameters: SkipBlocks, EnforcedStyle.
138176
# SupportedStyles: described_class, explicit
@@ -158,9 +196,9 @@ RSpec/EmptyLineAfterHook:
158196
- 'spec/controllers/stories_controller_spec.rb'
159197

160198
# Offense count: 50
161-
# Configuration parameters: Max.
199+
# Configuration parameters: CountAsOne.
162200
RSpec/ExampleLength:
163-
Enabled: false
201+
Max: 35
164202

165203
# Offense count: 18
166204
# Cop supports --auto-correct.
@@ -244,14 +282,17 @@ RSpec/MessageExpectation:
244282
RSpec/MessageSpies:
245283
Enabled: false
246284

247-
# Offense count: 96
285+
# Offense count: 97
248286
RSpec/MultipleExpectations:
249287
Max: 8
250288

251289
# Offense count: 7
252-
# Configuration parameters: AllowSubject.
290+
# Configuration parameters: AllowSubject, Max.
253291
RSpec/MultipleMemoizedHelpers:
254-
Max: 9
292+
Exclude:
293+
- 'spec/fever_api_spec.rb'
294+
- 'spec/tasks/fetch_feed_spec.rb'
295+
- 'spec/utils/feed_discovery_spec.rb'
255296

256297
# Offense count: 28
257298
# Configuration parameters: IgnoreSharedExamples.
@@ -270,8 +311,12 @@ RSpec/NamedSubject:
270311
- 'spec/fever_api/write_mark_item_spec.rb'
271312

272313
# Offense count: 9
314+
# Configuration parameters: Max.
273315
RSpec/NestedGroups:
274-
Max: 4
316+
Exclude:
317+
- 'spec/commands/feeds/add_new_feed_spec.rb'
318+
- 'spec/controllers/stories_controller_spec.rb'
319+
- 'spec/integration/feed_importing_spec.rb'
275320

276321
# Offense count: 1
277322
# Cop supports --auto-correct.
@@ -367,6 +412,17 @@ Rails/RakeEnvironment:
367412
Exclude:
368413
- 'Rakefile'
369414

415+
# Offense count: 5
416+
# Configuration parameters: Include.
417+
# Include: db/migrate/*.rb
418+
Rails/ReversibleMigrationMethodDefinition:
419+
Exclude:
420+
- 'db/migrate/20130423001740_drop_email_from_user.rb'
421+
- 'db/migrate/20130423180446_remove_author_from_stories.rb'
422+
- 'db/migrate/20130425222157_add_delayed_job.rb'
423+
- 'db/migrate/20130821020313_update_nil_entry_ids.rb'
424+
- 'db/migrate/20130905204142_use_text_datatype_for_title_and_entry_id.rb'
425+
370426
# Offense count: 15
371427
# Cop supports --auto-correct.
372428
# Configuration parameters: AllowImplicitReturn, AllowedReceivers.
@@ -395,7 +451,7 @@ Rails/SkipsModelValidations:
395451
- 'db/migrate/20140421224454_fix_invalid_unicode.rb'
396452
- 'db/migrate/20141102103617_fix_invalid_titles_with_unicode_line_endings.rb'
397453

398-
# Offense count: 30
454+
# Offense count: 27
399455
# Cop supports --auto-correct.
400456
# Configuration parameters: EnforcedStyle.
401457
# SupportedStyles: strict, flexible
@@ -477,9 +533,9 @@ Style/InlineComment:
477533
Exclude:
478534
- 'app/utils/opml_parser.rb'
479535

480-
# Offense count: 690
536+
# Offense count: 699
481537
# Cop supports --auto-correct.
482-
# Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
538+
# Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, AllowParenthesesInStringInterpolation, EnforcedStyle.
483539
# SupportedStyles: require_parentheses, omit_parentheses
484540
Style/MethodCallWithArgsParentheses:
485541
Enabled: false
@@ -506,8 +562,16 @@ Style/NumericPredicate:
506562
Exclude:
507563
- 'app/commands/stories/mark_group_as_read.rb'
508564

565+
# Offense count: 4
566+
Style/OpenStructUse:
567+
Exclude:
568+
- 'spec/factories/feed_factory.rb'
569+
- 'spec/factories/group_factory.rb'
570+
- 'spec/factories/story_factory.rb'
571+
- 'spec/factories/user_factory.rb'
572+
509573
# Offense count: 28
510-
# Configuration parameters: SuspiciousParamNames.
574+
# Configuration parameters: SuspiciousParamNames, Allowlist.
511575
# SuspiciousParamNames: options, opts, args, params, parameters
512576
Style/OptionHash:
513577
Enabled: false
@@ -525,6 +589,14 @@ Style/PercentLiteralDelimiters:
525589
- 'spec/helpers/url_helpers_spec.rb'
526590
- 'spec/javascript/test_controller.rb'
527591

592+
# Offense count: 6
593+
# Cop supports --auto-correct.
594+
# Configuration parameters: EnforcedStyle.
595+
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
596+
Style/QuotedSymbols:
597+
Exclude:
598+
- 'app/controllers/feeds_controller.rb'
599+
528600
# Offense count: 1
529601
# Cop supports --auto-correct.
530602
# Configuration parameters: EnforcedStyle.
@@ -563,7 +635,7 @@ Style/StaticClass:
563635
- 'app/utils/api_key.rb'
564636
- 'app/utils/content_sanitizer.rb'
565637

566-
# Offense count: 19
638+
# Offense count: 18
567639
# Cop supports --auto-correct.
568640
Style/StringHashKeys:
569641
Exclude:
@@ -581,11 +653,17 @@ Style/StringHashKeys:
581653
- 'spec/fever_api/read_links_spec.rb'
582654
- 'spec/fever_api/sync_saved_item_ids_spec.rb'
583655
- 'spec/fever_api/sync_unread_item_ids_spec.rb'
584-
- 'spec/helpers/authentications_helper_spec.rb'
585656

586657
# Offense count: 7
587658
# Cop supports --auto-correct.
588659
# Configuration parameters: MinSize.
589660
# SupportedStyles: percent, brackets
590661
Style/SymbolArray:
591662
EnforcedStyle: brackets
663+
664+
# Offense count: 6
665+
Style/TopLevelMethodDefinition:
666+
Exclude:
667+
- 'spec/integration/feed_importing_spec.rb'
668+
- 'spec/spec_helper.rb'
669+
- 'spec/support/active_record.rb'

0 commit comments

Comments
 (0)