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):
8585 items ["colorscale" ] = items .pop ("concentrationscales" )
8686
8787
88+ def lint_code ():
89+ """Check Python code using settings in pyproject.toml."""
90+
91+ subprocess .call (["ruff" , "check" , "." ])
92+
93+
8894def reformat_code ():
8995 """Reformat Python code using settings in pyproject.toml."""
9096
Original file line number Diff line number Diff line change 1111import sys
1212import time
1313
14- from codegen import perform_codegen , reformat_code
14+ from codegen import perform_codegen , lint_code , reformat_code
1515
1616
1717LOGGER = logging .getLogger (__name__ )
@@ -297,6 +297,8 @@ def parse_args():
297297 "--noformat" , action = "store_true" , help = "prevent reformatting"
298298 )
299299
300+ p_lint = subparsers .add_parser ("lint" , help = "lint code" )
301+
300302 p_format = subparsers .add_parser ("format" , help = "reformat code" )
301303
302304 p_updateplotlyjsdev = subparsers .add_parser (
@@ -319,6 +321,9 @@ def main():
319321 elif args .cmd == "format" :
320322 reformat_code ()
321323
324+ elif args .cmd == "lint" :
325+ lint_code ()
326+
322327 elif args .cmd == "updateplotlyjsdev" :
323328 update_plotlyjs_dev ()
324329
You can’t perform that action at this time.
0 commit comments