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

fix: update unicorn preset to 56, update prettier to v3 #248

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

antongolub
Copy link
Member

@antongolub antongolub commented Oct 10, 2024

@antongolub antongolub force-pushed the unicorn-56 branch 2 times, most recently from 7e647dc to aef2438 Compare October 10, 2024 17:03
@antongolub antongolub changed the title fix: update unicorn preset to 56 fix: update unicorn preset to 56, update prettier to v3 Oct 10, 2024
@antongolub antongolub force-pushed the unicorn-56 branch 3 times, most recently from 5441908 to 438defb Compare October 10, 2024 17:24
BREAKING CHANGE: prettier v3

expect(readFileSync(temp, 'utf-8')).toBe(readFileSync(output, 'utf-8'))
const result = cp.execSync(`${bin} ${input} --config ${configPath}`).toString()

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix AI about 1 month ago

To fix the problem, we should avoid constructing the shell command as a single string and instead use the cp.execFileSync method, which allows us to pass the command and its arguments separately. This approach prevents the shell from interpreting special characters in the paths.

  1. Replace the cp.execSync call with cp.execFileSync.
  2. Pass the command (bin) and its arguments (input, --config, configPath) as separate parameters to cp.execFileSync.
Suggested changeset 1
packages/prettier-config-qiwi/src/test/ts/index.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/prettier-config-qiwi/src/test/ts/index.ts b/packages/prettier-config-qiwi/src/test/ts/index.ts
--- a/packages/prettier-config-qiwi/src/test/ts/index.ts
+++ b/packages/prettier-config-qiwi/src/test/ts/index.ts
@@ -19,3 +19,3 @@
 
-    const result = cp.execSync(`${bin} ${input} --config ${configPath}`).toString()
+    const result = cp.execFileSync(bin, [input, '--config', configPath]).toString()
     expect(result).toBe(fs.readFileSync(output, 'utf-8'))
EOF
@@ -19,3 +19,3 @@

const result = cp.execSync(`${bin} ${input} --config ${configPath}`).toString()
const result = cp.execFileSync(bin, [input, '--config', configPath]).toString()
expect(result).toBe(fs.readFileSync(output, 'utf-8'))
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@antongolub antongolub merged commit af13baf into master Oct 10, 2024
12 checks passed
@antongolub antongolub deleted the unicorn-56 branch October 10, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants