diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d56a6b6..e9f6fe3 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,22 +4,26 @@ about: Create a report to help us improve title: '' labels: bug assignees: '' - --- ## Bug Description + A clear and concise description of what the bug is. ## To Reproduce + Steps to reproduce the behavior ## Expected Behavior + A clear and concise description of what you expected to happen. ## `rebar3` Logs + If applicable, run `rebar3` with `DIAGNOSTIC=1` and attach all the logs to your report. ## Additional Context - - OS: [e.g. MacOS] - - Erlang version - - rebar3 version + +- OS: [e.g. MacOS] +- Erlang version +- rebar3 version diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 219ef58..862d1ee 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,17 +4,20 @@ about: Suggest an idea for this project title: '' labels: enhancement assignees: '' - --- -## Is your feature request related to a problem? Please describe. +## Is your feature request related to a problem? Please describe + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ## Describe the solution you'd like + A clear and concise description of what you want to happen. ## Describe alternatives you've considered + A clear and concise description of any alternative solutions or features you've considered. ## Additional Context + Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/other-issues.md b/.github/ISSUE_TEMPLATE/other-issues.md index 683f930..5c5b06d 100644 --- a/.github/ISSUE_TEMPLATE/other-issues.md +++ b/.github/ISSUE_TEMPLATE/other-issues.md @@ -4,7 +4,6 @@ about: Something that's not covered by the other categories title: '' labels: '' assignees: '' - --- diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index 3c7507b..24caa99 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -1,6 +1,7 @@ +--- name: Erlang CI -on: [push, pull_request] +"on": [push, pull_request] env: ERL_FLAGS: "-enable-feature all" @@ -9,33 +10,41 @@ jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - otp: ['25.2.1'] - rebar: ['3.20.0'] + otp: ["25", "26"] + rebar: ["3.22"] steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - id: setup-beam - with: - otp-version: ${{matrix.otp}} - rebar3-version: ${{matrix.rebar}} - - name: Restore _build - uses: actions/cache@v2 - with: - path: _build - key: _build-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}} - - name: Restore rebar3's cache - uses: actions/cache@v2 - with: - path: ~/.cache/rebar3 - key: rebar3-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}} - - name: Compile - run: rebar3 compile - - name: Format check - run: rebar3 format --verify - - name: Run tests and verifications - run: rebar3 test + - uses: actions/checkout@v3 + - uses: erlef/setup-beam@v1 + id: setup-beam + with: + otp-version: ${{matrix.otp}} + rebar3-version: ${{matrix.rebar}} + - name: Restore _build + uses: actions/cache@v3 + with: + path: _build + key: "_build-cache-for + -os-${{runner.os}} + -otp-${{steps.setup-beam.outputs.otp-version}} + -rebar3-${{steps.setup-beam.outputs.rebar3-version}} + -hash-${{hashFiles('rebar.lock')}}" + - name: Restore rebar3's cache + uses: actions/cache@v3 + with: + path: ~/.cache/rebar3 + key: "rebar3-cache-for + -os-${{runner.os}} + -otp-${{steps.setup-beam.outputs.otp-version}} + -rebar3-${{steps.setup-beam.outputs.rebar3-version}} + -hash-${{hashFiles('rebar.lock')}}" + - name: Compile + run: rebar3 compile + - name: Format check + run: rebar3 format --verify + - name: Run tests and verifications + run: rebar3 as test test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6b4f8e5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +--- +name: Lint + +"on": [push, pull_request] + +jobs: + lint: + name: Lint + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + # uses .markdownlint.yml for configuration + - name: markdownlint + uses: DavidAnson/markdownlint-cli2-action@v11 + with: + globs: | + .github/**/*.md + *.md + + - name: yamllint + uses: ibiqlik/action-yamllint@v3 + with: + file_or_dir: | + .github/**/*.yml + .*.yml + strict: true + config_file: .yamllint.yml diff --git a/.gitignore b/.gitignore index a44178b..a4d70d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,5 @@ rebar3.crashdump .rebar3 _* -.eunit -*.o -*.beam -*.plt erl_crash.dump -.concrete/DEV_MODE - -.rebar -rel/ -ebin/ - -_build -_checkouts doc/ -rebar3 diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..90b8143 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,4 @@ +--- +default: true +MD013: + line_length: 100 diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..8cd0bbe --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,5 @@ +--- +extends: default +rules: + line-length: + max: 100 diff --git a/CHANGELOG.md b/CHANGELOG.md index c09ecc7..c4838ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,3 @@ +# Changelog + See the [Releases](../../releases) page. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 21eb30d..5e4bc8f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at rtb-team@nextroll.com. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -67,10 +67,10 @@ members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e16c403..2cfbdb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,17 +5,17 @@ helps, and credit will always be given. You can contribute in many ways: -Types of Contributions ----------------------- +## Types of Contributions ### Report Bugs -Report bugs at https://github.com/AdRoll/rebar3_depup/issues. +Report bugs at . If you are reporting a bug, please include: * Your operating system name and version. -* Any details about your local setup that might be helpful in troubleshooting (OTP version, rebar3 version, sample code, etc). +* Any details about your local setup that might be helpful in troubleshooting +(OTP version, rebar3 version, sample code, etc). * Detailed steps to reproduce the bug. ### Fix Bugs @@ -36,17 +36,18 @@ articles, and such. ### Submit Feedback -The best way to send feedback is to file an issue at https://github.com/AdRoll/rebar3_depup/issues. +The best way to send feedback is to file an issue at . If you are proposing a feature: * Explain in detail how it would work. * Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions are welcome :) - -Get Started! ------------- +* Remember that this is a volunteer-driven project, and that contributions are +welcome :) + +## Get Started! + Ready to contribute? Here's how to set up `rebar3_depup` for local development. 1. Fork the `rebar3_depup` repo on GitHub. @@ -55,7 +56,7 @@ Ready to contribute? Here's how to set up `rebar3_depup` for local development. `$ git clone git@github.com:your_name_here/rebar3_depup.git` -3. Compile the project, assuming you rebar3 and OTP 21 installed, you can run: +3. Compile the project, assuming you rebar3 and OTP 24 installed, you can run: `$ rebar3 compile` @@ -65,20 +66,21 @@ Ready to contribute? Here's how to set up `rebar3_depup` for local development. Now you can make your changes locally. -5. When you're done making changes, check that your changes pass the tests by running `rebar3 test`. You might have to run it twice, if the `dialyzer` step fails while building the PLT. It's a known annoyance, sorry about that. +5. When you're done making changes, check that your changes pass the tests +by running `rebar3 test`. You might have to run it twice, if the `dialyzer` +step fails while building the PLT. It's a known annoyance, sorry about that. 6. Commit your changes and push your branch to GitHub: ```bash - $ git add . - $ git commit -m "Your detailed description of your changes." - $ git push origin name-of-your-bugfix-or-feature + git add . + git commit -m "Your detailed description of your changes." + git push origin name-of-your-bugfix-or-feature ``` 7. Submit a pull request through the GitHub website. -Pull Request Guidelines ------------------------ +## Pull Request Guidelines Before you submit a pull request, check that it meets these guidelines: diff --git a/README.md b/README.md index 582d2cf..5feaac3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# rebar3_depup +# rebar3_depup [![Erlang CI](https://github.com/AdRoll/rebar3_depup/actions/workflows/erlang.yml/badge.svg)](https://github.com/AdRoll/rebar3_depup/actions/workflows/erlang.yml) + ## Dependency updater for rebar3 managed projects ![Cinderella Upgrade](https://media1.tenor.com/images/5d0c66a25a24f1c89936b90ea54ac41a/tenor.gif?itemid=13582416) @@ -16,14 +17,17 @@ You can add it to your _global `rebar.config`_ (e.g. `~/.config/rebar3/rebar.con Then... ```bash -$ rebar3 update-deps +rebar3 update-deps ``` ### ⚠️ Warning ⚠️ + With the default options (see below), this project assumes that… + 1. You have `rebar.config` file in your root folder 1. You do not use a `rebar.config.script` -1. The current OS user has access to the git repos that you have in your `rebar.config` file. +1. The current OS user has access to the git repos that you have in +your `rebar.config` file. ### Command-Line Options @@ -58,22 +62,26 @@ Usage: rebar3 update-deps [-r []] [-c []] ## Configuration -To automatically ignore updates for one or more deps, add the `ignore` configuration to your `rebar.config`: +To automatically ignore updates for one or more deps, add the `ignore` +configuration to your `rebar.config`: ```erlang %% Ignore any updates for eredis and lager. {depup, [{ignore, [eredis, lager]}]}. ``` -To only update if the specified SemVer component has changed, use `only`. Note that this configuration can +To only update if the specified SemVer component has changed, use `only`. +Note that this configuration can be overridden by the `-o/--only` command-line argument: ```erlang -%% Ignore any updates that change more than the minor (and patch) version of any dependency. +%% Ignore any updates that change more than the minor +%% (and patch) version of any dependency. {depup, [{only, minor}]. ``` -With the above configuration in your `rebar.config`, running the following will update all dependencies by overriding `minor` with `none`: +With the above configuration in your `rebar.config`, running the following will +update all dependencies by overriding `minor` with `none`: ```bash rebar3 update-deps --only none @@ -82,11 +90,11 @@ rebar3 update-deps --only none ## Build ```bash -$ rebar3 compile +rebar3 compile ``` ## Test ```bash -$ rebar3 test +rebar3 test ``` diff --git a/priv/overview.edoc b/priv/overview.edoc deleted file mode 100644 index 0825947..0000000 --- a/priv/overview.edoc +++ /dev/null @@ -1,8 +0,0 @@ -** this is the overview.doc file for rebar3_depup ** - -@author Brujo -@title DepUp: Dependency Updater for rebar3 Projects -@doc This project provides a rebar3 plugin to use the rebar3 depup command. - Use it to update your dependencies to their latest versions. - -@reference See our README for more information. diff --git a/rebar.config b/rebar.config index b757628..9e75a0d 100644 --- a/rebar.config +++ b/rebar.config @@ -1,30 +1,38 @@ {erl_opts, [warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}. -{minimum_otp_vsn, "23"}. - -{cover_enabled, true}. - -{cover_opts, [verbose]}. +{minimum_otp_vsn, "24"}. {deps, [{hex_core, "~> 0.10.0"}, {verl, "~> 1.1.1"}]}. -{profiles, [{test, [{deps, [{meck, "~> 0.9.2"}]}]}]}. +{profiles, + [{test, + [{deps, [{meck, "~> 0.9.2"}]}, + {cover_enabled, true}, + {cover_opts, [verbose]}, + {extra_src_dirs, [{"test", [{recursive, true}]}]}, + {xref_extra_paths, ["test"]}]}]}. {dialyzer, [{warnings, - [no_return, unmatched_returns, error_handling, missing_return, extra_return]}]}. - -{edoc_opts, - [{todo, true}, - {title, "Rebar3 DepUp"}, - {overview, "priv/overview.edoc"}, - {packages, true}, - {subpackages, true}, - {source_path, "src"}, - {application, rebar3_depup}, - {new, true}, - report_missing_types]}. + [underspecs, + unmatched_returns, + error_handling, + missing_return, + extra_return, + no_unknown]}, + {plt_extra_apps, [common_test]}]}. + +{xref_checks, [deprecated_function_calls, deprecated_functions]}. + +{ex_doc, + [{extras, ["README.md"]}, + {main, "README.md"}, + {api_reference, false}, + {source_url, "https://github.com/AdRoll/rebar3_depup"}, + {prefix_ref_vsn_with_v, false}]}. + +{hex, [{doc, ex_doc}]}. {format, [{files, ["*.config", "src/*", "test/*"]}]}. @@ -34,12 +42,12 @@ {additional_dictionaries, ["nextroll.dict"]}]}. {alias, - [{test, - [compile, format, spellcheck, lint, hank, dialyzer, {ct, "--verbose"}, cover, edoc]}]}. + [{test, [compile, format, spellcheck, lint, hank, xref, dialyzer, ct, cover, ex_doc]}]}. {project_plugins, [{rebar3_hex, "~> 7.0.7"}, {rebar3_format, "~> 1.3.0"}, {rebar3_lint, "~> 3.1.0"}, {rebar3_hank, "~> 1.4.0"}, - {rebar3_sheldon, "~> 0.4.2"}]}. + {rebar3_sheldon, "~> 0.4.2"}, + {rebar3_ex_doc, "~> 0.2.20"}]}. diff --git a/src/dep_hex.erl b/src/dep_hex.erl index 29c9b83..cfcd154 100644 --- a/src/dep_hex.erl +++ b/src/dep_hex.erl @@ -1,3 +1,4 @@ +%% @private %% @doc Interface with hex.pm -module(dep_hex). diff --git a/src/dep_updater.erl b/src/dep_updater.erl index a09e969..2222ed0 100644 --- a/src/dep_updater.erl +++ b/src/dep_updater.erl @@ -1,3 +1,4 @@ +%% @private %% @doc Core module of the system. %% Updates a list of dependencies according to the provided options. -module(dep_updater). diff --git a/src/rebar3_depup.app.src b/src/rebar3_depup.app.src index 83a2fcf..ce9ff96 100644 --- a/src/rebar3_depup.app.src +++ b/src/rebar3_depup.app.src @@ -7,4 +7,4 @@ {env, []}, {modules, []}, {licenses, ["MIT"]}, - {links, [{"github", "https://github.com/AdRoll/rebar3_depup"}]}]}. + {links, [{"GitHub", "https://github.com/AdRoll/rebar3_depup"}]}]}. diff --git a/src/rebar3_depup.erl b/src/rebar3_depup.erl index 5be0c1c..92be8e5 100644 --- a/src/rebar3_depup.erl +++ b/src/rebar3_depup.erl @@ -1,3 +1,4 @@ +%% @private %%% @doc Main entry point for the rebar3 depup plugin -module(rebar3_depup).