Skip to content

Commit b9613f8

Browse files
committed
Linters/rubocop
1 parent 3dd8a78 commit b9613f8

43 files changed

Lines changed: 937 additions & 861 deletions

Some content is hidden

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

.rubocop.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ plugins: rubocop-rspec
44

55
AllCops:
66
NewCops: enable
7+
SuggestExtensions: false
78

9+
Gemspec/DevelopmentDependencies:
10+
Enabled: false
11+
812
Layout/LineLength:
913
Enabled: false
1014

@@ -23,9 +27,16 @@ Metrics/MethodLength:
2327
Metrics/PerceivedComplexity:
2428
Enabled: false
2529

30+
Metrics/ClassLength:
31+
Enabled: false
32+
2633
Style/Documentation:
2734
Enabled: false
2835

36+
Style/RaiseArgs:
37+
EnforcedStyle: compact
38+
39+
2940
RSpec/DescribeSymbol:
3041
Enabled: false
3142

@@ -35,5 +46,50 @@ RSpec/MultipleExpectations:
3546
RSpec/LeakyConstantDeclaration:
3647
Enabled: false
3748

49+
RSpec/ExampleLength:
50+
Enabled: false
51+
52+
RSpec/NamedSubject:
53+
Enabled: false
54+
55+
RSpec/SpecFilePathFormat:
56+
Enabled: false
57+
58+
RSpec/NestedGroups:
59+
Max: 9
60+
61+
RSpec/DescribedClass:
62+
Enabled: false
63+
64+
RSpec/DescribeClass:
65+
Enabled: false
66+
67+
RSpec/MultipleMemoizedHelpers:
68+
Enabled: false
69+
70+
RSpec/RepeatedDescription:
71+
Enabled: false
72+
73+
RSpec/BeEq:
74+
Enabled: false
75+
76+
RSpec/MultipleDescribes:
77+
Enabled: false
78+
79+
RSpec/ExpectActual:
80+
Enabled: false
81+
3882
Lint/ConstantDefinitionInBlock:
83+
Enabled: false
84+
85+
Lint/SuppressedException:
86+
Enabled: false
87+
88+
Lint/SuppressedExceptionInNumberConversion:
89+
Enabled: false
90+
91+
Style/FormatStringToken:
92+
Enabled: false
93+
94+
Style/SpecialGlobalVars:
3995
Enabled: false

CONTRIBUTING.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,35 @@ We love pull requests. Here's a quick guide:
33
1. Fork the repo.
44

55
2. Run the tests. We only take pull requests with passing tests, and it's great
6-
to know that you have a clean slate: `bundle && rake`
6+
to know that you have a clean slate: `bundle && rake`
77

88
3. Add a test for your change. Only refactoring and documentation changes
9-
require no new tests. If you are adding functionality or fixing a bug, we need
10-
a test!
9+
require no new tests. If you are adding functionality or fixing a bug, we need
10+
a test!
1111

1212
4. Make the test pass.
1313

1414
5. Push to your fork and submit a pull request.
1515

16-
1716
At this point you're waiting on us. We like to at least comment on, if not
1817
accept, pull requests within three business days (and, typically, one business
1918
day). We may suggest some changes or improvements or alternatives.
2019

2120
Some things that will increase the chance that your pull request is accepted,
2221
taken straight from the Ruby on Rails guide:
2322

24-
* Use Rails idioms and helpers
25-
* Include tests that fail without your code, and pass with it
26-
* Update the documentation, the surrounding one, examples elsewhere, guides,
23+
- Use Rails idioms and helpers
24+
- Include tests that fail without your code, and pass with it
25+
- Update the documentation, the surrounding one, examples elsewhere, guides,
2726
whatever is affected by your contribution
2827

2928
Syntax:
3029

31-
* Two spaces, no tabs.
32-
* No trailing whitespace. Blank lines should not have any space.
33-
* Prefer &&/|| over and/or.
34-
* MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
35-
* a = b and not a=b.
36-
* Follow the conventions you see used in the source already.
30+
- Two spaces, no tabs.
31+
- No trailing whitespace. Blank lines should not have any space.
32+
- Prefer &&/|| over and/or.
33+
- MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
34+
- a = b and not a=b.
35+
- Follow the conventions you see used in the source already.
3736

3837
And in case we didn't emphasize it enough: we love tests!

Gemfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24
gemspec
35

4-
gem 'license_finder', group: :development
5-
gem 'rubocop'
6+
group :development do
7+
gem 'coveralls_reborn', require: false
8+
9+
# License
10+
gem 'license_finder', require: false
11+
12+
# Testing
13+
gem 'rspec'
14+
15+
# Linting
16+
gem 'ruboclean', require: false
17+
gem 'rubocop', require: false
18+
gem 'rubocop-rspec', require: false
19+
20+
gem 'simplecov', require: false
21+
end

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@
77

88
We love building payment applications! So after developing the [DTAUS library for Ruby](https://github.com/salesking/king_dtaus) we move on with SEPA.
99

10-
1110
## Features
1211

1312
This gem implements the following two messages out of the ISO 20022 standard:
1413

15-
* Credit Transfer Initiation (`pain.001.003.03`, `pain.001.002.03` and `pain.001.001.03`)
16-
* Direct Debit Initiation (`pain.008.003.02`, `pain.008.002.02` and `pain.008.001.02`)
14+
- Credit Transfer Initiation (`pain.001.003.03`, `pain.001.002.03` and `pain.001.001.03`)
15+
- Direct Debit Initiation (`pain.008.003.02`, `pain.008.002.02` and `pain.008.001.02`)
1716

1817
It handles the _Specification of Data Formats_ v3.3 (2019-11-17).
1918

2019
BTW: **pain** is a shortcut for **Pa**yment **In**itiation.
2120

22-
2321
## Requirements
2422

25-
* Ruby 2.7 or newer
26-
* ActiveModel 4.2 or newer (including 7.0)
27-
23+
- Ruby 2.7 or newer
24+
- ActiveModel 4.2 or newer (including 7.0)
2825

2926
## Installation
3027

3128
gem install sepa_king
3229

33-
3430
## Usage
3531

3632
How to create the XML for **Direct Debit Initiation** (in German: "Lastschriften")
@@ -149,7 +145,6 @@ xml_string = sdd.to_xml # Use schema pain.008.001.02
149145
xml_string = sdd.to_xml('pain.008.002.02') # Use schema pain.008.002.02
150146
```
151147

152-
153148
How to create the XML for **Credit Transfer Initiation** (in German: "Überweisungen")
154149

155150
```ruby
@@ -269,25 +264,22 @@ end
269264
**Beware:** The SEPA::IBANValidator is strict - e.g. it does not allow any spaces in the IBAN.
270265

271266
Also see:
272-
* [lib/sepa_king/validator.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/validator.rb)
273-
* [lib/sepa_king/transaction/direct_debit_transaction.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/transaction/direct_debit_transaction.rb)
274267

268+
- [lib/sepa_king/validator.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/validator.rb)
269+
- [lib/sepa_king/transaction/direct_debit_transaction.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/transaction/direct_debit_transaction.rb)
275270

276271
## Changelog
277272

278273
https://github.com/salesking/sepa_king/releases
279274

280-
281275
## Contributors
282276

283277
https://github.com/salesking/sepa_king/graphs/contributors
284278

285-
286279
## Resources
287280

288-
* https://www.ebics.de/de/datenformate
289-
* SalesKing: http://salesking.eu
290-
281+
- https://www.ebics.de/de/datenformate
282+
- SalesKing: http://salesking.eu
291283

292284
## License
293285

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'bundler/gem_tasks'
24
require 'rspec/core/rake_task'
35

lib/schema/pain.001.001.03.ch.02.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,4 +1209,4 @@ History
12091209
</xs:restriction>
12101210
</xs:simpleType>
12111211
-->
1212-
</xs:schema>
1212+
</xs:schema>

lib/schema/pain.001.001.03.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,4 +918,4 @@
918918
<xs:enumeration value="HLF2"/>
919919
</xs:restriction>
920920
</xs:simpleType>
921-
</xs:schema>
921+
</xs:schema>

lib/sepa_king.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'active_model'
24
require 'bigdecimal'
35
require 'nokogiri'

lib/sepa_king/account.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# encoding: utf-8
1+
# frozen_string_literal: true
2+
23
module SEPA
34
class Account
45
include ActiveModel::Validations
56
extend Converter
67

78
attr_accessor :name, :iban, :bic
9+
810
convert :name, to: :text
911

1012
validates_length_of :name, within: 1..70
11-
validates_with BICValidator, IBANValidator, message: "%{value} is invalid"
13+
validates_with BICValidator, IBANValidator, message: '%{value} is invalid'
1214

1315
def initialize(attributes = {})
1416
attributes.each do |name, value|
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# encoding: utf-8
1+
# frozen_string_literal: true
2+
23
module SEPA
34
class CreditorAccount < Account
45
attr_accessor :creditor_identifier
56

6-
validates_with CreditorIdentifierValidator, message: "%{value} is invalid"
7+
validates_with CreditorIdentifierValidator, message: '%{value} is invalid'
78
end
89
end

0 commit comments

Comments
 (0)