Skip to content

Commit

Permalink
Document current packages and ways to contribute into it
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed Jun 7, 2024
1 parent ca5471d commit b6dbc29
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ app/
├─ [threagile-stub-model.yaml](./demo/stub/threagile.yaml)
```

## Packages structure

After recent efforts on modularization the code those packages was added:

- ***cmd*** - contains programs which runs
- threagile - the main program, documentation about can be found at main [readme](./README.md)
- risk_demo - demo risk program which is demonstrating how to create custom risk rules
- script - util program to test script rule against your model
- ***pkg*** - reused part
- internal - details on how to run the application as part of cobra application and configuration
- types - simple structs (except [parsedModel](./pkg/types/model.go) which needs to be moved to [model](./pkg/model) package as soon as cross circular dependencies will be solved)
- examples - logic for generating useful examples for end user (like example or stub Threagile model)
- risks - logic for risk (builtin and scripts) to be executed against model
- macros - logic for macros logic ()
- server - [gin server](https://gin-gonic.com/) to run some of commands via UI
- report - logic to generate all kind of reports (JSON, PDF, Excel)
- input - logic to read the model from file system
- model - logic to analyze the model from package above (input)

![package structure](./docs/package-structure.png)

Currently it is not expected that any extra references will be added to the current architecture, so if it appears that adding extra dependency (effectively if you need to draw any extra line to make model above to expect reality) highly likely it may 2 options: some violation of [SOLID](https://en.wikipedia.org/wiki/SOLID)(particularly [interface segregation principle](https://en.wikipedia.org/wiki/Interface_segregation_principle)) is happening or current architecture require rethinking. Please raise a pull request and discuss this with other contributors.


## Contribution

To contribute the code simply make changes and create pull request. There is no strict rules about pull requests format like [this](https://www.pullrequest.com/blog/writing-a-great-pull-request-description/) however please take into consideration:
Expand Down
Binary file added docs/package-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b6dbc29

Please sign in to comment.