|
2 | 2 |
|
3 | 3 | 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. |
4 | 4 |
|
| 5 | + |
| 6 | + |
5 | 7 | ## Usage |
6 | 8 |
|
7 | 9 | ```` shell |
@@ -38,3 +40,51 @@ If you don't want to provide the Socket API Token every time then you can use th |
38 | 40 | | --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. | |
39 | 41 | | --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 | |
40 | 42 | | --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 | +``` |
0 commit comments