IN-CORE / pyincore

pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses . The pyIncore allows users to apply various hazards to infrastructure in selected areas, propagating the effect of physical infrastructure damage and loss of functionality to social and economic impacts.
Mozilla Public License 2.0
25 stars 7 forks source link

Black formatter and GH action check #482

Open longshuicy opened 9 months ago

longshuicy commented 9 months ago

Maybe it's time we start to look into black formatter in the next release? https://black.readthedocs.io/en/stable/ Here is an clowder example of using black and github action to check that https://github.com/clowder-framework/clowder2/blob/main/.github/workflows/black.yml Originally posted by @navarroc in https://github.com/IN-CORE/pyincore/issues/476#issuecomment-1912431477

navarroc commented 4 months ago

We can use pyincore-incubator as an example for setting up black and flake8. If needed, we could make this task just three things:

  1. Setting up black/flake8 (pyincore-incubator has a configuration from clowder, maybe that's good enough to borrow directly)
  2. Formatting/linting our code with black/flake8 and committing those changes
  3. Setting up the pre-commit hook and providing instructions on how to set that up

Later, we could add the github action piece if that makes sense to separate these out.

ylyangtw commented 4 months ago

to do: also write down steps for installing pre-commit

navarroc commented 4 months ago

You can probably start from pyincore incubator which has some of this.