Skip to content

Commit 9289fbf

Browse files
committed
doc: updates per @anthonyharrison's feedback
1 parent 130b087 commit 9289fbf

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
- name: Install pre-commit
2525
run: |
2626
python -m pip install --upgrade pip
27+
python -m pip install --upgrade setuptools wheel
2728
python -m pip install --upgrade pre-commit
2829
pre-commit install
2930
- name: Install cve-bin-tool if needed
3031
if: ${{ matrix.tool == 'format_checkers' }}
3132
run: |
32-
python -m pip install --upgrade setuptools wheel
3333
python -m pip install .
3434
- name: Run ${{ matrix.tool }}
3535
run: |

CONTRIBUTING.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ If you've already contributed to other open source projects, contributing to the
1919
- [Running black by itself](#running-black-by-itself)
2020
- [Other linting tools](#other-linting-tools)
2121
- [Making a new branch & pull request](#making-a-new-branch--pull-request)
22+
- [Commit message tips](#commit-message-tips)
23+
- [Sharing your code with us](#sharing-your-code-with-us)
2224
- [Checklist for a great pull request](#checklist-for-a-great-pull-request)
2325
- [Code Review](#code-review)
2426
- [Style Guide for cve-bin-tool](#style-guide-for-cve-bin-tool)
@@ -78,7 +80,7 @@ Replace MYUSERNAME with your own GitHub username.
7880

7981
This section isn't required, but many contributors find it helpful, especially for running tests using different versions of python.
8082

81-
[virtualenv](https://virtualenv.pypa.io/en/latest/) is a tool for setting up virtual python environments. This allows you to have all the dependencies for cve-binary-tool set up in a single environment, or have different environments set up for testing using different versions of Python.
83+
[virtualenv](https://virtualenv.pypa.io/en/latest/) is a tool for setting up virtual python environments. This allows you to have all the dependencies for cve-bin-tool set up in a single environment, or have different environments set up for testing using different versions of Python.
8284

8385
To install it:
8486

@@ -128,7 +130,7 @@ If you want to run a local copy of cve-bin-tool, the recommended way is to insta
128130
python3 -m pip install --user -e .
129131
```
130132

131-
Then you can type `cve-binary-tool` on the command line and it will do the right thing. This includes some special code intended to deal with adding new checkers to the list on the fly so things should work seamlessly for you while you're building new contributions.
133+
Then you can type `cve-bin-tool` on the command line and it will do the right thing. This includes some special code intended to deal with adding new checkers to the list on the fly so things should work seamlessly for you while you're building new contributions.
132134

133135
### Help, my checkers aren't loading
134136

@@ -157,6 +159,7 @@ CVE Binary Tool uses a few tools to improve code quality and readability:
157159
- `isort` sorts imports alphabetically and by type
158160
- `black` provides automatic style formatting. This will give you basic [PEP8](https://www.python.org/dev/peps/pep-0008/) compliance. (PEP8 is where the default python style guide is defined.)
159161
- `flake8` provides additional code "linting" for more complex errors like unused imports.
162+
- `pyupgrade` helps us be forward compatible with new versions of python.
160163

161164
We provide a `dev-requirements.txt` file which includes all the precise versions of tools as they'll be used in GitHub Actions. You an install them all using pip:
162165

@@ -207,8 +210,14 @@ specify a whole folder using ```./```
207210

208211
As well as `black` for automatically making sure code adheres to the style guide, we use `flake8` to help us find things like unused imports. The [flake8 documentation](https://flake8.pycqa.org/en/latest/user/index.html) covers what you need to know about running it.
209212

213+
We use [pyupgrade](https://github.com/asottile/pyupgrade) to make sure our syntax is updated to fit new versions of python.
214+
210215
We also have a spell checker set up to help us avoid typos in documentation. The [spelling actions readme file](https://github.com/intel/cve-bin-tool/tree/main/.github/actions/spelling) gives more information including how to add new words to the dictionary if needed.
211216

217+
We also have a tool to help make sure that new checkers are added to the tables in our documentation. [The format_checkers code is here](https://github.com/intel/cve-bin-tool/blob/main/cve_bin_tool/format_checkers.py), if you're curious.
218+
219+
You can view all the config files for GitHub Actions (what we use for Continous Integration (CI)) in [the .github/workflows directory](https://github.com/intel/cve-bin-tool/tree/main/.github/workflows).
220+
212221
## Making a new branch & pull request
213222

214223
Git allows you to have "branches" with variant versions of the code. You can see what's available using `git branch` and switch to one using `git checkout branch_name`.
@@ -225,8 +234,14 @@ When you're ready to share that branch to make a pull request, make sure you've
225234

226235
Use `git add FILENAME` to add the files you want to put in your pull request, and use `git commit` to check them in. Try to use [a clear commit message](https://chris.beams.io/posts/git-commit/) and use the [Conventional Commits](https://www.conventionalcommits.org/) format.
227236

237+
### Commit message tips
238+
228239
We usually merge pull requests into a single commit when we accept them, so it's fine if you have lots of commits in your branch while you figure stuff out, and we can fix your commit message as needed then. But if you make sure that at least the title of your pull request follows the [Conventional Commits](https://www.conventionalcommits.org/) format that you'd like for that merged commit message, that makes our job easier!
229240

241+
GitHub also has some keywords that help us link issues and then close them automatically when code is merged. The most common one you'll see us use looks like `fixes: #123456`. You can put this in the title of your PR (what usually becomes the commit message when we merge your code), another line in the commit message, or any comment in the pull request to make it work. You and read more about [linking a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) in the GitHub documentation.
242+
243+
### Sharing your code with us
244+
230245
Once your branch is ready and you've checked in all your code, push it to your fork:
231246

232247
```bash
@@ -251,8 +266,9 @@ Here's a quick checklist to help you make sure your pull request is ready to go:
251266
4. Have I added or updated any documentation if I changed or added a feature?
252267
- New features are often documented in [MANUAL.md](https://github.com/intel/cve-bin-tool/blob/main/doc/MANUAL.md). (See [Making documentation](#making-documentation) for more information.)
253268
5. Have I used [Conventional Commits](https://www.conventionalcommits.org/) to format the title of my pull request?
254-
6. Have I checked on the results from GitHub Actions?
255-
- GitHub Actions will run all the tests, linters and a spell check for you. if you can, try to make sure everything is running cleanly with no errors before leaving it for a human code reviewer!
269+
6. If I closed a bug, have I linked it using one of [Github's keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)? (e.g. include the text `fixed #1234`)
270+
7. Have I checked on the results from GitHub Actions?
271+
- GitHub Actions will run all the tests, linters and a spell check for you. If you can, try to make sure everything is running cleanly with no errors before leaving it for a human code reviewer!
256272
- As of this writing, tests take less than 20 minutes to run once they start, but they can be queued for a while before they start. Go get a cup of tea or work on something else while you wait!
257273

258274
## Code Review
@@ -275,7 +291,7 @@ Most of our "style" stuff is caught by the `black` and `flake8` linters, but we
275291

276292
Python provides many different ways to format the string(you can read about them [here](https://realpython.com/python-formatted-output/))and we use f-string formatting in our tool.
277293

278-
**Note: As f-strings are only supported in python 3.6+.** Please make sure you have version >=3.6
294+
> Note: f-strings are only supported in python 3.6+.
279295
280296
- **Example:** Formatting string using f-string
281297

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ This tool is meant to be used as a quick-to-run, easily-automatable check in a
214214
non-malicious environment so that developers can be made aware of old libraries
215215
with security issues that have been compiled into their binaries.
216216

217+
If you are using the binary scanner capabilities, be aware that we only have a limited number of binary checkers (see table above) so we can only detect those libraries. Contributions of new checkers are always welcome! You can also use an alternate way to detect components (for example, a bill of materials tool such as [tern](https://github.com/tern-tools/tern)) and then use the resulting list as input to cve-bin-tool to get a more comprehensive vulnerability list.
218+
217219
## Requirements
218220

219221
To use the auto-extractor, you may need the following utilities depending on the
@@ -239,7 +241,7 @@ On windows systems, you may need:
239241
- `Expand`
240242
- `pdftotext`
241243

242-
Windows has `ar` and `Expand` installed in default, but `7z` in particular might need to be installed.
244+
Windows has `ar` and `Expand` installed by default, but `7z` in particular might need to be installed.
243245
If you want to run our test-suite or scan a zstd compressed file, We recommend installing this [7-zip-zstd](https://github.com/mcmilk/7-Zip-zstd)
244246
fork of 7zip. We are currently using `7z` for extracting `jar`, `apk`, `msi`, `exe` and `rpm` files.
245247

0 commit comments

Comments
 (0)