From b1cd31299b024fcf12d3f4ed494d3d82a5c83f48 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 23 Nov 2024 11:13:02 -0800 Subject: [PATCH 1/3] reorganize repo folders This is meant to reduce some of the clutter in the repo's root folder. This also allows installing the python binding from repo root, instead of specifying the path to the python binding source. --- .../install-clang-action}/README.md | 0 .../install-clang-action}/action.yml | 0 .github/workflows/bump_version.py | 6 ++-- .github/workflows/node-js-packaging.yml | 28 +++++++++---------- .github/workflows/pre-commit-hooks.yml | 3 +- .github/workflows/python-packaging.yml | 14 ++++++---- .github/workflows/run-dev-tests.yml | 22 +++++++-------- .pre-commit-config.yaml | 2 +- Cargo.toml | 2 +- .../node}/.cargo/config.toml | 0 {node-binding => bindings/node}/.gitignore | 0 {node-binding => bindings/node}/.npmignore | 0 {node-binding => bindings/node}/.yarnrc.yml | 0 {node-binding => bindings/node}/Cargo.toml | 2 +- {node-binding => bindings/node}/README.md | 0 .../node}/__test__/index.spec.mjs | 0 {node-binding => bindings/node}/build.rs | 0 {node-binding => bindings/node}/cli.js | 0 .../node}/eslint.config.mjs | 0 {node-binding => bindings/node}/index.d.ts | 0 {node-binding => bindings/node}/index.js | 0 .../node}/npm/darwin-x64/README.md | 0 .../node}/npm/darwin-x64/package.json | 0 .../node}/npm/linux-x64-gnu/README.md | 0 .../node}/npm/linux-x64-gnu/package.json | 0 .../node}/npm/win32-x64-msvc/README.md | 0 .../node}/npm/win32-x64-msvc/package.json | 0 {node-binding => bindings/node}/package.json | 0 {node-binding => bindings/node}/src/lib.rs | 0 {py-binding => bindings/python}/.gitignore | 0 {py-binding => bindings/python}/Cargo.toml | 2 +- {py-binding => bindings/python}/README.md | 0 .../python}/cpp_linter/__init__.py | 0 .../python}/cpp_linter/cpp_linter.pyi | 0 .../python}/cpp_linter/py.typed | 0 .../python}/requirements-dev.txt | 0 {py-binding => bindings/python}/src/lib.rs | 0 docs/docs/node.md | 2 +- docs/docs/python.md | 2 +- package.json | 11 ++++---- py-binding/pyproject.toml => pyproject.toml | 3 +- 41 files changed, 51 insertions(+), 48 deletions(-) rename {install-clang-action => .github/install-clang-action}/README.md (100%) rename {install-clang-action => .github/install-clang-action}/action.yml (100%) rename {node-binding => bindings/node}/.cargo/config.toml (100%) rename {node-binding => bindings/node}/.gitignore (100%) rename {node-binding => bindings/node}/.npmignore (100%) rename {node-binding => bindings/node}/.yarnrc.yml (100%) rename {node-binding => bindings/node}/Cargo.toml (94%) rename {node-binding => bindings/node}/README.md (100%) rename {node-binding => bindings/node}/__test__/index.spec.mjs (100%) rename {node-binding => bindings/node}/build.rs (100%) rename {node-binding => bindings/node}/cli.js (100%) mode change 100755 => 100644 rename {node-binding => bindings/node}/eslint.config.mjs (100%) rename {node-binding => bindings/node}/index.d.ts (100%) rename {node-binding => bindings/node}/index.js (100%) rename {node-binding => bindings/node}/npm/darwin-x64/README.md (100%) rename {node-binding => bindings/node}/npm/darwin-x64/package.json (100%) rename {node-binding => bindings/node}/npm/linux-x64-gnu/README.md (100%) rename {node-binding => bindings/node}/npm/linux-x64-gnu/package.json (100%) rename {node-binding => bindings/node}/npm/win32-x64-msvc/README.md (100%) rename {node-binding => bindings/node}/npm/win32-x64-msvc/package.json (100%) rename {node-binding => bindings/node}/package.json (100%) rename {node-binding => bindings/node}/src/lib.rs (100%) rename {py-binding => bindings/python}/.gitignore (100%) rename {py-binding => bindings/python}/Cargo.toml (93%) rename {py-binding => bindings/python}/README.md (100%) rename {py-binding => bindings/python}/cpp_linter/__init__.py (100%) rename {py-binding => bindings/python}/cpp_linter/cpp_linter.pyi (100%) rename {py-binding => bindings/python}/cpp_linter/py.typed (100%) rename {py-binding => bindings/python}/requirements-dev.txt (100%) rename {py-binding => bindings/python}/src/lib.rs (100%) rename py-binding/pyproject.toml => pyproject.toml (95%) diff --git a/install-clang-action/README.md b/.github/install-clang-action/README.md similarity index 100% rename from install-clang-action/README.md rename to .github/install-clang-action/README.md diff --git a/install-clang-action/action.yml b/.github/install-clang-action/action.yml similarity index 100% rename from install-clang-action/action.yml rename to .github/install-clang-action/action.yml diff --git a/.github/workflows/bump_version.py b/.github/workflows/bump_version.py index 8118e84..d7f6ea3 100644 --- a/.github/workflows/bump_version.py +++ b/.github/workflows/bump_version.py @@ -115,11 +115,11 @@ def main(): Updater.new_version, "--no-git-tag-version", ], - cwd="node-binding", + cwd="bindings/node", check=True, ) - subprocess.run(["napi", "version"], cwd="node-binding", check=True) - print("Updated version in node-binding/**package.json") + subprocess.run(["napi", "version"], cwd="bindings/node", check=True) + print("Updated version in bindings/node/**package.json") subprocess.run( [ diff --git a/.github/workflows/node-js-packaging.yml b/.github/workflows/node-js-packaging.yml index 349f5d3..4d3e6fc 100644 --- a/.github/workflows/node-js-packaging.yml +++ b/.github/workflows/node-js-packaging.yml @@ -14,7 +14,7 @@ on: - cpp-linter/Cargo.toml - Cargo.toml - Cargo.lock - - node-binding/** + - bindings/node/** - package.json - yarn.lock - .github/workflows/node-js-packaging.yml @@ -27,7 +27,7 @@ on: - cpp-linter/Cargo.toml - Cargo.toml - Cargo.lock - - node-binding/** + - bindings/node/** - package.json - yarn.lock - .github/workflows/node-js-packaging.yml @@ -83,12 +83,12 @@ jobs: if: ${{ matrix.settings.setup }} shell: bash - name: Setup node x86 - working-directory: node-binding + working-directory: bindings/node if: matrix.settings.target == 'i686-pc-windows-msvc' run: yarn config set supportedArchitectures.cpu "ia32" shell: bash - name: Install dependencies - working-directory: node-binding + working-directory: bindings/node run: yarn install - name: Setup node x86 uses: actions/setup-node@v4 @@ -113,13 +113,13 @@ jobs: - name: Build run: ${{ matrix.settings.build }} if: ${{ !matrix.settings.docker }} - working-directory: node-binding + working-directory: bindings/node shell: bash - name: Upload artifact uses: actions/upload-artifact@v4 with: name: bindings-${{ matrix.settings.target }} - path: node-binding/${{ env.APP_NAME }}.*.node + path: bindings/node/${{ env.APP_NAME }}.*.node if-no-files-found: error test-macOS-windows-binding: name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} @@ -151,10 +151,10 @@ jobs: uses: actions/download-artifact@v4 with: name: bindings-${{ matrix.settings.target }} - path: node-binding + path: bindings/node - name: List packages run: ls -R . - working-directory: node-binding + working-directory: bindings/node shell: bash - name: Test bindings run: yarn test @@ -182,10 +182,10 @@ jobs: uses: actions/download-artifact@v4 with: name: bindings-x86_64-unknown-linux-gnu - path: node-binding + path: bindings/node - name: List packages run: ls -R . - working-directory: node-binding + working-directory: bindings/node shell: bash - name: Test bindings run: >- @@ -213,16 +213,16 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 with: - path: node-binding/artifacts + path: bindings/node/artifacts - name: Move artifacts - working-directory: node-binding + working-directory: bindings/node run: yarn artifacts - name: List packages run: ls -R ./npm - working-directory: node-binding + working-directory: bindings/node shell: bash - name: Publish - working-directory: node-binding + working-directory: bindings/node run: | echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc npm publish --access public --provenance true ${{ contains(github.ref_name, '-rc') && '--tag next' || '' }} diff --git a/.github/workflows/pre-commit-hooks.yml b/.github/workflows/pre-commit-hooks.yml index d2ed692..1c74cc0 100644 --- a/.github/workflows/pre-commit-hooks.yml +++ b/.github/workflows/pre-commit-hooks.yml @@ -39,5 +39,4 @@ jobs: node-version: 20 cache: yarn - run: yarn install - - run: yarn run eslint - working-directory: node-binding + - run: yarn lint diff --git a/.github/workflows/python-packaging.yml b/.github/workflows/python-packaging.yml index d52ab39..062efc4 100644 --- a/.github/workflows/python-packaging.yml +++ b/.github/workflows/python-packaging.yml @@ -17,18 +17,20 @@ on: branches: [main] paths: - cpp-linter/**.{rs,toml} - - py-binding/** + - bindings/python/** - Cargo.{toml,lock} - .github/workflows/python-packaging.yml + - pyproject.toml tags: - '*' pull_request: branches: [main] paths: - cpp-linter/**.{rs,toml} - - py-binding/** + - bindings/python/** - Cargo.{toml,lock} - .github/workflows/python-packaging.yml + - pyproject.toml permissions: contents: read @@ -75,7 +77,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml ${{ steps.is-openssl-vendored.outputs.enabled }} + args: --release --out dist --find-interpreter ${{ steps.is-openssl-vendored.outputs.enabled }} # sccache: 'true' manylinux: auto before-script-linux: | @@ -116,7 +118,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml + args: --release --out dist --find-interpreter sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 @@ -143,7 +145,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path py-binding/Cargo.toml --features openssl-vendored + args: --release --out dist --find-interpreter --features openssl-vendored sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 @@ -162,7 +164,7 @@ jobs: uses: PyO3/maturin-action@v1 with: command: sdist - args: --manifest-path py-binding/Cargo.toml --out dist + args: --out dist - name: Upload sdist uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml index a9b9351..b35aa75 100644 --- a/.github/workflows/run-dev-tests.yml +++ b/.github/workflows/run-dev-tests.yml @@ -80,7 +80,7 @@ jobs: - name: Install clang v7 if: runner.os == 'Linux' - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '7' @@ -92,7 +92,7 @@ jobs: - name: Install clang v8 if: runner.os == 'Linux' - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '8' @@ -113,7 +113,7 @@ jobs: run: just test ci - name: Install clang v10 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '10' @@ -123,7 +123,7 @@ jobs: run: just test ci - name: Install clang 11 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '11' @@ -133,7 +133,7 @@ jobs: run: just test ci - name: Install clang 12 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '12' @@ -143,7 +143,7 @@ jobs: run: just test ci - name: Install clang 13 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '13' @@ -153,7 +153,7 @@ jobs: run: just test ci - name: Install clang 14 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '14' @@ -163,7 +163,7 @@ jobs: run: just test ci - name: Install clang 15 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '15' @@ -173,7 +173,7 @@ jobs: run: just test ci - name: Install clang 16 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '16' @@ -183,7 +183,7 @@ jobs: run: just test ci - name: Install clang 17 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '17' @@ -193,7 +193,7 @@ jobs: run: just test ci - name: Install clang 18 - uses: cpp-linter/cpp-linter-rs/install-clang-action@main + uses: ./.github/install-clang-action with: version: '18' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75f051b..c8bee45 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: trailing-whitespace exclude: cpp-linter/tests/.*\.(?:patch|diff) - id: end-of-file-fixer - exclude: node-binding/.*package\.json + exclude: bindings/node/.*package\.json - id: check-docstring-first - id: check-added-large-files args: [--maxkb=9000] diff --git a/Cargo.toml b/Cargo.toml index 94aff40..45c58da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace] -members = ["cpp-linter", "py-binding", "node-binding", "docs"] +members = ["cpp-linter", "bindings/python", "bindings/node", "docs"] resolver = "2" [workspace.package] diff --git a/node-binding/.cargo/config.toml b/bindings/node/.cargo/config.toml similarity index 100% rename from node-binding/.cargo/config.toml rename to bindings/node/.cargo/config.toml diff --git a/node-binding/.gitignore b/bindings/node/.gitignore similarity index 100% rename from node-binding/.gitignore rename to bindings/node/.gitignore diff --git a/node-binding/.npmignore b/bindings/node/.npmignore similarity index 100% rename from node-binding/.npmignore rename to bindings/node/.npmignore diff --git a/node-binding/.yarnrc.yml b/bindings/node/.yarnrc.yml similarity index 100% rename from node-binding/.yarnrc.yml rename to bindings/node/.yarnrc.yml diff --git a/node-binding/Cargo.toml b/bindings/node/Cargo.toml similarity index 94% rename from node-binding/Cargo.toml rename to bindings/node/Cargo.toml index 0437425..7c77837 100644 --- a/node-binding/Cargo.toml +++ b/bindings/node/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["cdylib"] # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "2.16.13", default-features = false, features = ["napi4", "async"] } napi-derive = "2.12.2" -cpp-linter = { path = "../cpp-linter" } +cpp-linter = { path = "../../cpp-linter" } anyhow = "1.0.93" [features] diff --git a/node-binding/README.md b/bindings/node/README.md similarity index 100% rename from node-binding/README.md rename to bindings/node/README.md diff --git a/node-binding/__test__/index.spec.mjs b/bindings/node/__test__/index.spec.mjs similarity index 100% rename from node-binding/__test__/index.spec.mjs rename to bindings/node/__test__/index.spec.mjs diff --git a/node-binding/build.rs b/bindings/node/build.rs similarity index 100% rename from node-binding/build.rs rename to bindings/node/build.rs diff --git a/node-binding/cli.js b/bindings/node/cli.js old mode 100755 new mode 100644 similarity index 100% rename from node-binding/cli.js rename to bindings/node/cli.js diff --git a/node-binding/eslint.config.mjs b/bindings/node/eslint.config.mjs similarity index 100% rename from node-binding/eslint.config.mjs rename to bindings/node/eslint.config.mjs diff --git a/node-binding/index.d.ts b/bindings/node/index.d.ts similarity index 100% rename from node-binding/index.d.ts rename to bindings/node/index.d.ts diff --git a/node-binding/index.js b/bindings/node/index.js similarity index 100% rename from node-binding/index.js rename to bindings/node/index.js diff --git a/node-binding/npm/darwin-x64/README.md b/bindings/node/npm/darwin-x64/README.md similarity index 100% rename from node-binding/npm/darwin-x64/README.md rename to bindings/node/npm/darwin-x64/README.md diff --git a/node-binding/npm/darwin-x64/package.json b/bindings/node/npm/darwin-x64/package.json similarity index 100% rename from node-binding/npm/darwin-x64/package.json rename to bindings/node/npm/darwin-x64/package.json diff --git a/node-binding/npm/linux-x64-gnu/README.md b/bindings/node/npm/linux-x64-gnu/README.md similarity index 100% rename from node-binding/npm/linux-x64-gnu/README.md rename to bindings/node/npm/linux-x64-gnu/README.md diff --git a/node-binding/npm/linux-x64-gnu/package.json b/bindings/node/npm/linux-x64-gnu/package.json similarity index 100% rename from node-binding/npm/linux-x64-gnu/package.json rename to bindings/node/npm/linux-x64-gnu/package.json diff --git a/node-binding/npm/win32-x64-msvc/README.md b/bindings/node/npm/win32-x64-msvc/README.md similarity index 100% rename from node-binding/npm/win32-x64-msvc/README.md rename to bindings/node/npm/win32-x64-msvc/README.md diff --git a/node-binding/npm/win32-x64-msvc/package.json b/bindings/node/npm/win32-x64-msvc/package.json similarity index 100% rename from node-binding/npm/win32-x64-msvc/package.json rename to bindings/node/npm/win32-x64-msvc/package.json diff --git a/node-binding/package.json b/bindings/node/package.json similarity index 100% rename from node-binding/package.json rename to bindings/node/package.json diff --git a/node-binding/src/lib.rs b/bindings/node/src/lib.rs similarity index 100% rename from node-binding/src/lib.rs rename to bindings/node/src/lib.rs diff --git a/py-binding/.gitignore b/bindings/python/.gitignore similarity index 100% rename from py-binding/.gitignore rename to bindings/python/.gitignore diff --git a/py-binding/Cargo.toml b/bindings/python/Cargo.toml similarity index 93% rename from py-binding/Cargo.toml rename to bindings/python/Cargo.toml index 90dfc81..71c5ab3 100644 --- a/py-binding/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -17,7 +17,7 @@ crate-type = ["cdylib"] [dependencies] pyo3 = { version = "0.23.1", features = ["extension-module"] } -cpp-linter = { path = "../cpp-linter" } +cpp-linter = { path = "../../cpp-linter" } tokio = "1.41.1" [features] diff --git a/py-binding/README.md b/bindings/python/README.md similarity index 100% rename from py-binding/README.md rename to bindings/python/README.md diff --git a/py-binding/cpp_linter/__init__.py b/bindings/python/cpp_linter/__init__.py similarity index 100% rename from py-binding/cpp_linter/__init__.py rename to bindings/python/cpp_linter/__init__.py diff --git a/py-binding/cpp_linter/cpp_linter.pyi b/bindings/python/cpp_linter/cpp_linter.pyi similarity index 100% rename from py-binding/cpp_linter/cpp_linter.pyi rename to bindings/python/cpp_linter/cpp_linter.pyi diff --git a/py-binding/cpp_linter/py.typed b/bindings/python/cpp_linter/py.typed similarity index 100% rename from py-binding/cpp_linter/py.typed rename to bindings/python/cpp_linter/py.typed diff --git a/py-binding/requirements-dev.txt b/bindings/python/requirements-dev.txt similarity index 100% rename from py-binding/requirements-dev.txt rename to bindings/python/requirements-dev.txt diff --git a/py-binding/src/lib.rs b/bindings/python/src/lib.rs similarity index 100% rename from py-binding/src/lib.rs rename to bindings/python/src/lib.rs diff --git a/docs/docs/node.md b/docs/docs/node.md index 19b522d..b37b513 100644 --- a/docs/docs/node.md +++ b/docs/docs/node.md @@ -1,6 +1,6 @@ # Node.js Binding {% - include "../../node-binding/README.md" + include "../../bindings/node/README.md" start="" %} diff --git a/docs/docs/python.md b/docs/docs/python.md index 87b2a73..178ad28 100644 --- a/docs/docs/python.md +++ b/docs/docs/python.md @@ -1,6 +1,6 @@ # Python Binding {% - include "../../py-binding/README.md" + include "../../bindings/python/README.md" start="" %} diff --git a/package.json b/package.json index ba8fde7..993a094 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,15 @@ "name": "@cpp-linter/cpp-linter-rs", "version": "0.0.0", "description": "Node.js bindings for the cpp-linter rust source.", - "main": "node-bindings/index.node", + "main": "bindings/node/index.node", "directories": { "doc": "docs" }, "scripts": { - "build": "cd node-binding && napi build --platform --release", - "build:debug": "cd node-binding && napi build --platform", - "test": "cd node-binding && ava" + "build": "cd bindings/node && napi build --platform --release", + "build:debug": "cd bindings/node && napi build --platform", + "test": "cd bindings/node && ava", + "lint": "cd bindings/node && yarn run eslint" }, "repository": { "type": "git", @@ -23,7 +24,7 @@ "homepage": "https://github.com/cpp-linter/cpp-linter-rs#readme", "private": true, "workspaces": [ - "node-binding" + "bindings/node" ], "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/py-binding/pyproject.toml b/pyproject.toml similarity index 95% rename from py-binding/pyproject.toml rename to pyproject.toml index a99d4ba..2e8a0bd 100644 --- a/py-binding/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "maturin" [project] name = "cpp-linter" description = "Run clang-format and clang-tidy on a batch of files." -readme = "README.md" +readme = "bindings/python/README.md" keywords = ["clang", "clang-tools", "linter", "clang-tidy", "clang-format"] license = {text = "MIT License"} requires-python = ">=3.9" @@ -46,3 +46,4 @@ exclude = [ {path = "**/examples/**", format="sdist"}, {path = "**/docs/**", format="sdist"}, ] +manifest-path = "bindings/python/Cargo.toml" From 26ce6cc986d2dacc5e72bf6223d0ade5c563f4dd Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 23 Nov 2024 11:30:45 -0800 Subject: [PATCH 2/3] adjust doc comment --- cpp-linter/src/run.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp-linter/src/run.rs b/cpp-linter/src/run.rs index f35a8d8..b2a1adb 100644 --- a/cpp-linter/src/run.rs +++ b/cpp-linter/src/run.rs @@ -30,10 +30,12 @@ fn probe_ssl_certs() { /// This is the backend entry point for console applications. /// /// The idea here is that all functionality is implemented in Rust. However, passing -/// command line arguments is done differently in Python or Rust. +/// command line arguments is done differently in Python, node.js, or Rust. /// -/// - In python, the ``sys.argv`` list is passed from the ``cpp_linter.entry_point.main()`` -/// function to rust via the ``cpp_linter.run.main()`` binding (which wraps [`run_main()`]). +/// - In python, the `sys.argv` list is passed from the `cpp_linter.main()` +/// function to rust via the `cpp_linter.main()` binding (which wraps [`run_main()`]). +/// - In node.js, the `process.argv` array is passed from `cli.js` module to +/// rust via `index.node` module's `main()` (which wraps([`run_main()`])). /// - In rust, the [`std::env::args`] is passed to [`run_main()`] in the binary /// source `main.rs`. /// From d7334c6baf5f328d31fa05bde74ab0e4948812b9 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 23 Nov 2024 12:22:23 -0800 Subject: [PATCH 3/3] update py binding readme --- bindings/python/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/README.md b/bindings/python/README.md index 45fcb59..c57b8f3 100644 --- a/bindings/python/README.md +++ b/bindings/python/README.md @@ -30,10 +30,10 @@ For the description of supported Command Line Interface options, see ## Development -Build the binding with [maturin]: +Build the binding with [maturin] (from repository root folder): ```text -maturin dev --manifest-path py-binding/Cargo.toml +maturin dev ``` Then invoke the executable script as a normal CLI app: @@ -49,7 +49,7 @@ cpp-linter -help | `cpp_linter` | The pure python sources that wrap the rust binding. Typing information is located here. | | `src` | The location for all rust sources related to binding the cpp-linter library. | | `Cargo.toml` | Metadata about the binding's rust package (which _is not_ intended to be published to crates.io). | -| `pyproject.toml` | Metadata about the python package. | +| `../../pyproject.toml` | Metadata about the python package (located in repo root). | | `requirements-dev.txt` | The dependencies used in development (not needed for runtime/production). | Hidden files and folders are not described in the table above.