├── .github ├── CODE-OF-CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── feature-request.md ├── SECURITY.md ├── dependabot.yml ├── labeler.yml ├── pull_request_template.md ├── release-drafter.yml └── workflows │ ├── release-draft.yml │ ├── release.yml │ └── set-labels.yml ├── .gitignore ├── LICENSE ├── README.md ├── flake8_awesome └── __init__.py └── pyproject.toml /.github/CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies within all project spaces, and it also applies when 49 | an individual is representing the project or its community in public spaces. 50 | Examples of representing a project or community include using an official 51 | project e-mail address, posting via an official social media account, or acting 52 | as an appointed representative at an online or offline event. Representation of 53 | a project may be further defined and clarified by project maintainers. 54 | 55 | ## Attribution 56 | 57 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 58 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 59 | 60 | [homepage]: https://www.contributor-covenant.org 61 | 62 | For answers to common questions about this code of conduct, see 63 | https://www.contributor-covenant.org/faq 64 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | [legal]: https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license 4 | [license]: ../LICENSE 5 | [code-of-conduct]: CODE-OF-CONDUCT.md 6 | 7 | Hi! Thanks for your interest in contributing! 8 | 9 | We accept pull requests for bug fixes and features where we've discussed the approach in an issue and given the go-ahead for a community member to work on it. We'd also love to hear about ideas for new features as issues. 10 | 11 | Please do: 12 | 13 | * open an issue if things aren't working as expected 14 | * open an issue to propose a significant change 15 | * open a pull request to fix a bug 16 | * open a pull request to fix documentation about a command 17 | * open a pull request if one from core contributors has given the ok after discussion in an issue 18 | 19 | Please avoid: 20 | 21 | * adding installation instructions specifically for your OS/package manager 22 | 23 | ## Building the project 24 | 25 | Prerequisites: 26 | - python 3.7+ 27 | 28 | Init local environment with: `make init precommit_hook` 29 | 30 | Run autoformat with: `make pretty` 31 | 32 | Run linters with: `make lint` 33 | 34 | Run tests with: `make test` 35 | 36 | ## Submitting a pull request 37 | 38 | 1. Create a new branch: `git checkout -b my-branch-name` 39 | 1. Make your change, add tests, and ensure tests and linters pass 40 | 1. Submit a pull request 41 | 42 | Contributions to this project are [released][legal] to the public under the [project's open source license][license]. 43 | 44 | Please note that this project adheres to a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. 45 | 46 | ## Resources 47 | 48 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 49 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 50 | - [GitHub Help](https://help.github.com) 51 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "🐛 Bug report" 3 | about: Report a bug or unexpected behavior 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Describe the bug 11 | 12 | A clear and concise description of what the bug is. Include version of package. 13 | 14 | ### Steps to reproduce the behavior 15 | 16 | 1. Do this '...' 17 | 2. View the output '....' 18 | 3. See error 19 | 20 | ### Expected vs actual behavior 21 | 22 | A clear and concise description of what you expected to happen and what actually happened. 23 | 24 | ### Logs 25 | 26 | Paste the activity from your command line. Redact if needed. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "🚀 Submit a request" 3 | about: Surface a feature or problem that you think should be solved 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Describe the feature or problem you’d like to solve 11 | 12 | A clear and concise description of what the feature or problem is. 13 | 14 | ### Proposed solution 15 | 16 | - 17 | 18 | ### Additional context 19 | 20 | Add any other context like screenshots or mockups are helpful, if applicable. 21 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | If you discover a security issue in this repository, please create new issue about it. 2 | Thanks for helping make Open Source safe for everyone. 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | time: "00:00" 8 | open-pull-requests-limit: 10 9 | assignees: 10 | - afonasev 11 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | 2 | documentation: 3 | - "README.md" 4 | 5 | dependencies: 6 | - "pyproject.toml" 7 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Summary 8 | 9 | closes #[issue number] 10 | 11 | ## Details 12 | 13 | - 14 | 15 | ## Check list 16 | 17 | - [ ] README.md changed if needed 18 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: 'v$NEXT_PATCH_VERSION' 2 | tag-template: 'v$NEXT_PATCH_VERSION' 3 | 4 | categories: 5 | - title: '🚀 New Features' 6 | labels: 7 | - 'enhancement' 8 | - 'feature' 9 | 10 | - title: '🐛 Bugs Fixes' 11 | labels: 12 | - 'bug' 13 | - 'bug_fix' 14 | - 'fix' 15 | 16 | - title: '📄 Documentation' 17 | labels: 18 | - 'documentation' 19 | - 'docs' 20 | 21 | - title: '💊 Refactoring' 22 | labels: 23 | - 'refactoring' 24 | - 'refactor' 25 | 26 | - title: '🔧 Configuration' 27 | labels: 28 | - 'config' 29 | - 'conf' 30 | 31 | references: 32 | - master 33 | - v.+ 34 | 35 | exclude-labels: 36 | - 'skip-changelog' 37 | 38 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 39 | template: | 40 | ## Changes 41 | $CHANGES 42 | 43 | ## 👍Contributors 44 | $CONTRIBUTORS 45 | -------------------------------------------------------------------------------- /.github/workflows/release-draft.yml: -------------------------------------------------------------------------------- 1 | name: release-draft 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | update-release-draft: 10 | runs-on: ubuntu-18.04 11 | 12 | steps: 13 | - name: Update GITHUB release-draft with changelog 14 | uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*.*.*' 7 | 8 | jobs: 9 | publish-to-pypi: 10 | runs-on: ubuntu-18.04 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Set up Python 3.8.3 16 | uses: actions/setup-python@v2 17 | with: 18 | python-version: 3.8.3 19 | 20 | - name: Set up Poetry 21 | uses: dschep/install-poetry-action@v1.3 22 | with: 23 | version: 1.0.9 24 | 25 | - name: Build and publish to pypi 26 | run: | 27 | poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} 28 | poetry publish --build 29 | -------------------------------------------------------------------------------- /.github/workflows/set-labels.yml: -------------------------------------------------------------------------------- 1 | name: set-labels 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | set-labels: 7 | runs-on: ubuntu-18.04 8 | 9 | steps: 10 | - uses: actions/labeler@v2 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | # IDE 107 | .vscode/ 108 | .idea/ 109 | 110 | poetry.lock 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Afonasev Evgeniy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flake8-awesome 2 | 3 | [![pypi](https://badge.fury.io/py/flake8-awesome.svg)](https://pypi.org/project/flake8-awesome) 4 | [![Python: 3.6+](https://img.shields.io/badge/Python-3.6+-blue.svg)](https://pypi.org/project/flake8-awesome) 5 | [![Downloads](https://img.shields.io/pypi/dm/flake8-awesome.svg)](https://pypistats.org/packages/flake8-awesome) 6 | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License) 7 | 8 | Flake8 awesome plugins pack. 9 | 10 | ## Installation 11 | 12 | ```bash 13 | pip install flake8-awesome 14 | ``` 15 | 16 | vs 17 | 18 | ```bash 19 | pip install flake8 flake8-builtins flake8-comprehensions flake8-eradicate # etc. 20 | ``` 21 | 22 | ## Example of Flake8 config 23 | 24 | ```ini 25 | [flake8] 26 | enable-extensions = G 27 | exclude = .git, .venv 28 | ignore = 29 | A003 ; 'id' is a python builtin, consider renaming the class attribute 30 | W503 ; line break before binary operator 31 | S101 ; use of assert detected (useless with pytest) 32 | max-complexity = 8 33 | max-annotations-complexity = 3 34 | max-expression-complexity = 7 35 | max-line-length = 120 36 | show-source = true 37 | ``` 38 | 39 | ## List of plugins 40 | 41 | * flake8-annotations-complexity 42 | * flake8-bandit 43 | * flake8-breakpoint 44 | * flake8-bugbear 45 | * flake8-builtins 46 | * flake8-comprehensions 47 | * flake8-eradicate 48 | * flake8-expression-complexity 49 | * flake8-if-expr 50 | * flake8-isort 51 | * flake8-logging-format 52 | * flake8-print 53 | * flake8-pytest 54 | * flake8-pytest-style 55 | * flake8-requirements 56 | * flake8-return 57 | * pep8-naming 58 | -------------------------------------------------------------------------------- /flake8_awesome/__init__.py: -------------------------------------------------------------------------------- 1 | print('You are awesome!') 2 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "flake8-awesome" 3 | version = "1.3.0" 4 | description = "Flake8 awesome plugins pack" 5 | authors = ["Afonasev Evgeniy "] 6 | license = "MIT" 7 | readme = 'README.md' 8 | repository = "https://github.com/afonasev/flake8-awesome" 9 | homepage = "https://pypi.org/project/flake8-awesome" 10 | keywords = ['flake8', 'plugin'] 11 | 12 | [tool.poetry.dependencies] 13 | python = "^3.6" 14 | flake8 = "*" 15 | flake8-annotations-complexity = "*" 16 | flake8-bandit = "*" 17 | flake8-breakpoint = "*" 18 | flake8-bugbear = "*" 19 | flake8-builtins = "*" 20 | flake8-comprehensions = "*" 21 | flake8-eradicate = "*" 22 | flake8-expression-complexity = "*" 23 | flake8-if-expr = "*" 24 | flake8-isort = "*" 25 | flake8-logging-format = "*" 26 | flake8-print = "*" 27 | flake8-pytest = "*" 28 | flake8-pytest-style = "*" 29 | flake8-requirements = "*" 30 | flake8-return = "*" 31 | pep8-naming = "*" 32 | 33 | [build-system] 34 | requires = ["poetry>=0.12"] 35 | build-backend = "poetry.masonry.api" 36 | --------------------------------------------------------------------------------