Skip to content

Commit

Permalink
Merge pull request #1490 from pallets/style
Browse files Browse the repository at this point in the history
move to src directory, add pre-commit
  • Loading branch information
davidism authored Mar 8, 2020
2 parents 3d1dcc2 + 718485b commit 38ba2e6
Show file tree
Hide file tree
Showing 67 changed files with 3,777 additions and 3,128 deletions.
18 changes: 3 additions & 15 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ strategy:
python.version: '2.7'
Docs:
TOXENV: docs
Style:
TOXENV: style

pool:
vmImage: $(vmImage)
Expand All @@ -43,19 +45,5 @@ steps:
- script: pip --disable-pip-version-check install -U tox
displayName: Install tox

- script: tox -s false -- --junit-xml=test-results.xml
- script: tox
displayName: Run tox

- task: PublishTestResults@2
inputs:
testResultsFiles: test-results.xml
testRunTitle: $(Agent.JobName)
condition: eq(variables['hasTestResults'], 'true')
displayName: Publish test results

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: coverage.xml
condition: eq(variables['hasTestResults'], 'true')
displayName: Publish coverage results
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**This issue tracker is a tool to address bugs in Click itself.
Please use the #pocoo IRC channel on freenode, the Discord server or
Please use the #pocoo IRC channel on freenode, the Discord server or
Stack Overflow for general questions about using Flask or issues
not related to Click.**

Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.1.0
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.0.0
hooks:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Please, don't use the issue tracker for this. Check whether the
``#pocoo`` IRC channel on Freenode can help with your issue. If your problem
is not strictly Click-specific, ``#python`` on Freenode is generally more
active. Also try searching or asking on `Stack Overflow`_ with the
``python-click`` tag.
``python-click`` tag.

.. _Stack Overflow: https://stackoverflow.com/questions/tagged/python-click?sort=votes

Expand Down
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ A Simple Example
@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name",
help="The person to greet.")
@click.option("--name", prompt="Your name", help="The person to greet.")
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for _ in range(count):
click.echo("Hello, %s!" % name)
click.echo(f"Hello, {name}!")
if __name__ == '__main__':
hello()
Expand Down
91 changes: 0 additions & 91 deletions click/__init__.py

This file was deleted.

125 changes: 0 additions & 125 deletions click/_unicodefun.py

This file was deleted.

1 change: 0 additions & 1 deletion docs/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,3 @@ And from the command line:
.. click:run::
invoke(touch, ['-foo.txt', 'bar.txt'])

4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,4 @@

# LaTeX ----------------------------------------------------------------

latex_documents = [
(master_doc, f"Click-{version}.tex", html_title, author, "manual")
]
latex_documents = [(master_doc, f"Click-{version}.tex", html_title, author, "manual")]
Loading

0 comments on commit 38ba2e6

Please sign in to comment.