Skip to content

Commit

Permalink
Bumps to v2.0.0 (#19)
Browse files Browse the repository at this point in the history
* Bumps to v2.0.0

* Adapts CHANGELOG.md

* Adds markdownlint and yamllint

* Update LICENSE.md

* Update .markdownlint.yaml

* Update README.md (Adds badges)
  • Loading branch information
san983 authored Jan 30, 2025
1 parent 06aa34e commit 39f32f4
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 32 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,34 @@ name: CI
on:
pull_request:
push:
branches: [ "main" ]
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
markdownlint-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run markdownlint-cli
uses: nosborn/[email protected]
with:
files: .
config_file: ".markdownlint.yaml"

yamllint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run YAML Lint
uses: actionshub/yamllint@main

build:
name: Build
runs-on: ubuntu-22.04
Expand Down
13 changes: 13 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
default: true

# no-hard-tabs
MD010:
code_blocks: false

# no-multiple-blanks
MD012:
maximum: 2

# line-length
MD013: false
10 changes: 10 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
extends: default
rules:
document-start: false
line-length:
max: 256
level: warning
truthy:
ignore: |
/.github/workflows/*.yml
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## main

## 1.1.1
## 2.0.0

- Added CONTRIBUTING.md
- Added CHANGELOG.md
- Added release process to hex.pm
### Changed

- Bumps to OTP/27
- Replaced "jsx" with "json"

### Added

- erlfmt
- CONTRIBUTING.md
- CHANGELOG.md
- release process to hex.pm

## 1.1.0

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The following instructions uses `$VERSION` as a placeholder, where `$VERSION` is
git push origin --tags
```

1. GitHub actions will take it from there and release to https://hex.pm/packages/bugsnag_erlang
1. GitHub actions will take it from there and release to <https://hex.pm/packages/bugsnag_erlang>

## Tests

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Copyright (c) 2013-2019 Anthony Eden
Copyright (c) 2020-2025 DNSimple Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,59 @@
Bugsnag notifier for Erlang applications.
# Bugsnag notifier for Erlang applications

[![Build Status](https://github.com/dnsimple/bugsnag-erlang/actions/workflows/ci.yml/badge.svg)](https://github.com/dnsimple/bugsnag-erlang/actions/workflows/ci.yml)
[![Module Version](https://img.shields.io/hexpm/v/bugsnag_erlang.svg)](https://hex.pm/packages/bugsnag_erlang)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/dnsimple/)
[![Total Download](https://img.shields.io/hexpm/dt/dnsimple.svg)](https://hex.pm/packages/bugsnag_erlang)
[![License](https://img.shields.io/hexpm/l/dnsimple.svg)](https://github.com/dnsimple/bugsnag-erlang/blob/main/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/dnsimple/bugsnag-erlang.svg)](https://github.com/dnsimple/bugsnag-erlang/commits/main)

## Dependencies

Requires Lager.
Requires [Lager](https://github.com/erlang-lager/lager)

The following applications must be started:
The following applications must be started

kernel,stdlib,inets,crypto,ssl,lager
```text
kernel,stdlib,inets,crypto,ssl,lager
```

## Usage

You may send custom errors directly:
You may send custom errors directly

```erlang
bugsnag:notify(error, fake, "Testing bugsnag with a manual error report", no_module, 0).
```

Or use the Erlang error logger:
Or use the Erlang error logger

```erlang
error_logger:error_msg("A sample error caught by the bugsnag error logger.").
```

Or cause an error with a full stack trace:
Or cause an error with a full stack trace

```erlang
bugsnag:test_error().
```

When embedding, make sure to set up the configuration elements in your sys.config (or other config file):
When embedding, make sure to set up the configuration elements in your sys.config (or other config file)

```erlang
[
{bugsnag_erlang, [
{error_logger, true},
{api_key, "ENTER_API_KEY"},
{release_state, "development"}
]}
].
```
```erlang
[
{bugsnag_erlang, [
{error_logger, true},
{api_key, "ENTER_API_KEY"},
{release_state, "development"}
]}
].
```

And start the application:

```erlang
application:start(bugsnag)
```
```erlang
application:start(bugsnag)
```

Or add the application to your .app configuration.

Expand All @@ -54,19 +63,21 @@ We also provide a [lager](https://github.com/basho/lager) to report anything
above a certain level (by default, `error`) to Bugsnag.

For example, simply add
```

```erlang
{bugsnag_lager_handler, critical}
```

to your lager handler config.

## Formatting

To format the codebase:
To format the codebase

```shell
make format
```

## Thanks

Thank you to Ken Pratt: his library https://github.com/kenpratt/erlbrake provided a lot of code for this library.
Thank you to Ken Pratt: his library <https://github.com/kenpratt/erlbrake> provided a lot of code for this library.
2 changes: 1 addition & 1 deletion src/bugsnag.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-define(NOTIFY_ENDPOINT, "https://notify.bugsnag.com").

-define(NOTIFIER_NAME, <<"Bugsnag Erlang">>).
-define(NOTIFIER_VERSION, <<"1.1.1">>).
-define(NOTIFIER_VERSION, <<"2.0.0">>).
-define(NOTIFIER_URL, <<"https://github.com/dnsimple/bugsnag-erlang">>).

% Public API
Expand Down
2 changes: 1 addition & 1 deletion src/bugsnag_erlang.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, bugsnag_erlang, [
{description, "Bugsnag notifier for Erlang applications."},
{licenses, ["MIT"]},
{vsn, "1.1.1"},
{vsn, "2.0.0"},
{mod, {bugsnag_app, []}},
{applications, [kernel, stdlib, inets, crypto, ssl, lager]},
{links, [{"GitHub", "https://github.com/dnsimple/bugsnag-erlang"}]}
Expand Down

0 comments on commit 39f32f4

Please sign in to comment.