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

Integrate clerk and clerk.toml #737

Open
denismerigoux opened this issue Oct 30, 2024 · 2 comments
Open

Integrate clerk and clerk.toml #737

denismerigoux opened this issue Oct 30, 2024 · 2 comments
Assignees
Labels
🏗️ build system Build system or Makefile ✨ enhancement New feature or request

Comments

@denismerigoux
Copy link
Contributor

denismerigoux commented Oct 30, 2024

clerk should foster the user to keep the clerk.toml file up to date with information about the project. More precisely, all modules considered for use inside a Catala project should be declared in clerk.toml. clerk should fail to integrate as a dependency or run a module not declared in clerk.toml; it can search for files looking like the requested module and print a warning suggesting the user to add it to clerk.toml, but it should only perform what the user wants if the correct module declarations are in clerk.toml.

For modules split across multiple files, it is OK for clerk.toml to list the files to be included in the module, in order. However, the module_uses directive of clerk.toml should be removed, as the usage of modules should be declared inside one of the Catala files. This is better because the module_uses directive does not support module aliases, whereas using a module from a Catala file supports this crucial feature.

The > Module Bla directive inside Catala files declaring it as a module should be removed from the Catala syntax, as the information it provides is now redundant with what clerk.toml declare. In particular, clerk.toml can declare a module with name foo but defined in file blah.catala_en. If clerk.toml does not declare a file (or multiple files) for a module, clerk should look for a file with the same name as the module in the project directories.

With these rules, clerk test, clerk typecheck and clerk run should take as arguments (to optionally restrict their effect) not filenames but module names, as declared in clerk.toml. The overarching objective is that clerk.toml should declare all symbols and concepts for the CLI of clerk to interact with : NO MORE FILENAMES PASSED TO THE clerk CLI.

@denismerigoux denismerigoux added ✨ enhancement New feature or request 🏗️ build system Build system or Makefile labels Oct 30, 2024
@denismerigoux denismerigoux changed the title clerk should pick up project information from clerk.toml Integrate clerk and clerk.toml Oct 30, 2024
@AltGr
Copy link
Contributor

AltGr commented Oct 30, 2024

I agree with the general direction, but see one exception: tests are, in general, not modules. I keep thinking it's more convenient if those can be discovered, and called by file name (or directory name to run/reset them in bulk).

@denismerigoux
Copy link
Contributor Author

denismerigoux commented Oct 30, 2024

I agree with you concerning tests. What this entails is that tests should be placed in module-less files, and OK for clerk test to take these filenames as arguments to restrict what to test, otherwise clerk test tests all tests discovered in the project directories. But for that vision we really need the equivalent of a #[test] marker for scopes that are in fact test. Since we're moving up the priority of the attribute language with #736 maybe now is the right time for such a test marker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏗️ build system Build system or Makefile ✨ enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants