Skip to content

Add checker constants#105

Merged
thientc merged 4 commits intomainfrom
104-refactor-preprocessing
Mar 19, 2026
Merged

Add checker constants#105
thientc merged 4 commits intomainfrom
104-refactor-preprocessing

Conversation

@thientc
Copy link
Copy Markdown
Collaborator

@thientc thientc commented Mar 19, 2026

  • Introduced constants for disabled checkers and analyzer checkers in sysmsg.py to streamline configuration.

- Introduced constants for disabled checkers and analyzer checkers in sysmsg.py to streamline configuration.
@thientc thientc requested a review from Copilot March 19, 2026 05:55
@thientc thientc linked an issue Mar 19, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

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 centralizes scan-build checker configuration into shared constants and refactors the build/analyze flow to reuse common subprocess and environment-building helpers across Builder and ConsumerBuilder.

Changes:

  • Added constants for disabled checkers and Futag analyzer checker names in sysmsg.py.
  • Refactored preprocessor.py to share logic via _BaseBuilder and new helper functions (_run_command, _make_build_env, _load_json_files, etc.).
  • Updated .gitignore to ignore Claude-related files.

Reviewed changes

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

File Description
src/python/futag-package/src/futag/sysmsg.py Introduces constants for scan-build checker enable/disable configuration.
src/python/futag-package/src/futag/preprocessor.py Refactors builder logic to reduce duplication and standardize command execution / env setup.
.gitignore Ignores CLAUDE.md and .claude/settings.json.
Comments suppressed due to low confidence (1)

src/python/futag-package/src/futag/preprocessor.py:585

  • global_hash = [x for x in function_list] creates an intermediate list of dict keys, but the only use is membership testing (if hash in global_hash). This is both slower and more memory-heavy than testing directly against the dict (if func_hash in function_list). Consider removing global_hash and using dict membership.
            # get global hash of all functions
            global_hash = [x for x in function_list]
            # iterate function hash for adding to global hash list
            for hash in contexts:
                if hash in global_hash:

💡 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.

Comment on lines +44 to +58
def _scan_build_checker_args(scan_build_path, checker_name=None, analyzer_configs=None):
"""Build the common scan-build checker argument list."""
args = [scan_build_path.as_posix()]
for c in DISABLED_CHECKERS:
args.extend(["-disable-checker", c])
if checker_name:
args.extend(["-enable-checker", checker_name])
for config in (analyzer_configs or []):
args.extend(["-analyzer-config", config])
return args


def _run_command(cmd, env=None, msg_prefix="", fail_msg="", succeed_msg="",
exit_on_fail=True, capture=True):
"""Run a subprocess command with standardized error handling."""
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

thientc and others added 3 commits March 19, 2026 13:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

@thientc I've opened a new pull request, #107, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor preprocessing

3 participants