jfmengels / elm-review

Analyzes Elm projects, to help find mistakes before your users find them.
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
Other
252 stars 13 forks source link

Issue when updating #142

Closed AntouanK closed 1 year ago

AntouanK commented 1 year ago

Hi there.

I'm having an issue with elm-review where it keeps asking to update. So initially it says :

yarn run v1.22.19
$ elm-review --ignore-files src/Dtos.elm --ignore-files src/Design/Components/Chips.elm
-- UNSUPPORTED ELM-REVIEW VERSION ----------------------------------------------

You are using jfmengels/elm-review v2.6.2, but I need it to be
2.10.0 <= v < 3.0.0.

Please upgrade your version by running
npx elm-json install jfmengels/elm-review@2 inside
of /run/media/antouank/evo1/_REPOS_/_Gyldendal_/GrTeTo/TeTo.Web/review.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I go into /review and run the command it asks me to.

> npx elm-json install jfmengels/elm-review@2
npm WARN config init.author.name Use `--init-author-name` instead.

-- PACKAGE CHANGES READY -------------------------------------------------------

I want to make some changes to your direct dependencies

- [CHG] jfmengels/elm-review 2.6.2 -> 2.9.1

Should I make these changes? yes
Saved updated elm.json!

Then, running review gives me this:

yarn run v1.22.19
$ elm-review --ignore-files src/Dtos.elm --ignore-files src/Design/Components/Chips.elm
-- UNSUPPORTED ELM-REVIEW VERSION ----------------------------------------------

You are using jfmengels/elm-review v2.9.1, but I need it to be
2.10.0 <= v < 3.0.0.

Please upgrade your version by running
npx elm-json install jfmengels/elm-review@2 inside
of /run/media/antouank/evo1/_REPOS_/_Gyldendal_/GrTeTo/TeTo.Web/review.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

not sure how to get over that issue. any ideas?

I even tried to change it manually to 2.10.0 and I get this :

yarn run v1.22.19
$ elm-review --ignore-files src/Dtos.elm --ignore-files src/Design/Components/Chips.elm
-- CONFIGURATION COMPILATION ERROR ---------------------------------------------

I encountered a problem when solving dependencies:

-- NO VALID PACKAGE VERSION ----------------------------------------------------

Because jfmengels/elm-review 2.10.0 depends on elm-explorations/test 2.0.1 <= v
< 3.0.0 and elm-explorations/test 2.0.1 <= v < 3.0.0 is unavailable, no valid
set of package versions could be found.

And because this project depends on jfmengels/elm-review 2.10.0, no valid set of
package versions could be found.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
jfmengels commented 1 year ago

Hi @AntouanK,

elm-json is not upgrading elm-review to the latest version because starting from v2.10.0, this package depends on elm-explorations/test v2, and in your review/elm.json you are (I'm guessing) depending on elm-explorations/test v1.

I'm improving the error message for this kind of issue in the next version of the CLI, but you should be able to sort the issue by running the following command, which should bump both packages at the same time.

npx elm-json upgrade --unsafe

I hope this helps!

PS: If you always run the --ignore-files flags, you should specify ignored files in the ReviewConfig.elm file instead (using this function). The way to run elm-review should for all projects be without flags.

AntouanK commented 1 year ago

Thank you for the answer! :+1: