Fix false positive on "bare unsigned" detection (-> adding word boundaries around)#64
Open
llacote-holberton wants to merge 1 commit intoalx-tools:masterfrom
Open
Fix false positive on "bare unsigned" detection (-> adding word boundaries around)#64llacote-holberton wants to merge 1 commit intoalx-tools:masterfrom
llacote-holberton wants to merge 1 commit intoalx-tools:masterfrom
Conversation
…ries around ### Error encountered Betty wrongly detect use of "bare unsigned" and recommend unsigned int on a line just declaring the use of a function print_unsigned. ### Diagnosis The regex trying to find is not sufficiently restrictive. ### Suggested fix Adding word boundaries around unsigned to stop matching things like _unsigned or unsigned_. Note: as I didn't study the ins and outs of that program I am not sure that my fix resolves this use-case without harming another.
llacote-holberton
pushed a commit
to llacote-holberton/holbertonschool-printf
that referenced
this pull request
Apr 5, 2026
Because of a bug in Betty linter, precisely in its betty-style.pl, which makes it trigger a warning on a false positive (print_unsigned function). => PR opened towards Betty maintainers to try and fix (cf alx-tools/Betty#64). => In the meantime function is renamed to be 100% Betty compliant for the sake of exercise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, nice to meet you! Hereunder summary of problem and reasoning behind suggested fix.
Error encountered
Betty wrongly detect use of "bare unsigned" and recommend unsigned int on a line just declaring the use of a function print_unsigned.
Example: table['u'] = print_unsigned;
Betty error: _printf.c:26: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Diagnosis
The regex trying to find is not sufficiently restrictive.
Suggested fix
Adding word boundaries around unsigned to stop matching things like
_unsignedorunsigned_.Note: as I didn't study the ins and outs of that program I am not sure that my fix resolves this use-case without harming another.