# SCA2D - Static Code Analysis for SCAD
![](identity/SCA2D.png)
This is an experimental linter for OpenSCAD. The focus is to properly lex the `.scad` files so that we can test for dangerous code like redefining variable from other scopes. SCA2D is in a very early stage of development.
## How to install
If you have Python 3.6 or later installed on your machine (and on the PATH) you can install SCA2D from PyPi by running the following command from a terminal
pip install sca2d
to upgrade your current versions of SCA2D run:
pip install sca2d --upgrade
You can check that SCA2D is installed by running the following:
sca2d -h
you should see a help screen.
### Install issues
If you have problems with installation possible problems include:
* You may need to run `pip3` instead of `pip`
* Python may not be on the PATH, this often happens in Windows depending on how python was installed
## How to run
To analyse a `.scad` file run:
sca2d filename.scad
This will print any code messages to the screen.
To analyse all `.scad` files in a directory run:
sca2d directory_path
This will also print any code messages to the screen.
If you wish to inspect the parse tree that SCA2D generates and then uses you can instead run:
sca2d --output-tree filename.scad
the tree will be printed into a file called `filename.sca2d`.
## What works
* Parsing most `.scad` files. We don't yet do extensive testing. Please raise an issue if you find a parsing error in SCA2D.
* Parsing included and used `.scad` files and checking variable, function, and module usage in different scopes.
* Checking for a minimal number of code errors
## How to get involved
The best way to get involved is to find bugs and then [open an issue](https://gitlab.com/bath_open_instrumentation_group/sca2d/-/issues). You could also make changes and open a merge request.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/bath_open_instrumentation_group/sca2d",
"name": "sca2d",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "OpenSCAD,Linting",
"author": "Julian Stirling",
"author_email": "julian@julianstirling.co.uk",
"download_url": "https://files.pythonhosted.org/packages/41/26/a61d117c8ae38fecd203b1da7b09b766a7486c620f57610b7d17198d9224/sca2d-0.2.2.tar.gz",
"platform": null,
"description": "# SCA2D - Static Code Analysis for SCAD\n\n![](identity/SCA2D.png)\n\nThis is an experimental linter for OpenSCAD. The focus is to properly lex the `.scad` files so that we can test for dangerous code like redefining variable from other scopes. SCA2D is in a very early stage of development.\n\n## How to install\n\nIf you have Python 3.6 or later installed on your machine (and on the PATH) you can install SCA2D from PyPi by running the following command from a terminal\n\n pip install sca2d\n\nto upgrade your current versions of SCA2D run:\n\n pip install sca2d --upgrade\n\nYou can check that SCA2D is installed by running the following:\n\n sca2d -h\n\nyou should see a help screen.\n\n### Install issues\n\nIf you have problems with installation possible problems include:\n\n* You may need to run `pip3` instead of `pip`\n* Python may not be on the PATH, this often happens in Windows depending on how python was installed\n\n## How to run\n\nTo analyse a `.scad` file run:\n\n sca2d filename.scad\nThis will print any code messages to the screen.\n\nTo analyse all `.scad` files in a directory run:\n\n sca2d directory_path\nThis will also print any code messages to the screen.\n\nIf you wish to inspect the parse tree that SCA2D generates and then uses you can instead run:\n\n sca2d --output-tree filename.scad\nthe tree will be printed into a file called `filename.sca2d`.\n\n## What works\n\n* Parsing most `.scad` files. We don't yet do extensive testing. Please raise an issue if you find a parsing error in SCA2D.\n* Parsing included and used `.scad` files and checking variable, function, and module usage in different scopes.\n* Checking for a minimal number of code errors\n\n## How to get involved\n\nThe best way to get involved is to find bugs and then [open an issue](https://gitlab.com/bath_open_instrumentation_group/sca2d/-/issues). You could also make changes and open a merge request.\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "An experimental static code analyser for OpenSCAD.",
"version": "0.2.2",
"project_urls": {
"Bug Tracker": "https://gitlab.com/bath_open_instrumentation_group/sca2d/issues",
"Homepage": "https://gitlab.com/bath_open_instrumentation_group/sca2d",
"Source Code": "https://gitlab.com/bath_open_instrumentation_group/sca2d"
},
"split_keywords": [
"openscad",
"linting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a52522592c6ae8d684d937b4126dbd72a37723dcf71e67b27e53d06f75ff3b1b",
"md5": "23159d300ca8beb290be72f3f6155107",
"sha256": "4fcd8c38fecd7b02ab05043eace1cd4bab07351ff23d2a4e78dbd9a20582886d"
},
"downloads": -1,
"filename": "sca2d-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "23159d300ca8beb290be72f3f6155107",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 42180,
"upload_time": "2024-02-14T09:39:34",
"upload_time_iso_8601": "2024-02-14T09:39:34.238938Z",
"url": "https://files.pythonhosted.org/packages/a5/25/22592c6ae8d684d937b4126dbd72a37723dcf71e67b27e53d06f75ff3b1b/sca2d-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4126a61d117c8ae38fecd203b1da7b09b766a7486c620f57610b7d17198d9224",
"md5": "a9f64f1c1e36ea5c96f072f08ade065e",
"sha256": "32b6692008d939c85c6ffb257db73b013b8b6c50752705e486d4f416138af9d9"
},
"downloads": -1,
"filename": "sca2d-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "a9f64f1c1e36ea5c96f072f08ade065e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 44375,
"upload_time": "2024-02-14T09:39:36",
"upload_time_iso_8601": "2024-02-14T09:39:36.271711Z",
"url": "https://files.pythonhosted.org/packages/41/26/a61d117c8ae38fecd203b1da7b09b766a7486c620f57610b7d17198d9224/sca2d-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-14 09:39:36",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "bath_open_instrumentation_group",
"gitlab_project": "sca2d",
"lcname": "sca2d"
}