-
Notifications
You must be signed in to change notification settings - Fork 414
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
Fix 699 unsafe filenames #700
Fix 699 unsafe filenames #700
Conversation
“Catch URL‐illegal characters in filenames.” Someday I will learn to spell... ☺ |
This is awesome! I really appreciate the time you took to carefully consider the discussions that took place in previous issues and PRs when doing this. Looks like there are a few stylistic issues that rubocop caught. You can validate these yourself by running |
Thanks for the tip. I wasn’t sure how to run rubocop myself, and the path of least resistance so far was to wait for your CI suite to run it for me. ☺ |
It satisfies RuboCop now. One thing that has since occurred to me is that the mapping is many‐to‐one. i.e. I don’t think this would ever be a real‐world issue, because any API designed with underscores and hexadecimal needs to be rethought. Also the leading underscore is normally a mark of an unwillingly public symbol, which usually ought to receive Nevertheless, if anyone thinks this is a real concern, the fix is simply to extend the line @jpsim do you think this should be done? |
Yes, might as well make the safe URLs option generate truly safe URLs 😉 |
Will do. |
Don’t merge yet. I want to test something first. |
I should have read the documentation for
By now it should be apparent that Ruby isn’t my mother tongue... It’s fixed now though and all is well. |
@jpsim, I’m considering writing some minimalist test cases for realm/jazzy-integration-specs to make sure these last few bugs don’t return (two of them didn’t affect the existing tests), but I’m not entirely sure I understand its set‐up. If I just add to the contents of |
That sounds right. To make sure we're clear (sorry if redundant):
|
Thanks. I’ll give it a shot. |
I can’t seem to get the set‐up correct. No matter how I arrange my local repositories,
This has turned into a lot of work for just a unit test when the bugs have already been fixed. I don’t think I want to fight with it any further. If someone else wants to take charge (especially someone not needing to juggle forks), the following would just need to go into one of the files in realm/jazzy-integration-specs/misc_jazzy_features/before/MiscJazzyFeatures/ to guard against a regression. /// Function with characters unsafe for filenames
public func /<T>(lhs: T, rhs: T) {} (along with And the following (in the same place) would guard against a regression of #673: /// Function (recommended documentation comment style)
///
/// - Parameters:
/// - aParameter: A parameter
///
/// - Returns: A result
public func functionA(aParameter: Bool) -> Bool {
return true
}
/// Function (alternate documentation comment style)
///
/// - Parameter: aParameter: A parameter
public func functionB(aParameter: Bool) -> Bool {
return true
}
/// Function (non‐standard documentation comment style)
///
/// - parameters:
/// - aParameter: A parameter
///
/// - returns: A result
public func functionC(aParameter: Bool) -> Bool {
return true
}
/// Function (alternate non‐standard documentation comment style)
///
/// - parameter: aParameter: A parameter
public func functionD(aParameter: Bool) -> Bool {
return true
} |
One final note: I did notice I forgot to update the example in the changelog to match the minor change we made to the algorithm. I will do that right away. |
Unless the integration tests fail, I think everything is ready from my end. |
I'm sorry to hear you've been having trouble updating the integration specs. Are you sure you've recursively cloned the git submodules? I should be able to take this from here... I'll let you know if I run into any problems... |
@SDGGiesbrecht here's the integration specs diff: realm/jazzy-integration-specs@5abc501 I've noticed that some of the links are now broken due to this change. Like clicking on the sidebar categories (e.g. "Other Classes") links to a version of the URL with spaces ( I'm quite impressed with your level of contributions so far, so I've given you write access to both this repo and the integration specs one. Hopefully that will make it a bit easier for you to contribute, especially without having to juggle different forks and submodules pointing to different remotes 😅. Let me know if you'd like more help with this or if you think you have it covered.. |
Thanks. I’ll have a look. |
Continuing in #701. |
Continuing in #702. |
This would fix #699, #146, #361, #547 and #558 in one fell swoop, but probably needs thorough review.
See here for the rationale.
See here for a quick way to test it.
@jpsim, what are your thoughts?