From 7685e7497982cf91bf0a069e2d5afeeca9a2dce5 Mon Sep 17 00:00:00 2001
From: YingXing <yingxing.cheng@mathematik.uni-stuttgart.de>
Date: Thu, 5 Oct 2023 11:02:37 +0200
Subject: [PATCH] update readme

---
 .gitignore              | 12 ++++++++++
 .pre-commit-config.yaml | 52 +++++++++++++++++++++++++++++++++++++++++
 0_Installation.ipynb    | 13 ++++++++---
 README.md               | 31 ++++++++++++++++++++++++
 4 files changed, 105 insertions(+), 3 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 .pre-commit-config.yaml

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bb8d517
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+*.pyc
+*.un~
+/build/
+/deps/deps.jl
+/deps/build.log
+/deps/JUPYTER
+/deps/julia-*
+*.jl.*.cov
+.ipynb_checkpoints
+*.gif
+Manifest.toml
+Project.toml
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..f110d6b
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,52 @@
+repos:
+- repo: https://github.com/nbQA-dev/nbQA
+  rev: "1.7.0"
+  hooks:
+    - id: nbqa-black
+      args: [--nbqa-skip-celltags=before-import]
+    - id: nbqa-pyupgrade
+      args: [--py39-plus]
+    - id: nbqa-isort
+      args: [--nbqa-skip-celltags=before-import, --profile=black]
+    - id: nbqa-check-ast
+- repo: https://github.com/pre-commit/pre-commit-hooks
+  rev: "v4.4.0"
+  hooks:
+    - id: check-yaml
+    - id: check-json
+    - id: check-ast
+    - id: fix-byte-order-marker
+    - id: check-case-conflict
+    - id: check-merge-conflict
+    - id: end-of-file-fixer
+    - id: mixed-line-ending
+    - id: trailing-whitespace
+- repo: https://github.com/kynan/nbstripout.git
+  rev: "0.6.1"
+  hooks:
+    - id: nbstripout
+- repo: https://github.com/psf/black
+  rev: "23.9.1"
+  hooks:
+    - id: black
+      language_version: python3.9
+      args: ["-l", "100"]
+- repo: https://github.com/asottile/pyupgrade
+  rev: "v3.1.0"
+  hooks:
+    - id: pyupgrade
+      args: [--py39-plus]
+- repo: https://github.com/pycqa/isort
+  rev: "5.12.0"
+  hooks:
+    - id: isort
+      args: [--profile=black]
+- repo: https://github.com/pre-commit/pygrep-hooks
+  rev: "v1.10.0"
+  hooks:
+    - id: python-no-eval
+    - id: python-use-type-annotations
+- repo: https://github.com/srstevenson/nb-clean
+  rev: "3.0.1"
+  hooks:
+    - id: nb-clean
diff --git a/0_Installation.ipynb b/0_Installation.ipynb
index 2a66323..30c9e83 100644
--- a/0_Installation.ipynb
+++ b/0_Installation.ipynb
@@ -69,19 +69,26 @@
     "    push!(p, x, sin(x))\n",
     "end"
    ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "1f9376ca-21b5-429f-99f3-5612979662bb",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Julia 1.9.3",
+   "display_name": "Julia 1.9.2",
    "language": "julia",
    "name": "julia-1.9"
   },
   "language_info": {
    "file_extension": ".jl",
    "mimetype": "application/julia",
-   "name": "julia",
-   "version": "1.9.3"
+   "name": "julia"
   }
  },
  "nbformat": 4,
diff --git a/README.md b/README.md
index 7db91c0..8c64728 100644
--- a/README.md
+++ b/README.md
@@ -46,3 +46,34 @@ from the WorkshopWizard package by Carsten Bauer (which `install.jl` is using).
 There is a section in the [00_Installation](00_Installation.ipynb) notebook
 with a few quick commands to check everything works as expected.
 Please run these **before the course**.
+
+### For Developers: Setting Up `pre-commit`
+
+[`pre-commit`](https://pre-commit.com/) is a framework that helps to manage and maintain pre-commit hooks to ensure that your code adheres to a consistent style, prevents errors, and adheres to other quality assurance checks.
+
+1. **Install `pre-commit`:**
+   To ensure smooth development, install `pre-commit` using pip by running the following command:
+
+   ```bash
+   pip install pre-commit
+   ```
+
+   For more information and installation options, visit the [`pre-commit`](https://pre-commit.com/) website.
+
+2. **Navigate to the Project Directory:**
+    Change into the project directory, i.e., `julia-seminar` by running:
+
+    ```bash
+    cd julia-seminar
+    ```
+
+3. **Install Hooks:**
+    Install the git hooks by executing:
+
+    ```bash
+    pre-commit install
+    ```
+
+    This command installs the pre-commit script alongside existing git hooks.
+
+Once the pre-commit hook is installed, it will automatically check your code for any issues before each commit. If the checks do not pass, you will be prompted to fix them before proceeding.
-- 
GitLab