-
Notifications
You must be signed in to change notification settings - Fork 43
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
Expand list of reserved objc keywords to cover most conflicting cases… #79
Conversation
@bkase - this breaks the integration tests so I'll need to take another pass at it |
Could you guys accept this PR, I really need this to work. Thank you very much |
🚫 CI failed with log |
@CavalcanteLeo - Looking into this currently. We had an issue with the first version that needed to be resolved to merge. |
🚫 CI failed with log |
🚫 CI failed with log |
🚫 CI failed with log |
Ok, thanks dude! |
🚫 CI failed with log |
🚫 CI failed with log |
.buildkite/plank-pipeline.yml
Outdated
run: app | ||
config: docker-compose.yml | ||
- name: "Integration Test :iphone: :airplane:" | ||
command: "swift build && ./Utility/integration-test.sh" |
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.
You probably want to move swift build
either into the Docker container (if you're adding all files), or run this before integration-test.sh.
You might also create a single shell script that wraps both of these commands, but I think you can only run a single thing in the command here.
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.
I just saw that you were copying everything into the docker container with COPY . /plank
. Because we're copying files this will invalidate the docker cache for basically every PR, which is fine, but might mean that we want to also run swift build
inside of the docker container. This would also let you use the build for other steps in the pipeline if needed in parallel to integration tests.
🚫 CI failed with log |
…. This is an incomplete list and will likely have more additions in the future.
fb7fa5d
to
7a609d6
Compare
@@ -52,31 +52,114 @@ prefix func --> (body: () -> [String]) -> String { | |||
return -->body() | |||
} | |||
|
|||
// Most of these are derived from https://www.binpress.com/tutorial/objective-c-reserved-keywords/43 |
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.
We should create some abstraction for each language. Could be for example a Language
protocol that will be passes around and every supported language creates a struct that conforms to it.
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.
@maicki - I agree since there will be different reserved words per language. Only caveat is that the names must be consistent for any languages that bridge (Objc, Flow, Swift, etc.) so we might need a global set of all languages at runtime to utilize for consistent results.
str = replacementString | ||
} | ||
|
||
let components = str.components(separatedBy: "_") | ||
let name = components.map { return $0.uppercaseFirst } | ||
return name.joined(separator: "") | ||
let formattedName = name.joined(separator: "") | ||
if objectiveCReservedWords.contains(formattedName) { |
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 this clash if you would like to use "void" for something but it's a reserved word in objective c?
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.
if you used "void" it would just become "voidProperty" or "VoidProperty"
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 purpose of this PR is to prevent reserved words from being generated as identifiers. I don't believe this will cause issues for most since naming anything as a reserved keyword is probably unlikely.
@@ -97,6 +180,10 @@ extension String { | |||
} | |||
} | |||
|
|||
if objectiveCReservedWords.contains(name) { |
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.
Same question as above?
🚫 CI failed with log |
…ory to minimize unnecessary image creates
Generated by 🚫 Danger |
…. This is
an incomplete list and will likely have more additions in the future.