{"id":49832905,"url":"https://github.com/navidnabavi/styl","last_synced_at":"2026-05-29T19:00:41.858Z","repository":{"id":357082750,"uuid":"1234948788","full_name":"navidnabavi/styl","owner":"navidnabavi","description":"A fast, opinionated linter, validator, and formatter for Mapbox GL and MapLibre GL style JSON files.","archived":false,"fork":false,"pushed_at":"2026-05-22T01:22:35.000Z","size":196,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T09:44:01.567Z","etag":null,"topics":["cli","formatter","geojson","geospatial","gis","linter","map-style","mapbox","maplibre","rust","validator"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navidnabavi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T21:05:37.000Z","updated_at":"2026-05-22T01:22:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/navidnabavi/styl","commit_stats":null,"previous_names":["navidnabavi/styl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/navidnabavi/styl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidnabavi%2Fstyl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidnabavi%2Fstyl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidnabavi%2Fstyl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidnabavi%2Fstyl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navidnabavi","download_url":"https://codeload.github.com/navidnabavi/styl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navidnabavi%2Fstyl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33666290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","formatter","geojson","geospatial","gis","linter","map-style","mapbox","maplibre","rust","validator"],"created_at":"2026-05-13T22:00:31.107Z","updated_at":"2026-05-29T19:00:41.844Z","avatar_url":"https://github.com/navidnabavi.png","language":"Rust","funding_links":[],"categories":["Utility Libraries","Applications / Command line tools"],"sub_categories":["JavaScript"],"readme":"# styl\n\n**Linter, validator, and formatter for MapLibre GL / Mapbox GL style JSON.**  \nCatch spec violations, enforce best practices, and keep style files consistent — in CI or locally.\n\n![styl overview](assets/overview.svg)\n\n[![CI](https://github.com/navidnabavi/styl/actions/workflows/rust.yml/badge.svg)](https://github.com/navidnabavi/styl/actions/workflows/rust.yml)\n[![Rust](https://img.shields.io/badge/rust-2021_edition-orange.svg)](https://www.rust-lang.org)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![MapLibre Spec v8](https://img.shields.io/badge/MapLibre_spec-v8-green.svg)](https://maplibre.org/maplibre-style-spec/)\n\n---\n\n## Why styl?\n\nGL style JSON files grow fast. A single typo in a source reference silently breaks tiles. An invisible layer left in production wastes render time. Legacy filter syntax slips through code review unnoticed.\n\n`styl` is the `cargo clippy` for your map styles — runs in milliseconds, integrates with CI, and tells you exactly what is wrong and why.\n\n```\n$ styl check style.json\n\nwarning[W002] layers[9].layout.visibility: layer \"Building\" is permanently invisible\n  --\u003e style.json\n  hint: remove the layer or set visibility to \"visible\" if it should be shown\n\nwarning[W011] layers[3].filter: layer \"Landuse\" uses deprecated legacy filter syntax\n  --\u003e style.json\n  hint: migrate to expression-based filters: https://maplibre.org/maplibre-style-spec/expressions/\n\nerror[E003] sources.roads: vector source missing required field \"url\" or \"tiles\"\n  --\u003e style.json\n```\n\n---\n\n## Features\n\n| Feature | Description |\n|---|---|\n| **Validator** | Spec violations: missing fields, invalid values, broken source refs (E-codes) |\n| **Linter** | Best-practice warnings: duplicate IDs, invisible layers, legacy filters, perf anti-patterns (W-codes) |\n| **Formatter** | Canonical key ordering with `--check` mode for CI enforcement |\n| **Multiple output formats** | Human-readable, JSON (for tooling), GitHub Actions annotations |\n| **Config file** | Per-project `.stylrc` — per-rule severity overrides, indent settings |\n| **Stdin support** | `cat style.json \\| styl check --stdin` — pipe-friendly |\n\n---\n\n## Installation\n\n### Homebrew (macOS / Linux)\n\n```bash\nbrew tap navidnabavi/tap\nbrew install styl\n```\n\n### One-line installer\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/navidnabavi/styl/main/install.sh | bash\n```\n\nDetects your OS and architecture, downloads the correct binary, installs to `/usr/local/bin`.\n\n### Cargo (requires Rust)\n\n```bash\ncargo install --git https://github.com/navidnabavi/styl\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/navidnabavi/styl\ncd styl\ncargo build --release\n# binary at: target/release/styl\n```\n\n---\n\n## Usage\n\n```bash\nstyl check style.json                     # validate + lint (most common)\nstyl validate style.json                  # spec violations only (E-codes)\nstyl lint style.json                      # best-practice warnings only (W-codes)\nstyl fmt style.json                       # format in-place\nstyl fmt --check style.json               # CI: exit 1 if formatting would change\nstyl check --format json style.json       # machine-readable output\nstyl check --format github style.json     # GitHub Actions annotations\ncat style.json | styl check --stdin       # read from stdin\n```\n\n### Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Clean — no diagnostics |\n| `1` | Diagnostics found (errors or warnings) |\n| `2` | Tool error (bad JSON, I/O failure) |\n\n### CI Integration\n\n**GitHub Action (Recommended):**\n\n```yaml\n- uses: navidnabavi/styl@v0.0.4\n  with:\n    style_file: style.json\n```\n\n**Advanced usage:**\n\n```yaml\n- uses: navidnabavi/styl@latest\n  with:\n    style_file: style.json\n    command: check       # check (default), validate, lint, fmt\n    format: github       # github (default), human, json, html\n    version: v0.0.4      # pin styl version (optional)\n```\n\n\n**Pre-commit hook:**\n```bash\nstyl fmt --check style.json \u0026\u0026 styl check style.json\n```\n\n---\n\n## Configuration\n\nDrop a `.stylrc` at your project root:\n\n```toml\n[rules]\nW002 = \"error\"   # invisible layers → hard error\nW003 = \"off\"     # unused layers → silence\nW011 = \"warn\"    # legacy filters → warn (default)\n\n[format]\nindent = 4\n```\n\n`styl` walks up the directory tree to find it automatically.\n\n---\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [CLI Reference](docs/cli.md) | All subcommands and flags |\n| [Validators](docs/validators.md) | E-code spec violations |\n| [Linter Rules](docs/linter.md) | W-code best-practice warnings |\n| [Expressions](docs/expressions.md) | Supported expression operators |\n| [Formatter](docs/formatter.md) | Key ordering and `--check` mode |\n| [Configuration](docs/config.md) | `.stylrc` reference |\n| [Layer Properties](docs/layer-properties.md) | Valid paint/layout props per layer type |\n\n---\n\n## Supported Specs\n\n- **MapLibre GL Style Spec v8** (default) — [maplibre.org/maplibre-style-spec](https://maplibre.org/maplibre-style-spec/)\n- **Mapbox GL Style Spec v8** — pass `--spec mapbox`\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). New validators and linter rules are welcome — the architecture makes adding them straightforward.\n\n```bash\ncargo build \u0026\u0026 cargo test \u0026\u0026 cargo clippy -- -D warnings \u0026\u0026 cargo fmt --check\n```\n\nAll four must pass before opening a PR.\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavidnabavi%2Fstyl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavidnabavi%2Fstyl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavidnabavi%2Fstyl/lists"}