mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Small meta cleanups (#4893)
* Remove the unneeded pytest options from pyproject.toml * Clean up setup.py from old readthedocs.org workaround * Removes unused folder * Simplify list of excluded files in black's configuration * Fix returned exit codes in `make.ps1` * Add Sublime's project files to `.gitignore` * Update the link to Black in README and contributing guidelines
This commit is contained in:
parent
6c903aacff
commit
d1bc4b4302
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,6 +15,8 @@ Pipfile.lock
|
|||||||
.idea/
|
.idea/
|
||||||
*.iws
|
*.iws
|
||||||
.vscode/
|
.vscode/
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
## Plugin-specific files:
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ We're using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's
|
|||||||
Currently, tox does the following, creating its own virtual environments for each stage:
|
Currently, tox does the following, creating its own virtual environments for each stage:
|
||||||
- Runs all of our unit tests with [pytest](https://github.com/pytest-dev/pytest) on python 3.8 (test environment `py38`)
|
- Runs all of our unit tests with [pytest](https://github.com/pytest-dev/pytest) on python 3.8 (test environment `py38`)
|
||||||
- Ensures documentation builds without warnings, and all hyperlinks have a valid destination (test environment `docs`)
|
- Ensures documentation builds without warnings, and all hyperlinks have a valid destination (test environment `docs`)
|
||||||
- Ensures that the code meets our style guide with [black](https://github.com/ambv/black) (test environment `style`)
|
- Ensures that the code meets our style guide with [black](https://github.com/psf/black) (test environment `style`)
|
||||||
|
|
||||||
To run all of these tests, just run the command `tox` in the project directory.
|
To run all of these tests, just run the command `tox` in the project directory.
|
||||||
|
|
||||||
@ -92,9 +92,9 @@ To run a subset of these tests, use the command `tox -e <env>`, where `<env>` is
|
|||||||
Your PR will not be merged until all of these tests pass.
|
Your PR will not be merged until all of these tests pass.
|
||||||
|
|
||||||
### 4.3 Style
|
### 4.3 Style
|
||||||
Our style checker of choice, [black](https://github.com/ambv/black), actually happens to be an auto-formatter. The checking functionality simply detects whether or not it would try to reformat something in your code, should you run the formatter on it. For this reason, we recommend using this tool as a formatter, regardless of any disagreements you might have with the style it enforces.
|
Our style checker of choice, [black](https://github.com/psf/black), actually happens to be an auto-formatter. The checking functionality simply detects whether or not it would try to reformat something in your code, should you run the formatter on it. For this reason, we recommend using this tool as a formatter, regardless of any disagreements you might have with the style it enforces.
|
||||||
|
|
||||||
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/ambv/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. This is already set in `pyproject.toml` configuration file in the repo so you can simply format code with Black like so: `black <src>`.
|
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/psf/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. This is already set in `pyproject.toml` configuration file in the repo so you can simply format code with Black like so: `black <src>`.
|
||||||
|
|
||||||
### 4.4 Make
|
### 4.4 Make
|
||||||
You may have noticed we have a `Makefile` and a `make.bat` in the top-level directory. For now, you can do a few things with them:
|
You may have noticed we have a `Makefile` and a `make.bat` in the top-level directory. For now, you can do a few things with them:
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<a href="http://red-discordbot.readthedocs.io/en/stable/?badge=stable">
|
<a href="http://red-discordbot.readthedocs.io/en/stable/?badge=stable">
|
||||||
<img src="https://readthedocs.org/projects/red-discordbot/badge/?version=stable" alt="Red on readthedocs.org">
|
<img src="https://readthedocs.org/projects/red-discordbot/badge/?version=stable" alt="Red on readthedocs.org">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/ambv/black">
|
<a href="https://github.com/psf/black">
|
||||||
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black">
|
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black">
|
||||||
</a>
|
</a>
|
||||||
<a href="http://makeapullrequest.com">
|
<a href="http://makeapullrequest.com">
|
||||||
|
|||||||
2
make.ps1
2
make.ps1
@ -46,10 +46,12 @@ function reformat() {
|
|||||||
|
|
||||||
function stylecheck() {
|
function stylecheck() {
|
||||||
& $script:venvPython -m black --check $PSScriptRoot
|
& $script:venvPython -m black --check $PSScriptRoot
|
||||||
|
Exit $LASTEXITCODE
|
||||||
}
|
}
|
||||||
|
|
||||||
function stylediff() {
|
function stylediff() {
|
||||||
& $script:venvPython -m black --check --diff $PSScriptRoot
|
& $script:venvPython -m black --check --diff $PSScriptRoot
|
||||||
|
Exit $LASTEXITCODE
|
||||||
}
|
}
|
||||||
|
|
||||||
function newenv() {
|
function newenv() {
|
||||||
|
|||||||
@ -2,22 +2,9 @@
|
|||||||
line-length = 99
|
line-length = 99
|
||||||
target-version = ['py38']
|
target-version = ['py38']
|
||||||
include = '\.py$'
|
include = '\.py$'
|
||||||
exclude = '''
|
force-exclude = '''
|
||||||
/(
|
/(
|
||||||
\.eggs
|
redbot\/vendored
|
||||||
| \.git
|
|
||||||
| \.hg
|
|
||||||
| \.mypy_cache
|
|
||||||
| \.tox
|
|
||||||
| \.venv
|
|
||||||
| _build
|
|
||||||
| buck-out
|
|
||||||
| build
|
|
||||||
| dist
|
|
||||||
| redbot\/vendored
|
|
||||||
)/
|
)/
|
||||||
'''
|
'''
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
|
||||||
minversion = "6.0"
|
|
||||||
addopts = "--import-mode=importlib"
|
|
||||||
|
|||||||
2
redbot/cogs/downloader/repos/.gitignore
vendored
2
redbot/cogs/downloader/repos/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
Loading…
x
Reference in New Issue
Block a user