Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1e4a619
chore(deps): update actions/download-artifact action to v5
renovate[bot] Aug 6, 2025
ac5e91e
fix: fixing IsVariableLength() check for base segment to check in cor…
ebisrat Sep 16, 2025
5f0ccc2
fix: bad merge
ebisrat Sep 16, 2025
2c2bf26
meta: linter cleanup
adamdecaf Sep 22, 2025
f6b338d
Merge pull request #240 from bloomcredit/correctionIndicatorCheckFix
adamdecaf Sep 22, 2025
2aeae56
Merge pull request #236 from moov-io/renovate/major-github-artifact-a…
adamdecaf Sep 22, 2025
b08befc
build: update deps
adamdecaf Sep 22, 2025
6778cf4
build(deps-dev): bump nokogiri from 1.13.10 to 1.16.5 in /docs
dependabot[bot] May 13, 2024
f2945b2
build(deps-dev): bump nokogiri from 1.16.5 to 1.18.3 in /docs
dependabot[bot] Feb 28, 2025
79163a8
fix: capturing whether file is variable or not once only from header …
ebisrat Sep 26, 2025
4bbb854
fix: removing debug statements
ebisrat Sep 26, 2025
1b94bee
Merge branch 'master' into j2-fixes-and-is-variable-legnth-fix
ebisrat Sep 26, 2025
ae7701e
fix: wastedassign
ebisrat Sep 26, 2025
9b677c9
Merge pull request #242 from bloomcredit/j2-fixes-and-is-variable-leg…
adamdecaf Sep 29, 2025
8899e3b
build: reduce required code coverage
adamdecaf Sep 29, 2025
fb40724
chore(deps): update all (#234)
renovate[bot] Sep 29, 2025
e713135
perf: use strings.Builder instead of concatenation in ConcurrentString
steven-liou Jan 9, 2026
2f411c4
fix: add tests for trailer generation statistics
steven-liou Feb 23, 2026
13b59d9
fix: refactor trailer generation statistics from fileInstance to trai…
steven-liou Feb 24, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
uses: actions/checkout@v3

- name: Load Release URL File from release job
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: release_url

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23-alpine as builder
FROM golang:1.25-alpine as builder
WORKDIR /go/src/github.com/moov-io/metro2
RUN apk add -U git make
RUN adduser -D -g '' --shell /bin/false moov
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-openshift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY ./test ./test
COPY makefile makefile
RUN make build

FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1738816775
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6-1758184547
ARG VERSION=unknown
LABEL maintainer="Moov <oss@moov.io>"
LABEL name="metro2"
Expand Down
14 changes: 6 additions & 8 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,19 @@ GEM
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.24.1)
net-http (0.4.1)
uri
nokogiri (1.16.7-arm64-darwin)
minitest (5.22.2)
nokogiri (1.18.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.18.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.18.3-x86_64-linux-gnu)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.1.1)
public_suffix (5.0.5)
racc (1.8.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
Expand Down Expand Up @@ -292,4 +290,4 @@ DEPENDENCIES
wdm (~> 0.2.0)

BUNDLED WITH
2.2.17
2.2.17
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/moov-io/metro2

go 1.22.0
go 1.23.0

toolchain go1.23.6
toolchain go1.25.1

require (
github.com/ccoveille/go-safecast v1.6.1
github.com/gorilla/mux v1.8.1
github.com/moov-io/base v0.53.0
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.10.0
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac
github.com/moov-io/base v0.57.1
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
)

Expand All @@ -22,6 +22,6 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/pflag v1.0.9 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
46 changes: 11 additions & 35 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/ccoveille/go-safecast v1.6.1 h1:Nb9WMDR8PqhnKCVs2sCB+OqhohwO5qaXtCviZkIff5Q=
github.com/ccoveille/go-safecast v1.6.1/go.mod h1:QqwNjxQ7DAqY0C721OIO9InMk9zCwcsO7tnRuHytad8=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -19,46 +21,20 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/moov-io/base v0.51.1 h1:Dwv7QKluvtHKBIrRcA1t+Sc6hOFTvmswgP5pGMK198E=
github.com/moov-io/base v0.51.1/go.mod h1:xTpQ584ny4VO9zNLmPn+rux6KRXtfQJgvphj4UfORJg=
github.com/moov-io/base v0.53.0 h1:rpPWEbd/NTWApLzFq2AYbCZUlIv99OtvQcan7yArJVE=
github.com/moov-io/base v0.53.0/go.mod h1:F2cdACBgJHNemPrOxvc88ezIqFL6ymErB4hOuPR+axg=
github.com/moov-io/base v0.57.1 h1:5umeDMKfC5osUokmf26RW/vVK8SaWI0pXyGvNHhJMpg=
github.com/moov-io/base v0.57.1/go.mod h1:Kps96QD8ZKomVMMCMVrk34wk9sTlGiVRYUMkYpmU/EY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d h1:0olWaB5pg3+oychR51GUVCEsGkeCU/2JxjBgIo4f3M0=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e h1:4qufH0hlUYs6AO6XmZC3GqfDPGSXHVXUFR6OND+iJX4=
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 h1:9kj3STMvgqy3YA4VQXBrN7925ICMxD5wzMRcgA30588=
golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA=
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc=
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
golang.org/x/exp v0.0.0-20250207012021-f9890c6ad9f3 h1:qNgPs5exUA+G0C96DrPwNrvLSj7GT/9D+3WMWUcUg34=
golang.org/x/exp v0.0.0-20250207012021-f9890c6ad9f3/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo7yrN4mVcnkHDYz5vvs=
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifeq ($(OS),Windows_NT)
else
@wget -O lint-project.sh https://raw.githubusercontent.com/moov-io/infra/master/go/lint-project.sh
@chmod +x ./lint-project.sh
COVER_THRESHOLD=85.0 time ./lint-project.sh
COVER_THRESHOLD=75.0 time ./lint-project.sh
endif

check-openapi:
Expand Down
13 changes: 7 additions & 6 deletions pkg/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type File interface {
GetDataRecords() []lib.Record
GeneratorTrailer() (lib.Record, error)

Parse(record []byte) error
Parse(record []byte, isVariableLength bool) error
Bytes() []byte
String(newline bool) string
ConcurrentString(newline bool, goroutines int) string
Expand Down Expand Up @@ -158,7 +158,7 @@ func (r *Reader) Read() (File, error) {
}

f.Bases = []lib.Record{}

var isVariableLength bool
// read through the entire file
if r.scanner.Scan() {
r.line = r.scanner.Bytes()
Expand All @@ -174,9 +174,10 @@ func (r *Reader) Read() (File, error) {
}

f.SetType(fileFormat)

// only need to set it once based on header record
isVariableLength = utils.IsVariableLength(r.line)
// Header Record
if _, err := f.Header.Parse(r.line); err != nil {
if _, err := f.Header.Parse(r.line, isVariableLength); err != nil {
return nil, err
}
} else {
Expand All @@ -194,7 +195,7 @@ func (r *Reader) Read() (File, error) {
base = lib.NewBaseSegment()
}

_, err := base.Parse(r.line)
_, err := base.Parse(r.line, isVariableLength)
if err != nil {
failedParse = true
break
Expand All @@ -211,7 +212,7 @@ func (r *Reader) Read() (File, error) {
}
}

_, err := f.Trailer.Parse(r.line)
_, err := f.Trailer.Parse(r.line, isVariableLength)
if err != nil {
return nil, err
}
Expand Down
Loading
Loading