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

Comprehensive validation πŸ”Ž, 30+ fixes integrated/added πŸ”¨πŸ›, optimized performance πŸš€ #159

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
335c1f9
added some actions
arran4 Feb 15, 2023
26d95ba
My issue
arran4 Feb 15, 2023
5335e6f
Error return value is not checked (errcheck)
arran4 Feb 15, 2023
14cb70e
field `offsetlen` is unused (unused)
arran4 Feb 15, 2023
2fb4c46
S1021: should merge variable declaration with assignment on next line…
arran4 Feb 15, 2023
5143d47
S1023: redundant break statement (gosimple)
arran4 Feb 15, 2023
57a1767
SA4006: this value of `err` is never used (staticcheck)
arran4 Feb 15, 2023
ad0ab84
Lint action out of date.
arran4 Feb 15, 2023
a8e238d
Go mod tidy
arran4 Feb 15, 2023
e654ac7
Bug fixes.
arran4 Feb 15, 2023
cefe5b3
More typo changes
arran4 Feb 15, 2023
4345a38
Another error
arran4 Feb 15, 2023
515cd81
S1023: redundant break statement (gosimple)
arran4 Feb 15, 2023
eabb56b
Text should be lowercase
arran4 Feb 15, 2023
c5b562a
Added go releaser
arran4 Feb 15, 2023
094aad3
Commented code
arran4 Feb 15, 2023
53a8cbd
Unnecessary bracket
arran4 Feb 15, 2023
544b542
Test improvements.. I think
arran4 Feb 15, 2023
c5a1edc
My addition last
arran4 Feb 15, 2023
268a690
So people don't have to check the string they can use the new errors.…
arran4 Feb 15, 2023
bf3a5b3
Skip white space - to delete strategically
arran4 Feb 15, 2023
3a32cbb
All of these did nothing
arran4 Feb 15, 2023
b1fd89e
The only required one.
arran4 Feb 15, 2023
19ef6a2
New failure - still white space
arran4 Feb 15, 2023
8b765a5
Skip white space
arran4 Feb 15, 2023
b0b5409
Unused code
arran4 Feb 15, 2023
01b692d
Another case.
arran4 Feb 15, 2023
465140d
Fix ineffective break statements
klondikedragon Dec 9, 2023
1b1e0b3
Add extensive format validation, bugfixes
klondikedragon Dec 12, 2023
3ebc8bc
Incorporate fix for dd.mm.yyyy format
klondikedragon Dec 12, 2023
c62ed15
Support PMDT and AMT time zones
klondikedragon Dec 13, 2023
49f9259
Add support for dd[th,nd,st,rd] Month yyyy
klondikedragon Dec 13, 2023
301ffee
Add support for mon/dd/yyyy (Oct/31/1970)
klondikedragon Dec 13, 2023
18938f1
Implement support for yyyy mon dd (2013 May 02)
klondikedragon Dec 13, 2023
fc278d3
Incorporate support for dd-mm-yyyy (digit month)
klondikedragon Dec 13, 2023
df9ae2e
Incorporate support for yyyymmddhhmmss.SSS
klondikedragon Dec 13, 2023
8f0059d
Add tests to verify ambiguous cases
klondikedragon Dec 13, 2023
2b3f700
Handle format "date time (MST)"
klondikedragon Dec 14, 2023
d05b099
Add better timezone explanation to README.md
klondikedragon Dec 14, 2023
14fb939
Fix parsing for format (time) UTC[+-]NNNN
klondikedragon Dec 15, 2023
23869f3
Add support for mm/dd/yyyy, hh:mm:ss
klondikedragon Dec 15, 2023
cc63421
Support times after yyyy.mm.dd dates
klondikedragon Dec 15, 2023
18ec8c6
Expand Chinese date format support
klondikedragon Dec 16, 2023
249dd73
Support git log format (Thu Apr 7 15:13:13 2005 -0700)
klondikedragon Dec 16, 2023
0c3943e
Support RabbitMQ log format (dd-mon-yyyy::hh:mm:ss)
klondikedragon Dec 16, 2023
0d2fd5e
Add broader benchmarks
klondikedragon Dec 16, 2023
f4307ef
Heavily optimize memory allocations
klondikedragon Dec 16, 2023
ed5310d
Optimize ambiguous date parsing
klondikedragon Dec 16, 2023
23f8fa1
Further optimize ambiguous parsing
klondikedragon Dec 16, 2023
d2e1443
Comprehensive date format validation
klondikedragon Dec 17, 2023
fbf07cc
Optimize memory for error case
klondikedragon Dec 17, 2023
a45d593
Optimize checks for day of week and full month
klondikedragon Dec 17, 2023
89df0f8
Comprehensive time validation
klondikedragon Dec 19, 2023
7a3c923
Fix mm.dd.yyyy (time) format
klondikedragon Dec 19, 2023
65e6e8d
Add support for dd-month-year format
klondikedragon Dec 19, 2023
4f7e854
Update example and README.md with new formats
klondikedragon Dec 19, 2023
4d76f59
Fix ambiguous mm/dd that start with weekday
klondikedragon Dec 19, 2023
5cb2793
Update benchmark results
klondikedragon Dec 19, 2023
9f7bdf7
Update go doc
klondikedragon Dec 20, 2023
fd21b1e
Allow weekday prefix for most date formats
klondikedragon Dec 24, 2023
c4de5d4
Unify/fix timezone offset/name states
klondikedragon Dec 30, 2023
d5b3c60
Cleanup handling of TZ name parsing
klondikedragon Dec 30, 2023
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
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
39 changes: 39 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: releaser

on:
push:
tags:
- 'v*.*.*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Test
run: go test ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Test
run: go test ./...
38 changes: 38 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
project_name: dateparse
builds:
-
id: "dateparse"
binary: "dateparse"
dir: dateparse
-
id: "example"
binary: "example"
dir: example
archives:
-
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
nfpms:
-
vendor: dateparse
homepage: https://github.com/araddon/dateparse
maintainer: n/a <[email protected]>
description: NA
formats:
- apk
- deb
- rpm
release: 1
section: default
priority: extra
Loading