Comments (8)
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.
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.
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.
@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.
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.
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.
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.
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)
- [BUG] Problem running prettier in workflow HOT 5
- [BUG] Doesn't fail on infer parser failed HOT 4
- [BUG] Shouldn't delete node_modules HOT 8
- [BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php'
- [BUG] Cannot find module 'prettier-plugin-tailwindcss' HOT 11
- [BUG] `prettier` not installed correctly HOT 9
- [BUG] prettier: command not found HOT 3
- [BUG] Problem --writer HOT 4
- [BUG] Process completed with exit code 1 HOT 5
- [BUG] Example not working. HOT 4
- IDEA: Add push_options parameter HOT 3
- [BUG] Error: Process completed with exit code 1 when using prettier-php HOT 12
- [BUG] Code style issues found, can't reproduce locally HOT 2
- [FEATURE] Format only changed lines not the whole file HOT 1
- [BUG] Should work when package-lock.json is not versioned HOT 3
- [FEATURE] Don't log unchanged files
- [BUG] Dry run fails in spite of the fact that a line length does not exceed 80 chars. HOT 2
- What is status code 128? HOT 5
- Readme out of date
- [FEATURE] Print the `prettier` command to be executed before executing it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier_action.