
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
flake8-functions-names
Advanced tools
An extension for flake8 that validates functions names, decomposition and conformity with annotations.
An extension for flake8 that validates functions names, decomposition and conformity with annotations. The plugin also has some validations of deal contracts.
This plugin helps to provide better naming for functions. The validations are based on my articles:
deal
-related validations are enabled only if deal
is installed.
They are disabled otherwise.
pip install flake8-functions-names
def is_user_banned(user: User) -> str:
return 'is_banned' if user.id in BANNED_USERS else 'not_banned'
def save_user(user: User) -> None:
user.save()
Usage:
$ flake8 test.py
text.py:1:35: FNE001 Name of the function says that it should return bool-like, but it returns str
text.py:4:4: FNE003 Name of the function uses "save", but not uses "to"
Tested on Python 3.8+ and flake8 3.9+.
Error code | Description |
---|---|
FNE001 | Name of the function says that it should return bool-like 1, but it returns actual_type |
FNE002 | The method has a @property decorator, but has a verb in it's name (verb) |
FNE003 | Name of the function uses save , but not uses to |
FNE004 | Name of the function uses load , but not uses from |
FNE005 | Return type of the function is bool-like 1, but the name doesn't show it |
FNE006 | Name of function says, that it works with data, so it should be pure, but it has no @deal.pure() |
FNE007 | and is not recommended in functions names |
FNE008 | Name of functions ends with it's first argument name |
FAQs
An extension for flake8 that validates functions names, decomposition and conformity with annotations.
We found that flake8-functions-names demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.