Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow per-project resolvers and formatters #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neomilium
Copy link
Member

No description provided.

@mtancoigne
Copy link
Member

Nice to have some revolvers here 🔫

@smortex
Copy link
Member

smortex commented Dec 17, 2021

Hum, I am not a fan of how we can add custom formatters and resolvers:

def load_classes(directory)
Dir["#{directory}/formatters/*.rb", "#{directory}/resolvers/*.rb"].sort.each do |file|
require file
end
end

Because this is just a require, this allow the user to break everything and change motoko behavior completely 😒 / execute arbitrary code at each command invocation. Evaluating code from the current working directory looks dangerous, it is the reason why 6cb50ef was not just adding load_config(".").

I feel like this whole support for local formatters / resolvers should be nucked: it was handy in the early days, but maybe we can bundle the code we need in motoko? If for some reason it is not desirable, maybe we can create extra gems that add such code? What do you think?

@neomilium
Copy link
Member Author

I really like the local resolvers/formatters capabilities as I think some, at least resolvers, will be specific to targeted infrastructure.

Bundling them (specific ones) in additional gem is painful: I already see use-case where I will usemotoko and its resolvers/formatter to process one subject then drop custom code when target reached.

Nevertheless, I think I can contribute some generic ones.

I use motoko from control-repo so I already execute arbitrary code shared by colleagues ;-)

@smortex smortex changed the title Allow per-project revolvers and formatters Allow per-project resolvers and formatters Dec 20, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants