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

Files with parentheses fails format. #1473

Closed
4 tasks done
ZachJW34 opened this issue Jun 7, 2019 · 2 comments · Fixed by #1485
Closed
4 tasks done

Files with parentheses fails format. #1473

ZachJW34 opened this issue Jun 7, 2019 · 2 comments · Fixed by #1485
Labels
community This is a good first issue for contributing outdated type: bug

Comments

@ZachJW34
Copy link
Contributor

ZachJW34 commented Jun 7, 2019

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

Files with parentheses in them should be formatted as normal

Current Behavior

Files that contain parentheses e.g some(file).json cause formatting to fail.

Failure Information

Parentheses in a shell command throw a syntax error. The nx format scripts pass in the list of affected files to prettier via execSync without escaping parentheses or wrapping the file path in quotes. The error thrown is:

bash: syntax error near unexpected token `('

Steps to Reproduce

  1. yarn create nx-workspace myworkspace
  2. cd myworkspace
  3. touch some\(file\).json
  4. git add .
  5. git commit -m "testing"
  6. yarn format --base HEAD~1 --head HEAD

Context

Tested with Nx version 8:

"devDependencies": {
    "@nrwl/workspace": "8.1.0",
    "@types/node": "~8.9.4",
    "dotenv": "6.2.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.4.5",
    "prettier": "1.16.4",
    "@angular/cli": "8.0.0"
  }

The relevant code can be found here.
I'd be happy to submit a PR to fix this so let me know.

@FrozenPandaz FrozenPandaz added community This is a good first issue for contributing type: bug labels Jun 11, 2019
@FrozenPandaz
Copy link
Collaborator

It would be great if you could open a PR to fix this issue 👍

ZachJW34 added a commit to ZachJW34/nx that referenced this issue Jun 12, 2019
Files that contained parentheses caused 'yarn format' to fail unless the files passed to the
prettier cli are wrapped in quotes

fix nrwl#1473
ZachJW34 added a commit to ZachJW34/nx that referenced this issue Jun 12, 2019
Files that contained parentheses caused 'yarn format' to fail unless the files passed to the
prettier cli are wrapped in quotes

fix nrwl#1473
ZachJW34 added a commit to ZachJW34/nx that referenced this issue Jun 12, 2019
Files that contained parentheses caused 'yarn format' to fail unless the files passed to the
prettier cli are wrapped in quotes

fix nrwl#1473
ZachJW34 added a commit to ZachJW34/nx that referenced this issue Jun 14, 2019
Files that contained parentheses caused 'yarn format' to fail unless the files passed to the
prettier cli are wrapped in quotes

fix nrwl#1473
vsavkin pushed a commit that referenced this issue Jun 15, 2019
Files that contained parentheses caused 'yarn format' to fail unless the files passed to the
prettier cli are wrapped in quotes

fix #1473
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants