-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added checks for description and longDescription length, description being non-empty #333
Conversation
@Onyx2406 In case this is not clear, you don't have implemented everything requested. |
can you review this now? @kelson42 I made some commits |
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.
Update the usage()
as well
Done @kelson42 |
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.
LGTM, requesting @veloman-yunkan for a more technical review.
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.
Please squash all commits into one.
src/zimwriterfs/zimwriterfs.cpp
Outdated
if (description.length() > 80) { | ||
std::cerr << "Description length exceeds the 80 character limit." << std::endl; | ||
exit(1); | ||
} |
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.
- Please fix the indentation
- Do we allow empty descriptions? Should we impose a lower limit on the length of the short description?
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 we allow empty descriptions?
#336 says "no". So we can fix that ticket in this PR too.
a305a39
to
c922868
Compare
Done @kelson42 , can you review? |
@Onyx2406 I have already approved, @veloman-yunkan is your reviewer now. You don't need to put a comment, just click on the review rerequesting icon. |
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.
The commit description must be edited
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.
Code is good. However the commit message body contains some text that has little to no value. Once the commit message is fixed this PR can be merged.
Note that std::string::length() returns the size of the string in bytes rather than in characters, i.e. the checks will not work correctly on non-ascii texts. But that can be fixed in s separate PR.
Hi, which commit message body? Can you maybe give reference. |
Your PR contains only one commit. Its description (commit message) reads
The first line (the commit title) is A better commit description should be, for example:
|
80b5658
to
7333904
Compare
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.
The title of the commit message is too long - it exceeds the recommended limit, hence part of the title is moved into the body. If you want to mention the new checks in the title, you better split your changes into two commits:
- Introduce the checks on
--description
option - Add
--longDescription
option (along with its own checks, but the latter part doesn't need to be in the commit title)
Looks good now.. |
@veloman-yunkan @Onyx2406 Part of the CI does not pass, it seems to me we have a regression here. |
Indeed. I missed a missing closing brace during review since I trust the compiler. Looks like @Onyx2406 didn't build the latest code before requesting review. |
@kelson42 BTW, I wonder why the list of CI jobs in this PR is limited to Packages workflows. |
This is because the PR is coming from a branch in another repository. And the CI workflow is not run for security reasons. |
f8a7f8a
to
ec80394
Compare
should pass now @veloman-yunkan |
made the --description option mandatory (its value cannot be empty) checking that the lengths of the short and long descriptions are below their respective limits (80 and 4000) the long description is optional; however, if provided, it must not be shorter than the short description
fixes #332 and #336