Git Product home page Git Product logo

rebar3_plugin's Introduction

rebar3_plugin

A rebar_plugin is a simple rebar3 GitHub template which includes the basic functionality that will be used in any rebar3 plugin, as well as a ready-made template for GitHub Actions, GitHub Issue Templates, and the configuration for some useful tools like dialyzer, xref, hank, etc.

How it works

  • On the main page of this repository, you should find and click a button called Use this template.
  • Add Repository name and Description for your particular plugin.
  • Then clone and build your template plugin and push it into your GitHub repository
  • Finally, run ./bootsrap to setup your repository using the name you've chosen.
$ git clone https://github.com/yourname/your_rebar3_plugin_repo.git
$ cd your_rebar3_plugin_repo
$ ./bootstrap
$ git add .
$ git commit -m "Base rebar3 template"
$ git push origin main

Commands

Currently supports the following commands:

  • bootstrap - build by default with adding useful tools like dialyzer, xref, hank, etc
$ ./bootstrap
$ tree -a
├── .github
│   ├── ISSUE_TEMPLATE
│   │   ├── bug_report.md
│   │   ├── feature_request.md
│   │   └── other_issues.md
│   └── workflows
│       └── ci.yaml
├── src
│   ├── rebar3_plugin.app.src
│   ├── rebar3_plugin.erl
│   └── rebar3_plugin_prv.erl
└── test
    └── rebar3_plugin_SUITE.erl
├── .gitignore
├── LICENSE
├── README.md
├── CHANGELOG.md
├── rebar.config
├── elvis.config
├── rebar.lock
  • bootstrap clean - build without adding useful tools, configs, GitHub folder
$ ./bootstrap
$ tree -a
├── src
│   ├── rebar3_plugin.app.src
│   ├── rebar3_plugin.erl
│   └── rebar3_plugin_prv.erl
└── test
    └── rebar3_plugin_SUITE.erl
├── .gitignore
├── LICENSE
├── README.md
├── CHANGELOG.md
├── rebar.config
├── rebar.lock

rebar3_plugin's People

Contributors

vkatsuba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rebar3_plugin's Issues

edoc_opts (rebar.config)

{edoc_opts, [
    {includes, ["src"]},
    {preprocess, true}
]}.

The last option is especially interesting when macros (@elbrujohalcon's favourite Erlang component) are present. The includes I'd have to check (can't remember of the top of my head) but I know it was important for us at a point in time.

Fix spec of test case

Used -spec success(list()) -> ok | no_return()..
Expected -spec success(ct_suite:ct_config()) -> ok | no_return().

How about a CHANGELOG?

It's always good to have one in any software project, IMO.
I usually go for something like

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

rebar2 in .gitignore: why?

If this is a rebar3 plugin for rebar3 plugins, why ignore stuff that's not generated by the plugin instance?

Also, to start, I think .gitignore can be as easy as

.rebar3
_build
erl_crash.dump
log
rebar3.crashdump

I'm also not fond of ignoring _checkouts/. If it's there, it's changing behaviour, so whatever gets pushed might be different from what is excepted. (and again, _checkouts isn't generated, but put there on purpose)

How about a default elvis.config?

I usually go with something like

[{elvis, [
    {config, [
        #{ dirs => ["src/**"],
           filter => "*.erl",
           ruleset => erl_files },
        #{ dirs => ["test/**"],
           filter => "*.erl",
           ruleset => erl_files },
        #{ dirs => ["."],
           filter => "rebar.config",
           ruleset => rebar_config },
        #{ dirs => ["."],
           filter => "elvis.config",
           ruleset => elvis_config }
    ]},
    {verbose, false}
]}].

to start.

rebar3_lint implements its own default, but it's a more reduced version of the above. Also, some people do prefer to not include tests in their analysis, but this is a template that can be stripped somewhat, right?

Fix link to rebar3

In README used link https://rebar3.readme.io but should be https://www.rebar3.org.

Add clean argument to bootstrap

rebar3_plugin version

0.1.0

OTP version

23.3/24.1

Description

  • Motivation
    Extension CLI bootstrap for more flexibility since not for all plugins are suitable the basic set of functionality and configuration that is present in the version 0.1.0.
  • Proposal
    Extension CLI bootstrap for parse clean argument for build plugin template without additional tools like dialyzer, xref, hank etc.

Current behavior

CLI bootstrap working without additional arguments and build plugin template with additional tools like dialyzer, xref, hanketc.

Expected behavior

CLI bootstrap should accept additional argument clean for build plugin template without additional arguments and build plugin template with additional tools like dialyzer, xref, hank etc.

xref defaults (rebar.config)

I usually use the following

{xref_checks, [
    deprecated_function_calls,
    exports_not_used,
    locals_not_used,
    undefined_function_calls
]}.

though some might issue unwanted warnings for lack of context (eg. calling rebar3_ functions)

erl_opts (rebar.config)

I'm used to having this as simple as

{erl_opts, [
    debug_info,
    warn_export_vars,
    warn_missing_spec_all,
    warn_unused_import,
    warnings_as_errors,
    {i, "src"}
]}.

because most other options are already there, by default, but one would've to parse the existing list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.