diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..bb8d517fdd64b21f1b049d13a339cb7236546669 --- /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 0000000000000000000000000000000000000000..f110d6b4a9ea7e7b870651f6d2e783b91a0d9eff --- /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 2a66323901cf7da8954e09b8a86939c3194a00ea..30c9e83c93dcb74b356641ac4a72a8ea8a7919e0 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 7db91c093307301af17552fcff37a93196857623..8c64728d5c7a3ced88c7d922b891d7bde2371b2d 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.