Skip to content
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

Set up pre commit hook for black #1048

Merged
merged 9 commits into from Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
@@ -1,4 +1,8 @@
- repo: https://github.com/pre-commit/mirrors-yapf
sha: v0.22.0
- repo: "https://github.com/ambv/black"
rev: "18.9b0"
hooks:
- id: yapf
- id: black
args: ["--fast", "-v", "-S", "-N", "."]
language_version: "python3.6"
pass_filenames: false
always_run: true
18 changes: 18 additions & 0 deletions pyproject.toml
@@ -1,2 +1,20 @@
[tool.black]
line-length = 100
exclude = '''
/(
build
| buck-out
| dist
| _build
| \.eggs
| \.git
| \.hg
| \.mypy_cache
| \.nox
| \.tox
| \.venv
| python_modules/dagster/dagster/tutorials
| snapshots
| python_modules/dagster-airflow/dagster_airflow_tests/test_project
)/
'''
10 changes: 10 additions & 0 deletions python_modules/dagster/docs/contributing.rst
Expand Up @@ -43,6 +43,16 @@ take a few minutes.

Have fun coding!

6. Set up pre-commit hooks

We use black to enforce a consistent code style. To set up a pre-commit hook, just run:

.. code-block:: console

$ pre-commit install

(The `pre-commit` package is installed in dagster's dev-requirements.)

Running dagit webapp in development
-------------------------------------
For development, run the dagit GraphQL server on a different port than the
Expand Down
18 changes: 18 additions & 0 deletions python_modules/dagster/docs/snapshots/snap_test_doc_build.py
Expand Up @@ -345,6 +345,14 @@
</li>
</ol>
<p>Have fun coding!</p>
<ol class="arabic simple" start="6">
<li>Set up pre-commit hooks</li>
</ol>
<p>We use black to enforce a consistent code style. To set up a pre-commit hook, just run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pre-commit install
</pre></div>
</div>
<p>(The <cite>pre-commit</cite> package is installed in dagster’s dev-requirements.)</p>
<div class="section" id="running-dagit-webapp-in-development">
<h3>Running dagit webapp in development<a class="headerlink" href="#running-dagit-webapp-in-development" title="Permalink to this headline">¶</a></h3>
<p>For development, run the dagit GraphQL server on a different port than the
Expand Down Expand Up @@ -1938,6 +1946,16 @@

Have fun coding!

6. Set up pre-commit hooks

We use black to enforce a consistent code style. To set up a pre-commit hook, just run:

.. code-block:: console

$ pre-commit install

(The `pre-commit` package is installed in dagster's dev-requirements.)

Running dagit webapp in development
-------------------------------------
For development, run the dagit GraphQL server on a different port than the
Expand Down