slowql 0.0.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.
Files changed (158) hide show
  1. slowql-0.0.0/.dockerignore +9 -0
  2. slowql-0.0.0/.github/CODEOWNERS +11 -0
  3. slowql-0.0.0/.github/ISSUE_TEMPLATE/bug_report.yml +34 -0
  4. slowql-0.0.0/.github/ISSUE_TEMPLATE/detector_request.yml +24 -0
  5. slowql-0.0.0/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
  6. slowql-0.0.0/.github/dependabot.yml +10 -0
  7. slowql-0.0.0/.github/pull_request_template.md +15 -0
  8. slowql-0.0.0/.github/security.md +15 -0
  9. slowql-0.0.0/.github/workflows/ci.yml +189 -0
  10. slowql-0.0.0/.github/workflows/dependency-review.yml +17 -0
  11. slowql-0.0.0/.github/workflows/docs.yml +26 -0
  12. slowql-0.0.0/.github/workflows/sbom.yml +27 -0
  13. slowql-0.0.0/.github/workflows/snyk.yml +19 -0
  14. slowql-0.0.0/.gitignore +29 -0
  15. slowql-0.0.0/CHANGELOG.md +14 -0
  16. slowql-0.0.0/CODE_OF_CONDUCT.md +27 -0
  17. slowql-0.0.0/CONTRIBUTING.md +27 -0
  18. slowql-0.0.0/Dockerfile +65 -0
  19. slowql-0.0.0/LICENSE +53 -0
  20. slowql-0.0.0/MANIFEST.in +12 -0
  21. slowql-0.0.0/Makefile +53 -0
  22. slowql-0.0.0/PKG-INFO +239 -0
  23. slowql-0.0.0/README.md +202 -0
  24. slowql-0.0.0/SECURITY.md +20 -0
  25. slowql-0.0.0/assets/demo.gif +0 -0
  26. slowql-0.0.0/codecov.yml +6 -0
  27. slowql-0.0.0/docs/CHANGELOG.md +23 -0
  28. slowql-0.0.0/docs/architecture/detector-system.md +79 -0
  29. slowql-0.0.0/docs/architecture/export-system.md +94 -0
  30. slowql-0.0.0/docs/architecture/parser-engine.md +71 -0
  31. slowql-0.0.0/docs/architecture/system-design.md +84 -0
  32. slowql-0.0.0/docs/detectors/critical-detectors.md +56 -0
  33. slowql-0.0.0/docs/detectors/custom-detectors.md +78 -0
  34. slowql-0.0.0/docs/detectors/high-severity.md +69 -0
  35. slowql-0.0.0/docs/detectors/low-severity.md +57 -0
  36. slowql-0.0.0/docs/detectors/medium-severity.md +57 -0
  37. slowql-0.0.0/docs/detectors/overview.md +60 -0
  38. slowql-0.0.0/docs/development/adding-detectors.md +99 -0
  39. slowql-0.0.0/docs/development/contributing.md +90 -0
  40. slowql-0.0.0/docs/development/release-process.md +99 -0
  41. slowql-0.0.0/docs/development/setup.md +67 -0
  42. slowql-0.0.0/docs/development/testing.md +80 -0
  43. slowql-0.0.0/docs/enterprise/deployment.md +85 -0
  44. slowql-0.0.0/docs/enterprise/overview.md +51 -0
  45. slowql-0.0.0/docs/enterprise/support.md +66 -0
  46. slowql-0.0.0/docs/enterprise/team-features.md +79 -0
  47. slowql-0.0.0/docs/examples/basic-usage.md +65 -0
  48. slowql-0.0.0/docs/examples/github-actions.md +64 -0
  49. slowql-0.0.0/docs/examples/gitlab-ci.md +61 -0
  50. slowql-0.0.0/docs/examples/jenkins.md +67 -0
  51. slowql-0.0.0/docs/examples/nasty_queries.sql +85 -0
  52. slowql-0.0.0/docs/examples/pre-commit-hook.md +75 -0
  53. slowql-0.0.0/docs/examples/sample.sql +155 -0
  54. slowql-0.0.0/docs/getting-started/configuration.md +67 -0
  55. slowql-0.0.0/docs/getting-started/first-analysis.md +69 -0
  56. slowql-0.0.0/docs/getting-started/installation.md +48 -0
  57. slowql-0.0.0/docs/getting-started/quick-start.md +57 -0
  58. slowql-0.0.0/docs/index.md +49 -0
  59. slowql-0.0.0/docs/license.md +53 -0
  60. slowql-0.0.0/docs/security/best-practices.md +61 -0
  61. slowql-0.0.0/docs/security/security-policy.md +59 -0
  62. slowql-0.0.0/docs/security/vulnerability-reporting.md +59 -0
  63. slowql-0.0.0/docs/troubleshooting/common-issues.md +80 -0
  64. slowql-0.0.0/docs/troubleshooting/faq.md +79 -0
  65. slowql-0.0.0/docs/troubleshooting/performance.md +78 -0
  66. slowql-0.0.0/docs/tutorials/custom-detector-walkthrough.md +57 -0
  67. slowql-0.0.0/docs/tutorials/dashboard-integration.md +40 -0
  68. slowql-0.0.0/docs/tutorials/end-to-end-pipeline.md +54 -0
  69. slowql-0.0.0/docs/tutorials/team-onboarding-guide.md +55 -0
  70. slowql-0.0.0/docs/user-guide/ci-cd-integration.md +95 -0
  71. slowql-0.0.0/docs/user-guide/cli-reference.md +55 -0
  72. slowql-0.0.0/docs/user-guide/export-formats.md +72 -0
  73. slowql-0.0.0/docs/user-guide/file-analysis.md +70 -0
  74. slowql-0.0.0/docs/user-guide/interactive-mode.md +56 -0
  75. slowql-0.0.0/mkdocs.yml +64 -0
  76. slowql-0.0.0/mypy.ini +8 -0
  77. slowql-0.0.0/pyproject.toml +142 -0
  78. slowql-0.0.0/pytest.ini +6 -0
  79. slowql-0.0.0/requirements.txt +10 -0
  80. slowql-0.0.0/setup.cfg +4 -0
  81. slowql-0.0.0/site/assets/images/favicon.png +0 -0
  82. slowql-0.0.0/site/assets/javascripts/bundle.e71a0d61.min.js +16 -0
  83. slowql-0.0.0/site/assets/javascripts/bundle.e71a0d61.min.js.map +7 -0
  84. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
  85. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
  86. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
  87. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
  88. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
  89. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
  90. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
  91. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
  92. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
  93. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
  94. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
  95. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
  96. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
  97. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
  98. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
  99. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
  100. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
  101. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
  102. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
  103. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
  104. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
  105. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
  106. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
  107. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
  108. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
  109. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
  110. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
  111. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
  112. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
  113. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
  114. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
  115. slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
  116. slowql-0.0.0/site/assets/javascripts/lunr/tinyseg.js +206 -0
  117. slowql-0.0.0/site/assets/javascripts/lunr/wordcut.js +6708 -0
  118. slowql-0.0.0/site/assets/javascripts/workers/search.7a47a382.min.js +42 -0
  119. slowql-0.0.0/site/assets/javascripts/workers/search.7a47a382.min.js.map +7 -0
  120. slowql-0.0.0/site/assets/stylesheets/main.618322db.min.css +1 -0
  121. slowql-0.0.0/site/assets/stylesheets/main.618322db.min.css.map +1 -0
  122. slowql-0.0.0/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
  123. slowql-0.0.0/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
  124. slowql-0.0.0/site/examples/nasty_queries.sql +85 -0
  125. slowql-0.0.0/site/examples/sample.sql +155 -0
  126. slowql-0.0.0/site/sitemap.xml +3 -0
  127. slowql-0.0.0/site/sitemap.xml.gz +0 -0
  128. slowql-0.0.0/src/slowql/__init__.py +22 -0
  129. slowql-0.0.0/src/slowql/cli.py +318 -0
  130. slowql-0.0.0/src/slowql/cli_help.py +11 -0
  131. slowql-0.0.0/src/slowql/core/__init__.py +0 -0
  132. slowql-0.0.0/src/slowql/core/analyzer.py +389 -0
  133. slowql-0.0.0/src/slowql/core/detector.py +538 -0
  134. slowql-0.0.0/src/slowql/effects/__init__.py +2 -0
  135. slowql-0.0.0/src/slowql/effects/animations.py +363 -0
  136. slowql-0.0.0/src/slowql/formatters/__init__.py +2 -0
  137. slowql-0.0.0/src/slowql/formatters/console.py +787 -0
  138. slowql-0.0.0/src/slowql/metrics.py +42 -0
  139. slowql-0.0.0/src/slowql/telemetry.py +17 -0
  140. slowql-0.0.0/src/slowql.egg-info/PKG-INFO +239 -0
  141. slowql-0.0.0/src/slowql.egg-info/SOURCES.txt +156 -0
  142. slowql-0.0.0/src/slowql.egg-info/dependency_links.txt +1 -0
  143. slowql-0.0.0/src/slowql.egg-info/entry_points.txt +3 -0
  144. slowql-0.0.0/src/slowql.egg-info/requires.txt +12 -0
  145. slowql-0.0.0/src/slowql.egg-info/top_level.txt +1 -0
  146. slowql-0.0.0/tests/__init__.py +0 -0
  147. slowql-0.0.0/tests/conftest.py +94 -0
  148. slowql-0.0.0/tests/integration/__init__.py +0 -0
  149. slowql-0.0.0/tests/integration/test_cli.py +177 -0
  150. slowql-0.0.0/tests/performance/__init__.py +0 -0
  151. slowql-0.0.0/tests/performance/test_bemchmarks.py +68 -0
  152. slowql-0.0.0/tests/test_demo.py +48 -0
  153. slowql-0.0.0/tests/unit/__init__.py +0 -0
  154. slowql-0.0.0/tests/unit/test_analyzer.py +202 -0
  155. slowql-0.0.0/tests/unit/test_animations.py +95 -0
  156. slowql-0.0.0/tests/unit/test_console.py +180 -0
  157. slowql-0.0.0/tests/unit/test_detector.py +115 -0
  158. slowql-0.0.0/tests/unit/test_init.py +41 -0
@@ -0,0 +1,9 @@
1
+ .git
2
+ .gitignore
3
+ dist
4
+ build
5
+ *.egg-info
6
+ .venv*
7
+ __pycache__
8
+ node_modules
9
+ *.pyc
@@ -0,0 +1,11 @@
1
+ # Global owner
2
+ * @makroumi
3
+
4
+ # Detectors require specialized review
5
+ /slowql/detectors/ @makroumi @security-team
6
+
7
+ # CI/CD changes
8
+ /.github/workflows/ @makroumi @devops-team
9
+
10
+ # Documentation
11
+ /docs/ @makroumi @docs-team
@@ -0,0 +1,34 @@
1
+ name: 🐛 Bug Report
2
+ description: Report a reproducible bug in SlowQL
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for reporting a bug! Please fill out the details below.
10
+ - type: input
11
+ id: environment
12
+ attributes:
13
+ label: Environment
14
+ description: OS, Python version, SlowQL version
15
+ placeholder: "Ubuntu 22.04, Python 3.11, SlowQL 1.0.4"
16
+ - type: textarea
17
+ id: steps
18
+ attributes:
19
+ label: Steps to Reproduce
20
+ description: What commands or inputs caused the bug?
21
+ - type: textarea
22
+ id: expected
23
+ attributes:
24
+ label: Expected Behavior
25
+ - type: textarea
26
+ id: actual
27
+ attributes:
28
+ label: Actual Behavior
29
+ - type: textarea
30
+ id: logs
31
+ attributes:
32
+ label: Relevant Logs/Output
33
+ render: shell
34
+ description: Please format logs/output as code for readability.
@@ -0,0 +1,24 @@
1
+ name: 🔍 Detector Request
2
+ description: Propose a new SQL detector
3
+ title: "[Detector]: "
4
+ labels: ["detector"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Help us expand SlowQL’s detector library!
10
+ - type: input
11
+ id: name
12
+ attributes:
13
+ label: Detector Name
14
+ placeholder: "Missing WHERE clause detector"
15
+ - type: textarea
16
+ id: description
17
+ attributes:
18
+ label: Detector Description
19
+ description: What issue does this detector catch?
20
+ - type: textarea
21
+ id: example
22
+ attributes:
23
+ label: Example SQL
24
+ description: Provide sample queries that should trigger this detector.
@@ -0,0 +1,24 @@
1
+ name: ✨ Feature Request
2
+ description: Suggest a new feature or enhancement
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for suggesting a feature! Please describe your idea clearly.
10
+ - type: textarea
11
+ id: description
12
+ attributes:
13
+ label: Feature Description
14
+ description: What should SlowQL do?
15
+ - type: textarea
16
+ id: motivation
17
+ attributes:
18
+ label: Motivation
19
+ description: Why is this feature useful?
20
+ - type: textarea
21
+ id: alternatives
22
+ attributes:
23
+ label: Alternatives
24
+ description: Other ways you considered solving this?
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ groups:
8
+ all-deps:
9
+ patterns:
10
+ - "*"
@@ -0,0 +1,15 @@
1
+ # Pull Request
2
+
3
+ ## Description
4
+ <!-- Describe your changes clearly -->
5
+
6
+ ## Related Issue
7
+ <!-- Link to issue if applicable -->
8
+
9
+ ## Checklist
10
+ - [ ] Tests added/updated
11
+ - [ ] Linting and type checks pass (`make all`)
12
+ - [ ] Documentation updated
13
+ - [ ] CI pipeline green
14
+
15
+ ## Screenshots (if applicable)
@@ -0,0 +1,15 @@
1
+ # 🔐 Security Policy
2
+
3
+ If you discover a vulnerability in SlowQL, please report it privately.
4
+
5
+ ## Reporting
6
+ - Email: elmehdi.makroumi@gmail.com
7
+ - GitHub: [Open a private advisory](https://github.com/makroumi/slowql/security/advisories)
8
+
9
+ We aim to respond within 48 hours and patch within 7 days.
10
+
11
+ ## Scope
12
+ This policy covers:
13
+ - SQL parsing and analysis logic
14
+ - CLI behavior and output
15
+ - Containerized builds and published packages
@@ -0,0 +1,189 @@
1
+ name: CI Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ tags:
7
+ - 'v*'
8
+ pull_request:
9
+ branches: [ main ]
10
+
11
+ jobs:
12
+ # -------------------------------
13
+ # Linting
14
+ # -------------------------------
15
+ lint:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Set up Python 3.12
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ cache: "pip"
26
+
27
+ - name: Install Ruff
28
+ run: pip install ruff
29
+
30
+ - name: Run Ruff linter
31
+ run: ruff check src tests
32
+
33
+ # -------------------------------
34
+ # Type Checking
35
+ # -------------------------------
36
+ type-check:
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - name: Checkout repository
40
+ uses: actions/checkout@v4
41
+
42
+ - name: Set up Python 3.12
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.12"
46
+ cache: "pip"
47
+
48
+ - name: Install Mypy
49
+ run: pip install mypy
50
+
51
+ - name: Run Mypy type checker
52
+ run: mypy src
53
+
54
+ # -------------------------------
55
+ # Tests + Coverage
56
+ # -------------------------------
57
+ tests:
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - name: Checkout repository
61
+ uses: actions/checkout@v4
62
+
63
+ - name: Set up Python 3.12
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: "3.12"
67
+ cache: "pip"
68
+
69
+ - name: Install dependencies
70
+ run: |
71
+ python -m pip install --upgrade pip
72
+ pip install -r requirements.txt
73
+ pip install -e .
74
+ pip install pytest pytest-cov pytest-benchmark
75
+
76
+ - name: Run test suite
77
+ run: |
78
+ pytest --maxfail=1 --disable-warnings --benchmark-disable -v \
79
+ --cov=src --cov-report=xml --cov-report=term-missing \
80
+ --junitxml=junit.xml -o junit_family=legacy
81
+
82
+ - name: Upload coverage to Codecov
83
+ uses: codecov/codecov-action@v4
84
+ with:
85
+ token: ${{ secrets.CODECOV_TOKEN }}
86
+ files: coverage.xml
87
+ flags: unittests
88
+ name: codecov-slowql
89
+ fail_ci_if_error: true
90
+
91
+ - name: Upload test results to Codecov
92
+ if: ${{ !cancelled() }}
93
+ uses: codecov/test-results-action@v1
94
+ with:
95
+ token: ${{ secrets.CODECOV_TOKEN }}
96
+
97
+ - name: Upload coverage report artifact
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: coverage-report
101
+ path: coverage.xml
102
+
103
+ # -------------------------------
104
+ # Docker Build & Push (DockerHub)
105
+ # -------------------------------
106
+ docker-build-and-push:
107
+ runs-on: ubuntu-latest
108
+ needs: [lint, type-check, tests]
109
+ steps:
110
+ - name: Checkout repository
111
+ uses: actions/checkout@v4
112
+
113
+ - name: Log in to Docker Hub
114
+ uses: docker/login-action@v3
115
+ with:
116
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
117
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
118
+
119
+ - name: Set up Docker Buildx
120
+ uses: docker/setup-buildx-action@v3
121
+
122
+ - name: Build and push Docker image
123
+ uses: docker/build-push-action@v5
124
+ with:
125
+ context: .
126
+ push: true
127
+ tags: |
128
+ makroumi/slowql:latest
129
+ makroumi/slowql:${{ github.ref_name }}
130
+
131
+ # -------------------------------
132
+ # Docker Build & Push (GHCR)
133
+ # -------------------------------
134
+ docker-build-and-push-ghcr:
135
+ runs-on: ubuntu-latest
136
+ needs: [lint, type-check, tests]
137
+ steps:
138
+ - name: Checkout repository
139
+ uses: actions/checkout@v4
140
+
141
+ - name: Log in to GHCR
142
+ uses: docker/login-action@v3
143
+ with:
144
+ registry: ghcr.io
145
+ username: ${{ github.actor }}
146
+ password: ${{ secrets.GITHUB_TOKEN }}
147
+
148
+ - name: Set up Docker Buildx
149
+ uses: docker/setup-buildx-action@v3
150
+
151
+ - name: Build and push GHCR image
152
+ uses: docker/build-push-action@v5
153
+ with:
154
+ context: .
155
+ push: true
156
+ tags: |
157
+ ghcr.io/makroumi/slowql:latest
158
+ ghcr.io/makroumi/slowql:${{ github.ref_name }}
159
+
160
+ # -------------------------------
161
+ # Publish to PyPI
162
+ # -------------------------------
163
+ publish-pypi:
164
+ runs-on: ubuntu-latest
165
+ needs: [lint, type-check, tests]
166
+ permissions:
167
+ id-token: write # Required for OIDC
168
+ contents: read
169
+ steps:
170
+ - name: Checkout
171
+ uses: actions/checkout@v4
172
+
173
+ - name: Set up Python
174
+ uses: actions/setup-python@v5
175
+ with:
176
+ python-version: "3.12"
177
+
178
+ - name: Install build tools
179
+ run: |
180
+ python -m pip install --upgrade pip
181
+ pip install build
182
+
183
+ - name: Build package
184
+ run: python -m build
185
+
186
+ - name: Publish to PyPI
187
+ uses: pypa/gh-action-pypi-publish@release/v1
188
+ with:
189
+ skip-existing: true
@@ -0,0 +1,17 @@
1
+ name: Dependency Review
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ "main" ]
6
+
7
+ jobs:
8
+ dependency-review:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Dependency Review
15
+ uses: actions/dependency-review-action@v4
16
+ with:
17
+ fail-on-severity: high
@@ -0,0 +1,26 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+
7
+ permissions:
8
+ contents: write # <-- critical: allows github-actions[bot] to push to gh-pages
9
+
10
+ jobs:
11
+ deploy:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0 # <-- ensures full history for git-revision-date-localized plugin
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+ - run: pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin
21
+ - run: mkdocs build --strict
22
+ - name: Deploy to GitHub Pages
23
+ uses: peaceiris/actions-gh-pages@v4
24
+ with:
25
+ github_token: ${{ secrets.GITHUB_TOKEN }}
26
+ publish_dir: ./site
@@ -0,0 +1,27 @@
1
+ name: SBOM
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ jobs:
10
+ sbom:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Generate SBOM
17
+ uses: anchore/sbom-action@v0
18
+ with:
19
+ path: .
20
+ format: spdx-json
21
+ output-file: sbom.spdx.json
22
+
23
+ - name: Upload SBOM artifact
24
+ uses: actions/upload-artifact@v4
25
+ with:
26
+ name: sbom
27
+ path: sbom.spdx.json
@@ -0,0 +1,19 @@
1
+ name: Security Scan
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ security:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.11"
16
+ - run: pip install -e .
17
+ - uses: snyk/actions/python@main
18
+ env:
19
+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
@@ -0,0 +1,29 @@
1
+ .venv
2
+
3
+ __pycache__/
4
+ *.pyc
5
+ .coverage
6
+ *.egg-info/
7
+ sql_analysis_*.json
8
+ .pytest_cache/
9
+
10
+ # Generated files
11
+ htmlcov/
12
+ dist/
13
+ build/
14
+ *.egg-info/
15
+ .coverage
16
+ .pytest_cache/
17
+ reports/
18
+ *.html
19
+ *.json
20
+ *.csv
21
+
22
+ # Generated
23
+ htmlcov/
24
+ report/
25
+ reports/
26
+ .coverage
27
+ *.egg-info/
28
+ __pycache__/
29
+
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented here.
4
+
5
+ ---
6
+
7
+ ## [1.0.3] - 2025-12-03
8
+ ### Added
9
+ - Initial release of SlowQL
10
+ - Critical and High severity detectors
11
+ - CI/CD examples (GitHub, GitLab, Jenkins, Pre-Commit)
12
+
13
+ ### Fixed
14
+ - MkDocs strict build errors
@@ -0,0 +1,27 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We pledge to make participation in SlowQL a harassment-free experience for everyone.
6
+
7
+ ## Standards
8
+
9
+ **Positive behavior:**
10
+ - Welcoming and inclusive language
11
+ - Respectful of differing viewpoints
12
+ - Gracefully accepting constructive criticism
13
+
14
+ **Unacceptable behavior:**
15
+ - Harassment, trolling, insulting comments
16
+ - Publishing others' private information
17
+ - Unprofessional conduct
18
+
19
+ ## Enforcement
20
+
21
+ Report violations to: elmehdi.makroumi@gmail.com
22
+
23
+ Consequences: Warning → Temporary ban → Permanent ban
24
+
25
+ ## Attribution
26
+
27
+ Adapted from [Contributor Covenant](https://www.contributor-covenant.org/).
@@ -0,0 +1,27 @@
1
+ # Contributing to SlowQL
2
+
3
+ Thank you for your interest in contributing!
4
+
5
+ ## How to Contribute
6
+ - Fork the repository
7
+ - Create a feature branch (`git checkout -b feat/my-feature`)
8
+ - Write tests for new code
9
+ - Run `make all` to ensure lint, type checks, and tests pass
10
+ - Submit a pull request
11
+
12
+ ## Code Style
13
+ - Use `black` for formatting
14
+ - Use `ruff` for linting
15
+ - Type hints required (`mypy`)
16
+
17
+ ## Commit Messages
18
+ Follow [Conventional Commits](https://www.conventionalcommits.org/):
19
+ - `feat:` new feature
20
+ - `fix:` bug fix
21
+ - `docs:` documentation
22
+ - `chore:` maintenance
23
+
24
+ ## Pull Requests
25
+ - Include a clear description
26
+ - Reference related issues
27
+ - Ensure CI passes before requesting review
@@ -0,0 +1,65 @@
1
+ # syntax=docker/dockerfile:1.5
2
+ ####################################
3
+ # Builder: create wheel from source
4
+ ####################################
5
+ FROM python:3.12-slim AS builder
6
+
7
+ ENV PYTHONUNBUFFERED=1 \
8
+ PIP_NO_CACHE_DIR=1 \
9
+ LC_ALL=C.UTF-8 \
10
+ LANG=C.UTF-8
11
+
12
+ WORKDIR /src
13
+
14
+ # Install build-time system deps. Keep small and explicit.
15
+ RUN apt-get update \
16
+ && apt-get install -y --no-install-recommends \
17
+ build-essential \
18
+ ca-certificates \
19
+ curl \
20
+ git \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
+ # Install pip tooling used to build wheel
24
+ RUN python -m pip install --upgrade pip build setuptools wheel
25
+
26
+ # Copy project metadata and source code
27
+ # Include README.md and LICENSE so setuptools can find them
28
+ COPY pyproject.toml README.md LICENSE /src/
29
+ COPY src/ /src/src/
30
+
31
+ # Build wheel into /out
32
+ RUN python -m build --wheel --outdir /out
33
+
34
+ ####################################
35
+ # Runtime image: minimal, only runtime deps
36
+ ####################################
37
+ FROM python:3.12-slim AS runtime
38
+
39
+ ENV PYTHONUNBUFFERED=1 \
40
+ PIP_NO_CACHE_DIR=1 \
41
+ LC_ALL=C.UTF-8 \
42
+ LANG=C.UTF-8
43
+
44
+ WORKDIR /app
45
+
46
+ # Runtime system deps (keep ca-certificates for HTTPS)
47
+ RUN apt-get update \
48
+ && apt-get install -y --no-install-recommends \
49
+ ca-certificates \
50
+ && rm -rf /var/lib/apt/lists/*
51
+
52
+ # Copy built wheel from builder stage and install it
53
+ COPY --from=builder /out /out
54
+ RUN python -m pip install --upgrade pip setuptools wheel \
55
+ && python -m pip install /out/slowql-*.whl \
56
+ && rm -rf /root/.cache/pip /out
57
+
58
+ # Use a non-root user for better security
59
+ RUN groupadd --gid 1000 slowql && useradd --uid 1000 --gid slowql --create-home slowql
60
+ USER slowql
61
+ WORKDIR /home/slowql
62
+
63
+ # Default CLI entrypoint
64
+ ENTRYPOINT ["slowql"]
65
+ CMD ["--help"]
slowql-0.0.0/LICENSE ADDED
@@ -0,0 +1,53 @@
1
+ # License
2
+
3
+ SlowQL is released under the Apache License, Version 2.0.
4
+
5
+ ---
6
+
7
+ ## Apache License
8
+ Version 2.0, January 2004
9
+ http://www.apache.org/licenses/
10
+
11
+ ### TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12
+
13
+ **1. Definitions.**
14
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
15
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner.
16
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity.
17
+ "Source" form shall mean the preferred form for making modifications.
18
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form.
19
+
20
+ **2. Grant of Copyright License.**
21
+ Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non‑exclusive, no‑charge, royalty‑free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Work and Derivative Works in Source or Object form.
22
+
23
+ **3. Grant of Patent License.**
24
+ Each Contributor grants You a perpetual, worldwide, non‑exclusive, no‑charge, royalty‑free, irrevocable patent license to make, use, sell, offer to sell, import, and otherwise transfer the Work.
25
+
26
+ **4. Redistribution.**
27
+ You may reproduce and distribute copies of the Work or Derivative Works in any medium, with or without modifications, provided that You meet the following conditions:
28
+ - Include a copy of this License in each copy.
29
+ - Provide prominent notices stating that You have changed the files if modifications were made.
30
+ - Retain all copyright, patent, trademark, and attribution notices.
31
+ - Include a NOTICE file with attribution if applicable.
32
+
33
+ **5. Disclaimer of Warranty.**
34
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
35
+
36
+ **6. Limitation of Liability.**
37
+ In no event shall the Licensor or Contributors be liable for damages arising in any way out of the use of the Work.
38
+
39
+ ---
40
+
41
+ ## NOTICE
42
+
43
+ Copyright © 2025 El Mehdi Makroumi
44
+
45
+ Licensed under the Apache License, Version 2.0 (the "License");
46
+ you may not use this file except in compliance with the License.
47
+ You may obtain a copy of the License at:
48
+
49
+ http://www.apache.org/licenses/LICENSE-2.0
50
+
51
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
52
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+ See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,12 @@
1
+ include README.md
2
+ include LICENSE
3
+
4
+ # create or ensure entries exist
5
+ if [ -f MANIFEST.in ]; then
6
+ grep -q "^include LICENSE$" MANIFEST.in || echo "include LICENSE" >> MANIFEST.in
7
+ grep -q "^include NOTICE$" MANIFEST.in || echo "include NOTICE" >> MANIFEST.in
8
+ git add MANIFEST.in && git commit -m "Ensure LICENSE and NOTICE are included in source distribution" || true
9
+ else
10
+ printf "include LICENSE\ninclude NOTICE\n" > MANIFEST.in
11
+ git add MANIFEST.in && git commit -m "Add MANIFEST.in to include LICENSE and NOTICE"
12
+ fi