forked from facebook/sapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code formatting to code blocks in SAPP docs
Summary: Adding pretty syntax highlighting to code blocks on docs Reviewed By: gbleaney Differential Revision: D28364971 fbshipit-source-id: c11df9af319c1e3b49830d836c74b4e4d6f0460a
- Loading branch information
1 parent
0296bb0
commit 38b94f9
Showing
1 changed file
with
11 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ SAPP functionality can be accessed through the web interface or through a subcom | |
|
||
### File Format | ||
A filter is required to have a `name` and at least one other key, excluding `description`. Filters can be stored as JSON in the following format: | ||
``` | ||
```json | ||
{ | ||
"name": "Name of filter", | ||
"description": "Description for the filter", | ||
|
@@ -223,61 +223,61 @@ You can find some example filters to reference in the [pyre-check repo](https:// | |
|
||
### Importing filters | ||
You can import a filter from a file by running: | ||
``` | ||
```shell | ||
[~/example]$ sapp --database-name sapp.db filter import filter-filename.json | ||
``` | ||
|
||
You can also import all filters within a directory by running: | ||
``` | ||
```shell | ||
[~/example]$ sapp --database-name sapp.db filter import path/to/list_of_filters | ||
``` | ||
|
||
### Deleting filters | ||
You can delete filters by name with: | ||
``` | ||
```shell | ||
[~/example]$ sapp --database-name sapp.db filter delete "filter name 1" "filter name 2" "filter name 3" | ||
``` | ||
|
||
### Filtering list of issues | ||
You can apply a filter to a list of issues by run number. For example, the following command will show you a list of issues after applying `example-filter` to run `1`: | ||
``` | ||
```shell | ||
[~/example]$ sapp --database-name sapp.db filter issues 1 example-filter.json | ||
``` | ||
|
||
You can also apply a list of filters to a single list of issues by run number. SAPP will apply each filter individually from the directory you specify to the list of issues and merge results into a single list of issues to show you. For example, the following command will show you a list of issues after applying every filter in `list_of_filters` to run `1`: | ||
``` | ||
```shell | ||
[~/example]$ sapp --database-name sapp.db filter issues 1 path/to/list_of_filters | ||
``` | ||
|
||
|
||
## Development Environment Setup | ||
Start by cloning the repo and setting up a virtual environment: | ||
``` | ||
```shell | ||
$ git clone [email protected]:facebook/sapp.git && cd sapp | ||
$ python3 -m venv ~/.venvs/sapp | ||
$ source ~/.venvs/sapp/bin/activate | ||
(sapp) $ pip3 install -r requirements.txt | ||
``` | ||
|
||
Run the flask server: | ||
``` | ||
```shell | ||
(sapp) $ python3 -m sapp.cli server | ||
``` | ||
|
||
Parse static analysis output and save to disk: | ||
``` | ||
```shell | ||
(sapp) $ python3 -m sapp.cli analyze taint-output.json | ||
``` | ||
|
||
If you make any changes to files under `sapp/ui/frontend/*`, you will need to run `npm install` once to install dependencies and `npm run-script build` each time you make changes before running the flask server to see the changes you made reflected: | ||
|
||
Installing dependencies: | ||
``` | ||
```shell | ||
(sapp) $ cd sapp/ui/frontend && npm install | ||
``` | ||
|
||
Build static files and run the flask server: | ||
``` | ||
```shell | ||
(sapp) $ cd sapp/ui/frontend && npm run-script build | ||
(sapp) $ python3 -m sapp.cli server --debug | ||
``` | ||
|