Skip to content

Conversation

@maelle
Copy link
Contributor

@maelle maelle commented Jan 6, 2026

Fix #2202

One thing we might consider adding, is a period at the end of the message if it's not already there.

@szhorvat
Copy link
Member

szhorvat commented Jan 6, 2026

One thing we might consider adding, is a period at the end of the message if it's not already there.

I've added punctuation at the end of most messages in the C core now, but a few are still left out. This is a nice-to-have aesthetic feature, it's not an absolute must unless you want to append extra text at the end of the message. We do correct for missing punctuation in both the Python and Mathematica interfaces.

Comment on lines +2318 to +2327
/* Strip vendor/cigraph/src/ prefix from file path */
static inline const char* simplify_file_path(const char* file) {
const char* prefix = "vendor/cigraph/src/";
size_t prefix_len = strlen(prefix);

if (strncmp(file, prefix, prefix_len) == 0) {
return file + prefix_len;
}
return file;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/* Strip vendor/cigraph/src/ prefix from file path */
static inline const char* simplify_file_path(const char* file) {
const char* prefix = "vendor/cigraph/src/";
size_t prefix_len = strlen(prefix);
if (strncmp(file, prefix, prefix_len) == 0) {
return file + prefix_len;
}
return file;
}
/* Strip vendor/cigraph/src/ prefix from file path. This prefix depends on the
* build procedure, namely on the directory that the compiler is invoked from. */
static inline const char* simplify_file_path(const char *file) {
const char prefix[] = "vendor/cigraph/src/";
const size_t prefix_len = sizeof(prefix) / sizeof(prefix[0]);
if (strncmp(file, prefix, prefix_len) == 0) {
return file + prefix_len;
}
return file;
}

You can get the length statically. It's good to have a comment about where this prefix comes from because it will change if changes are made to the build procedure. The reason it even appears (compared to the standard use of the C core) is the tweaked build procedure.

@szhorvat
Copy link
Member

szhorvat commented Jan 6, 2026

One thing we might consider adding, is a period at the end of the message if it's not already there.

Isn't this already there with maybe_add_puctuation?

LGTM, but I didn't test.

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.

Warning

4 participants