File tree 8 files changed +17
-25
lines changed
8 files changed +17
-25
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,11 @@ This script runs a simple test to ensure the native module was built correctly.
58
58
| ` build.rs ` | The cargo-specific build script used when compiling the binding. |
59
59
| ` Cargo.toml ` | Metadata about the binding's rust package (which _ is not_ intended to be published to crates.io). |
60
60
| ` package.json ` | Metadata about the npm package (platform agnostic). |
61
+ | ` cli.js ` | The executable script invoked as a Command Line Interface. |
61
62
| ` index.d.ts ` | The generated TypeScript typing info the describes the exposing functionality in the built native module. |
62
63
| ` index.js ` | The generated script that delegates which platform-specific package to import. |
63
64
| ` cpp-linter.x-y-z.node ` | Then native module built for a specific platform (where ` x-y-z ` denotes the platform's name using compilation target). |
64
65
65
66
Hidden files and folders are not described in the table above.
66
67
If they are not ignored by a gitignore specification, then they should be considered
67
- important for maintenance or distribution.
68
+ important only for maintenance or distribution.
Original file line number Diff line number Diff line change @@ -46,12 +46,12 @@ cpp-linter -help
46
46
47
47
| Name | Description |
48
48
| -----:| :------------|
49
- | ` cpp_linter ` | The pure python sources that wrap the rust binding. Typing information is located here. |
50
49
| ` src ` | The location for all rust sources related to binding the cpp-linter library. |
51
50
| ` Cargo.toml ` | Metadata about the binding's rust package (which _ is not_ intended to be published to crates.io). |
51
+ | ` ../../cpp_linter.pyi ` | The typing stubs for the package (located in repo root). |
52
52
| ` ../../pyproject.toml ` | Metadata about the python package (located in repo root). |
53
53
| ` requirements-dev.txt ` | The dependencies used in development (not needed for runtime/production). |
54
54
55
55
Hidden files and folders are not described in the table above.
56
56
If they are not ignored by a gitignore specification, then they should be considered
57
- important for maintenance or distribution.
57
+ important only for maintenance or distribution.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
use pyo3:: { exceptions:: PyOSError , prelude:: * } ;
2
+ use std:: env;
2
3
use tokio:: runtime:: Builder ;
3
4
4
5
use :: cpp_linter:: run:: run_main;
5
6
6
7
/// A wrapper for the ``::cpp_linter::run::run_main()```
7
8
#[ pyfunction]
8
- fn main ( args : Vec < String > ) -> PyResult < ( ) > {
9
+ #[ pyo3( signature = ( args = None ) ) ]
10
+ fn main ( args : Option < Vec < String > > ) -> PyResult < ( ) > {
11
+ // exclude path to python interpreter
12
+ let args = args. unwrap_or ( env:: args ( ) . collect :: < Vec < String > > ( ) [ 1 ..] . to_vec ( ) ) ;
9
13
Builder :: new_multi_thread ( )
10
14
. enable_all ( )
11
15
. build ( )
Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ fn probe_ssl_certs() {
32
32
/// The idea here is that all functionality is implemented in Rust. However, passing
33
33
/// command line arguments is done differently in Python, node.js, or Rust.
34
34
///
35
- /// - In python, the `sys.argv` list is passed from the `cpp_linter.main()`
36
- /// function to rust via the `cpp_linter.main()` binding (which wraps [`run_main()`]).
37
- /// - In node.js, the `process.argv` array is passed from `cli.js` module to
38
- /// rust via `index.node` module's `main()` (which wraps([`run_main()`])).
35
+ /// - In python, the CLI arguments list is optionally passed to the binding's
36
+ /// `cpp_linter.main()` function (which wraps [`run_main()`]). If no args are passed,
37
+ /// then `cpp_linter.main()` uses [`std::env::args`] without the leading path to the
38
+ /// python interpreter removed.
39
+ /// - In node.js, the `process.argv` array (without the leading path to the node
40
+ /// interpreter removed) is passed from `cli.js` module to rust via `index.node`
41
+ /// module's `main()` (which wraps([`run_main()`])).
39
42
/// - In rust, the [`std::env::args`] is passed to [`run_main()`] in the binary
40
43
/// source `main.rs`.
41
44
///
Original file line number Diff line number Diff line change
1
+ def main (args : list [str ] | None = None ) -> int : ...
You can’t perform that action at this time.
0 commit comments