File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ def preprocess_schema(plotly_schema):
85
85
items ["colorscale" ] = items .pop ("concentrationscales" )
86
86
87
87
88
+ def lint_code ():
89
+ """Check Python code using settings in pyproject.toml."""
90
+
91
+ subprocess .call (["ruff" , "check" , "." ])
92
+
93
+
88
94
def reformat_code ():
89
95
"""Reformat Python code using settings in pyproject.toml."""
90
96
Original file line number Diff line number Diff line change 11
11
import sys
12
12
import time
13
13
14
- from codegen import perform_codegen , reformat_code
14
+ from codegen import perform_codegen , lint_code , reformat_code
15
15
16
16
17
17
LOGGER = logging .getLogger (__name__ )
@@ -297,6 +297,8 @@ def parse_args():
297
297
"--noformat" , action = "store_true" , help = "prevent reformatting"
298
298
)
299
299
300
+ p_lint = subparsers .add_parser ("lint" , help = "lint code" )
301
+
300
302
p_format = subparsers .add_parser ("format" , help = "reformat code" )
301
303
302
304
p_updateplotlyjsdev = subparsers .add_parser (
@@ -319,6 +321,9 @@ def main():
319
321
elif args .cmd == "format" :
320
322
reformat_code ()
321
323
324
+ elif args .cmd == "lint" :
325
+ lint_code ()
326
+
322
327
elif args .cmd == "updateplotlyjsdev" :
323
328
update_plotlyjs_dev ()
324
329
You can’t perform that action at this time.
0 commit comments