-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): add NX_DEFAULT_OUTPUT_STYLE env var #33493
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
base: master
Are you sure you want to change the base?
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4725756 to
6d770d9
Compare
|
@AgentEnder any chance you could take another look? |
|
View your CI Pipeline Execution ↗ for commit 55c3ead
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
These changes fix the format:check failure by applying Prettier formatting to the code introduced in the PR. The original changes adding NX_DEFAULT_OUTPUT_STYLE support had inconsistent spacing and indentation that violated the project's formatting standards. Running nx format automatically corrected the formatting issues in both the test file and source file.
We verified this fix by re-running nx-cloud record -- nx format:check.
Suggested Fix changes
diff --git a/packages/nx/src/command-line/yargs-utils/shared-options.spec.ts b/packages/nx/src/command-line/yargs-utils/shared-options.spec.ts
index 0062d5bd6f..a16ae62278 100644
--- a/packages/nx/src/command-line/yargs-utils/shared-options.spec.ts
+++ b/packages/nx/src/command-line/yargs-utils/shared-options.spec.ts
@@ -113,8 +113,7 @@ describe('shared-options', () => {
const result = command.parseSync([]);
expect(result.outputStyle).toEqual('stream-without-prefixes');
}
- )
- );
+ ));
it('should set NX_TUI if using not set', () =>
withEnvironmentVariables(
diff --git a/packages/nx/src/command-line/yargs-utils/shared-options.ts b/packages/nx/src/command-line/yargs-utils/shared-options.ts
index ddd0d3aff8..ff5dfda909 100644
--- a/packages/nx/src/command-line/yargs-utils/shared-options.ts
+++ b/packages/nx/src/command-line/yargs-utils/shared-options.ts
@@ -326,10 +326,11 @@ export function withOutputStyleOption<T>(
.middleware([
(args) => {
if (
- !args.outputStyle &&
- process.env.NX_DEFAULT_OUTPUT_STYLE &&
- choices.includes(process.env.NX_DEFAULT_OUTPUT_STYLE as OutputStyle)) {
- args.outputStyle = process.env.NX_DEFAULT_OUTPUT_STYLE;
+ !args.outputStyle &&
+ process.env.NX_DEFAULT_OUTPUT_STYLE &&
+ choices.includes(process.env.NX_DEFAULT_OUTPUT_STYLE as OutputStyle)
+ ) {
+ args.outputStyle = process.env.NX_DEFAULT_OUTPUT_STYLE;
}
},
(args) => {
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally 4gl0-owqG
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Allows setting a default output style instead of having to include it on every command Closes nrwl#27490
6d770d9 to
55c3ead
Compare

Allows setting a default output style instead of having to include it on every command
Closes #27490
Current Behavior
We must specify --outputStyle on every command
Expected Behavior
Should allow overriding the default with an environment variable
Related Issue(s)
#27490
Fixes #27490