badwords: rework exceptions, fix many of them#20886
badwords: rework exceptions, fix many of them#20886vszakats wants to merge 43 commits intocurl:masterfrom
Conversation
|
I think you can do this differently. I think banning Having a special set of whitelisted words could be handled within the script, the same way it now ignores markdown-indented content only for some files. |
|
For example, when building the large set of files to scan, we could give each file a "qualifier" if it is document or source code, and then we could apply a special set of whitelisted words on the different categories. Without needing two invokes. |
|
I would not be upset if we just skipped scanning the source code, because I think that actually does not need the same attention to language. |
|
Doing separate whitelisting could then also make the bold and backtick whitelisting not apply to source code... |
|
url is easy to whitelist now on a per-subdir basis. But it's really Though what I noticed is not all badwords are caught for some I'd still vouch for scanning sources and reduce exceptions. What |
|
ah, my mistake, |
|
I have a pending script that extracts all the comments from source code, which should help to ignore code. Do we want it to check double-quoted strings as well? |
That would be nice, yes. I expect a couple of exception due to it, but manageable. |
| static int setup(struct input *t, int num, const char *upload) | ||
| { | ||
| char url[256]; | ||
| char urlup[256]; |
There was a problem hiding this comment.
Shouldn't url be whitelisted here?
There was a problem hiding this comment.
Seemed simpler to avoid by renaming. Could be a better
name though probably. I was wondering why it's only caught
here, not in other examples where declared as char *url.
There was a problem hiding this comment.
Uhm, we do not want to forbid meaningful variable names now, or?
There was a problem hiding this comment.
With 2 hits in total, one in examples, the other in lib, whitelisted,
it seems fine to me. Can be whitelisted wider, if causing issues.
Or, using @bagder's comment-filter.
There was a problem hiding this comment.
But we don't want warnings for this when the next example is added using url as a variable name...
Although I will fix this in the next step which will make the script ignore the code and only check comments and strings
Also: we do need -a for src!
|
I updated |
Also:
(except for 'And' which had just a few hits.)
(there also remain about 350 'will' uses in lib)
To make it usable from CMake.