Skip to main content

An experimental static code analyser for OpenSCAD.

Project description

SCA2D - Static Code Analysis for SCAD

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. You could also make changes and open a merge request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sca2d-0.2.2.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

sca2d-0.2.2-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file sca2d-0.2.2.tar.gz.

File metadata

  • Download URL: sca2d-0.2.2.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for sca2d-0.2.2.tar.gz
Algorithm Hash digest
SHA256 32b6692008d939c85c6ffb257db73b013b8b6c50752705e486d4f416138af9d9
MD5 a9f64f1c1e36ea5c96f072f08ade065e
BLAKE2b-256 4126a61d117c8ae38fecd203b1da7b09b766a7486c620f57610b7d17198d9224

See more details on using hashes here.

File details

Details for the file sca2d-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: sca2d-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for sca2d-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4fcd8c38fecd7b02ab05043eace1cd4bab07351ff23d2a4e78dbd9a20582886d
MD5 23159d300ca8beb290be72f3f6155107
BLAKE2b-256 a52522592c6ae8d684d937b4126dbd72a37723dcf71e67b27e53d06f75ff3b1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page