-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add support for flask-restful api functions #208
Comments
Could you provide an example, please? |
file from flask_restful import Resource
class Test(Resource):
@staticmethod
def delete():
pass
|
+1 for API methods defined when using any of the following packages |
This sounds like a good fit for a whitelist. If you like, we can try to integrate your whitelist for flask or flask-restful into Vulture. See the whitelists directory for examples. |
@jendrikseipp how would you go with adding an external package into your whitelist without having to import it? That would define an external dependency which I don't think you would like to have |
@HitLuca because Vulture isn't aware of the package, or it's namespace, we don't need to actually source the actual module -- we just need a variable with the same name. |
Actually, i think it's good to use "real" source code in whitelists. That way, we can test that the names really exist and are spelled correctly. The whitelist files that are bundled with Vulture are only used when the corresponding module is imported, and even then the content is only parsed for names, not actually run, so no new dependency is needed. We only need to add flask or its extensions to the tox.ini testenv section and this allows us to actually run the whitelist file during testing. |
Makes sense, thank you. I'll write something down for flask when I have the time |
As for right now, vulture detects as unused function my flask-restful functions (delete in this case). Would it be feasible to add the knowledge that flask-restful behaves in this way?
The text was updated successfully, but these errors were encountered: