Skip to content

Commit

Permalink
Merge pull request #44 from kontext-tech/pre-open-source
Browse files Browse the repository at this point in the history
ci: added pre-commit checks for pull requests
  • Loading branch information
tang2087 authored Sep 9, 2024
2 parents 2a9e710 + 93b8fbc commit f0e136e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Pre-Commit Hooks

on:
push:
branches:
- main
pull_request:

jobs:
pre-commit:
name: Run Pre-Commit
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9" # Use the appropriate Python version

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "20.16.0"

- name: Install npm dependencies
run: npm install
working-directory: ./ui

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit on all files for pull requests
if: github.event_name == 'pull_request'
run: pre-commit run --all-files

- name: Run pre-commit on changed files for pushes
if: github.event_name != 'pull_request'
run: pre-commit run
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Launch the tool:
kontext-copilot
```

> For more details about installation, refer to [**Kontext Copilot Installation**](https://kontext.tech/article/1385/kontext-copilot-installation)
For more details about installation, refer to [**Kontext Copilot Installation**](https://kontext.tech/article/1385/kontext-copilot-installation)

## Get started

Expand All @@ -31,13 +31,13 @@ Kontext Copilot is still at early stage. Please follow the guide below to evalua

## Change logs

[**Change logs**](./CHANGELOG.md)
[**Change logs**](https://github.com/kontext-tech/kontext-copilot/blob/main/CHANGELOG.md)

## For developers and contributors

This section shows you how to setup local environment to participate in development of kontext-copilot.

> Note - repo
VS Code is recommended.

### Setup Python environment

Expand Down

0 comments on commit f0e136e

Please sign in to comment.