diff --git a/.github/actions/pre-commit/action.yaml b/.github/actions/pre-commit/action.yaml deleted file mode 100644 index 6db4408..0000000 --- a/.github/actions/pre-commit/action.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: pre-commit -description: run pre-commit to enforce code standards -inputs: - extra_args: - description: options to pass to pre-commit run - required: false - default: '--all-files' -runs: - using: composite - steps: - - run: python -m pip install pre-commit - shell: bash - - run: python -m pip freeze --local - shell: bash - - run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }} - shell: bash diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index fc0c5c0..65947d3 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -9,6 +9,6 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: ./.github/actions/pre-commit + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..6c2c005 --- /dev/null +++ b/.lintr @@ -0,0 +1,2 @@ +linters: linters_with_defaults(object_usage_linter = NULL) +encoding: "UTF-8" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e90348..96b86eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,52 +1,147 @@ +################################################################################ +# OVERVIEW +################################################################################ +# The following contains the pre-commit hooks for this repository, which are +# likely a modified version of the author's (AFg6K7h4fhy2) repository template. +# +# Links: +# +# Pre-commit: https://pre-commit.com/ +# The author's template: https://github.com/AFg6K7h4fhy2/AFg6K7h4fhy2-Template +# Supported hooks: https://github.com/pre-commit/pre-commit-hooks repos: ################################################################################ +# GENERAL +################################################################################ - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: + # prevent giant files from being committed. - id: check-added-large-files args: ["--maxkb=10000"] + # simply check whether files parse as valid + # python + - id: check-ast + # check for files with names that would + # conflict on a case-insensitive filesystem + # like MacOS HFS+ or Windows FAT. + - id: check-case-conflict + # checks for a common error of placing + # code before the docstring. + - id: check-docstring-first + # attempts to load all yaml files to + # verify syntax. - id: check-yaml + # allow yaml files which use the + # multi-document syntax args: ["--allow-multiple-documents"] + # attempts to load all TOML files to + # verify syntax. - id: check-toml + # makes sure files end in a newline and + # only a newline. - id: end-of-file-fixer + # replaces or checks mixed line ending. - id: mixed-line-ending + # verifies that test files are named + # correctly. + - id: name-tests-test + # ensure tests match test_.*\.py + args: ["--pytest-test-first"] + # checks that all your JSON files are pretty. + # "Pretty" here means that keys are sorted + # and indented. + - id: pretty-format-json + # automatically format json files; + # when autofixing, retain the original + # key ordering (instead of sorting + # the keys) + args: ["--autofix", "--no-sort-keys"] + # trims trailing whitespace. - id: trailing-whitespace + # checks that non-binary executables have + # a proper shebang. + - id: check-executables-have-shebangs + files: \.sh$ + # checks for the existence of private keys. + - id: detect-private-key +################################################################################ +# PYTHON ################################################################################ - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.10.0 hooks: - - id: black-jupyter + - id: black args: ["--line-length", "79"] language_version: python3 - repo: https://github.com/PyCQA/isort rev: 5.13.2 hooks: - id: isort - args: ["--profile", "black", - "--line-length", "79"] -- repo: https://github.com/numpy/numpydoc - rev: v1.7.0 - hooks: - - id: numpydoc-validation + args: ["--profile", "black", "--line-length", "79"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.7 + rev: v0.8.2 hooks: - id: ruff args: ["--ignore=E741", "--ignore=E731", "--fix"] +# - repo: https://github.com/pre-commit/mirrors-mypy +# rev: v1.13.0 +# hooks: +# - id: mypy +################################################################################ +# R +################################################################################ +# - repo: https://github.com/lorenzwalthert/precommit +# rev: v0.4.3.9003 +# hooks: +# - id: style-files +# - id: lintr +################################################################################ +# MAKE FILES +################################################################################ +- repo: https://github.com/mrtazz/checkmake.git + rev: 0.2.2 + hooks: + - id: checkmake +################################################################################ +# SECURITY +################################################################################ +# - repo: https://github.com/gitleaks/gitleaks +# rev: v8.19.0 +# hooks: +# - id: gitleaks +# - repo: https://github.com/Yelp/detect-secrets +# rev: v1.5.0 +# hooks: +# # must first run +# # detect-secrets scan > .secrets.baseline +# - id: detect-secrets +# args: ["--baseline", ".secrets.baseline"] +# exclude: package.lock.json +################################################################################ +# GITHUB ACTIONS ################################################################################ - repo: https://github.com/rhysd/actionlint - rev: v1.7.1 + rev: v1.7.4 hooks: - id: actionlint ################################################################################ +# SPELLING +################################################################################ - repo: https://github.com/crate-ci/typos - rev: v1.21.0 + rev: typos-dict-v0.11.37 hooks: - id: typos args: ["--force-exclude"] ################################################################################ +# COMMIT MESSAGES +################################################################################ - repo: https://github.com/commitizen-tools/commitizen - rev: v3.27.0 + rev: v4.0.0 hooks: - id: commitizen +- repo: https://github.com/jorisroovers/gitlint + rev: v0.19.1 + hooks: + - id: gitlint ################################################################################ diff --git a/labels.toml b/labels.toml index e8ffa5d..da8192c 100644 --- a/labels.toml +++ b/labels.toml @@ -158,6 +158,11 @@ color = "cfd3d7" name = "visuals" description = "Adds or pertains to visualizations." +[warnings] +color = "cfd3d7" +name = "warnings" +description = "Adjustments to project to remove warnings." + [website] color = "cfd3d7" name = "website" diff --git a/pyproject.toml b/pyproject.toml index ed8ad22..b2dc5fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,13 @@ [tool.poetry] name = "genetic-evolution-tournament" version = "0.0.1" -description = "The Genetic Evolution Tournament." +description = "The Genetic Evolution Tournament (GET) is a Metaculus human judgment forecasting tournament established to generate forecasts and scenarios pertaining to the use of human genetic and reproductive technologies for treatment and enhancement." authors = ["AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>"] license = "Apache-2.0" package-mode = false +readme = "README.md" +repository = "https://github.com/AFg6K7h4fhy2/Genetic-Evolution-Tournament" +keywords = ["genetics", "tournament", "forecasting", "genetic-engineering", "human-enhancement", "human-judgment", "dna-technology"] [tool.poetry.dependencies] python = "^3.12" @@ -14,6 +17,10 @@ pre-commit = "^3.7.0" [tool.poetry.group.dev.dependencies] matplotlib = "^3.9.2" +[tool.poetry.urls] +"Repository Issues" = "https://github.com/Genetic-Evolution-Tournament/issues" +"Author Homepage" = "https://github.com/AFg6K7h4fhy2" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"