From 39f32f4d627ae3d16dd081e3eee4935426711548 Mon Sep 17 00:00:00 2001 From: Santiago Traversa Date: Thu, 30 Jan 2025 07:25:37 -0300 Subject: [PATCH] Bumps to v2.0.0 (#19) * Bumps to v2.0.0 * Adapts CHANGELOG.md * Adds markdownlint and yamllint * Update LICENSE.md * Update .markdownlint.yaml * Update README.md (Adds badges) --- .github/workflows/ci.yml | 22 ++++++++++++++- .markdownlint.yaml | 13 +++++++++ .yamllint | 10 +++++++ CHANGELOG.md | 16 ++++++++--- CONTRIBUTING.md | 2 +- LICENSE.md => LICENSE | 2 +- README.md | 57 +++++++++++++++++++++++--------------- src/bugsnag.erl | 2 +- src/bugsnag_erlang.app.src | 2 +- 9 files changed, 94 insertions(+), 32 deletions(-) create mode 100644 .markdownlint.yaml create mode 100644 .yamllint rename LICENSE.md => LICENSE (95%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8ec0e..ff5aee5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,8 @@ name: CI on: pull_request: push: - branches: [ "main" ] + branches: + - main workflow_dispatch: concurrency: @@ -11,6 +12,25 @@ concurrency: 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/github-action-markdown-cli@v3.4.0 + 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 diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..5935c62 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,13 @@ +--- +default: true + +# no-hard-tabs +MD010: + code_blocks: false + +# no-multiple-blanks +MD012: + maximum: 2 + +# line-length +MD013: false diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..d08ddc1 --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +--- +extends: default +rules: + document-start: false + line-length: + max: 256 + level: warning + truthy: + ignore: | + /.github/workflows/*.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ebd158..fc6360c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c717f8e..1e51ba3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ## Tests diff --git a/LICENSE.md b/LICENSE similarity index 95% rename from LICENSE.md rename to LICENSE index 43d5bf9..e19f230 100644 --- a/LICENSE.md +++ b/LICENSE @@ -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. - diff --git a/README.md b/README.md index 99a8a14..6f23f78 100644 --- a/README.md +++ b/README.md @@ -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. @@ -54,14 +63,16 @@ 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 @@ -69,4 +80,4 @@ 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 provided a lot of code for this library. diff --git a/src/bugsnag.erl b/src/bugsnag.erl index 5450f23..994356c 100644 --- a/src/bugsnag.erl +++ b/src/bugsnag.erl @@ -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 diff --git a/src/bugsnag_erlang.app.src b/src/bugsnag_erlang.app.src index 25c2fcf..db6a99c 100644 --- a/src/bugsnag_erlang.app.src +++ b/src/bugsnag_erlang.app.src @@ -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"}]}