Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.idea
*.iml
.env
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
- id: cycode
name: Cycode pre commit defender
language: python
language_version: python3
entry: cycode
args: [ 'scan', 'pre_commit' ]
args: [ '--no-progress-meter', 'scan', 'pre_commit' ]
- id: cycode-sca
name: Cycode SCA pre commit defender
language: python
language_version: python3
entry: cycode
args: [ 'scan', '--scan-type', 'sca', 'pre_commit' ]
args: [ '--no-progress-meter', 'scan', '--scan-type', 'sca', 'pre_commit' ]
14 changes: 14 additions & 0 deletions cycode/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
__version__ = '0.0.0' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag

if __version__ == '0.0.1.dev1':
# If CLI was installed from shallow clone, __version__ will be 0.0.1.dev1 due to non-strict versioning.
# This happens when installing CLI as pre-commit hook.
# We are not able to provide the version based on Git Tag in this case.
# This fallback version is maintained manually.

# One benefit of it is that we could pass the version with a special suffix to mark pre-commit hook usage.

import os

version_filepath = os.path.join(os.path.dirname(__file__), 'pre-commit-hook-version')
with open(version_filepath, 'r', encoding='UTF-8') as f:
__version__ = f.read().strip()
1 change: 1 addition & 0 deletions cycode/pre-commit-hook-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.5-pre-commit
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ log_cli = true
[tool.poetry-dynamic-versioning]
# poetry self add "poetry-dynamic-versioning[plugin]"
enable = true
strict = true
strict = false
bump = true
metadata = false
vcs = "git"
Expand Down