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

Error handling #73

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
08adbda
Add Todo and Journal Property Methods
spslater Apr 1, 2023
14095cc
Add Alarm, Timezone, and FreeBusy Property Methods
spslater Apr 2, 2023
67727dd
Fix Typos in a couple places
spslater Apr 6, 2023
b51e64d
Merge branch 'arran4:master' into add-todo-journal
spslater Apr 6, 2023
6d4f14f
Add Comment and Category Properties to Components
spslater Apr 27, 2023
a5a215d
Merge branch 'master' into add-todo-journal
spslater Apr 27, 2023
4b2d6a1
Add changes for All Day Events to All Day Todos
spslater Apr 28, 2023
23c4714
added errors.go and converted errors to constants for better error ha…
ManoloTonto1 Jul 12, 2023
b69874f
fixed some namings
ManoloTonto1 Jul 12, 2023
7d97e96
Bump gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0
dependabot[bot] Sep 6, 2023
ce8cff1
Merge pull request #76 from arran4/dependabot/go_modules/gopkg.in/yam…
arran4 Sep 6, 2023
0abebc2
Add VEvent.GetDtStampTime
galenwarren Nov 8, 2023
acf49e9
Merge pull request #80 from coachclientconnect/add-get-timestamp
arran4 Nov 11, 2023
a0f11e3
add possibility to remove VEvent from calendar by id
zachmann Nov 23, 2023
70f69c8
undo formatting change
zachmann Nov 23, 2023
1dfe73f
remove redundant return statement
zachmann Nov 24, 2023
7678c37
Merge pull request #81 from zachmann/master
arran4 Nov 24, 2023
e69ce9c
Add ComponentPropertyPriority; the VTODO component can have that
quite Dec 4, 2023
aef0a29
Merge pull request #82 from quite/add-component-priority
arran4 Dec 7, 2023
8525f6b
Add {Get,Set}LastModifiedAt
bcspragu Dec 18, 2023
1a61754
Merge pull request #83 from bcspragu/last-modified
arran4 Dec 20, 2023
a55aac2
Merge remote-tracking branch 'origin/pull-66-add-todo-journal-orphan'…
arran4 Jan 8, 2024
5f3bef9
Unnecessary functions causing lint recursion errors.
arran4 Jan 8, 2024
55df13e
Consistent todo receiver
arran4 Jan 8, 2024
9e30bdf
Ignore explicitly
arran4 Jan 8, 2024
1e96c15
Consistent receivers.
arran4 Jan 8, 2024
cf8d1b3
Ignore explicitly
arran4 Jan 8, 2024
804f4d3
Merge pull request #84 from arran4/pull-66-add-todo-journal
arran4 Jan 8, 2024
681cc6e
fix panic for missing property param operator
brackendawson Jan 27, 2024
3631125
fix panic when property ends without colon or value
brackendawson Jan 27, 2024
a8f0586
fix panic when param value has incomplete escape sequence
brackendawson Jan 27, 2024
46e2a5c
Exclude fuzz testing from pre-1.18 toolchains
brackendawson Jan 28, 2024
51fa6f1
Merge pull request #85 from brackendawson/panic
arran4 Jan 28, 2024
3ffa099
fix: only escape property values when serializing.
frereit Feb 9, 2024
0f8a325
fix: reorder string replaces in escaping values.
frereit Feb 9, 2024
647cf9e
test: Add test for escaped semicolons in property parameters
frereit Feb 13, 2024
542d6e5
Merge pull request #86 from JM-Lemmi/fix/text_escaping
arran4 Feb 14, 2024
7bd8708
test: Add test for escaped semicolons in RRULEs
frereit Feb 15, 2024
bb39d64
Revert "fix: only escape property values when serializing."
frereit Feb 15, 2024
0fcebed
Merge pull request #87 from JM-Lemmi/fix/text_escaping
arran4 Feb 15, 2024
f5b4408
Prefix mailto: for email in organizer property
meain Feb 27, 2024
93ca35f
Only conditionally add in the mailto: prefix for attendee and organizer
meain Mar 4, 2024
84a339a
Merge pull request #88 from meain/org-mailto
arran4 Mar 4, 2024
02c6335
Re-add Calendar.RemoveEvent method
zachmann Apr 11, 2024
9fab3f0
Merge pull request #90 from zachmann/master
arran4 Apr 11, 2024
1e5b6e4
add: contributing.md
brenank May 21, 2024
27bb2dd
fix: simplify & update ghas
brenank May 21, 2024
909bd3b
fix: explicitly list golang versions
brenank May 21, 2024
3e4aba3
fix: use macos-13, arm is not supported by setup-go
brenank May 21, 2024
f044c04
Merge pull request #92 from brenank/brenank/update-golang
arran4 May 21, 2024
008589d
add: stable serialization of property parameters
brenank May 20, 2024
baa1c1d
add: serialiation test
brenank May 20, 2024
ea37e62
fix: VFREEBUSY serialization
brenank May 20, 2024
8d1cec9
breaking: unescape Property.Value of type TEXT
brenank May 19, 2024
68b453c
refactor: fix linting errors
brenank May 21, 2024
b866620
refactor: reduce scope of gitignore
brenank May 30, 2024
2f726f2
refactor: switch syntax
brenank May 30, 2024
9a99514
fix: add test err assertion
brenank May 30, 2024
20061ba
fix: reduce build restriction on serialization test
brenank May 30, 2024
6591742
Merge pull request #91 from brenank/master
arran4 May 30, 2024
c331f7a
Add ComponentPropertyRelatedTo; the VTODO component can have that
quite Jul 10, 2024
ea4ce01
Merge pull request #94 from quite/add-component-relatedto
arran4 Jul 10, 2024
f76e1f3
fixed merge conflicts
ManoloTonto1 Sep 25, 2024
e616cd6
fixed some namings
ManoloTonto1 Jul 12, 2023
2520cb0
Merge branch 'master' of github.com:ManoloTonto1/golang-ical
ManoloTonto1 Sep 25, 2024
4c3688b
fixed som functions that are using the wrong Struct Embeddings
ManoloTonto1 Sep 25, 2024
1d9da2e
Some suggestions, this could be improved still. (#1)
arran4 Oct 4, 2024
3a306dd
Error handling conflicts again (#2)
arran4 Oct 21, 2024
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
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: 🐞 Bug
about: File a bug/issue
title: '[BUG] <title>'
labels: Bug, Needs Triage
assignees: ''

---

<!--
Note: Please search to see if an issue already exists for the bug you encountered.
-->

### Current Behavior:
<!-- A concise description of what you're experiencing. -->

### Expected Behavior:
<!-- A concise description of what you expected to happen. -->

### Steps To Reproduce:
<!--
Example: steps to reproduce the behavior:
1. In this environment...
1. With this config...
1. Run '...'
1. See error...
-->

### Minimal Example ical extract:

```ical
BEGIN:VCALENDAR
....
```

### Anything else:
<!--
Links? References? Anything that will give us more context about the issue that you are encountering!
-->
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Something else
about: Any other issue
title: '<title>'
labels: Needs Triage
assignees: ''

---

<!--
Note: Please search to see if an issue already exists for the bug you encountered.

Please include smallest possible sized examples.
-->

35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--

Thanks for contributing!

-->

# Pull Request Template

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

<!-- The following line will automatically close the issues if done correctly -->

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- This might take a while to be considered

## Must haves:

- [ ] I have commented in hard-to-understand areas and anywhere the function not immediately apparent
- [ ] I have made corresponding changes to the comments (if any)
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove the fix is effective or that my feature works
- [ ] I have added tests that protects the code from degradation in the future

## Nice to haves:

- [ ] I have added additional function comments to new or existing functions
20 changes: 7 additions & 13 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,15 @@ on:
pull_request:
jobs:
golangci:
name: lint
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read # allow read access to the content for analysis.
checks: write # allow write access to checks to allow the action to annotate code in the PR.
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: Checkout
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: latest
11 changes: 11 additions & 0 deletions .github/workflows/goleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: gitleaks
on: [push,pull_request]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/govun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Go vunderability check
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
- id: govulncheck
uses: golang/govulncheck-action@v1
49 changes: 30 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
on: [push, pull_request]
name: Test
jobs:
test:
version:
name: Test
permissions:
contents: read
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['oldstable', 'stable']
os: ['ubuntu-latest', 'macos-13', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache-Go
uses: actions/cache@v1
go-version: "${{ matrix.go-version }}"
- name: Go Test
run: go test -race ./...
module:
name: Test
permissions:
contents: read
strategy:
matrix:
go-version-file: ['go.mod']
os: ['ubuntu-latest', 'macos-13', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
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: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
go-version-file: "${{ matrix.go-version-file }}"
- name: Go Test
run: go test -race ./...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.idea/
/testdata/serialization/actual
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary?

17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing

## Linting
Make sure your code has been linted using [golangci-lint](https://github.com/golangci/golangci-lint?tab=readme-ov-file#install-golangci-lint)

```shell
$ golangci-lint run
```

## Tests

If you want to submit a bug fix or new feature, make sure that all tests are passing.
```shell
$ go test ./...
```


9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ A ICS / ICal parser and serialiser for Golang.
Because the other libraries didn't quite do what I needed.

Usage, parsing:
```
```golang
cal, err := ParseCalendar(strings.NewReader(input))

```

Creating:
Usage, parsing from a URL :
```golang
cal, err := ParseCalendar("an-ics-url")
```

Creating:
```golang
cal := ics.NewCalendar()
cal.SetMethod(ics.MethodRequest)
event := cal.AddEvent(fmt.Sprintf("id@domain", p.SessionKey.IntID()))
Expand Down
Loading