Skip to content

Commit

Permalink
Base repository without python files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed Mar 6, 2024
1 parent 6bb2c1a commit d7d5ba1
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 336 deletions.
20 changes: 0 additions & 20 deletions .bandit.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,7 @@ dmypy.json

# IDE
.vscode/
.idea/

# CI
.gitlab-ci-local/
8 changes: 8 additions & 0 deletions .gitlab-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
super-linter:
stage: build
image:
name: github/super-linter:v3.15.5
script:
- "true"
variables:
RUN_LOCAL: "true"
32 changes: 0 additions & 32 deletions .gitlab/workflows/lint.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .gitlab/workflows/security-bandit.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .gitlab/workflows/test.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .isort.cfg

This file was deleted.

66 changes: 15 additions & 51 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,19 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-xml
- id: detect-private-key
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
- repo: https://github.com/myint/autoflake
rev: v2.2.1
hooks:
- id: autoflake
# Manage spaces.
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-symlinks
# Check file syntax/format
- id: check-xml
- id: check-json
- id: check-yaml
args: [--allow-multiple-documents]
# Security checks.
- id: detect-private-key
- id: detect-aws-credentials
args:
- --in-place
- --remove-unused-variables
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
# Use black profile for isort to avoid conflicts
# see https://github.com/PyCQA/isort/issues/1518
args: ["--profile", "black"]
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
hooks:
- id: bandit
name: bandit
args: ["-c", ".bandit.yaml"]
description: 'Bandit is a tool for finding common security issues in Python code'
entry: bandit
language: python
language_version: python3
types: [python]
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.3
hooks:
- id: python-safety-dependencies-check
# See https://github.com/pre-commit/pre-commit-hooks/issues/174
- --allow-missing-credentials
8 changes: 0 additions & 8 deletions .pylintrc

This file was deleted.

22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Python Cookiecutter repository
# Base Cookiecutter repository

Python template repository including boilerplate workflows and CI.

```bash
.bandit.yaml
.pre-commit-config.yaml
.github
└── workflows
.gitlab
└── issue_templates
└── merge_request_templates
.gitlab-ci.yaml
```

Delete unused folder after creating the repository.

## Creating a new project

The name of a new project should be descriptive and short.
Expand Down Expand Up @@ -40,7 +45,7 @@ docker-compose run pre-commit
Tune the Github pipelines in [.github/workflows](.github/workflows/).

To speed up the development, you can test the pipeline with [act](https://github.com/nektos/act).
Installing `act` is beyond the scope of this document.
Its installation is beyond the scope of this document.

To test the pipeline locally and ensure that secrets (e.g., service accounts and other credentials)
are correctly configured, use:
Expand All @@ -50,3 +55,14 @@ are correctly configured, use:
act -j test -s CI_API_TOKEN="$(cat gh-ci.json)" \
-s CI_ACCOUNT=my-secret-account
```

## Testing gitlab-ci

Tune the Gitlab pipelines in [.gitlab-ci.yml](.gitlab-ci.yml).

To speed up the development, you can test the pipeline with gitlab-ci-local.
Its installation is beyond the scope of this document.

```bash
gitlab-ci-local --file .gitlab-ci.yaml super-linter
```
5 changes: 2 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# Run this file using
#
# $ docker-compose up processor
# $ docker-compose up pre-commit
#
version: "3.9"
services:
pre-commit:
build:
context: .
dockerfile: tests/Dockerfile.pre-commit
dockerfile: pre-commit.dockerfile
working_dir: /code
volumes:
- .:/code
Expand All @@ -23,7 +23,6 @@ services:
- IGNORE_GITIGNORED_FILES=true
volumes:
- .:/tmp/lint/
- ./tox.ini:/action/lib/.automation/.flake8
# This container will run successfully
# only if all dependencies return no errors.
test:
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions requirements-dev.txt

This file was deleted.

Empty file removed requirements.txt
Empty file.
2 changes: 0 additions & 2 deletions tests/test_noop.py

This file was deleted.

Loading

0 comments on commit d7d5ba1

Please sign in to comment.