-
Notifications
You must be signed in to change notification settings - Fork 149
Fix #679 Illegal number #683
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
Conversation
c613a91 to
23a0926
Compare
lib/formats/sh.sh
Outdated
| # Run check | ||
| check_for_equality "$1" "$2"; check_return = $? | ||
| # Check latest result. Note the directory compare returns text, which would fail this function #679 | ||
| if [ "$check_return" -ne "0" ]; then |
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.
What about if ! check_for_equality "$1" "$2"; then ?
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.
That is shorter.
I am not a bash guru 😁 but the first is a bit more clear to me that we are checking the return value of the function as the function itself is returning the full stdout of the compare - which is the reason the if failed to begin with as the comparison wasn't comparing the things that were expected.
Result-wise they are the same. Having said that: I did make a mistake when adding and pushing the check_return 😊 It should read check_return=$?. So this needs an update, either way.
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.
Do not mention bash :)
This should not be a bash-script but an sh POSIX-compatible script.
Well, it is shorter and it is what b2dc4ac does, which will eventually get merged.
So I think we should use that.
I propose that your PR be merged for 2.10.3 and it will be overwritten by b2dc4ac when merging for 2.11.0
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.
You make a lot of ground 😁
It seems we are patching stuff that is already patched. Ah well... I fixed my my fix.
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.
Not directly related but with testing it bites me that the version has not been updated (e.g. testing with the incorrect executable). Mind if we bump the version to 2.10.3 so it becomes clear what we are working on?
Can make a separate PR for that for clarity, obviously.
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.
It seems we are patching stuff that is already patched.
Yes, the idea was to use specifically if ! check_for_equality "$1" "$2"; then in your PR so that line will not conflict when merging later.
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.
Not directly related but with testing it bites me that the version has not been updated (e.g. testing with the incorrect executable).
Do you get a warning of some sort ?
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.
line will not conflict when merging later.
Ah.. that makes sense 👍
Do you get a warning of some sort ?
Nothing to worry about, just me not working with the exec I just build (and therefore getting confusing results)
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.
Nothing to worry about, just me not working with the exec I just build (and therefore getting confusing results)
When you run RM_TS_PRINT_CMD=1 RM_TS_KEEP_TESTDIR=1 nosetests -s tests/test_formatters/test_sh.py to test this PR, it compiles and run rmlint from the repository, not from the system path
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.
😁 I was not running the tests but trying to replay an issue report with something I modified to see whether my idea was sound. which told me enough but I was still second-guessing myself. Either way... having a new version after a release is always sound in my book. The current develop/master issue is adding some confusion too, which makes me a bit more cautious than if I were free hacking away on develop. Thanks for #694
23a0926 to
7676a35
Compare
7676a35 to
34ac762
Compare
Solves "Illegal number" #679 error when two directories are rechecked when generated
rmlint.shis executed with the-pparameter before removing.