Skip to content

Commit 89f39af

Browse files
authored
Merge pull request #1 from Krishnabot/feature
Ruby on Rails capstone project - Expense Tracker app
2 parents 1096b89 + 06fc59d commit 89f39af

File tree

117 files changed

+8167
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+8167
-55
lines changed

.github/workflows/linters.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Linters
2+
3+
on: pull_request
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
rubocop:
10+
name: Rubocop
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-ruby@v1
15+
with:
16+
ruby-version: 3.1.x
17+
- name: Setup Rubocop
18+
run: |
19+
gem install --no-document rubocop -v '>= 1.0, < 2.0' # https://docs.rubocop.org/en/stable/installation/
20+
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.rubocop.yml
21+
- name: Rubocop Report
22+
run: rubocop --color
23+
stylelint:
24+
name: Stylelint
25+
runs-on: ubuntu-22.04
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-node@v1
29+
with:
30+
node-version: "18.x"
31+
- name: Setup Stylelint
32+
run: |
33+
npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x
34+
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.stylelintrc.json
35+
- name: Stylelint Report
36+
run: npx stylelint "**/*.{css,scss}"
37+
nodechecker:
38+
name: node_modules checker
39+
runs-on: ubuntu-22.04
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Check node_modules existence
43+
run: |
44+
if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@
2929

3030
# Ignore master key for decrypting credentials and more.
3131
/config/master.key
32+
node_modules

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

.rubocop.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
AllCops:
2+
NewCops: enable
3+
Exclude:
4+
- "db/**/*"
5+
- "bin/*"
6+
- "config/**/*"
7+
- "Guardfile"
8+
- "Rakefile"
9+
- "node_modules/**/*"
10+
11+
DisplayCopNames: true
12+
13+
Layout/LineLength:
14+
Max: 120
15+
Metrics/MethodLength:
16+
Include:
17+
- "app/controllers/*"
18+
- "app/models/*"
19+
Max: 20
20+
Metrics/AbcSize:
21+
Include:
22+
- "app/controllers/*"
23+
- "app/models/*"
24+
Max: 50
25+
Metrics/ClassLength:
26+
Max: 150
27+
Metrics/BlockLength:
28+
IgnoredMethods: ['describe']
29+
Max: 30
30+
31+
Style/Documentation:
32+
Enabled: false
33+
Style/ClassAndModuleChildren:
34+
Enabled: false
35+
Style/EachForSimpleLoop:
36+
Enabled: false
37+
Style/AndOr:
38+
Enabled: false
39+
Style/DefWithParentheses:
40+
Enabled: false
41+
Style/FrozenStringLiteralComment:
42+
EnforcedStyle: never
43+
44+
Layout/HashAlignment:
45+
EnforcedColonStyle: key
46+
Layout/ExtraSpacing:
47+
AllowForAlignment: false
48+
Layout/MultilineMethodCallIndentation:
49+
Enabled: true
50+
EnforcedStyle: indented
51+
Lint/RaiseException:
52+
Enabled: false
53+
Lint/StructNewOverride:
54+
Enabled: false
55+
Style/HashEachMethods:
56+
Enabled: false
57+
Style/HashTransformKeys:
58+
Enabled: false
59+
Style/HashTransformValues:
60+
Enabled: false

.stylelintrc.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": ["stylelint-config-standard"],
3+
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
4+
"rules": {
5+
"at-rule-no-unknown": [
6+
true,
7+
{
8+
"ignoreAtRules": [
9+
"tailwind",
10+
"apply",
11+
"variants",
12+
"responsive",
13+
"screen"
14+
]
15+
}
16+
],
17+
"scss/at-rule-no-unknown": [
18+
true,
19+
{
20+
"ignoreAtRules": [
21+
"tailwind",
22+
"apply",
23+
"variants",
24+
"responsive",
25+
"screen"
26+
]
27+
}
28+
],
29+
"csstree/validator": true
30+
},
31+
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"]
32+
}

Gemfile

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
1-
source "https://rubygems.org"
1+
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby "3.1.3"
4+
ruby '3.1.3'
55

66
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7-
gem "rails", "~> 7.0.4", ">= 7.0.4.3"
7+
gem 'rails', '~> 7.0.4', '>= 7.0.4.3'
88

99
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10-
gem "sprockets-rails"
10+
gem 'sprockets-rails'
1111

1212
# Use postgresql as the database for Active Record
13-
gem "pg", "~> 1.1"
13+
gem 'pg', '~> 1.1'
1414

1515
# Use the Puma web server [https://github.com/puma/puma]
16-
gem "puma", "~> 5.0"
16+
gem 'puma', '~> 5.0'
1717

1818
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
19-
gem "importmap-rails"
19+
gem 'importmap-rails'
2020

2121
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
22-
gem "turbo-rails"
22+
gem 'turbo-rails'
2323

2424
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25-
gem "stimulus-rails"
25+
gem 'stimulus-rails'
2626

2727
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
28-
gem "jbuilder"
28+
gem 'jbuilder'
2929

30+
gem 'letter_opener'
31+
32+
gem 'devise'
33+
34+
# Formatter
35+
gem 'erb-formatter'
3036
# Use Redis adapter to run Action Cable in production
3137
# gem "redis", "~> 4.0"
3238

@@ -37,25 +43,29 @@ gem "jbuilder"
3743
# gem "bcrypt", "~> 3.1.7"
3844

3945
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
40-
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
46+
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
4147

4248
# Reduces boot times through caching; required in config/boot.rb
43-
gem "bootsnap", require: false
49+
gem 'bootsnap', require: false
50+
51+
gem 'factory_bot_rails'
4452

4553
# Use Sass to process CSS
46-
# gem "sassc-rails"
54+
gem 'sassc-rails'
4755

4856
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
49-
# gem "image_processing", "~> 1.2"
57+
gem 'image_processing', '~> 1.2'
5058

5159
group :development, :test do
5260
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
53-
gem "debug", platforms: %i[ mri mingw x64_mingw ]
61+
gem 'database_cleaner'
62+
gem 'debug', platforms: %i[mri mingw x64_mingw]
63+
gem 'rspec-rails'
5464
end
5565

5666
group :development do
5767
# Use console on exceptions pages [https://github.com/rails/web-console]
58-
gem "web-console"
68+
gem 'web-console'
5969

6070
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
6171
# gem "rack-mini-profiler"
@@ -66,7 +76,7 @@ end
6676

6777
group :test do
6878
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
69-
gem "capybara"
70-
gem "selenium-webdriver"
71-
gem "webdrivers"
79+
gem 'capybara'
80+
gem 'selenium-webdriver'
81+
gem 'webdrivers'
7282
end

0 commit comments

Comments
 (0)