sharelint 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sharelint-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +68 -0
- sharelint-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- sharelint-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +59 -0
- sharelint-0.1.0/.github/ISSUE_TEMPLATE/question.yml +46 -0
- sharelint-0.1.0/.github/dependabot.yml +24 -0
- sharelint-0.1.0/.github/pull_request_template.md +36 -0
- sharelint-0.1.0/.github/workflows/ci.yml +94 -0
- sharelint-0.1.0/.github/workflows/codeql.yml +37 -0
- sharelint-0.1.0/.github/workflows/release.yml +88 -0
- sharelint-0.1.0/CHANGELOG.md +25 -0
- sharelint-0.1.0/CODE_OF_CONDUCT.md +36 -0
- sharelint-0.1.0/CONTRIBUTING.md +79 -0
- sharelint-0.1.0/GOVERNANCE.md +47 -0
- sharelint-0.1.0/LICENSE +21 -0
- sharelint-0.1.0/MANIFEST.in +13 -0
- sharelint-0.1.0/PKG-INFO +277 -0
- sharelint-0.1.0/README.md +242 -0
- sharelint-0.1.0/README.zh-CN.md +219 -0
- sharelint-0.1.0/SECURITY.md +53 -0
- sharelint-0.1.0/SUPPORT.md +31 -0
- sharelint-0.1.0/docs/assets/hero.svg +79 -0
- sharelint-0.1.0/docs/releasing.md +77 -0
- sharelint-0.1.0/docs/report-format.md +629 -0
- sharelint-0.1.0/docs/roadmap.md +59 -0
- sharelint-0.1.0/docs/rules.md +293 -0
- sharelint-0.1.0/docs/threat-model.md +262 -0
- sharelint-0.1.0/pyproject.toml +92 -0
- sharelint-0.1.0/schemas/receipt.schema.json +224 -0
- sharelint-0.1.0/schemas/report.schema.json +173 -0
- sharelint-0.1.0/setup.cfg +4 -0
- sharelint-0.1.0/src/sharelint/__init__.py +15 -0
- sharelint-0.1.0/src/sharelint/__main__.py +3 -0
- sharelint-0.1.0/src/sharelint/_version.py +3 -0
- sharelint-0.1.0/src/sharelint/cli.py +269 -0
- sharelint-0.1.0/src/sharelint/context.py +133 -0
- sharelint-0.1.0/src/sharelint/demo.py +98 -0
- sharelint-0.1.0/src/sharelint/filesystem.py +58 -0
- sharelint-0.1.0/src/sharelint/models.py +226 -0
- sharelint-0.1.0/src/sharelint/packing.py +823 -0
- sharelint-0.1.0/src/sharelint/privacy.py +66 -0
- sharelint-0.1.0/src/sharelint/py.typed +1 -0
- sharelint-0.1.0/src/sharelint/reporters.py +306 -0
- sharelint-0.1.0/src/sharelint/rules.py +382 -0
- sharelint-0.1.0/src/sharelint/scanner.py +463 -0
- sharelint-0.1.0/src/sharelint/scanners/__init__.py +1 -0
- sharelint-0.1.0/src/sharelint/scanners/archive.py +415 -0
- sharelint-0.1.0/src/sharelint/scanners/detect.py +95 -0
- sharelint-0.1.0/src/sharelint/scanners/image.py +219 -0
- sharelint-0.1.0/src/sharelint/scanners/ooxml.py +253 -0
- sharelint-0.1.0/src/sharelint/scanners/path.py +73 -0
- sharelint-0.1.0/src/sharelint/scanners/pdf.py +69 -0
- sharelint-0.1.0/src/sharelint/scanners/text.py +164 -0
- sharelint-0.1.0/src/sharelint.egg-info/PKG-INFO +277 -0
- sharelint-0.1.0/src/sharelint.egg-info/SOURCES.txt +70 -0
- sharelint-0.1.0/src/sharelint.egg-info/dependency_links.txt +1 -0
- sharelint-0.1.0/src/sharelint.egg-info/entry_points.txt +2 -0
- sharelint-0.1.0/src/sharelint.egg-info/requires.txt +8 -0
- sharelint-0.1.0/src/sharelint.egg-info/top_level.txt +1 -0
- sharelint-0.1.0/tests/__init__.py +1 -0
- sharelint-0.1.0/tests/bootstrap.py +10 -0
- sharelint-0.1.0/tests/cli_harness.py +110 -0
- sharelint-0.1.0/tests/contract.py +58 -0
- sharelint-0.1.0/tests/helpers.py +351 -0
- sharelint-0.1.0/tests/test_archive_safety.py +75 -0
- sharelint-0.1.0/tests/test_cli_contract.py +171 -0
- sharelint-0.1.0/tests/test_limits.py +140 -0
- sharelint-0.1.0/tests/test_pack_receipt.py +372 -0
- sharelint-0.1.0/tests/test_privacy_and_determinism.py +215 -0
- sharelint-0.1.0/tests/test_recursive_provenance.py +79 -0
- sharelint-0.1.0/tests/test_schemas.py +65 -0
- sharelint-0.1.0/tests/test_security_regressions.py +268 -0
- sharelint-0.1.0/tests/test_synthetic_helpers.py +116 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report reproducible incorrect or unexpected behavior
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for reporting a bug. Use only synthetic examples and remove sensitive values, usernames, and local paths. If this may be a vulnerability, stop and follow SECURITY.md to report it privately.
|
|
9
|
+
- type: input
|
|
10
|
+
id: version
|
|
11
|
+
attributes:
|
|
12
|
+
label: ShareLint version
|
|
13
|
+
description: Output of `sharelint --version`, or the commit hash.
|
|
14
|
+
placeholder: 0.1.0
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: input
|
|
18
|
+
id: environment
|
|
19
|
+
attributes:
|
|
20
|
+
label: Environment
|
|
21
|
+
description: Operating system, architecture, Python version, and installation method.
|
|
22
|
+
placeholder: Ubuntu 24.04, x86_64, Python 3.12, editable install
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: command
|
|
27
|
+
attributes:
|
|
28
|
+
label: Command and configuration
|
|
29
|
+
description: Provide the exact command and relevant policy settings, with private paths and values replaced.
|
|
30
|
+
render: shell
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: reproduction
|
|
35
|
+
attributes:
|
|
36
|
+
label: Synthetic reproduction
|
|
37
|
+
description: Give the smallest reproducible steps or a link to a clearly synthetic fixture.
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
- type: textarea
|
|
41
|
+
id: expected
|
|
42
|
+
attributes:
|
|
43
|
+
label: Expected behavior
|
|
44
|
+
validations:
|
|
45
|
+
required: true
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: actual
|
|
48
|
+
attributes:
|
|
49
|
+
label: Actual behavior
|
|
50
|
+
description: Include sanitized output or a traceback if useful. Do not include matched values.
|
|
51
|
+
validations:
|
|
52
|
+
required: true
|
|
53
|
+
- type: textarea
|
|
54
|
+
id: additional
|
|
55
|
+
attributes:
|
|
56
|
+
label: Additional context
|
|
57
|
+
description: Add any other non-sensitive context, screenshots, or suspected regression range.
|
|
58
|
+
- type: checkboxes
|
|
59
|
+
id: checklist
|
|
60
|
+
attributes:
|
|
61
|
+
label: Checklist
|
|
62
|
+
options:
|
|
63
|
+
- label: I searched existing issues for duplicates.
|
|
64
|
+
required: true
|
|
65
|
+
- label: This report contains no real secrets, personal information, or confidential documents.
|
|
66
|
+
required: true
|
|
67
|
+
- label: This is not a security vulnerability requiring private reporting.
|
|
68
|
+
required: true
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a focused improvement to ShareLint
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Explain the sharing workflow and privacy surface, not just the proposed implementation. Use synthetic examples only. Roadmap items are not delivery commitments.
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: problem
|
|
11
|
+
attributes:
|
|
12
|
+
label: Problem
|
|
13
|
+
description: What disclosure risk or workflow limitation are you trying to address?
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: proposal
|
|
18
|
+
attributes:
|
|
19
|
+
label: Proposed behavior
|
|
20
|
+
description: Describe inputs, outputs, expected findings, and fail-closed behavior.
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: input
|
|
24
|
+
id: formats
|
|
25
|
+
attributes:
|
|
26
|
+
label: Formats or workflows
|
|
27
|
+
description: Which file types, embedded surfaces, platforms, or integrations are involved?
|
|
28
|
+
placeholder: PPTX speaker notes inside a ZIP handoff bundle
|
|
29
|
+
- type: textarea
|
|
30
|
+
id: safety
|
|
31
|
+
attributes:
|
|
32
|
+
label: Privacy and safety considerations
|
|
33
|
+
description: Note possible false positives, false negatives, resource limits, or sensitive output risks.
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: alternatives
|
|
38
|
+
attributes:
|
|
39
|
+
label: Alternatives considered
|
|
40
|
+
description: What existing ShareLint behavior or external tool did you try?
|
|
41
|
+
- type: dropdown
|
|
42
|
+
id: contribution
|
|
43
|
+
attributes:
|
|
44
|
+
label: Contribution
|
|
45
|
+
options:
|
|
46
|
+
- I can submit a pull request
|
|
47
|
+
- I can help with synthetic fixtures or review
|
|
48
|
+
- I am proposing the idea only
|
|
49
|
+
validations:
|
|
50
|
+
required: true
|
|
51
|
+
- type: checkboxes
|
|
52
|
+
id: checklist
|
|
53
|
+
attributes:
|
|
54
|
+
label: Checklist
|
|
55
|
+
options:
|
|
56
|
+
- label: I searched existing issues and the roadmap.
|
|
57
|
+
required: true
|
|
58
|
+
- label: Any examples in this request are synthetic and contain no confidential data.
|
|
59
|
+
required: true
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Question or setup help
|
|
2
|
+
description: Ask about installation, documented behavior, or a sharing workflow
|
|
3
|
+
title: "[Question]: "
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Questions are welcome. Describe the workflow with synthetic names and values only. Never attach a real document, report, secret, personal identifier, or private local path. Possible vulnerabilities belong in the private reporting flow described by SECURITY.md.
|
|
9
|
+
- type: input
|
|
10
|
+
id: version
|
|
11
|
+
attributes:
|
|
12
|
+
label: ShareLint version
|
|
13
|
+
description: Output of `sharelint --version`, a commit hash, or `not installed` if setup failed.
|
|
14
|
+
placeholder: 0.1.0 / not installed
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: input
|
|
18
|
+
id: environment
|
|
19
|
+
attributes:
|
|
20
|
+
label: Environment
|
|
21
|
+
description: Operating system, Python version, and installation method.
|
|
22
|
+
placeholder: Ubuntu 24.04, Python 3.14, source checkout
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: question
|
|
27
|
+
attributes:
|
|
28
|
+
label: Question
|
|
29
|
+
description: What are you trying to inspect or automate, and what is unclear?
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: attempted
|
|
34
|
+
attributes:
|
|
35
|
+
label: What you tried
|
|
36
|
+
description: Include sanitized commands and output when useful.
|
|
37
|
+
render: shell
|
|
38
|
+
- type: checkboxes
|
|
39
|
+
id: checklist
|
|
40
|
+
attributes:
|
|
41
|
+
label: Privacy checklist
|
|
42
|
+
options:
|
|
43
|
+
- label: This question contains only synthetic data and sanitized paths.
|
|
44
|
+
required: true
|
|
45
|
+
- label: This is not a suspected security vulnerability requiring private reporting.
|
|
46
|
+
required: true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: pip
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: monthly
|
|
7
|
+
open-pull-requests-limit: 5
|
|
8
|
+
groups:
|
|
9
|
+
python-tooling:
|
|
10
|
+
patterns:
|
|
11
|
+
- "*"
|
|
12
|
+
update-types:
|
|
13
|
+
- minor
|
|
14
|
+
- patch
|
|
15
|
+
|
|
16
|
+
- package-ecosystem: github-actions
|
|
17
|
+
directory: /
|
|
18
|
+
schedule:
|
|
19
|
+
interval: weekly
|
|
20
|
+
open-pull-requests-limit: 5
|
|
21
|
+
groups:
|
|
22
|
+
github-actions:
|
|
23
|
+
patterns:
|
|
24
|
+
- "*"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What changed, and why is it needed? -->
|
|
4
|
+
|
|
5
|
+
## Related issue
|
|
6
|
+
|
|
7
|
+
<!-- Link an issue when applicable, for example: Closes #123 -->
|
|
8
|
+
|
|
9
|
+
## Validation
|
|
10
|
+
|
|
11
|
+
<!-- List the exact commands and results used to verify this change. -->
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
python -m unittest discover -s tests -v
|
|
15
|
+
PYTHONPATH=src python -m sharelint demo
|
|
16
|
+
python -m compileall -q src tests
|
|
17
|
+
ruff check .
|
|
18
|
+
ruff format --check .
|
|
19
|
+
mypy
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Privacy and maintenance checklist
|
|
23
|
+
|
|
24
|
+
- [ ] Tests use only clearly synthetic data.
|
|
25
|
+
- [ ] Normal reports, logs, errors, and snapshots do not expose matched values.
|
|
26
|
+
- [ ] New or changed parsers have bounded input and explicit unknown/error behavior.
|
|
27
|
+
- [ ] Originals remain untouched unless the behavior is explicit and documented.
|
|
28
|
+
- [ ] No scanning-path network behavior was added.
|
|
29
|
+
- [ ] User-facing behavior and known blind spots are documented.
|
|
30
|
+
- [ ] English and Chinese user-facing docs were updated together, or the difference is explained above.
|
|
31
|
+
- [ ] Tests and quality checks pass, or exceptions are explained above.
|
|
32
|
+
- [ ] The change is focused enough to maintain over time.
|
|
33
|
+
|
|
34
|
+
## Risk notes
|
|
35
|
+
|
|
36
|
+
<!-- Describe compatibility, security, privacy, performance, or migration risks. -->
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
quality:
|
|
18
|
+
name: Quality checks
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 10
|
|
21
|
+
steps:
|
|
22
|
+
- name: Check out repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
- name: Set up Python 3.11
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
cache: pip
|
|
29
|
+
cache-dependency-path: pyproject.toml
|
|
30
|
+
- name: Install development tools
|
|
31
|
+
run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]"
|
|
32
|
+
- name: Lint
|
|
33
|
+
run: ruff check .
|
|
34
|
+
- name: Check formatting
|
|
35
|
+
run: ruff format --check .
|
|
36
|
+
- name: Type check
|
|
37
|
+
run: mypy
|
|
38
|
+
|
|
39
|
+
tests:
|
|
40
|
+
name: Python ${{ matrix.python-version }}
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
timeout-minutes: 10
|
|
43
|
+
strategy:
|
|
44
|
+
fail-fast: false
|
|
45
|
+
matrix:
|
|
46
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
47
|
+
steps:
|
|
48
|
+
- name: Check out repository
|
|
49
|
+
uses: actions/checkout@v4
|
|
50
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
51
|
+
uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
cache: pip
|
|
55
|
+
cache-dependency-path: pyproject.toml
|
|
56
|
+
- name: Install project and test tools
|
|
57
|
+
run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]"
|
|
58
|
+
- name: Run unittest contract
|
|
59
|
+
run: python -m unittest discover -s tests -v
|
|
60
|
+
- name: Run pytest suite
|
|
61
|
+
env:
|
|
62
|
+
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
|
|
63
|
+
run: pytest -p pytest_cov.plugin --cov=sharelint --cov-branch -q
|
|
64
|
+
|
|
65
|
+
wheel:
|
|
66
|
+
name: Build and install wheel
|
|
67
|
+
needs: [quality, tests]
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
timeout-minutes: 10
|
|
70
|
+
steps:
|
|
71
|
+
- name: Check out repository
|
|
72
|
+
uses: actions/checkout@v4
|
|
73
|
+
- name: Set up Python 3.11
|
|
74
|
+
uses: actions/setup-python@v5
|
|
75
|
+
with:
|
|
76
|
+
python-version: "3.11"
|
|
77
|
+
cache: pip
|
|
78
|
+
cache-dependency-path: pyproject.toml
|
|
79
|
+
- name: Build distribution
|
|
80
|
+
run: python -m pip install --upgrade pip build && python -m build
|
|
81
|
+
- name: Install wheel
|
|
82
|
+
run: python -m pip install --no-deps --force-reinstall dist/*.whl
|
|
83
|
+
- name: Smoke-test installed commands
|
|
84
|
+
run: |
|
|
85
|
+
sharelint --version
|
|
86
|
+
sharelint rules > /dev/null
|
|
87
|
+
python -c "import sharelint; print(sharelint.__version__)"
|
|
88
|
+
- name: Upload distributions
|
|
89
|
+
uses: actions/upload-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: distributions
|
|
92
|
+
path: dist/
|
|
93
|
+
if-no-files-found: error
|
|
94
|
+
retention-days: 14
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "17 4 * * 1"
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: codeql-${{ github.workflow }}-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: true
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
analyze:
|
|
21
|
+
name: Analyze Python
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 20
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
security-events: write
|
|
27
|
+
steps:
|
|
28
|
+
- name: Check out repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
- name: Initialize CodeQL
|
|
31
|
+
uses: github/codeql-action/init@v3
|
|
32
|
+
with:
|
|
33
|
+
languages: python
|
|
34
|
+
- name: Perform CodeQL analysis
|
|
35
|
+
uses: github/codeql-action/analyze@v3
|
|
36
|
+
with:
|
|
37
|
+
category: /language:python
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: Publish release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: release-${{ github.event.release.tag_name }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
name: Build and verify distributions
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
timeout-minutes: 10
|
|
19
|
+
steps:
|
|
20
|
+
- name: Check out repository
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.11"
|
|
26
|
+
cache: pip
|
|
27
|
+
cache-dependency-path: pyproject.toml
|
|
28
|
+
- name: Verify release tag matches package version
|
|
29
|
+
env:
|
|
30
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
31
|
+
run: |
|
|
32
|
+
PACKAGE_VERSION="$(PYTHONPATH=src python -c 'import sharelint; print(sharelint.__version__)')"
|
|
33
|
+
test "$RELEASE_TAG" = "v$PACKAGE_VERSION"
|
|
34
|
+
- name: Install release verification tools
|
|
35
|
+
run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]" twine
|
|
36
|
+
- name: Run lint and format checks
|
|
37
|
+
run: |
|
|
38
|
+
ruff check .
|
|
39
|
+
ruff format --check .
|
|
40
|
+
- name: Run type checks
|
|
41
|
+
run: mypy src
|
|
42
|
+
- name: Run tests
|
|
43
|
+
env:
|
|
44
|
+
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
|
|
45
|
+
run: |
|
|
46
|
+
python -m unittest discover -s tests -v
|
|
47
|
+
pytest -p pytest_cov.plugin --cov=sharelint --cov-branch -q
|
|
48
|
+
- name: Build distributions
|
|
49
|
+
run: python -m build
|
|
50
|
+
- name: Check distribution metadata
|
|
51
|
+
run: python -m twine check dist/*
|
|
52
|
+
- name: Smoke-test the built wheel in a clean environment
|
|
53
|
+
run: |
|
|
54
|
+
python -m venv "$RUNNER_TEMP/sharelint-wheel-smoke"
|
|
55
|
+
"$RUNNER_TEMP/sharelint-wheel-smoke/bin/python" -m pip install --no-deps dist/*.whl
|
|
56
|
+
"$RUNNER_TEMP/sharelint-wheel-smoke/bin/sharelint" --version
|
|
57
|
+
"$RUNNER_TEMP/sharelint-wheel-smoke/bin/sharelint" rules > /dev/null
|
|
58
|
+
- name: Upload distributions
|
|
59
|
+
uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: release-distributions
|
|
62
|
+
path: dist/
|
|
63
|
+
if-no-files-found: error
|
|
64
|
+
retention-days: 14
|
|
65
|
+
|
|
66
|
+
publish:
|
|
67
|
+
name: Publish to PyPI
|
|
68
|
+
needs: build
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
timeout-minutes: 10
|
|
71
|
+
environment:
|
|
72
|
+
name: pypi
|
|
73
|
+
url: https://pypi.org/p/sharelint
|
|
74
|
+
permissions:
|
|
75
|
+
contents: read
|
|
76
|
+
id-token: write
|
|
77
|
+
steps:
|
|
78
|
+
- name: Download distributions
|
|
79
|
+
uses: actions/download-artifact@v4
|
|
80
|
+
with:
|
|
81
|
+
name: release-distributions
|
|
82
|
+
path: dist/
|
|
83
|
+
# This requires a matching PyPI Trusted Publisher and protected `pypi`
|
|
84
|
+
# environment to be configured before the first release.
|
|
85
|
+
- name: Publish distributions with Trusted Publishing
|
|
86
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
87
|
+
with:
|
|
88
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ShareLint will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-08-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Local-only scanning for directories, archives, Office documents, PDFs, images, and text.
|
|
15
|
+
- Recursive provenance for findings in nested share bundles.
|
|
16
|
+
- Privacy-preserving console, JSON, SARIF, and HTML reports.
|
|
17
|
+
- Deterministic fail-closed packaging with hash-bound receipts.
|
|
18
|
+
- Explicit coverage gaps and bounded handling of untrusted archives.
|
|
19
|
+
- Synthetic demonstration bundle, contributor governance, and security documentation.
|
|
20
|
+
- Continuous integration across Python 3.11, 3.12, 3.13, and 3.14.
|
|
21
|
+
- A branch-aware 75% coverage floor enforced in CI and release verification.
|
|
22
|
+
- CodeQL analysis, dependency update automation, and a Trusted Publishing release workflow.
|
|
23
|
+
|
|
24
|
+
[Unreleased]: https://github.com/jasonzhang06-source/sharelint/compare/v0.1.0...HEAD
|
|
25
|
+
[0.1.0]: https://github.com/jasonzhang06-source/sharelint/releases/tag/v0.1.0
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our standard
|
|
4
|
+
|
|
5
|
+
ShareLint is committed to a respectful, inclusive, and technically rigorous
|
|
6
|
+
community. Participants are expected to:
|
|
7
|
+
|
|
8
|
+
- communicate with empathy and assume good faith;
|
|
9
|
+
- critique ideas and code rather than people;
|
|
10
|
+
- welcome questions and differing levels of experience;
|
|
11
|
+
- respect privacy, consent, and confidentiality;
|
|
12
|
+
- accept maintainer decisions about scope and project sustainability.
|
|
13
|
+
|
|
14
|
+
Unacceptable behavior includes harassment, discrimination, threats, sexualized
|
|
15
|
+
attention, deliberate intimidation, publishing another person's private
|
|
16
|
+
information, or sustained disruption of project spaces.
|
|
17
|
+
|
|
18
|
+
## Scope
|
|
19
|
+
|
|
20
|
+
This code applies in repository issues, pull requests, discussions, and other
|
|
21
|
+
spaces where someone is representing the ShareLint project.
|
|
22
|
+
|
|
23
|
+
## Enforcement
|
|
24
|
+
|
|
25
|
+
The maintainer may edit or remove content, close or lock threads, reject
|
|
26
|
+
contributions, or temporarily or permanently restrict participation when needed
|
|
27
|
+
to protect the community.
|
|
28
|
+
|
|
29
|
+
Use GitHub's report and block features for platform abuse. For a
|
|
30
|
+
repository-specific incident, contact the maintainer through a private contact
|
|
31
|
+
method published on the maintainer's GitHub profile, if available. If no private
|
|
32
|
+
channel is available, contact GitHub Support. Do not post sensitive incident
|
|
33
|
+
details publicly.
|
|
34
|
+
|
|
35
|
+
Reports will be considered as privately as practical. Retaliation against a
|
|
36
|
+
good-faith reporter is not tolerated.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Contributing to ShareLint
|
|
2
|
+
|
|
3
|
+
Thanks for helping make ShareLint more useful and trustworthy. Small, focused
|
|
4
|
+
changes with tests are easiest to review and maintain.
|
|
5
|
+
|
|
6
|
+
## Before opening an issue
|
|
7
|
+
|
|
8
|
+
- Search existing issues and the roadmap for related work.
|
|
9
|
+
- Use a minimal synthetic example. Never upload real credentials, personal
|
|
10
|
+
information, client documents, or other confidential material.
|
|
11
|
+
- Report possible vulnerabilities privately as described in
|
|
12
|
+
[SECURITY.md](SECURITY.md), not in a public issue.
|
|
13
|
+
|
|
14
|
+
## Development workflow
|
|
15
|
+
|
|
16
|
+
1. Fork the repository and create a branch from `main`.
|
|
17
|
+
2. Create a virtual environment and install the development dependencies:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python -m venv .venv
|
|
21
|
+
source .venv/bin/activate
|
|
22
|
+
python -m pip install -e ".[dev]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. Make one coherent change and add or update tests.
|
|
26
|
+
4. Run the required repository checks:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python -m unittest discover -s tests -v
|
|
30
|
+
PYTHONPATH=src python -m sharelint demo
|
|
31
|
+
python -m compileall -q src tests
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
When the development extras are installed, also run:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
ruff check .
|
|
38
|
+
ruff format --check .
|
|
39
|
+
mypy
|
|
40
|
+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p pytest_cov.plugin --cov=sharelint --cov-branch -q
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5. Open a pull request using the repository template.
|
|
44
|
+
|
|
45
|
+
If a command is not available on the branch you are contributing to, explain
|
|
46
|
+
what you ran instead in the pull request.
|
|
47
|
+
|
|
48
|
+
## Privacy and safety expectations
|
|
49
|
+
|
|
50
|
+
ShareLint operates on potentially sensitive files. Contributions must:
|
|
51
|
+
|
|
52
|
+
- keep test fixtures synthetic and clearly fictional;
|
|
53
|
+
- hide matched values in normal reports, logs, exceptions, and snapshots;
|
|
54
|
+
- treat unknown, encrypted, truncated, or unscanned content explicitly rather
|
|
55
|
+
than silently declaring it clean;
|
|
56
|
+
- bound recursion, decompression, file sizes, and other attacker-controlled
|
|
57
|
+
work;
|
|
58
|
+
- preserve originals unless an explicitly documented command says otherwise;
|
|
59
|
+
- never send scanned content, findings, filenames, or telemetry over a
|
|
60
|
+
network;
|
|
61
|
+
- describe results as policy and coverage findings, not as a guarantee that a
|
|
62
|
+
file is anonymous or safe.
|
|
63
|
+
|
|
64
|
+
New scanners should document supported surfaces, known blind spots, resource
|
|
65
|
+
limits, and stable finding identifiers. Include nominal, malformed-input, and
|
|
66
|
+
false-positive regression tests where practical.
|
|
67
|
+
|
|
68
|
+
Rule changes should also follow the checklist in
|
|
69
|
+
[Adding or changing a rule](docs/rules.md#adding-or-changing-a-rule).
|
|
70
|
+
|
|
71
|
+
## Pull request review
|
|
72
|
+
|
|
73
|
+
The maintainer may ask for changes to scope, tests, privacy behavior, or public
|
|
74
|
+
interfaces. A pull request can be declined when its ongoing maintenance cost is
|
|
75
|
+
too high, even if the implementation works. Decisions and material tradeoffs
|
|
76
|
+
should remain visible in the issue or pull request.
|
|
77
|
+
|
|
78
|
+
By contributing, you agree that your contribution is licensed under the
|
|
79
|
+
project's MIT License.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Governance
|
|
2
|
+
|
|
3
|
+
ShareLint is a maintainer-led open source project. This lightweight model keeps
|
|
4
|
+
decision-making clear and sustainable for a project currently maintained by one
|
|
5
|
+
person.
|
|
6
|
+
|
|
7
|
+
## Roles
|
|
8
|
+
|
|
9
|
+
- **Maintainer:** sets scope, merges changes, publishes releases, handles
|
|
10
|
+
security reports, and moderates project spaces.
|
|
11
|
+
- **Contributors:** propose changes through issues and pull requests, review
|
|
12
|
+
work, and help improve documentation and tests.
|
|
13
|
+
|
|
14
|
+
The maintainer has final responsibility for decisions. Significant choices
|
|
15
|
+
should be explained in the relevant issue, pull request, or decision record so
|
|
16
|
+
the reasoning remains reviewable.
|
|
17
|
+
|
|
18
|
+
## Decision principles
|
|
19
|
+
|
|
20
|
+
Changes are prioritized by user impact, privacy and security risk,
|
|
21
|
+
reproducibility, compatibility, and ongoing maintenance cost. Rough consensus is
|
|
22
|
+
preferred, but lack of consensus does not require the project to accept or
|
|
23
|
+
indefinitely delay a change.
|
|
24
|
+
|
|
25
|
+
Roadmap items are intentions, not commitments or deadlines. Issues and pull
|
|
26
|
+
requests may be closed when they are out of scope, inactive, duplicated, or too
|
|
27
|
+
costly to maintain.
|
|
28
|
+
|
|
29
|
+
## Releases
|
|
30
|
+
|
|
31
|
+
Releases follow semantic versioning where practical. Security fixes may be
|
|
32
|
+
released without waiting for unrelated roadmap work. Only the maintainer, or a
|
|
33
|
+
delegate explicitly granted release access, may publish official artifacts.
|
|
34
|
+
The repeatable release procedure is documented in [docs/releasing.md](docs/releasing.md).
|
|
35
|
+
|
|
36
|
+
## Adding maintainers
|
|
37
|
+
|
|
38
|
+
Additional maintainers may be invited after sustained, constructive
|
|
39
|
+
contributions and demonstrated care with privacy-sensitive changes. Access is
|
|
40
|
+
granted gradually and may be removed when it is no longer needed.
|
|
41
|
+
|
|
42
|
+
If the project becomes inactive, the MIT License permits the community to fork
|
|
43
|
+
and continue the work. Any successor project must not imply that it publishes
|
|
44
|
+
official ShareLint releases without authorization.
|
|
45
|
+
|
|
46
|
+
Community behavior is governed by [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), and
|
|
47
|
+
vulnerabilities follow [SECURITY.md](SECURITY.md).
|
sharelint-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ShareLint contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|