Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: consistent deps applications #334

Open
paulo-ferraz-oliveira opened this issue Feb 14, 2024 · 3 comments
Open

New rule: consistent deps applications #334

paulo-ferraz-oliveira opened this issue Feb 14, 2024 · 3 comments
Labels
Milestone

Comments

@paulo-ferraz-oliveira
Copy link
Collaborator

Name

consistent_deps_applications

Brief Description

It's common to have .app.src updated with the dep names from rebar.config. This rule would look at rebar.config's deps, and compare them with the first found .app.src file in src/.

Reasoning

One less thing to remember when you're adding dependencies to your projects.

Refactoring Proposal

Make sure their list, in .app.src, is the same as deps. We could output the comma-separated list that could be simply copy-and-pasted, then formatted, as well as present an option to exclude applications when these aren't supposed to be in the .app.src file.

@elbrujohalcon
Copy link
Member

It probably shouldn't be "the same list", since some applications are libraries and therefore there is no need to start them as part of the main application startup procedure, but the .app.src list should 100% be "a sublist" of deps.

@elbrujohalcon
Copy link
Member

Oh, and we need to be careful with umbrella repos, too.

@elbrujohalcon
Copy link
Member

On the other hand, if there is an app on .app.src that's not on deps (i.e., the list is not a sublist), the main app will fail on initialization (i.e. ensure_all_started(the_main_app)), or (if the app is never initialized - again, library apps) it will fail on Dialyzer/Xref checks when they find unknown function calls. That is, unless the app is never used, in which case this should be a more suitable rule for Hank than Elvis.

@elbrujohalcon elbrujohalcon added this to the 4.1.0 milestone Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants