https://github.com/jotsr/freecad_name_conv_checker
The simple and flexible FreeCAD name convention checker
https://github.com/jotsr/freecad_name_conv_checker
api cli conventions deno freecad jsr typescript utils
Last synced: 3 months ago
JSON representation
The simple and flexible FreeCAD name convention checker
- Host: GitHub
- URL: https://github.com/jotsr/freecad_name_conv_checker
- Owner: JOTSR
- License: mit
- Created: 2024-03-19T14:32:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T09:29:21.000Z (over 2 years ago)
- Last Synced: 2025-10-30T19:55:43.697Z (8 months ago)
- Topics: api, cli, conventions, deno, freecad, jsr, typescript, utils
- Language: TypeScript
- Homepage:
- Size: 247 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
📋FCNC✔️
The simple and flexible FreeCAD name convention checker
[](https://jsr.io/@jotsr/fcnc)
[](https://jsr.io/@jotsr/fcnc)



`fcnc` tool allows you to check your custom name convention of your
[FreeCAD](https://www.freecad.org/) models (based on
[fcinfo](https://github.com/FreeCAD/FreeCAD/blob/main/src/Tools/fcinfo) output).
## Basic usage
### Requirements
- [fcinfo](https://github.com/FreeCAD/FreeCAD/blob/main/src/Tools/fcinfo) for
extracting informations from `FreeCAD` files.
- [python3](https://www.python.org/downloads/) for running `fcinfo`.
- [deno](https://deno.land) only for contributing or for installation-less use.
### CLI
- Get help:
```sh
fcnc --help
```
- Get command help:
```sh
fcnc --help
```
- Check constraints:
```sh
# Run fcinfo
./fcinfo my_freecad_model.FCStd > any_file.fcinfo
# Check name convention
fcnc check my_constraints.ts any_file.fcinfo or*globs?.fcinfo
```
### API
Available on [jsr:@jotsr/fcnc](https://jsr.io/@jotsr/fcnc).
```ts
import { type Constraint } from 'jsr:@jotsr/fcnc'
const snakeCaseLabel = /[a-z][a-z0-9_]*[a-z0-9]/
const fileLabel: Constraint = {
//Type of constraint
kind: 'file:label',
//Pattern to match ($fields refers to custom regexp)
pattern: '$label.$type',
//All "$" fields need to be defined
fields: {
//Array of regexp to match against (order matter)
label: [snakeCaseLabel],
type: [/part/, /assembly/],
},
}
//name convention file should export array of constraints as default export
export default [fileLabel]
```
### [Documentation](#doc)
## Installation
### From [deno](https://deno.land)
Without install
```sh
deno run --allow-read=your-dir jsr:@jotsr/fcnc
```
With install
```sh
deno install --allow-read --allow-net=api.github.com -rf jsr:@jotsr/fcnc
```
[Deno permissions](https://docs.deno.com/runtime/manual/basics/permissions)
explanations
- `--allow-read` to read input files.
- `--allow-net=api.github.com` to upgrade the cli.
### From binaries
```sh
# Linux
curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-unknown-linux-gnu.gz
curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-aarch64-unknown-linux-gnu.gz
# macOS
curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-apple-darwin.gz
curl -fsSLo fcnc https://github.com/JOTSR/release/download/$VERSION/fcnc-aarch64-apple-darwin.gz
# Windows
curl -fsSLo fcnc.exe https://github.com/JOTSR/release/download/$VERSION/fcnc-x86_64-pc-windows-msvc.exe.gz
```
## Doc
### CLI
- `fcnc --help`.
- Some [examples](./examples).
### API
Available on [jsr:@jotsr/fcnc](https://jsr.io/@jotsr/fcnc/doc).
## Contributing
Any kind of contribution is welcomed. Please read
[contributing guidelines](./CONTRIBUTING.md) before and respect
[contributor covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
### For local development:
**Required dependencies**:
- [`deno`](https://deno.land) To run project (code, ci, ...).
**Before first commit or after editing [`./deno.json`](./deno.json)**:
- Run `deno task hooks:install`.
**Using VSCode**:
- Pre-configured workspace available in
[`fcnc.code-workspace`](./fcnc.code-workspace).
- Or without local tooling install use [`.devcontainer`](./.devcontainer).