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

Juvix format does not work as expected #3000

Open
heueristik opened this issue Sep 6, 2024 · 1 comment
Open

Juvix format does not work as expected #3000

heueristik opened this issue Sep 6, 2024 · 1 comment
Assignees

Comments

@heueristik
Copy link

Steps to reproduce:

checkout this commit: anoma/juvix-anoma-test@41b428e

  1. juvix clean --global && juvix clean && juvix dependencies update
  2. Execute juvix format --check and observe that it does nothing
  3. Exectue juvix-format --in-place and observe that it change 2 out of 4 files (it didn't change the files in the tests folder, which is unexpected)

Moreover, it would be nice if, both, juvix format --check and juvix format --in-place would return a list containing the files that are malformatted or were formatted in-place, respectively.

@janmasrovira
Copy link
Collaborator

it does not report about the files inside the tests folder because that's a different package (i.e. there is a package.juvix inside).

I've tried juvix format --check and it returns an error exit code but no output. That's the intended behaviour.

From juvix format --help:

Given a file, it prints the reformatted source to standard output.
Given a project directory it prints a list of unformatted files in the project.
Given no argument it prints a list of unformatted files in the project which contains the current directory.
[..]
  --check                  Do not print reformatted sources or unformatted file
                           paths to standard output.

So, if you want to get the list of unformatted files, you shouldn't pass --check.

It would be nice if [..] juvix format --in-place would return a list containing the files that are [..] formatted in-place

I agree.

We could consider rethinking the cli interface to make it more intuitive.
One option would be to rename --check to --silent (or something similar). Or even remove the flag.

@janmasrovira janmasrovira removed the bug label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants