Skip to content

Commit eac4bdf

Browse files
committed
initial commit
0 parents  commit eac4bdf

14 files changed

Lines changed: 1004 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
9+
jobs:
10+
pytest:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install -e ".[dev]"
30+
31+
- name: Run tests
32+
run: python -m pytest -q
33+
34+
- name: Run security checks
35+
run: |
36+
python -m bandit -q -r src/predicate_secure/
37+
38+
lint:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.11"
48+
49+
- name: Install pre-commit
50+
run: python -m pip install pre-commit
51+
52+
- name: Run pre-commit
53+
run: pre-commit run --all-files

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
MANIFEST
23+
24+
# Virtual environments
25+
venv/
26+
env/
27+
ENV/
28+
.venv
29+
30+
# IDE
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
36+
# Testing and tooling caches
37+
.pytest_cache/
38+
.coverage
39+
htmlcov/
40+
.tox/
41+
.mypy_cache/
42+
.ruff_cache/
43+
.pre-commit-cache/
44+
45+
# Environment
46+
.env
47+
.env.local
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db
52+
53+
# Runtime traces and artifacts
54+
traces/
55+
artifacts/
56+
tmp/
57+
temp/

.markdownlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
default: false
2+
3+
# Keep this lightweight and non-disruptive for design-heavy docs.
4+
# Enable only the most universal, low-noise rule.
5+
MD010: true

.pre-commit-config.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Pre-commit hooks for predicate-secure repository
2+
3+
repos:
4+
# General file checks
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.5.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-json
12+
- id: check-added-large-files
13+
args: ["--maxkb=1000"]
14+
- id: check-merge-conflict
15+
- id: check-case-conflict
16+
- id: detect-private-key
17+
- id: debug-statements
18+
- id: mixed-line-ending
19+
args: ["--fix=lf"]
20+
21+
# Python code formatting with Black
22+
- repo: https://github.com/psf/black
23+
rev: 24.2.0
24+
hooks:
25+
- id: black
26+
language_version: python3.11
27+
args: ["--line-length=100"]
28+
exclude: ^(venv/|\.venv/|build/|dist/)
29+
30+
# Import sorting with isort (compatible with Black)
31+
- repo: https://github.com/pycqa/isort
32+
rev: 5.13.2
33+
hooks:
34+
- id: isort
35+
args: ["--profile=black", "--line-length=100"]
36+
exclude: ^(venv/|\.venv/|build/|dist/)
37+
38+
# Flake8 for style guide enforcement
39+
- repo: https://github.com/pycqa/flake8
40+
rev: 7.0.0
41+
hooks:
42+
- id: flake8
43+
args:
44+
- "--max-line-length=100"
45+
- "--extend-ignore=E203,W503,E501" # Black compatibility
46+
- "--exclude=venv,build,dist,.eggs,*.egg"
47+
- "--max-complexity=15"
48+
exclude: ^(venv/|\.venv/|build/|dist/)
49+
50+
# Type checking with mypy
51+
- repo: https://github.com/pre-commit/mirrors-mypy
52+
rev: v1.8.0
53+
hooks:
54+
- id: mypy
55+
additional_dependencies:
56+
- pydantic>=2.0
57+
- types-requests
58+
args:
59+
- "--ignore-missing-imports"
60+
- "--no-strict-optional"
61+
- "--warn-unused-ignores"
62+
exclude: ^(tests/|examples/|venv/|\.venv/|build/|dist/)
63+
64+
# Security checks
65+
- repo: https://github.com/PyCQA/bandit
66+
rev: 1.7.7
67+
hooks:
68+
- id: bandit
69+
args: ["-c", "pyproject.toml"]
70+
additional_dependencies: ["bandit[toml]"]
71+
exclude: ^(tests/|venv/|\.venv/)
72+
73+
# Check for common Python anti-patterns
74+
- repo: https://github.com/asottile/pyupgrade
75+
rev: v3.15.0
76+
hooks:
77+
- id: pyupgrade
78+
args: ["--py311-plus"]
79+
exclude: ^(venv/|\.venv/|build/|dist/)
80+
81+
# Markdown linting for docs-heavy workflows
82+
- repo: https://github.com/DavidAnson/markdownlint-cli2
83+
rev: v0.14.0
84+
hooks:
85+
- id: markdownlint-cli2
86+
args: ["--config", ".markdownlint.yaml"]
87+
files: \.md$
88+
89+
default_language_version:
90+
python: python3.11
91+
92+
fail_fast: false
93+
94+
exclude: |
95+
(?x)^(
96+
venv/.*|
97+
\.venv/.*|
98+
build/.*|
99+
dist/.*|
100+
\.eggs/.*|
101+
.*\.egg-info/.*|
102+
__pycache__/.*|
103+
\.pytest_cache/.*|
104+
\.mypy_cache/.*|
105+
\.ruff_cache/.*|
106+
\.pre-commit-cache/.*
107+
)$

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# License
2+
3+
This project is dual-licensed under your choice of either:
4+
5+
* **MIT License** ([LICENSE-MIT](./LICENSE-MIT))
6+
* **Apache License 2.0** ([LICENSE-APACHE](./LICENSE-APACHE))
7+
8+
## Choosing a License
9+
10+
You may use this software under the terms of either license, at your option.
11+
12+
### MIT License
13+
The MIT License is a permissive license that is short and to the point. It lets people do almost anything they want with your project, like making and distributing closed source versions.
14+
15+
### Apache License 2.0
16+
The Apache License 2.0 is also a permissive license, similar to MIT, but it also provides an express grant of patent rights from contributors to users.
17+
18+
## Contribution
19+
20+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you shall be dual-licensed as above, without any additional terms or conditions.
21+
22+
---
23+
24+
Copyright (c) 2026 Predicate Systems Contributors

0 commit comments

Comments
 (0)