diff --git a/.github/workflows/lint_and_format.yml b/.github/workflows/lint_and_format.yml new file mode 100644 index 0000000..3263b34 --- /dev/null +++ b/.github/workflows/lint_and_format.yml @@ -0,0 +1,36 @@ +name: lint_and_format +on: + workflow_dispatch: + pull_request: + types: + - "opened" + - "synchronize" + - "reopened" + branches: + - "main" + - "dev" + push: + branches: + - "main" + - "dev" +jobs: + lint-and-format: + name: Lint and format code. + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup python + uses: actions/setup-python@v4 + with: + cache: 'pip' + python-version: '3.10' + - name: Install pre-commit + run: pip install pre-commit + - name: Setup Cache + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: Lint and Format + run: pre-commit run --show-diff-on-failure --color=always --all-files \ No newline at end of file diff --git a/readme.md b/readme.md index 1dcb1aa..8098617 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,5 @@ +![Linting and Formatting](https://github.com/TPAFS/hicric/actions/workflows/lint_and_format.yml/badge.svg) + # HICRIC: A Dataset of Law, Policy, and Regulatory Guidance for Health Insurance Coverage Understanding