ipywidgets_bokeh icon indicating copy to clipboard operation
ipywidgets_bokeh copied to clipboard

Add pre-commit

Open ndmlny-qs opened this issue 2 years ago • 1 comments

This commit does not run pre-commit on the repo, it just adds it as a dev dependency, and adds the following checks.

  • prevents commits to the main branch
  • remove unused imports from python files
  • modifies all imports to be absolute for python files
  • removes commented out code in python files
  • runs isort on imports for python files
  • runs black on python files (formatting)
  • runs ruff on python files (linting)
  • fixes for the setup.cfg file
  • ensures json, yaml, and toml files are parseable (ignores the conda.recipe/meta.yaml file)
  • uses local installs of eslint and prettier for linting and formatting any [java|type]script files.

Also, three additional files have been added.

  • ipywidgets_bokeh/.eslintrc.js
  • ipywidgets_bokeh/.prettierrc

These files contain the formatting and linting rules as outlined in Bokeh.

The last file is a project.toml file that for the time being only contains preferences for ruff. In the future we can use it for complying with setuptools installs.

The package*.json files have also been modified to include eslint and prettier, as well as updating the lint script from a TODO to an actual linting action. This helps with the requests in #75

Resolves #80

ndmlny-qs avatar Feb 07 '23 19:02 ndmlny-qs

Happy to see this merged!

philippjfr avatar Mar 01 '23 14:03 philippjfr