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

Rename noFileID rule to fileMacro, support preferring either #file or #fileID #1892

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

calda
Copy link
Collaborator

@calda calda commented Sep 28, 2024

This discussion on the Swift Evolution forums shows that there isn't a clear consensus on whether or not #file or #fileID will be preferred long-term.

This PR renames the noFileID rule to fileMacro, and adds support for preferring either #file or #fileID.

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.83%. Comparing base (be3df7b) to head (65bd90d).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1892   +/-   ##
========================================
  Coverage    94.83%   94.83%           
========================================
  Files          135      135           
  Lines        19278    19293   +15     
========================================
+ Hits         18282    18297   +15     
  Misses         996      996           

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

@nicklockwood
Copy link
Owner

@calda are these actually macros? I'm not sure what the general term for #identifiers is in Swift, but they predate macros

@calda
Copy link
Collaborator Author

calda commented Sep 30, 2024

Yes, they're considered macros now: https://developer.apple.com/documentation/swift/macros

@nicklockwood nicklockwood merged commit ae97e4a into nicklockwood:develop Sep 30, 2024
12 checks passed
@nicklockwood
Copy link
Owner

I think this is reasonable given the information we have so far, but tbh it might make more sense to wait and find out the conclusion of the discussion before shipping this, because it feels like something where there will be a right way and a wrong way, as opposed something that should be left to individual preference

@calda
Copy link
Collaborator Author

calda commented Sep 30, 2024

To me, there not being a clear consensus today is a great reason why we would have a format rule for this. You may prefer #fileID, and I may prefer #file, and until one is deprecated there isn't an intrinsic technical reason to prefer one over the other.

My gut feeling is that the status quo (neither being deprecated) will stay the same for quite a while. (Would love to be wrong about this! It just seems too low priority and contentious to me.)

So, to me, it doesn't seem necessary to intentionally delay releasing this. Today is when it's most useful :) If this changes one day it seems fine to deprecate the rule at that point.

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.

2 participants