Skip to content

Commit

Permalink
fixup! Set up linting and tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
erickguan committed Mar 5, 2024
1 parent d398f2a commit a013064
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
40 changes: 4 additions & 36 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AllCops:
NewCops: enable
StyleGuideBaseURL: https://rubystyle.guide
TargetRubyVersion: 3.0
SuggestExtensions: false # reduce noise. consider add rubocop-benchmark

Exclude:
- bin/**/*
Expand All @@ -21,11 +22,11 @@ Bundler/OrderedGems:
Include:
- '*.gemspec'

# Documentation
# ALlow no documentation.
Style/Documentation:
Enabled: false

# Allow more flexibility with string literals
# Enforce single quotes in the gem
Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes
Expand All @@ -34,26 +35,10 @@ Style/StringLiterals:
Layout/DotPosition:
EnforcedStyle: trailing

# Project maximum code line length
Layout/LineLength:
Max: 120

# Enforce comma after the last item of a multiline array or hash
Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
Enabled: true
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArguments:
Enabled: true
EnforcedStyleForMultiline: comma

Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_fixed_indentation

Layout/FirstArrayElementIndentation:
Enabled: true
EnforcedStyle: consistent
Expand All @@ -66,36 +51,19 @@ Style/WordArray:
# difficult to figure out source text
EnforcedStyle: brackets

# Encourage the use of method call with args parentheses
Style/MethodCallWithArgsParentheses:
Enabled: true
EnforcedStyle: require_parentheses

# Allow guard clauses
Style/GuardClause:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: false

Layout/EmptyLineAfterMagicComment:
Enabled: true

# Exclude test files from BlockComments check
Style/BlockComments:
Exclude:
- 'test/**/*'

# Naming conventions
Naming/PredicateName:
Enabled: true

Metrics/ClassLength:
Max: 500

Metrics/BlockLength:
Max: 50

Exclude:
# allows longer block for RSpec
- spec/**/*.rb
Expand Down
35 changes: 35 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
extends: default

locale: en_US.UTF-8

# ignored directories
ignore: |
.git/

rules:
octal-values: enable

document-start: disable
document-end: disable

# allow 120 characters in a line
line-length:
max: 120
level: error

indentation:
spaces: 2
indent-sequences: true

# allow one space indent
comments:
level: error
min-spaces-from-content: 1

# disallow boolean values to avoid surprise
truthy:
level: error

# github workflows uses `on` as trigger
ignore: |
.github/workflows/*.yml

0 comments on commit a013064

Please sign in to comment.