Fix bug where you weren't able to use both the -q and -j flags at the same time #227

Open
Vylpes wants to merge 11 commits from feature/181-q-json-flags into develop
Owner
  • Fix bug where if you supplied both -q/--query-metadata and -j/--json the query metadata wasn't added to the output
  • Update tests

#181

- Fix bug where if you supplied both `-q`/`--query-metadata` and `-j`/`--json` the query metadata wasn't added to the output - Update tests #181
Vylpes added 3 commits 2024-09-15 11:56:43 +01:00
Plan tests
All checks were successful
Test / build (push) Successful in 9s
ebf270f2bb
Update tests
All checks were successful
Test / build (push) Successful in 9s
bf026dae32
Vylpes requested review from VylpesTester 2024-09-15 11:56:47 +01:00
Vylpes added the
type
bug
label 2024-09-15 11:56:51 +01:00
VylpesTester was assigned by Vylpes 2024-09-15 11:56:53 +01:00
VylpesTester requested changes 2024-09-15 16:19:28 +01:00
Dismissed
@ -8,6 +8,15 @@ export default class OutputHelper {
const outputLines: string[] = [];
if (options.json) {
if (options.queryMetadata != null) {
Member

I feel like there could be a better way to do this? As now we have the output kinda splintered. I suggest maybe we have the json object created in a separate function, and then split to human-readable if -j isn't present

I feel like there could be a better way to do this? As now we have the output kinda splintered. I suggest maybe we have the json object created in a separate function, and then split to human-readable if `-j` isn't present
Vylpes marked this conversation as resolved
Vylpes added 3 commits 2024-10-18 18:58:03 +01:00
Vylpes added 1 commit 2024-10-18 19:12:20 +01:00
New line the return statement
All checks were successful
Test / build (push) Successful in 8s
3b284484c2
Vylpes added 1 commit 2024-10-18 19:27:36 +01:00
Make object flat
Some checks failed
Test / build (push) Failing after 9s
438884b270
Vylpes added 1 commit 2024-10-18 19:28:21 +01:00
Fix linting
All checks were successful
Test / build (push) Successful in 8s
eb09754e2e
VylpesTester requested changes 2024-10-19 20:35:23 +01:00
Dismissed
@ -33,0 +25,4 @@
let output = "";
for (const key in object) {
output += `${key} = ${object[key]}\n`;
Member

This will add an additional new line at the end of the output which might not look right

This will add an additional new line at the end of the output which might not look right
Vylpes marked this conversation as resolved
Vylpes added 2 commits 2024-10-26 20:52:50 +01:00
Vylpes requested review from VylpesTester 2024-10-26 20:53:03 +01:00
VylpesTester reviewed 2024-10-26 21:58:46 +01:00
@ -33,0 +22,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
private static GetFriendlyObjectText(object: any): string {
const output: string[] = [];
Member

I don't think I like the way this is done, I think it should be how it was before, but when its actually printed to the terminal it should remove the appended new line

I don't think I like the way this is done, I think it should be how it was before, but when its actually printed to the terminal it should remove the appended new line
VylpesTester requested changes 2024-10-26 21:59:08 +01:00
VylpesTester left a comment
Member

See above

See above
Copilot reviewed 2024-11-18 20:50:30 +00:00
Vylpes requested review from Copilot 2024-11-18 20:51:07 +00:00
Copilot reviewed 2024-11-18 20:51:40 +00:00
@ -32,1 +21,4 @@
}
/* eslint-disable @typescript-eslint/no-explicit-any */
private static GetFriendlyObjectText(object: any): string {
Member

[nitpick] The use of 'any' for the object parameter is not ideal. Consider using a more specific type.

[nitpick] The use of 'any' for the object parameter is not ideal. Consider using a more specific type.
Vylpes removed review request for Copilot 2024-11-18 20:51:52 +00:00
All checks were successful
Test / build (push) Successful in 9s
Required
Details
This pull request has changes conflicting with the target branch.
  • src/helpers/outputHelper.ts
  • tests/helpers/outputHelper.test.ts
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/181-q-json-flags:feature/181-q-json-flags
git checkout feature/181-q-json-flags
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: RabbitLabs/random-bunny#227
No description provided.