Skip to content

Commit ee3e646

Browse files
committed
update to v2
1 parent 5e3c219 commit ee3e646

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+195443
-3071
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ dist
66
*.build
77
*.dist
88
*.egg-info
9-
test
109
*.env
1110
run_container.sh
1211
*.zip
1312
bin
1413
scripts/*.py
1514
*.json
15+
!tests/**/*.json
1616
markdown_overview_temp.md
1717
markdown_security_temp.md
1818
.DS_Store
@@ -21,4 +21,5 @@ test.py
2121
*.cpython-312.pyc`
2222
file_generator.py
2323
.coverage
24-
.env.local
24+
.env.local
25+
Pipfile

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.10

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: sync-deps test lint
2+
3+
sync-deps:
4+
pip-compile pyproject.toml -o requirements.txt
5+
6+
test:
7+
pytest
8+
9+
lint:
10+
ruff check .
11+
ruff format --check .

Pipfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 207 deletions
This file was deleted.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The Socket Security CLI was created to enable integrations with other tools like Github Actions, Gitlab, BitBucket, local use cases and more. The tool will get the head scan for the provided repo from Socket, create a new one, and then report any new alerts detected. If there are new alerts against the Socket security policy it'll exit with a non-Zero exit code.
44

5+
6+
57
## Usage
68

79
```` shell
@@ -38,3 +40,51 @@ If you don't want to provide the Socket API Token every time then you can use th
3840
| --files | | False | | If provided in the format of `["file1", "file2"]` will be used to determine if there have been supported file changes. This is used if it isn't a git repo and you would like to only run if it supported files have changed. |
3941
| --ignore-commit-files | | False | False | If enabled then the CLI will ignore what files are changed in the commit and look for all manifest files |
4042
| --disable-blocking | | False | False | Disables failing checks and will only exit with an exit code of 0 |
43+
44+
## Development
45+
46+
This project uses `pyproject.toml` as the primary dependency specification.
47+
48+
### Installing dependencies with your preferred tool:
49+
- **pip**:
50+
```bash
51+
pip install -r requirements.txt # Install main dependencies
52+
pip install -e ".[dev,test]" # Install development and test dependencies
53+
```
54+
- **poetry**:
55+
```bash
56+
poetry install --all-extras # Installs all dependencies including dev and test
57+
```
58+
- **Rye**:
59+
```bash
60+
rye sync --all-features # Installs all dependencies including dev and test
61+
```
62+
63+
### Changing dependencies:
64+
65+
1. Update `pyproject.toml` with dependency changes
66+
2. Run `make sync-deps` to update `requirements.txt`
67+
- Note: Requires dev dependencies to be installed (`pip-tools`)
68+
69+
### Running tests:
70+
71+
#### Run all tests:
72+
```bash
73+
make test # Requires dev dependencies to be installed (`pytest`)
74+
```
75+
Note: For any of the `pytest` commands below, you can substitute `ptw` for `pytest` to run tests in watch mode.
76+
77+
#### Run specific tests:
78+
```bash
79+
# Run all tests in a file
80+
pytest tests/test_socketcli.py
81+
82+
# Run all tests in a directory
83+
pytest tests/core
84+
```
85+
86+
87+
### Linting:
88+
```bash
89+
make lint # Requires dev dependencies to be installed (`ruff`)
90+
```

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "socketsecurity"
77
dynamic = ["version"]
8-
requires-python = ">= 3.9"
8+
requires-python = ">= 3.11"
99
dependencies = [
1010
'requests',
1111
'mdutils',
@@ -28,8 +28,6 @@ maintainers = [
2828
classifiers = [
2929
"Development Status :: 4 - Beta",
3030
"Intended Audience :: Developers",
31-
"Programming Language :: Python :: 3.9",
32-
"Programming Language :: Python :: 3.10",
3331
"Programming Language :: Python :: 3.11",
3432
"Programming Language :: Python :: 3.12",
3533
]
@@ -44,6 +42,7 @@ test = [
4442
]
4543
dev = [
4644
"ruff>=0.3.0",
45+
"pip-tools>=7.4.0", # for pip-compile
4746
]
4847

4948
[project.scripts]

0 commit comments

Comments
 (0)