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

Custom filters discoverability #471

Closed
ilyapuchka opened this issue Jan 2, 2018 · 4 comments
Closed

Custom filters discoverability #471

ilyapuchka opened this issue Jan 2, 2018 · 4 comments

Comments

@ilyapuchka
Copy link
Collaborator

@krzysztofzablocki @Antondomashnev I have an idea how to improve discoverability of custom filters (and any other Sourcery API) that I saw in some other project. It's not the first time when we get reports where users use wrong filter names, and I myself not very familiar with all filters available in SwiftStencilKit. I wanted to implement something like this https://github.com/xcodeswift/sake/pull/39

Not sure how well it will work and if it will be easier to implement on our side, or as a part of Stencil itself. Stencil at this moment only have one type of error, which will make us to check for it's description string, unless we add more error cases in Stencil. There are some improvements to error reporting that I was working on in stencilproject/Stencil#167. It still will not solve this issue but if we do it in Stencil right away it might be easier to integrate with its error log.

What do you think? Or should we just put all the filters in the docs?

cc @kylef @AliSoftware

@ilyapuchka
Copy link
Collaborator Author

Another idea is to add diagnose command to print out some information about stencil environment

@krzysztofzablocki
Copy link
Owner

that would be very helpful, I think it makes sense to add it to Stencil direct as it would know that someone tried to use unknown filter

@Antondomashnev
Copy link
Collaborator

I like the idea and it will definitely help in some cases. I agree with @krzysztofzablocki that it makes sense to add directly to Stencil and I think adding another type of error shouldn't be an issue. On the other hand, I think to have docs with all supported filters would be nice to have - list with Sourcery filters only, link to the StencilSwiftKit filters documentation and link to Stencil filters documentation.

@ilyapuchka
Copy link
Collaborator Author

I've implemented this in stencilproject/Stencil#186. Let's wait sometime until @kylef can look at that and otherwise let's maybe switch to our own fork (together with SwiftStencilKit?) as I've implemented a lot of additions (and would like to add some more) but I can understand that Kyle can have no time to look at all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants