File tree 1 file changed +26
-0
lines changed 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,32 @@ Here's what you need to know: changes to any files inside the following director
64
64
- ` packages/python/chart-studio/chart_studio/plotly/chunked_requests `
65
65
- ` packages/python/plotly/plotly/matplotlylib/mplexporter `
66
66
67
+ ### Configure black code formatting
68
+ This repo uses the [ Black] ( https://black.readthedocs.io/en/stable/ ) code formatter,
69
+ and the [ pre-commit] ( https://pre-commit.com/ ) library to manage a git commit hook to
70
+ run Black prior to each commit. Both pre-commit and black are included in the
71
+ ` packages/python/plotly/optional-requirements.txt ` file, so you should have them
72
+ installed already if you've been following along.
73
+
74
+ To enable the Black formatting git hook, run the following from within your virtual
75
+ environment.
76
+
77
+ ``` bash
78
+ (plotly_dev) $ pre-commit install
79
+ ```
80
+
81
+ Now, whenever you perform a commit, the Black formatter will run. If the formatter
82
+ makes no changes, then the commit will proceed. But if the formatter does make changes,
83
+ then the commit will abort. To proceed, stage the files that the formatter
84
+ modified and commit again.
85
+
86
+ If you don't want to use ` pre-commit ` , then you can run black manually prior to making
87
+ a PR as follows.
88
+
89
+ ``` bash
90
+ (plotly_dev) $ black .
91
+ ```
92
+
67
93
### Making a Development Branch
68
94
69
95
Third, * don't* work in the ` master ` branch. As soon as you get your master branch ready, run:
You can’t perform that action at this time.
0 commit comments