File tree Expand file tree Collapse file tree 8 files changed +17
-25
lines changed Expand file tree Collapse file tree 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.
5858| ` build.rs ` | The cargo-specific build script used when compiling the binding. |
5959| ` Cargo.toml ` | Metadata about the binding's rust package (which _ is not_ intended to be published to crates.io). |
6060| ` package.json ` | Metadata about the npm package (platform agnostic). |
61+ | ` cli.js ` | The executable script invoked as a Command Line Interface. |
6162| ` index.d.ts ` | The generated TypeScript typing info the describes the exposing functionality in the built native module. |
6263| ` index.js ` | The generated script that delegates which platform-specific package to import. |
6364| ` 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). |
6465
6566Hidden files and folders are not described in the table above.
6667If 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
4646
4747| Name | Description |
4848| -----:| :------------|
49- | ` cpp_linter ` | The pure python sources that wrap the rust binding. Typing information is located here. |
5049| ` src ` | The location for all rust sources related to binding the cpp-linter library. |
5150| ` 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). |
5252| ` ../../pyproject.toml ` | Metadata about the python package (located in repo root). |
5353| ` requirements-dev.txt ` | The dependencies used in development (not needed for runtime/production). |
5454
5555Hidden files and folders are not described in the table above.
5656If 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 11use pyo3:: { exceptions:: PyOSError , prelude:: * } ;
2+ use std:: env;
23use tokio:: runtime:: Builder ;
34
45use :: cpp_linter:: run:: run_main;
56
67/// A wrapper for the ``::cpp_linter::run::run_main()```
78#[ 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 ( ) ) ;
913 Builder :: new_multi_thread ( )
1014 . enable_all ( )
1115 . build ( )
Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ fn probe_ssl_certs() {
3232/// The idea here is that all functionality is implemented in Rust. However, passing
3333/// command line arguments is done differently in Python, node.js, or Rust.
3434///
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()`])).
3942/// - In rust, the [`std::env::args`] is passed to [`run_main()`] in the binary
4043/// source `main.rs`.
4144///
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