Skip to content

Util: Add shared file system implementation#12289

Merged
hvitved merged 2 commits intogithub:mainfrom
hvitved:util/file-system
Feb 24, 2023
Merged

Util: Add shared file system implementation#12289
hvitved merged 2 commits intogithub:mainfrom
hvitved:util/file-system

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented Feb 23, 2023

Avoids duplicating the logic and documentation for file system predicates.

This PR applies the new shared implementation to C# and Ruby only. I encourage other languages to follow suit (ping @github/codeql-swift , @github/codeql-c , @github/codeql-go , @github/codeql-java , @github/codeql-python, @github/codeql-javascript ).

result.getStem() = stem and
result.getExtension() = extension
}
predicate hasSourceLocationPrefix = sourceLocationPrefix/1;

Check warning

Code scanning / CodeQL

QL-for-QL encountered an internal consistency error

PredConsistency::noResolvePredicateExpr
string getStem() {
result = this.getAbsolutePath().regexpCapture(".*/([^/]*?)(?:\\.([^.]*))?", 1)
}
predicate hasSourceLocationPrefix = sourceLocationPrefix/1;

Check warning

Code scanning / CodeQL

QL-for-QL encountered an internal consistency error

PredConsistency::noResolvePredicateExpr
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Feb 23, 2023
@hvitved hvitved marked this pull request as ready for review February 23, 2023 13:06
@hvitved hvitved requested review from a team as code owners February 23, 2023 13:06
@hvitved hvitved requested review from hmac and removed request for a team February 23, 2023 13:06
Copy link
Copy Markdown
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

C# LGTM

Copy link
Copy Markdown
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me. Might be worth to compare this to #10592 .

@hvitved
Copy link
Copy Markdown
Contributor Author

hvitved commented Feb 24, 2023

Might be worth to compare this to #10592 .

Certainly looks very similar; I wonder why it was dropped.

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

Labels

C# no-change-note-required This PR does not need a change note Ruby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants