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

mini-yetus: a yetus you fall in love with #4188

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

shjala
Copy link
Member

@shjala shjala commented Aug 30, 2024

Add script to run yetus only on changes made in the current branch against the master branch. This is much faster than running yetus on the entire codebase. Now you can do make mini-yetus!

Copy link
Contributor

@deitch deitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please!!

--patch-dir=/src/yetus-output > /dev/null 2>&1

echo "[+] Results:"
cat "$SRC_DIR/yetus-output/results-full.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should let the users decide to which files they want to look at it and remove the output by themselves... in my case I go directly to the result file I'm interested, e.g., results-shellcheck.txt or results-golangcilint.txt, here it's enforced to always get the full results and remove the output dir, sometimes users can also want to keep the results saved....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

@@ -0,0 +1,68 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any "bashism" in the script to enforce bash... better to keep /bin/sh....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you bashing my script? may the /bin/sh be with you!

@shjala
Copy link
Member Author

shjala commented Aug 30, 2024

btw the result is clickable if using something like VSCode.
image

@OhmSpectator
Copy link
Member

The CI version of Yetus tries its best to stop the new competitor:

tools/mini-yetus.sh:9:1:shellcheck: warning: Use var=$(command) to assign output (or quote to assign string). [SC2209]
tools/mini-yetus.sh:96:30:shellcheck: warning: In POSIX sh, &> is undefined. [SC3020]

@OhmSpectator
Copy link
Member

I also have a suggestion: could we add the mini-yetus run as a Makefile target?

@shjala shjala requested a review from rene August 30, 2024 10:17
@@ -0,0 +1,106 @@
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX header, please :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost none of the files in tools have it, I though that's the tradition :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it was an intentional tradition =)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😃 done.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no "Linux Foundation".

@shjala shjala force-pushed the love_yetus branch 2 times, most recently from 01e4dc2 to e60f7fb Compare August 30, 2024 10:26

# copy all the dot files from root to the SRC_DIR, this includes all
# the yetus configuration files.
find . -maxdepth 1 -type f -name '.*' -exec cp --parents {} "$SRC_DIR/" \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! ❤️

@shjala
Copy link
Member Author

shjala commented Aug 30, 2024

if anyone has a better suggestion for MYETUS_XXX variables, please tell me.

@@ -459,6 +459,10 @@ yetus:
--plugins=all \
--patch-dir=/src/yetus-output

mini-yetus:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫶🏻🫶🏻🫶🏻

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫰🏼🫰🏼🫰🏼

@shjala shjala self-assigned this Aug 30, 2024
@shjala shjala added the enhancement New feature or request label Aug 30, 2024
@OhmSpectator
Copy link
Member

Ah, sorry for the failure of the new linter. Just rebase on the latest master

Add script to run yetus only on changes made in the
current branch against the master branch. This is much
faster than running yetus on the entire codebase.

Signed-off-by: Shahriyar Jalayeri <[email protected]>
Copy link
Member

@OhmSpectator OhmSpectator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! You can also add info about the Maketarget into the commit message, but it's optional.

@OhmSpectator OhmSpectator merged commit 83c73a5 into lf-edge:master Aug 30, 2024
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants