-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Markdown Table Reporting to Summary, and more .... (#2186)
* Adding Markdown Table Reporting to Summary, and more .... - Refactored and simplified the summary code - Documented everything - Added a more logicical set of flags so that you could both output to stdout and a file at the same time or either - Added Logging to Summary - Added Unit Tests - Still need to add a Markdown Table Test - The JSON and YAML tests are passing Signed-off-by: Aaron Lippold <[email protected]> Signed-off-by: Emily Rodriguez <[email protected]> Co-authored-by: Emily Rodriguez <[email protected]> Co-authored-by: Emily Rodriguez <[email protected]>
- Loading branch information
1 parent
7cc4e34
commit 01dffae
Showing
34 changed files
with
5,697 additions
and
3,786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v18.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug MarkdownTable", | ||
"runtimeExecutable": "node --inspect", // replace with your actual path | ||
"program": "${workspaceFolder}/bin/run", | ||
"args": [ | ||
"view", | ||
"summary", | ||
"-i", | ||
"test/sample_data/HDF/input/rhel-8_hardened.json", | ||
"--format", | ||
"markdown", | ||
"--logLevel", | ||
"verbose" | ||
], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"outFiles": ["${workspaceFolder}/dist/**/*.js"], | ||
"preLaunchTask": "tsc: build - tsconfig.json", | ||
"sourceMaps": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG BASE_CONTAINER=node:18-alpine | ||
ARG BASE_CONTAINER=node:18.18-alpine | ||
|
||
FROM $BASE_CONTAINER AS builder | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# MITRE `saf-cli` Develpment, Testing and Contribution Guide | ||
|
||
The MITRE saf-cli is an OCLIF application developed with TypeScript. | ||
|
||
## Prerequisites | ||
|
||
- Node.js (check the package.json file for the current version) | ||
- npm (version 6 or newer) | ||
|
||
## Installation | ||
|
||
To install the project, clone the repository and install the dependencies: | ||
|
||
```bash | ||
git clone https://github.com/mitre/saf.git | ||
cd project | ||
npm install | ||
``` | ||
|
||
## Development | ||
|
||
To start the development server, run: | ||
|
||
```bash | ||
npm run dev -- ${command you destire to run & its flags} | ||
``` | ||
|
||
This script will clean the `lib` directory, compile the TypeScript files, and start the application. You can pass arguments to the `dev` script using the `--` syntax. For example: | ||
|
||
```bash | ||
npm run dev -- --help | ||
npm run dev -- view summary | ||
``` | ||
|
||
## Testing | ||
|
||
We use both ts-mocha/chai and ts-jest for testing. | ||
|
||
### Command Tests | ||
|
||
The 'command' tests are located in the `./tests/commands` directory and organized by the OCLIF commands such as attest, view, generate etc. These tests are written in ts-mocha. You can run all the tests or a single test. For example: | ||
|
||
```bash | ||
npm run test:mocha | ||
npm run test:mocha:one ./tests/command/view/summary.ts | ||
``` | ||
|
||
### Utility Tests | ||
|
||
The 'utility' tests are located in the `./tests/utility` directory and organized by each of the utility classes of the saf-cli. These tests are a mix of chai and jest tests. The chai tests are all the files named `{utility}.test.ts` and the jest tests are located in the `__tests__` directory. You can run all the tests or a single test. For example: | ||
|
||
```bash | ||
npm run test:jest | ||
npm run test:jest:one ./tests/utility/calculations.test.ts | ||
``` | ||
|
||
## Linting | ||
|
||
We use ESLint with the TypeScript ESLint plugin for linting. To run the linter, use: | ||
|
||
```bash | ||
npm run lint | ||
npm run lint --fix | ||
``` | ||
|
||
## Building | ||
|
||
To build the project, use: | ||
|
||
```bash | ||
npm run prepack | ||
``` | ||
|
||
This script will clean the `lib` directory and compile the TypeScript files. | ||
|
||
## Usage | ||
|
||
Here's how you can use the CLI: | ||
|
||
```bash | ||
./bin/run command-name | ||
``` | ||
|
||
You can get help on the available commands with: | ||
|
||
```bash | ||
./bin/run --help | ||
``` | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! We use the standard GitFlow model for PRs. Please ensure that your PRs pass all tests and close all related issues. We also use a semver-based release process. | ||
|
||
## License | ||
|
||
See the LICENSE and NOTICE files at the root of the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.