diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..a847fce --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,56 @@ +--- +name: Lint Code Base + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + linter: + runs-on: ubuntu-latest + + defaults: + run: + shell: bash -l {0} + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + # - name: Install conda environment dependencies + # uses: conda-incubator/setup-miniconda@v2 + # with: + # miniforge-version: latest + # miniforge-variant: Mambaforge + # mamba-version: "*" + # channels: conda-forge,bioconda + # channel-priority: strict + # activate-environment: JupyText + # auto-update-conda: true + # environment-file: tests/conda_snk_env.yaml + + # - name: Set up Python + # uses: actions/setup-python@v5 + # with: + # python-version: '3.12' + # architecture: 'x64' + + - name: Super-linter + uses: super-linter/super-linter@v6.4.1 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: main + + VALIDATE_SNAKEMAKE_SNAKEFMT: true + #VALIDATE_SNAKEMAKE_LINT: true + PYTHON_RUFF_CONFIG_FILE: .ruff.toml + VALIDATE_PYTHON_RUFF: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..54985bc --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,77 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.8 +target-version = "py38" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "single" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" diff --git a/README.md b/README.md index 64ba1b6..0d6dcde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # mixmax +[![Super-Linter](https://github.com/JohannesGawron/DNA-ADT-analysis/actions/workflows/linter.yml/badge.svg)](https://github.com/marketplace/actions/super-linter) A python tool to develop cost efficient and robust multiplexing strategies for single-cell genomics and transcriptomics data that allows sample identification after demultiplexing.