dapper 1.4.6 copy "dapper: ^1.4.6" to clipboard
dapper: ^1.4.6 copied to clipboard

A simple Markdown and YAML formatter for Dart, inspired by Prettier.

1.4.6 #

Fixed #

  • Fix _parseOptionsMap hardcoding default values instead of using FormatOptions.defaults.copyWith().
  • Fix num variable shadowing built-in num type in ordered list formatting.
  • Fix stdout leaking into test output from run_test.dart.

Changed #

  • Cache RegExp objects at module level in text_utils.dart and yaml_formatter.dart to avoid recompilation per call.
  • Use Set literal instead of List for inline tag lookup in _isInline and YAML reserved word check in _needsQuoting.
  • Simplify dart:io imports in dapper_cli.dart from two overlapping imports to a single hide clause.
  • Simplify _resolveOptions to use FormatOptions.defaults.copyWith().
  • Remove dead methods: _printListItem, _printTableSection, _printTableRow, _printTableCell.
  • Consolidate table-related switch cases (thead, tbody, tr, th, td) into a single shared case.
  • Extract YAML reserved words to a top-level const Set for _needsQuoting.
  • Hide internal basename function from public API via show clause on lib/bin.dart export.
  • Clean up development comments and normalize code style (var for type-inferred locals).
  • Add library; declarations and doc comments to all lib/bin/ files for consistency.
  • Add description line to yaml_formatter.dart library doc comment.
  • Add doc comments to ExitCode, OutputMode, and ProcessResult enum values.

Added #

  • Add countTrailingNewlines to shared text_utils.dart, replacing duplicated implementations in markdown and YAML formatters.
  • Add ulStyle to Option Applicability table in options.dart doc comment.
  • Add file_system.dart to AGENTS.md architecture diagram.
  • Add tests for ConfigLoader: non-existent directory, camelCase options, ul_style shorthands, invalid config, missing dapper block, string integer parsing.
  • Add tests for FormatOptions: ulStyle defaults, copyWith(ulStyle:), UnorderedListStyle enum, toString with ulStyle.
  • Add tests for countTrailingNewlines in text_utils_test.dart.

1.4.5 #

Fixed #

  • Fix inline images losing title attribute when rendered inside paragraphs or list items (e.g., ![alt](src "title")).
  • Fix redundant O(n) key lookup per entry in YAML map formatting.
  • Fix hardcoded 4-space checkbox continuation indent to use actual prefix length.

Changed #

  • Remove unused normalization functions from normalizer.dart (normalizeEmphasis, normalizeHorizontalRule, normalizeUnorderedListMarker, orderedListContentIndent, normalizeCodeFence) — these were superseded by AST-based formatting.
  • Remove unused utility functions from text_utils.dart (displayWidth, indent, repeat, trimTrailingWhitespace).

Added #

  • Add idempotency integration tests for Markdown and YAML formatting.
  • Add integration test for inline image title attribute in list items.

1.4.4 #

Refactored #

  • Internal: Refactored CLI entrypoint (bin/dapper.dart) to follow best practices:
    • Added POSIX-compliant shebang (#!/usr/bin/env dart).
    • Replaced unsafe exit() calls with exitCode setter.
    • Added top-level error handling.
    • Extracted execution logic to dapper.run() in lib/bin/dapper_cli.dart.

1.4.3 #

Fixed #

  • Fix broken indentation and layout when formatting loose lists (lists with blank lines).

1.4.2 #

Fixed #

  • Preserve blank lines after HTML comments in Markdown formatting

1.4.1 #

Fixed #

  • Fix space accumulation on blank lines in nested code blocks.

Added #

  • Added strict-casts, strict-inference, and strict-raw-types to analysis_options.yaml for stronger type safety.
  • Added additional defensive linter rules: avoid_catching_errors, cancel_subscriptions, close_sinks, directives_ordering, no_adjacent_strings_in_list, only_throw_errors, prefer_const_constructors_in_immutables, sort_constructors_first, test_types_in_equals, unnecessary_statements, use_super_parameters.
  • Added prefer_relative_imports to linter rules.
  • Add execution time and file statistics to CLI output.

Changed #

  • Refactor: Use relative imports in lib/bin/ to improve code organization.
  • Fix: Add explicit type arguments to Future and Iterable in tests to satisfy strict mode.

1.4.0 #

Changed #

  • Internal: Remove dead code in Markdown printer related to checkbox list items.
  • Internal: Remove duplicate _ensureTrailingNewline in YAML formatter, reuse text_utils.dart.
  • Internal: Clean up development notes and verbose comments in code.
  • Internal: Move CLI modules from bin/src/ to lib/bin/ for coverage and reusability.
  • Internal: Split test/cli_test.dart into test/bin/ for better organization.

Added #

  • Add FileSystem abstraction in lib/bin/ for testability (100% coverage).
  • Add lib/bin.dart exporting CLI utilities (DapperCli, ConfigLoader, IgnoreRules).
  • Add AGENTS.md for AI agent design guidelines.

1.3.7 #

Fixed #

  • Fix unnecessary newline insertion after list items containing code blocks.
  • Fix data loss when formatting checkbox list items with block content (e.g., code blocks).
  • Fix data loss and incorrect structure when formatting nested blockquotes.
  • Fix whitespace handling in paragraphs to ensure proper trimming, especially within blockquotes.

1.3.6 #

Changed #

  • Ignored *-lock.yaml files by default to prevent formatting auto-generated files.

Fixed #

  • Fixed incorrect escaping of backslashes and quotes in double-quoted and single-quoted YAML strings.

1.3.5 #

Fixed #

  • Fixed an issue where Markdown headers stripped inline formatting (e.g. "## code").

1.3.4 #

Fixed #

  • Fix YAML block scalars (| and >) being converted to double-quoted strings (e.g., in GitHub Actions workflows)

1.3.3 #

Fixed #

  • Fix path-based ignore patterns (e.g., ios/Pods, sub/ignored) not working in nested directories

Added #

  • Add comprehensive CLI tests for ignore pattern handling

1.3.2 #

Fixed #

  • Fix .gitignore directory patterns (trailing /) not being recognized

Changed #

  • Refactor CLI code structure for better maintainability

1.3.1 #

Changed #

  • Change default Markdown unordered list style in the CLI from - (dash) to * (asterisk).

1.3.0 #

Changed #

  • Change default Markdown unordered list style from - (dash) to * (asterisk) to match Prettier's default behavior.

1.2.0 #

Added #

  • Add .dapperignore and .gitignore support for excluding files and directories
    • Glob pattern matching (e.g., *.generated.md)
    • Negation patterns to override defaults (e.g., !build)
    • Nested ignore file support (child directories inherit parent rules)

1.1.1 #

Fixed #

  • Fix extra blank lines being inserted between nested list items

1.1.0 #

Fixed #

  • Add missing executables section to enable dart pub global activate dapper to work correctly
  • Add .pubignore to reduce package size

1.0.4 #

Changed #

  • Remove unused code

1.0.3 #

Added #

  • Add interactive demo page with GitHub Pages support

1.0.2 #

Fixed #

  • Fix bug where nested list items were rendered on the same line instead of new lines

1.0.1 #

Fixed #

  • Normalize extra whitespace in list items (* Item* Item)
  • Normalize extra whitespace in headings (# Title# Title)
  • Normalize extra whitespace in blockquotes (> Text> Text)

Changed #

  • Improved integration tests for messy input handling
  • Updated example to demonstrate whitespace normalization

1.0.0 #

Initial release of Dapper * A simple Markdown and YAML formatter for Dart.

Features #

Markdown Formatting

  • Emphasis normalization (*text*_text_)
  • List formatting with proper alignment (ordered and unordered)
  • Configurable list bullet style (-, *, +)
  • Code block preservation
  • Table formatting with column alignment
  • Prose wrapping (always, never, preserve)
  • Definition list support
  • Front matter preservation
  • Setext to ATX heading conversion
  • Deep nesting support

YAML Formatting

  • Consistent, configurable indentation (default 2 spaces)
  • Map and list formatting
  • Nested structure support
  • Automatic string quoting for special values
  • Comment preservation (inline and block)

CLI

  • Format files in place (-o write)
  • Preview output (-o show)
  • JSON output (-o json)
  • CI check mode (-o none --set-exit-if-changed)
  • Recursive directory processing
  • Configurable print width and prose wrap

Configuration

  • dapper.yaml configuration file support
  • analysis_options.yaml integration
  • CLI arguments override file configuration
0
likes
160
points
2.12k
downloads

Publisher

verified publisherkoji-1009.com

Weekly Downloads

A simple Markdown and YAML formatter for Dart, inspired by Prettier.

Repository (GitHub)
View/report issues

Topics

#formatter #markdown #yaml #cli

Documentation

API reference

License

MIT (license)

Dependencies

args, glob, markdown, yaml

More

Packages that depend on dapper