Skip to content
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

Improve compile command handling #82

Merged
merged 7 commits into from
Mar 19, 2024
Merged

Conversation

Pennycook
Copy link
Contributor

The CompileCommand class introduced here is intended to be part of a later refactoring. Things like extract_defines and all the path handling in load_database should eventually be folded into this class, but that can be deferred until 2.0.0.

Related issues

Fixes #81.

Proposed changes

  • Add a CompileCommand class to represent a single entry in a compilation database.
  • Add is_source_file function to check if a filename/path represents a source file CBI can understand.
  • Ignore compilation database entries that CBI cannot process.
  • Add tests for all new functionality.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
- Test that strings are handled correctly.
- Test that Paths are handled correctly.
- Test for TypeError if argument is not a string or Path.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
Represents a single compile command from a compilation database.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
More refactoring is possible here, but deferred until 2.0.0.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
- Test that command and arguments fields are handled correctly.
- Test that we can identify which commands we can/should emulate.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
@Pennycook Pennycook added the bug Something isn't working label Mar 18, 2024
@Pennycook Pennycook added this to the 1.2.0 milestone Mar 18, 2024
@Pennycook Pennycook changed the title Compile command Improve compile command handling Mar 18, 2024
codebasin/__init__.py Outdated Show resolved Hide resolved
codebasin/__init__.py Outdated Show resolved Hide resolved
codebasin/config.py Show resolved Hide resolved
codebasin/source.py Show resolved Hide resolved
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
@Pennycook Pennycook merged commit 14096fe into intel:main Mar 19, 2024
2 checks passed
@Pennycook Pennycook deleted the compile-command branch March 19, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration makes assumptions about compilation database contents
2 participants