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 infinite recursion when using nested config files. Fixes #368 #393

Merged
merged 2 commits into from
Jan 21, 2016

Conversation

jpsim
Copy link
Collaborator

@jpsim jpsim commented Jan 21, 2016

/cc @scottrhoyt

Also replaced all the hardcoded .swiftlint.yml strings while I was in there.

@scottrhoyt
Copy link
Contributor

Love getting those literals out of there. The sanity check against getting to the / directory is a great add as well. We should never get to / in the search though (unless you are linting the / path). I believe the more direct solution here is to set Configuration.rootPath in the autocorrect command how it is set in the lint command here. 👍

this is a more correct fix than checking that path != "/" when merging
configurations, but let's keep that check more as an assertion to make sure
we never recurse infinitely.
@jpsim
Copy link
Collaborator Author

jpsim commented Jan 21, 2016

Ah, you're right @scottrhoyt, that's definitely the correct fix. Updated. Thanks for reviewing!

jpsim added a commit that referenced this pull request Jan 21, 2016
…rsion

fix infinite recursion when using nested config files. Fixes #368
@jpsim jpsim merged commit 8fa3d30 into master Jan 21, 2016
@jpsim jpsim deleted the jp-fix-nested-config-infinite-recursion branch January 21, 2016 23:58
@scottrhoyt
Copy link
Contributor

No problem. Yeah, it probably makes sense to be setting root path in Configuration.init given how critical it is to the nested configs option. But ideally it would be nice to refactor the directory traversal out into a new consumer of Configuration or perhaps into Linter, though I'd prefer the former for SRP purposes.

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