Skip to content

badwords: combine the whitelisting into a single regex#20880

Closed
bagder wants to merge 2 commits intomasterfrom
bagder/badwords-single-wlre
Closed

badwords: combine the whitelisting into a single regex#20880
bagder wants to merge 2 commits intomasterfrom
bagder/badwords-single-wlre

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Mar 10, 2026

Takes it down from 3.6 seconds to 1.1 on my machine.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the scripts/badwords checker by consolidating whitelist removals into a single regex to reduce runtime, and includes a couple of small documentation wording tweaks.

Changes:

  • Combine multiple whitelist patterns into one precompiled regex in scripts/badwords.
  • Extend whitelist removal to include backticked text removal via the whitelist mechanism.
  • Minor wording/grammar adjustments in documentation files.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/badwords Combines whitelist stripping into a single regex to improve performance.
docs/tests/FILEFORMAT.md Minor grammar adjustment in test file format documentation.
docs/cmdline-opts/connect-to.md Wording tweak (“host name” → “hostname”).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@bagder bagder force-pushed the bagder/badwords-single-wlre branch from 2f96f0c to b150d92 Compare March 10, 2026 22:14
@bagder bagder marked this pull request as ready for review March 10, 2026 22:14
bagder added 2 commits March 10, 2026 23:20
Also: make the whitelist matches case insensitve

Takes the script execution time down from 3.6 seconds to 1.1 on my
machine.
found when improving the badwords whitelisting logic
@bagder bagder force-pushed the bagder/badwords-single-wlre branch from b150d92 to d981d13 Compare March 10, 2026 22:20
@bagder
Copy link
Copy Markdown
Member Author

bagder commented Mar 10, 2026

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 10, 2026

🤖 Augment PR Summary

Summary: Speeds up scripts/badwords by combining all whitelisting patterns into one precompiled regex and stripping them in a single pass.
Changes: Also whitelists Markdown bold/code spans during scanning and makes small wording tweaks in two documentation files.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder bagder closed this in 2e52a57 Mar 11, 2026
@bagder bagder deleted the bagder/badwords-single-wlre branch March 11, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants