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

[Fix] JSON decoder not properly decoding defaultConfigurationIsVisible in some projects #593

Merged
merged 5 commits into from
Nov 26, 2020

Conversation

tjwio
Copy link
Contributor

@tjwio tjwio commented Nov 22, 2020

Resolves #592

Short description 📝

This PR should fix decoding defaultConfigurationIsVisible (and other booleans) of multiple types of encoding (ie. plist encoded which encodes to a proper boolean or a normal pbxproj which encodes into a string).

Solution 📦

Try decoding it as a string like before, then an int, then a boolean and finally return nil if it cannot. Notice each try is marked with try? so it doesn't actually throw in case there is a type mismatch.

Implementation 👩‍💻👨‍💻

  • Fix decoder process for booleans
  • Test out in both pbxproj formats

@codecov
Copy link

codecov bot commented Nov 22, 2020

Codecov Report

Merging #593 (6adefa8) into main (82bf5ef) will decrease coverage by 0.02%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #593      +/-   ##
==========================================
- Coverage   84.24%   84.21%   -0.03%     
==========================================
  Files         154      154              
  Lines        8663     8668       +5     
==========================================
+ Hits         7298     7300       +2     
- Misses       1365     1368       +3     
Impacted Files Coverage Δ
.../Extensions/KeyedDecodingContainer+Additions.swift 80.95% <57.14%> (-12.80%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82bf5ef...6adefa8. Read the comment docs.

@pepicrft pepicrft merged commit c686cdc into tuist:main Nov 26, 2020
@pepicrft
Copy link
Contributor

Thanks for fixing this @tjwio 🙏

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.

JSON decoder not properly decoding defaultConfigurationIsVisible in some projects
2 participants