Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
2 changes: 2 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
7 changes: 7 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
31 changes: 31 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.6
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.6.3
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- node@18.12.1
- python@3.10.8
- ruby@3.1.4
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- rubocop@1.39.0
- brakeman@5.4.0
- checkov@3.2.257
- git-diff-check
- markdownlint@0.42.0
- prettier@3.3.3
- trufflehog@3.82.6
- yamllint@1.35.1
actions:
enabled:
- trunk-upgrade-available
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ source 'https://rubygems.org'
gemspec

gem "appraisal"
gem "rubocop", "~> 1.66"

gem "rubocop-rspec", "~> 3.1"

gem "rubocop-performance", "~> 1.22"
gem 'ammeter', '~> 1.1.2'
gem 'rake'
gem 'rspec'
gem 'sqlite3', '~> 1.4'
gem 'vcr'
gem 'webmock'
9 changes: 9 additions & 0 deletions lib/salesforce_ar_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ module SalesforceArSync
def self.setup
yield self
end

def someBadRuby_code
puts "This is a bad method";


return

return "Return value"
end
end

if defined?(ActiveRecord::Base)
Expand Down
91 changes: 91 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
require:
- rubocop-rspec
- rubocop-performance

AllCops:
NewCops: enable
# Exclude:
# - config/**/*
ExtraDetails: enable

# Ruby

Layout/LineLength:
Max: 120

Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: new_line

Lint/AmbiguousBlockAssociation:
AllowedMethods: [change not_change]

Metrics/AbcSize:
Severity: warning
CountRepeatedAttributes: false # potential change

Metrics/ClassLength:
Max: 300
Details: >-
Look for ways to decrease class size by pulling logic into services, concerns, etc.

Metrics/MethodLength:
CountAsOne: [array, hash, heredoc, method_call]

Metrics/CyclomaticComplexity:
Severity: warning
Details: >-
Look for ways to simplify/refactor the method. Pull logic out into more specific methods.

Metrics/ModuleLength:
Enabled: false

Metrics/PerceivedComplexity:
Severity: warning
Details: >-
Look for ways to simplify/refactor the method. Pull logic out into more specific methods.

Style/AndOr:
EnforcedStyle: always
Details: >-
And/Or methods have unexpected complexity attached to them. Try not to use them.

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Details: >-
Add `# frozen_string_literal: true` to the top of the file.
Frozen string literals help the memory profile of the application by making strings immutable and register a single time.

Style/NumericLiterals:
Severity: warning

# RSpec

RSpec/DescribeClass:
Exclude:
- "**/spec/features/**/*"
- "**/spec/requests/**/*"
- "**/spec/routing/**/*"
- "**/spec/system/**/*"
- "**/spec/views/**/*"
IgnoredMetadata:
type:
- request
- routing
- view
- feature
- system
- task

RSpec/ExampleLength:
CountAsOne:
- array
- heredoc
- hash

RSpec/NestedGroups:
Max: 5

RSpec/PredicateMatcher:
Enabled: false
14 changes: 3 additions & 11 deletions salesforce_ar_sync.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@ require File.expand_path('lib/salesforce_ar_sync/version', __dir__)

Gem::Specification.new do |gem|
gem.authors = ['Michael Halliday', 'Nick Neufeld', 'Andrew Coates', 'Devon Noonan', 'Liam Nediger']
gem.email = ['mhalliday@infotech.com', 'nneufeld@infotech.com', 'acoates@infotech.com', 'dnoonan@infotech.com', 'lnediger@infotech.com']
gem.email = ['mhalliday@infotech.com', 'nneufeld@infotech.com', 'acoates@infotech.com',
'dnoonan@infotech.com', 'lnediger@infotech.com']
gem.description = 'ActiveRecord extension & rails engine for syncing data with Salesforce.com'
gem.summary = 'ActiveRecord extension & rails engine for syncing data with Salesforce.com'
gem.homepage = 'http://github.com/InfoTech/'

gem.files = Dir['README.md', 'LICENSE', 'lib/**/*', 'app/**/*', 'config/**/*']
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = 'salesforce_ar_sync'
gem.require_paths = ['lib']
gem.version = SalesforceArSync::VERSION

gem.add_dependency 'actionpack-xml_parser'
gem.add_dependency 'rails', '>= 5'
gem.add_dependency 'restforce', '~> 5.0.5'
gem.add_dependency 'rexml', '~> 3.2'

gem.add_development_dependency 'ammeter', '~> 1.1.2'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'sqlite3', '~> 1.4'
gem.add_development_dependency 'vcr'
gem.add_development_dependency 'webmock'

gem.add_runtime_dependency 'restforce', '~> 5.0.5'
end