Skip to content

Release trial follow up #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*.css text eol=lf
*.md text eol=lf
*.rs text eol=lf
*.js text eol=lf
*.ts text eol=lf
*.yaml text eol=lf
*.toml text eol=lf
*.lock text eol=lf
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pre-commit-hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,15 @@ jobs:
run: cargo clippy
- name: cargo fmt
run: cargo fmt --check

eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install
- run: yarn run eslint
working-directory: node-binding
163 changes: 139 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<!-- markdownlint-disable MD041 -->

[file-annotations]: https://cpp-linter.github.io/cpp_linter_rs/cli#-a---file-annotations
[thread-comments]: https://cpp-linter.github.io/cpp_linter_rs/cli#-g---thread-comments
[step-summary]: https://cpp-linter.github.io/cpp_linter_rs/cli#-w---step-summary
[tidy-review]: https://cpp-linter.github.io/cpp_linter_rs/cli#-d---tidy-review
[format-review]: https://cpp-linter.github.io/cpp_linter_rs/cli#-m---format-review

[format-annotations-preview]: docs/src/images/annotations-clang-format.png
[tidy-annotations-preview]: docs/src/images/annotations-clang-tidy.png
[step-summary-preview]: docs/src/images/step-summary.png
[thread-comment-preview]: docs/src/images/comment.png
[tidy-review-preview]: docs/src/images/tidy-review.png
[format-review-preview]: docs/src/images/format-review.png
[format-suggestion-preview]: docs/src/images/format-suggestion.png

[![Python packaging][py-build-badge]][py-build-ci]
[![Binary executable builds][bin-build-badge]][bin-build-ci]
[![node-js builds][node-ci-badge]][node-ci]
[![Test CI][test-ci-badge]][test-ci]
[![Docs][docs-ci-badge]][docs-site]
[![Pre-commit-ci][pre-commit-badge]][pre-commit-ci]

[![codecov-status][codecov-badge]][codecov-project]
[![docs.rs][docs-rs-badge]][docs-rs]
[![PyPI - Version][pypi-badge]][pypi-pkg]
[![Crates.io Version][crates-io-badge]][crates-io-pkg]
[![NPM Version][npm-badge]][npm-pkg]

[py-build-ci]: https://github.com/cpp-linter/cpp_linter_rs/actions/workflows/python-packaging.yml
[py-build-badge]: https://github.com/cpp-linter/cpp_linter_rs/actions/workflows/python-packaging.yml/badge.svg
Expand All @@ -30,20 +40,78 @@
[docs-rs]: https://docs.rs/cpp-linter
[pypi-badge]: https://img.shields.io/pypi/v/cpp-linter
[pypi-pkg]: https://pypi.org/project/cpp-linter/
[test-pypi-badge]: https://img.shields.io/pypi/v/cpp-linter?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org&label=test-pypi
[test-pypi-pkg]: https://test.pypi.org/project/cpp-linter/
[crates-io-badge]: https://img.shields.io/crates/v/cpp-linter
[crates-io-pkg]: https://crates.io/crates/cpp-linter
[npm-badge]: https://img.shields.io/npm/v/%40cpp-linter%2Fcpp-linter
[npm-pkg]: https://www.npmjs.com/package/@cpp-linter/cpp-linter

# C/C++ Linting Package

A Python and Rust package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments, step summary, or file annotations.
A package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of

- [x] [thread-comments](#thread-comment)
- [x] [step-summary](#step-summary)
- [x] [file-annotations](#annotations)
- [x] [Pull Request Review](#pull-request-review) suggestions

> [!CAUTION]
> This project is still experimental and subject to drastic changes.
> Please use the pure python [cpp-linter](https://github.com/cpp-linter/cpp-linter)
> Please use the [pure python cpp-linter](https://github.com/cpp-linter/cpp-linter)
> package until this project is ready for deployment.

## Install

This package is available in several programming languages (through their respective package managers).

### Rust

[![Crates.io Version][crates-io-badge]][crates-io-pkg]
[![docs.rs][docs-rs-badge]][docs-rs]

Install from source code hosted at crates.io:

```text
cargo install cpp-linter
```

Install a pre-compiled binary from GitHub releases:

First [install `cargo-binstall`](https://github.com/cargo-bins/cargo-binstall?tab=readme-ov-file#installation).

```text
cargo binstall cpp-linter
```

### Python

[![PyPI - Version][pypi-badge]][pypi-pkg]

Install the python package:

```text
pip install cpp-linter
```

[![testPyPI - Version][test-pypi-badge]][test-pypi-pkg]

Pre-releases are uploaded to test-pypi:

```text
pip install -i https://test.pypi.org/simple/ cpp-linter
```

### Node.js

[![NPM Version][npm-badge]][npm-pkg]

Install the Node.js binding:

```text
npm -g install @cpp-linter/cpp-linter
```

## Usage

For usage in a CI workflow, see
Expand All @@ -52,56 +120,103 @@ For usage in a CI workflow, see
For the description of supported Command Line Interface options, see
[the CLI documentation](https://cpp-linter.github.io/cpp_linter_rs/cli.html).

## Example

### Annotations

Using [`--file-annotations`][file-annotations]:

#### clang-format annotations

![clang-format annotations][format-annotations-preview]

#### clang-tidy annotations

![clang-tidy annotations][tidy-annotations-preview]

### Thread Comment

Using [`--thread-comments`][thread-comments]:

![sample thread-comment][thread-comment-preview]

### Step Summary

Using [`--step-summary`][step-summary]:

![step summary][step-summary-preview]

### Pull Request Review

#### Only clang-tidy

Using [`--tidy-review`][tidy-review]:

![sample tidy-review][tidy-review-preview]

#### Only clang-format

Using [`--format-review`][format-review]:

![sample format-review][format-review-preview]

![sample format-suggestion][format-suggestion-preview]

## Have question or feedback?

To provide feedback (requesting a feature or reporting a bug) please post to
[issues](https://github.com/cpp-linter/cpp_linter_rs/issues).

## License

The scripts and documentation in this project are released under the [MIT][MIT].
The scripts and documentation in this project are released under the [MIT].

Dependencies (that are redistributed by us in binary form) have the following
license agreements:

- [clap](https://crates.io/crates/clap):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [git2](https://crates.io/crates/git2):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].

The following are conditionally included in binaries (using the `openssl-vendored` feature on a
case-by-case basis) because it is a dependency of git2:

- [openssl](https://crates.io/crates/openssl): Licensed under [Apache 2.0][Apache2]
- [openssl-probe](https://crates.io/crates/openssl-probe):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].

- [lenient_semver](https://crates.io/crates/lenient_semver):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [log](https://crates.io/crates/log):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [regex](https://crates.io/crates/regex):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [reqwest](https://crates.io/crates/reqwest):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [semver](https://crates.io/crates/semver):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [serde](https://crates.io/crates/serde):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
- [serde-xml-rs](https://crates.io/crates/serde-xml-rs): Licensed under [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [serde-xml-rs](https://crates.io/crates/serde-xml-rs): Licensed under [MIT].
- [serde_json](https://crates.io/crates/serde_json):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
- [which](https://crates.io/crates/which): Licensed under [MIT][MIT].
- [tokio](https://crates.io/crates/tokio): Licensed under [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [which](https://crates.io/crates/which): Licensed under [MIT].
- [tokio](https://crates.io/crates/tokio): Licensed under [MIT].
- [futures](https://crates.io/crates/futures):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].
- [chrono](https://crates.io/crates/chrono):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].

The python binding uses

- [pyo3](https://crates.io/crates/pyo3):
Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT].
Dual-licensed under [Apache 2.0][Apache2] or [MIT].

The node binding uses

- [napi](https://crates.io/crates/napi): Licensed under [MIT]
- [napi-derive](https://crates.io/crates/napi-derive): Licensed under [MIT]

[MIT]: https://choosealicense.com/licenses/mit
[Apache2]: https://choosealicense.com/licenses/apache-2.0/
4 changes: 4 additions & 0 deletions cspell.config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "0.2"
language: en
words:
- binstall
- Boolish
- bugprone
- chrono
Expand All @@ -15,6 +16,7 @@ words:
- iomanip
- libgit
- markdownlint
- maturin
- mdbook
- msvc
- napi
Expand All @@ -25,6 +27,8 @@ words:
- pybind
- pyfunction
- pymodule
- pypi
- pyproject
- ratelimit
- reqwest
- revparse
Expand Down
2 changes: 2 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
- [Command Line Interface](./cli.md)
- [Token Permissions](./permissions.md)
- [Pull Request Review Caveats](./pr-review-caveats.md)
- [Python Binding](./python.md)
- [Node.js Binding](./node.md)
Binary file added docs/src/images/annotations-clang-format.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/annotations-clang-tidy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/format-review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/format-suggestion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/step-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/tidy-review.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<!-- markdownlint-disable MD041 MD053 -->

<!-- markdownlint-disable MD041 -->
[file-annotations]: cli.md#-a---file-annotations
[thread-comments]: cli.md#-g---thread-comments
[step-summary]: cli.md#-w---step-summary
[tidy-review]: cli.md#-d---tidy-review
[format-review]: cli.md#-m---format-review

{{#include ../../README.md}}
[format-annotations-preview]: images/annotations-clang-format.png
[tidy-annotations-preview]: images/annotations-clang-tidy.png
[step-summary-preview]: images/step-summary.png
[thread-comment-preview]: images/comment.png
[tidy-review-preview]: images/tidy-review.png
[format-review-preview]: images/format-review.png
[format-suggestion-preview]: images/format-suggestion.png

{{#include ../../README.md:16:}}
3 changes: 3 additions & 0 deletions docs/src/node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Node.js Binding

{{#include ../../node-binding/README.md:2:}}
3 changes: 3 additions & 0 deletions docs/src/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Python Binding

{{#include ../../py-binding/README.md:2:}}
Loading