Code Monkey home page Code Monkey logo

Comments (8)

creyD avatar creyD commented on July 20, 2024

Pretty weird, sorry I wasn't able to investigate, will take a couple of days more. Do you have an idea what causes this? Maybe git changes the newline chars or something? There must be some kind of change.

from prettier_action.

davwheat avatar davwheat commented on July 20, 2024

Honestly I have no clue.

Prettier outputs that it all matches, then the action reports a failure.

I ended up switching to my own action in the end.

from prettier_action.

fsz-codeshop avatar fsz-codeshop commented on July 20, 2024

Hi guys! Maybe it is caused by this block on entry point?

  if $INPUT_DRY; then
    echo "Prettier found unpretty files!"
    exit 1
  else

from prettier_action.

creyD avatar creyD commented on July 20, 2024

@fsz-codeshop Can you please test it with the new push in dev? I tried your fix a couple of times now and it doesn't seem to work (https://github.com/creyD/prettier_test/runs/2313102123)

from prettier_action.

fsz-codeshop avatar fsz-codeshop commented on July 20, 2024

Hi @creyD, you are indeed right. It is not working with the dev branch. I am getting:

Error:  No parser and no file path given, couldn't infer a parser.

I have forked and worked on top of the main branch for that dry-run fix.
Nevertheless, I have also checked out the last commit on dev before merging my changes and I am still getting the same error (87e1553). When using fsz-codeshop/prettier_action@issue-37-dry-run-reporting-unpretty I get it working as expected:

Installing prettier...
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ [email protected]
added 1 package from 1 contributor in 0.627s
Prettifying files...
Files:
Checking formatting...
[warn] .github/PULL_REQUEST_TEMPLATE.md
[warn] docs/CONTRIBUTING.md
[warn] index.js
[warn] README.md
[warn] test.js
[warn] Code style issues found in the above file(s). Forgot to run Prettier?
Problem running prettier with --check --ignore-path ./.prettierignore --config ./prettier.config.js **/*.{js,ts,md}
Nothing to commit. Exiting.

Maybe it is something else of the other changes?

from prettier_action.

fsz-codeshop avatar fsz-codeshop commented on July 20, 2024

Furthermore, checking the provided link (https://github.com/creyD/prettier_test/runs/2313102123) it seems that it worked as expected

No unpretty files! Finishing dry-run.

Did I miss something?

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Furthermore, checking the provided link (https://github.com/creyD/prettier_test/runs/2313102123) it seems that it worked as expected

No unpretty files! Finishing dry-run.

Did I miss something?

It states that it worked, but there was a unpretty file and it even showed it in the "Files:" statement.

from prettier_action.

fsz-codeshop avatar fsz-codeshop commented on July 20, 2024

Ok. I think I got it.
The logic only works when using --check configuration because of the prettier command status code

Anyway, I reopened the PR (#49) with the change of the logic to handle the cases using --write + dry-run and --check + dry-run.

I have forked the prettier_test and ran some tests and it seems it is working as expected now. If you can check it =)

from prettier_action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.