thehardwarestore.ai

where AI agents shop for the right tools

── 99129 repos indexed ── | filtered by tag: formatter
prettier/prettier ★ 52321 5035 APPLICATION

Prettier is an opinionated code formatter that acts as both a CLI tool and a programmable library. It parses source code into an AST (using a variety of language-specific parsers such as @babel/parser, typescript-eslint, flow-parser, postcss, markdown-it, etc.), converts the AST into a custom Document IR (intermediate representation) composed of primitive formatting commands (group, indent, line, fill, etc.), and then prints the Document IR into a formatted string. The architecture is modular: each supported language (JavaScript, TypeScript, Flow, CSS, HTML, Markdown, YAML, JSON, GraphQL, Handlebars) is defined by a 'language plugin' that provides parsers, printers, and additional options. The core formatting algorithm is language-agnostic and operates solely on the Document IR. Key entry points are the CLI (bin/prettier.cjs) and the JavaScript API (src/index.js). The system also supports a standalone browser build, configuration via .prettierrc files, editorconfig integration, and a rich plugin system for adding custom parsers or printers. External dependencies include numerous parser libraries and utilities for config loading. The codebase is exceptionally well-crafted, with a clean separation of concerns, a highly reusable document IR design, extensive test coverage, and a long history of active maintenance.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
psf/black ★ 41865 2907 APPLICATION

Black is the uncompromising Python code formatter. It is a CLI tool that automatically reformats Python source code to a consistent style, with a focus on determinism and minimal configuration. The repository contains the core formatting engine, a HTTP server (blackd) for on-demand formatting, a GitHub Action for CI integration, and a Vim plugin. The architecture is modular: parsing uses a forked lib2to3 parser (blib2to3) for lenient syntax handling, then a visitor-based line generator produces formatted lines, with specialized transformers for strings, brackets, and comments. It supports Jupyter notebooks, line-range formatting, caching, and parallel execution. The codebase is exceptionally well-tested with hundreds of edge-case test files and a comprehensive test suite. It demonstrates high craftsmanship in areas like tree manipulation, concurrency patterns, and string normalization.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
mvdan/sh ★ 9130 457 APPLICATION

mvdan/sh is a comprehensive Go library and CLI toolchain for parsing, formatting, and interpreting shell scripts. It supports POSIX Shell, Bash, mksh, Zsh (experimental), and Bats dialects. The architecture is modular: the `syntax` package provides a lexer, parser, AST, pretty-printer, and simplifier; the `interp` package implements a shell interpreter with extensible handler middleware; the `expand` package handles parameter, arithmetic, brace, and glob expansion; and the `pattern` package converts shell patterns to regular expressions. Two CLI tools are built on top: `shfmt` (a shell formatter with EditorConfig support, JSON AST output, and minification) and `gosh` (a proof-of-concept interactive shell). The library is designed for embedding shell execution in Go programs, with platform-specific support for Unix, Windows, and js/wasm. The codebase is exceptionally well-tested, with thousands of table-driven tests, fuzz testing, and conformance checks against real shells (bash, dash, mksh, zsh). It demonstrates high craftsmanship in parser design, error recovery, streaming APIs, and middleware patterns. The project is actively maintained with regular releases and a clear v4 roadmap.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
sirupsen/logrus ★ 25761 2296 APPLICATION

Logrus is a structured logging library for Go, providing a flexible and performant alternative to the standard library logger. It offers a clean architecture based on three core interfaces: Logger (configuration and output), Entry (log event with fields), Formatter (output formatting), and Hook (level-based callbacks). The library supports multiple output formats (text/logfmt with optional ANSI colors, JSON), customizable field maps, caller reporting, and a buffer pool for reduced allocation overhead. It includes built-in hooks for syslog, slog (Go's standard logging API), and a test hook for capturing log entries in tests. The package-level exported logger provides a simple global API, while custom Logger instances allow independent configuration. External dependencies are minimal, relying only on the standard library and a small set of well-maintained packages (testify for testing, sys for terminal detection). The codebase is in maintenance mode, focusing on stability, performance, and interoperability with Go's log/slog ecosystem.

RATING: 9.3/10 MAINT: maintained DRIFT: low
▸ 5 reusable components found
ProvableHQ/leo ★ 4821 715 APPLICATION

This repository is the official compiler and toolchain for the Leo programming language, a statically-typed language for writing private zero-knowledge applications on the Aleo blockchain. The codebase implements a full compilation pipeline from Leo source to Aleo bytecode, including parsing (with a lossless rowan-based parser), type checking, static analysis, multiple optimization passes (constant propagation, loop unrolling, dead code elimination, common subexpression elimination, SSA formation, function inlining, flattening, destructuring, storage lowering, option lowering, peephole optimization), and code generation targeting snarkVM. Beyond the compiler, it provides a complete development environment: a CLI with commands for building, testing, deploying, executing, and querying the Aleo network; a Language Server Protocol (LSP) implementation with diagnostics, goto-definition, references, rename, and semantic tokens; a standalone formatter; a package manager supporting local, git, network, and workspace dependencies with lock files; and an ABI generation and compatibility checker. The architecture is a multi-crate Rust workspace with clear separation of concerns, extensive test coverage (unit, integration, and expectation-based compiler tests), and CI/CD pipelines. The codebase demonstrates high craftsmanship with reusable patterns such as a generic directed graph with cycle detection, a canonicalization trait for structural equality, an intern-based type system, and a pass-based compiler architecture.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
eslint-stylistic/eslint-stylistic ★ 1988 165 APPLICATION

This repository is a pnpm monorepo for @stylistic/eslint-plugin, a community-maintained ESLint plugin that provides formatting and stylistic rules for JavaScript, TypeScript, JSX, and related syntaxes. It ports formatting rules that were deprecated or removed from ESLint core and typescript-eslint, giving users a drop-in path to continue enforcing style conventions. The main deliverable is an npm library consumed through ESLint flat config; there is no server, database, or runtime application. The plugin exposes roughly a hundred rules, each with typed options, autofix support, parser-specific test coverage, and generated metadata and type declarations.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
hhatto/autopep8 ★ 4660 284 APPLICATION

autopep8 is a production-grade Python code formatter that automatically modifies source code to conform to the PEP 8 style guide. It operates as both a CLI tool and a library, using pycodestyle to detect violations and applying targeted fixes for most reported error codes (E1xx, E2xx, E3xx, E4xx, E5xx, E7xx, E9xx, and W6xx). The tool supports incremental formatting, aggressive mode, configuration file inheritance (pyproject.toml, setup.cfg, tox.ini, .pep8, .flake8), and integration with pre-commit hooks and editors like Vim. The entire logic is contained in a single monolithic module (autopep8.py), which includes a complex line-wrapping system for long lines, a reindentation engine, and token-based heuristics. The test suite is exceptionally thorough, with fixture-based regression tests and an 'acid test' framework that validates correctness on arbitrary Python files (including live PyPI packages). While the single-file architecture limits modularity, the internal components are well-factored and demonstrate strong engineering practice.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
commerceguys/addressing ★ 969 149 APPLICATION

This is a PHP 8.0+ library for postal address manipulation, formatting, validation, and localization (i18n). It provides immutable address value objects (Address, AddressInterface), formatters for display and postal labels, validators (Symfony constraints), and repositories for countries, address formats, and subdivisions. The library bundles extensive static JSON data derived from CLDR (country names in 150+ locales) and Google's Address Data Service (address formats for 200+ countries, subdivisions for 62 countries). Key architectural patterns include the repository pattern for data loading, lazy-loaded subdivision collections, type-safe enumerations via AbstractEnum, and PSR-7-style immutable mutators. It is designed as a standalone Composer package with optional Symfony Validator integration, and is used in Drupal and Symfony applications. The code is well-structured, uses modern PHP features, and has solid test coverage.

RATING: 8.7/10 MAINT: maintained DRIFT: low
▸ 2 reusable components found
Rhymond/go-money ★ 1911 162 APPLICATION

This is a Go library implementing the Money pattern for representing monetary values in a currency's smallest unit (e.g., cents). It provides precise arithmetic operations (addition, subtraction, multiplication, rounding), allocation and splitting of amounts without floating-point rounding errors, and formatting to human-readable strings with currency symbols and separators. The library includes a comprehensive set of ISO 4217 currency definitions, supports JSON serialization/deserialization with customizable marshal/unmarshal functions, and integrates with database/sql via Scanner and Valuer interfaces for storing monetary values in relational databases. It has no external dependencies beyond the Go standard library, making it lightweight and easy to embed. The architecture is a simple library with clear separation of concerns: a calculator for arithmetic, a formatter for display, a currency registry, and the core Money struct that composes these components.

RATING: 8.4/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
nix-community/vscode-nix-ide ★ 517 42 APPLICATION

This VS Code extension provides comprehensive Nix language support including syntax highlighting via a custom TextMate grammar, formatting via external tools (nixfmt, alejandra, etc.), linting via nix-instantiate, and a language server client supporting nil and nixd. It uses a clean architecture with separate modules for the language client, formatter, linter, and process execution. The extension activates on Nix files and falls back to local formatting/linting when no LSP is enabled. The codebase demonstrates good software engineering practices with TypeScript, unit tests, and continuous integration, though it is tightly coupled to the VS Code extension API and Nix toolchain, limiting reuse outside its domain. The most reusable component is the process-runner module, which encapsulates external command execution with error handling in a workspace-aware manner.

RATING: 7.2/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: