[rocprof-compute] updated formatting workflow and docs (#348)
* updated formatting workflow and docs * restored requirements.txt
This commit is contained in:
committed by
GitHub
parent
3fd8af5974
commit
2936a468aa
@@ -52,6 +52,45 @@ Now, when you commit code to the repository you should see something like this:
|
||||
|
||||
Please see the [pre-commit documentation](https://pre-commit.com/#quick-start) for additional information.
|
||||
|
||||
## Contribution Guidelines
|
||||
|
||||
To ensure code quality and consistency, we use **Ruff**, a fast Python linter and formatter. Before submitting a pull request, please ensure your code is formatted and linted correctly. This is the manual alternative to running ruff pre-commit hooks.
|
||||
|
||||
-----
|
||||
|
||||
## Installing and Running Ruff
|
||||
|
||||
Ruff is available on PyPI and can be installed using `pip`:
|
||||
|
||||
```bash
|
||||
pip install ruff
|
||||
```
|
||||
|
||||
Once installed, you can run Ruff from the command line. To check for linting errors and formatting issues, navigate to the project root and run:
|
||||
|
||||
```bash
|
||||
ruff check .
|
||||
ruff format --check .
|
||||
```
|
||||
|
||||
To automatically fix most of the issues detected, you can use the `--fix` flag with the `check` command and run the `format` command without the `--check` flag:
|
||||
|
||||
```bash
|
||||
ruff check --fix .
|
||||
ruff format .
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
## Disabling Formatting for Specific Sections
|
||||
|
||||
There may be instances where you need to disable Ruff's formatting on a specific block of code. You can do this using special comments:
|
||||
|
||||
* **`# fmt: off`** and **`# fmt: on`**: These comments can be used to disable and re-enable formatting for a block of code.
|
||||
* **`# fmt: skip`**: This comment, placed at the end of a line, will prevent Ruff from formatting that specific statement.
|
||||
|
||||
You can also disable specific linting rules for a line by using `# noqa: <rule_code>`.
|
||||
|
||||
## Coding guidelines
|
||||
|
||||
Below are some repository specific guidelines which are followed througout the repository.
|
||||
|
||||
@@ -75,7 +75,7 @@ To build the binary we follow these steps:
|
||||
NOTE: Since RHEL 8 ships with glibc version 2.28, this standalone binary can only be run on environment with glibc version greater than 2.28.
|
||||
glibc version can be checked using `ldd --version` command.
|
||||
|
||||
NOTE: libnss3.so shared library is required when using --roof-only option which generates roofline data in PDF format
|
||||
NOTE: libnss3.so shared library is required when using --roof-only option which generates roofline data in PDF format
|
||||
|
||||
To test the standalone binary provide the `--call-binary` option to pytest.
|
||||
|
||||
@@ -104,42 +104,3 @@ style reference is provided below for convenience:
|
||||
url = {https://doi.org/10.5281/zenodo.7314631}
|
||||
}
|
||||
```
|
||||
|
||||
### Contribution Guidelines
|
||||
|
||||
To ensure code quality and consistency, we use **Ruff**, a fast Python linter and formatter. Before submitting a pull request, please ensure your code is formatted and linted correctly.
|
||||
|
||||
-----
|
||||
|
||||
### Installing and Running Ruff
|
||||
|
||||
Ruff is available on PyPI and can be installed using `pip`:
|
||||
|
||||
```bash
|
||||
pip install ruff
|
||||
```
|
||||
|
||||
Once installed, you can run Ruff from the command line. To check for linting errors and formatting issues, navigate to the project root and run:
|
||||
|
||||
```bash
|
||||
ruff check .
|
||||
ruff format --check .
|
||||
```
|
||||
|
||||
To automatically fix most of the issues detected, you can use the `--fix` flag with the `check` command and run the `format` command without the `--check` flag:
|
||||
|
||||
```bash
|
||||
ruff check --fix .
|
||||
ruff format .
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Disabling Formatting for Specific Sections
|
||||
|
||||
There may be instances where you need to disable Ruff's formatting on a specific block of code. You can do this using special comments:
|
||||
|
||||
* **`# fmt: off`** and **`# fmt: on`**: These comments can be used to disable and re-enable formatting for a block of code.
|
||||
* **`# fmt: skip`**: This comment, placed at the end of a line, will prevent Ruff from formatting that specific statement.
|
||||
|
||||
You can also disable specific linting rules for a line by using `# noqa: <rule_code>`.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
@@ -16,4 +16,4 @@ tabulate
|
||||
textual
|
||||
textual_plotext
|
||||
textual-fspicker
|
||||
tqdm
|
||||
tqdm
|
||||
|
||||
Reference in New Issue
Block a user