GithubHelp home page GithubHelp logo

Comments (5)

acw224 avatar acw224 commented on July 21, 2024

Some update:
erlang/rebar3#2580
#874

from relx.

ferd avatar ferd commented on July 21, 2024

We've communicated by e-mail before on this. In short, we think this is a good idea and something that does indeed need fixing, and greatly appreciate the PRs.

The one bit we're not sure of is the division of responsibility between Relx and Rebar3 in terms of policies and components. The one bit we think needs changing is that we're passing the warning through the Relx state, which sort of piggy-backs on implementation details.

What we think should happen instead is this:

  1. extend relx state to accept in a filter function for xref. Make it default to fun(_) -> true end if unspecified
  2. keep the relx state weaving the way you build it here, but apply the filter before printing the way it was already printing (within relx). We can at this point merge the Relx PR fine independently, which speaks to the isolation we get
  3. adjust the rebar3 PR to take the adjusted filtering function you already wrote, but wrap it in fun(Warn) -> YourCode end and set it in the relx state. You should use a closure to carry whatever rebar3 state you need without relx knowing a thing about the details
  4. The xref filtering is now configured by rebar3 knowing its config state but handled by Relx as if nothing special took place. We're essentially using this to tunnel rebar3's config into the relx state to apply it to the xref warnings, rather than tunneling the xref warnings back to rebar3.

Do you think this make sense? It sounds like it shouldn't be too much of a rewrite since many of the components can be kept and shifted around instead.

from relx.

acw224 avatar acw224 commented on July 21, 2024

Thanks for the feedback.

I was able to carry the required modifications pretty easily, except for one little detail. The method filter_xref_results in rebar3
https://github.com/erlang/rebar3/blob/3169392c7d73e6b849fb3117fb76177478c85f38/src/rebar_prv_xref.erl#L183 is a bit more involved than being just a predicate on list.

Therefore, I found it a bit easier to pass the whole filter method as a fun(list()) -> list(), which default to the identity.

from relx.

acw224 avatar acw224 commented on July 21, 2024

On Relx side #882
On rebar3 side erlang/rebar3#2611

from relx.

tsloughter avatar tsloughter commented on July 21, 2024

Resolved on the relx side in #882

from relx.

Related Issues (20)

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.