Skip to content

Correct formatter#253

Merged
K20shores merged 2 commits intomainfrom
correct_formatter
Mar 16, 2026
Merged

Correct formatter#253
K20shores merged 2 commits intomainfrom
correct_formatter

Conversation

@K20shores
Copy link
Copy Markdown
Collaborator

@K20shores K20shores commented Mar 14, 2026

In JuliaPackaging/Yggdrasil#13280, I learned I had implemented the custom formatter incorrectly. This fixes the build for older versions of macos, but still seems to work with all other compilers

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

Fixes the custom std::formatter specialization for mechanism_configuration::ErrorLocation to restore compatibility with older macOS toolchains while keeping std::format-based error messages working across compilers.

Changes:

  • Replaces the previous std::formatter implementation with a specialization that defines parse() and a templated format() using std::format_to.
  • Removes the prior inheritance-based formatting approach (string-formatter delegation).

💡 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 thread include/mechanism_configuration/error_location.hpp
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.00%. Comparing base (1bb63bc) to head (73f548f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #253   +/-   ##
=======================================
  Coverage   70.00%   70.00%           
=======================================
  Files           5        5           
  Lines          10       10           
=======================================
  Hits            7        7           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

} // namespace mechanism_configuration

namespace std
template<>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My understanding is that we'd still need std namespace because we're specializing std::formatter to write line and column to the output.

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.

The line below this applies the namespace, so it's no longer needed struct std::.... I don't think it matters if the specialization is applied in the namespace or scoped as it is. Happy to change this if you would prefer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah I missed that. Thank you, this looks good!

@K20shores K20shores merged commit f9ac1e5 into main Mar 16, 2026
19 of 20 checks passed
@K20shores K20shores deleted the correct_formatter branch March 16, 2026 19:23
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.

4 participants