Skip to content

Commit

Permalink
Merge pull request #2 from rwaffen/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
rwaffen authored Sep 15, 2024
2 parents 1730511 + 5432afb commit 92f0058
Show file tree
Hide file tree
Showing 10 changed files with 278 additions and 12 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: CI🚦

on:
pull_request:
branches:
- main
workflow_dispatch:


jobs:
rubocop:
name: 'RuboCop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run tests
run: bundle exec rake rubocop
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-rake

AllCops:
NewCops: enable
164 changes: 164 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-09-14 23:35:39 UTC using RuboCop version 1.66.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
# SupportedStyles: case, end
Layout/CaseIndentation:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
- 'lib/OptionParser.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/NonAtomicFileOperation:
Exclude:
- 'lib/bootstrap.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/ScriptPermission:
Exclude:
- 'wallcollage2.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 25

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 15

# Offense count: 2
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 26

# Offense count: 1
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Max: 7

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 12

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
- 'Rakefile.rb'
- 'lib/OptionParser.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Style/BlockComments:
Exclude:
- 'lib/OptionParser.rb'
- 'lib/bootstrap.rb'
- 'wallcollage2.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/EvenOdd:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'lib/OptionParser.rb'
- 'lib/bootstrap.rb'
- 'lib/wallcollage.rb'
- 'wallcollage2.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'lib/bootstrap.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/wallcollage.rb'

# Offense count: 1
Style/OptionalArguments:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'lib/wallcollage.rb'

# Offense count: 14
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'lib/OptionParser.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Exclude:
- 'wallcollage2.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/OptionParser.rb'
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.3.5
15 changes: 13 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
source 'https://rubygems.org' do
gem 'rmagick'
# frozen_string_literal: true

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

ruby file: '.ruby-version'

gem 'rmagick'
gem 'prime'

group :development do
gem 'rake'
gem 'rubocop-rake'
gem 'rubocop'
end
53 changes: 46 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,57 @@
GEM
specs:

GEM
remote: https://rubygems.org/
specs:
pkg-config (1.5.5)
rmagick (5.3.0)
ast (2.4.2)
forwardable (1.3.3)
json (2.7.2)
language_server-protocol (3.17.0.3)
observer (0.1.2)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pkg-config (1.5.6)
prime (0.1.2)
forwardable
singleton
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rmagick (6.0.1)
observer (~> 0.1)
pkg-config (~> 1.4)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
singleton (0.2.0)
unicode-display_width (2.6.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
rmagick!
prime
rake
rmagick
rubocop
rubocop-rake

RUBY VERSION
ruby 3.3.5p100

BUNDLED WITH
2.0.2
2.5.16
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ Pick randomly pictures from a directory path and join them to a 2560x1440 collag

### Main installation

bundle install --path vendor/gems
bundle config set path 'vendor'
bundle config set with 'development'
bundle install

### if rmagic wont compile

brew unlink imagemagick
brew install imagemagick@6 && brew link imagemagick@6 --force

## Arch Linux

sudo pacman -S imagemagick ghostscript
bundle config set path 'vendor'
bundle config set with 'development'
bundle install

# Usage

## Command parameters
Expand Down
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop) do |task|
# These make the rubocop experience maybe slightly less terrible
task.options = ['-D', '-S', '-E']

# Use Rubocop's Github Actions formatter if possible
task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true'
end
2 changes: 1 addition & 1 deletion lib/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
require_relative 'OptionParser'

# create needed directories
Dir.mkdir('out') unless File.exists?('out')
Dir.mkdir('out') unless File.exist?('out')
2 changes: 1 addition & 1 deletion wallcollage2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@ruby: 2.2.3p173
=end

require_relative 'lib/Bootstrap'
require_relative 'lib/bootstrap'

create_collage(
@options[:path],
Expand Down

0 comments on commit 92f0058

Please sign in to comment.