-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Drop redundant columns from files
and folders
relations
#6477
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
Conversation
8ffea3e
to
c4812ab
Compare
files
and folders
relations
002975e
to
34588d9
Compare
34588d9
to
45578fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ changes LGTM, though note the behaviour change.
name = this.getBaseName() and | ||
firstDotPos = min(name.indexOf(".")) and | ||
result = name.suffix(firstDotPos + 1) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell this change doesn't accurately reproduce current behaviour - despite the comment, for "file.tar.gz"
, getExtensions()
would return just "gz"
and getShortName()
would be "file.tar"
. This has probably been broken at some point, and this is a fix, but we should be aware stuff (like tests) could break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think the old getExtensions()
would return an empty string if there's no extension, whereas your code gives no result. This change is probably worth addressing as it seems like it could potentially break some query somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C# changes LGTM. I added one minor comment/question.
internal static Tuple files(File file, string fullName) => | ||
new Tuple("files", file, fullName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of Semmle.Extraction.CIL.Tuples.files()
and Semmle.Extraction.CIL.Tuples.folders()
methods altogether? The relations are shared between CIL and C#, so we could use a single implementation in Semmle.Extraction.Tuples
.
The merge conflicts appear to come from #6488 - the locations of some files have changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. Apart from that this looks fine to me. 👍
/** DEPRECATED: Use `getBaseName` instead. */ | ||
deprecated string getSimple() { folders(this, _, result) } | ||
deprecated string getSimple() { result = this.getBaseName() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can just be deleted. It's been deprecated for 2+ years.
* This dbscheme is auto-generated by 'semmle/dbscheme_gen.py'. | ||
* WARNING: Any modifications to this file will be lost. | ||
* Relations can be changed by modifying master.py or | ||
* by adding rules to dbscheme.template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this warning heeded? (That is, did you update dbscheme.template
?)
Replaced by per-language PRs. |
No description provided.