Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NEM12 headers and exporting #85

Merged
merged 20 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 11 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
26 changes: 26 additions & 0 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Lints
on:
pull_request:
push:
tags-ignore:
- '*'
paths-ignore:
- '*.md'
workflow_dispatch:
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run lints
run: bundle exec rubocop
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Tests
on:
pull_request:
push:
tags-ignore:
- '*'
paths-ignore:
- '*.md'
workflow_dispatch:
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1', '3.2', 'ruby-head']

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rspec
59 changes: 34 additions & 25 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,52 @@
---
inherit_from: .rubocop_todo.yml

require:
- rubocop-minitest
- rubocop-rspec

AllCops:
NewCops: enable
Exclude:
- 'vendor/**/*'
DefaultFormatter: progress
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
TargetRubyVersion: 2.6

Style/StringLiterals:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
ExtraDetails: 3.2

# Metrics/AbcSize:
# # Target: 15
# Max: 175
Metrics/LineLength:
# Overrides.
Layout/LineLength:
AllowHeredoc: true
AllowURI: true
Exclude:
- 'spec/**/*_spec.rb'
URISchemes:
- http
- https
# Target: 80
# Max: 210
# Metrics/MethodLength:
# # Target 10
# Max: 80
# Metrics/ClassLength:
# Max: 600
# Metrics/CyclomaticComplexity:
# # Target 6
# Max: 29
# Metrics/PerceivedComplexity:
# # Target 7
# Max: 29
Max: 210
Metrics/AbcSize:
# Target: 15
Max: 190
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'aemo.gemspec'
# Target: 25
Max: 40
Metrics/ClassLength:
Max: 600
Metrics/CyclomaticComplexity:
# Target 6
Max: 40
Metrics/MethodLength:
# Target 10
Max: 80
Metrics/PerceivedComplexity:
# Target 7
Max: 38
Style/StringLiterals:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes

69 changes: 42 additions & 27 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
---
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-05-01 11:12:22 +1000 using RuboCop version 0.50.0.
# on 2023-12-19 05:58:24 UTC using RuboCop version 1.59.0.
# 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: 18
Metrics/AbcSize:
Max: 165
# Offense count: 8
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/lib/aemo/nem12_spec.rb'
- 'spec/lib/aemo/nmi/allocation_spec.rb'
- 'spec/lib/aemo/nmi_spec.rb'

# Offense count: 1
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 35
# Offense count: 6
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 23

# Offense count: 3
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 499
# Offense count: 44
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/lib/aemo/market/interval_spec.rb'
- 'spec/lib/aemo/market/node_spec.rb'
- 'spec/lib/aemo/nmi_spec.rb'
- 'spec/lib/aemo/region_spec.rb'

# Offense count: 8
Metrics/CyclomaticComplexity:
Max: 29
# Offense count: 6
RSpec/MultipleExpectations:
Max: 5

# Offense count: 191
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 192
# Offense count: 10
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 4

# Offense count: 14
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 51
# Offense count: 2
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/lib/aemo/msats_spec.rb'

# Offense count: 7
Metrics/PerceivedComplexity:
Max: 29
# Offense count: 17
RSpec/RepeatedDescription:
Exclude:
- 'spec/lib/aemo/market/interval_spec.rb'
- 'spec/lib/aemo/msats_spec.rb'
- 'spec/lib/aemo/nem12_spec.rb'
- 'spec/lib/aemo/nmi_spec.rb'
28 changes: 7 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,21 @@ bundler_args: --retry=3 --jobs=3
cache: bundler
sudo: false
rvm:
- 3.1.0-preview1
- 3.2.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- ruby-head
matrix:
allow_failures:
- rvm: ruby-head
- rvm: 3.1.0-preview1
fast_finish: true
install:
- gem install bundler
Expand All @@ -45,6 +34,3 @@ script:
- bundle exec rspec
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
addons:
code_climate:
repo_token: 20981d9b6c53ed895076e87fd8f8d5782800824f86eb501bfccb525dab7deca1
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# AEMO Gem Changelog

## [v0.6.0] (2023-12-18)

### Added

* NEM12 header value set at parsing.
* `to_nem12_csv` capability added.

## [v0.5.1] (2023-06-16)

### Changed
Expand Down
25 changes: 22 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@

source 'https://rubygems.org'

source 'https://rubygems.org' do
# Specify your gem's dependencies in aemo.gemspec
gemspec
# Specify your gem's production dependencies in [aemo.gemspec](./aemo.gemspec).
gemspec

# Specify the development/test gems here.
group :development, :test do
gem 'addressable', '~> 2.8', '>= 2.8.0'
gem 'awesome_print', '~> 1.8', '>= 1.8.0'
gem 'coveralls', '~> 0.8', '>= 0.8.21'
gem 'ffi', '~> 1.16', '> 1.9.18'
gem 'guard-yard', '~> 2.2', '>= 2.2.0'
gem 'listen', '~> 3.1', '>= 3.5.0'
gem 'minitest', '~> 5.14', '>= 5.14.2'
gem 'rack', '~> 3.0', '>= 3.0.8'
gem 'rdoc', '~> 6.3', '>= 5.1.0'
gem 'rspec', '~> 3.7', '>= 3.7.0'
gem 'rubocop', '~> 1.59', '>= 0.52.1'
gem 'rubocop-minitest'
gem 'rubocop-rspec'
gem 'simplecov', '~> 0.14', '>= 0.14.1'
gem 'timecop', '~> 0.9', '>= 0.9.1'
gem 'webmock', '~> 3.1', '>= 3.1.0'
gem 'yard', '~> 0.9', '>= 0.9.11'
end
Loading
Loading