From c1371e20c2eb77eb4fac089412570ace88e7b56b Mon Sep 17 00:00:00 2001
From: Simonas <20096648+simjak@users.noreply.github.com>
Date: Thu, 9 Nov 2023 10:27:53 +0200
Subject: [PATCH] removed venv

---
 .github/workflows/lint.yml     | 40 ++++++++++++++++++++++++++++++++++
 .github/workflows/pr_agent.yml | 18 +++++++++++++++
 .pre-commit-config.yaml        | 27 +++++++++++++++++++++++
 .vscode/settings.json          |  5 +++++
 Makefile                       | 11 ++++++++++
 5 files changed, 101 insertions(+)
 create mode 100644 .github/workflows/lint.yml
 create mode 100644 .github/workflows/pr_agent.yml
 create mode 100644 .pre-commit-config.yaml
 create mode 100644 .vscode/settings.json
 create mode 100644 Makefile

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..b7c6e679
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,40 @@
+name: lint
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+
+env:
+  POETRY_VERSION: "1.5.1"
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version:
+          - "3.11"
+    steps:
+      - uses: actions/checkout@v3
+      - name: Cache Poetry
+        uses: actions/cache@v2
+        with:
+          path: ~/.poetry
+          key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-poetry-
+      - name: Install poetry
+        run: |
+          pipx install poetry==$POETRY_VERSION
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python-version }}
+          cache: poetry
+      - name: Install dependencies
+        run: |
+          poetry install
+      - name: Analyzing the code with our lint
+        run: |
+          make lint
\ No newline at end of file
diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml
new file mode 100644
index 00000000..4e86dfbc
--- /dev/null
+++ b/.github/workflows/pr_agent.yml
@@ -0,0 +1,18 @@
+on:
+  pull_request:
+  issue_comment:
+jobs:
+  pr_agent_job:
+    runs-on: ubuntu-latest
+    permissions:
+      pull-requests: write
+      issues: write
+      contents: write
+    name: Run pr agent on every pull request, respond to user comments
+    steps:
+      - name: PR Agent action step
+        id: pragent
+        uses: Codium-ai/pr-agent@main
+        env:
+          OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 00000000..03b6163c
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,27 @@
+default_language_version:
+  python: python3.11.3
+repos:
+  - repo: https://github.com/psf/black
+    rev: 23.9.1
+    hooks:
+      - id: black
+
+  - repo: https://github.com/asottile/blacken-docs
+    rev: 1.16.0
+    hooks:
+      - id: blacken-docs
+        additional_dependencies: [black==22.10.0]
+
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    rev: v0.0.290
+    hooks:
+      - id: ruff
+        types_or: [python, pyi, jupyter]
+        
+
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v4.4.0
+    hooks:
+      - id: trailing-whitespace
+      - id: end-of-file-fixer
+      - id: check-yaml
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..40b98b58
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,5 @@
+{
+    "cSpell.words": [
+        "linalg"
+    ]
+}
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..6fcc35a1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+format:
+	poetry run black .
+	poetry run ruff --select I --fix .
+
+PYTHON_FILES=.
+lint: PYTHON_FILES=.
+lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$')
+
+lint lint_diff:
+	poetry run black $(PYTHON_FILES) --check
+	poetry run ruff .
-- 
GitLab