Skip to content

Commit

Permalink
Set up pre commit hook for black (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgasner committed Mar 27, 2019
1 parent 11a1241 commit 69a6d26
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 69a6d26

Please sign in to comment.