All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.13.0 - 2025-11-24
-
Sorting: Complete overhaul with list-based configuration system
THE GOLDEN RULE: If it's not in the TOML, it doesn't affect sorting.
Every sort decision can now be traced back to an ordered list in the configuration file. No more regex patterns for utility groups - everything is explicit and predictable.
New configuration structure:
component_orderdefines comparison priority:["variant", "prefix", "direction", "size", "value", "color", "shade", "alpha"]variantslist for variant ordering (breakpoints, states, pseudo-elements)prefixeslist for utility prefix ordering (layout, spacing, typography, etc.)directionslist for directional modifiers (x, y, t, r, b, l, etc.)sizeslist for size modifiers (xs, sm, md, lg, xl, etc.)numericslist for spacing/sizing values (0, 1, 2, 4, 8, etc.)colorslist for color orderingshadeslist for color shade ordering (50-950)alphaslist for opacity values
Sorting behavior:
- Non-Tailwind classes sort first (preserves external library classes)
- No-direction utilities sort before directional variants (
border-1beforeborder-t-1) - Base utilities sort before modified variants (
blurbeforeblur-sm) - Variants support prefix matching (
min-[320px]:matchesminin variants list)
Configuration improvements:
- Grouped
flex/inline-flexandgrid/inline-gridtogether - Added missing utilities:
text-wrap,text-pretty,underline,uppercase,italic, etc. - Added
inset-x,inset-yfor positioning - Added
grid-flow-row,grid-flow-col,grid-flow-densevariants - Added
min/maxto variants for arbitrary breakpoint support - Removed duplicate
contententry - Removed mutually exclusive values (border styles,
auto,none) - they don't need ordering since you can't have bothborder-solidandborder-dashed
Benefits:
- Fully declarative - every ordering decision is visible in the TOML
- Predictable - no hidden regex magic
- Extensible - add new utilities by adding to the appropriate list
- Debuggable - trace any sort order to a specific list position
-
Performance: Optimized sorting hot path for ~45% faster execution
- Added
slots=TruetoParsedClassdataclass for reduced memory and faster attribute access - Replaced dict construction with if/elif chain in
_component_rank()(called 6x per class) - Moved
_MAX_RANKconstant to module level to avoid repeated allocation - Changed list comprehension to generator expression in diff output
Benchmark results (median of 10 pytest runs):
Before After Improvement 1.81s 0.99s 45% faster - Added
-
Colors: Colors and custom_colors are now merged and sorted alphabetically
- Custom colors integrate naturally with built-in colors (e.g.,
brandsorts betweenblueandcurrent) - Removed unused
all_colorsset from configuration
- Custom colors integrate naturally with built-in colors (e.g.,
0.12.0 - 2025-11-23
-
Configuration: Added "?" to default
skip_expressionsfor JavaScript ternary operator support- Prevents sorting of class attributes containing ternary expressions (e.g.,
condition ? "class-a" : "class-b") - Updated documentation in README.md, example.tailwhip.toml, and configuration.toml
- Updated dtest expectations to reflect new default
- Prevents sorting of class attributes containing ternary expressions (e.g.,
-
CI/CD: GitHub Actions workflow for automated documentation deployment
- Added
.github/workflows/deploy-docs.ymlfor generating and deploying documentation - Uses Microdocs to convert README.md and CHANGELOG.md into HTML documentation site
- Automatically deploys to GitHub Pages on push to main branch
- Includes comprehensive inline documentation explaining each workflow step
- Manual workflow dispatch option available from Actions tab
- Added
- Documentation: Updated documentation URL in
pyproject.tomlto point to GitHub Pages- Changed from GitHub README link to
https://barttc.github.io/tailwhip/ - Provides users with a dedicated documentation site instead of raw markdown
- Changed from GitHub README link to
0.11.0 - 2025-11-12
- Pre-commit Integration: Git pre-commit hook support for automatic class sorting
- Added
.pre-commit-hooks.yamlfor seamless pre-commit integration - Users can reference tailwhip directly:
repo: https://github.com/bartTC/tailwhip - Automatically sorts Tailwind classes in HTML and CSS files before each commit
- Documentation includes setup instructions and customization examples
- Added
pre-committo dev dependencies
- Added
-
CLI Output: Simplified output messaging for better usability
- Removed verbose flag hints from normal output (cluttered default experience)
- Moved dry run warning and completion message to verbose mode only
- Cleaner default output focuses on essential information
-
Documentation: Added usage examples to CLI help text
- Examples demonstrate common workflows: single files, multiple files, directories
- Shows write mode, verbose diff preview, and stdin/stdout usage
- Improves discoverability of key features for new users
-
Testing: Added test coverage for stdin behavior when no input is provided
- New test
test_no_stdin_and_no_filesverifies proper error handling - Ensures clean exit with appropriate error message (no traceback)
- New test
0.10.1 - 2025-11-07
- Reliability: Fixed crash when no
pyproject.tomlis found in current or parent directories
0.10.0 - 2025-11-06
- Editor Integration: STDIN/STDOUT filter mode for text editor integrations
- Tailwhip now reads from stdin and writes to stdout when no file paths are provided
- Enables direct integration with Vim/Neovim (
:%!tailwhip), Emacs, VSCode, and other editors - No configuration or file I/O needed - just pipe text through tailwhip
- Added comprehensive test suite in
test_stdin.pywith 4 test cases - Updated documentation with editor integration examples for Vim, VSCode, and Emacs
-
Documentation: Added additional project metadata URLs to
pyproject.toml- Added direct link to project documentation (README.md)
- Added direct link to changelog (CHANGELOG.md)
- Added direct link to bug tracker (GitHub Issues)
-
Refactoring: Moved
all_colorscomputation to configuration module- Added
all_colorsattribute toTailwhipConfigclass - Computed once during pattern recompilation instead of on every sort
- Simplified function signatures by removing
all_colorsparameter passing is_color_utility()andsort_key()now useconfig.all_colorsdirectly
- Added
-
Testing: Simplified test suite for better maintainability
- Removed redundant integration tests (
test_kitchen_sink_example,test_css_apply_advanced) - Added focused
test_deduplicationtest for duplicate class handling - Updated test documentation to reflect current coverage
- Removed redundant integration tests (
0.9.4 - 2025-11-05
- Development: Claude Code project configuration
- Added PROJECT.md with development workflow guidelines
- Added slash commands:
/release,/changelogand/verify - Configured hooks to enforce workflow: tests → linting → changelog
- Automated reminders after code changes to ensure quality standards
- Shared settings in
settings.jsonfor all contributors - Added
.claude/settings.local.jsonto.gitignorefor personal overrides
-
Performance: File processing now starts immediately when scanning large directories
- Removed eager materialization of file list in
apply_changes() - Files are now processed as they are discovered by the generator
- Significantly reduces startup delay for large codebases
- Removed eager materialization of file list in
-
Reliability: Added 60-second timeout to file processing
- Prevents indefinite hangs when processing files
as_completed()now uses timeout parameter inapply_changes()
-
Documentation: Restructured comments in configuration arrays
- All comments in
utility_groupsandvariant_groupsnow consistently appear above their patterns - Clear separation between major groups with blank lines
- Improved readability and maintainability of configuration structure
- All comments in
0.9.3 - 2025-01-04
- Sorting: Position utilities (top, right, bottom, left) now sort clockwise
- Split combined positioning pattern into separate utility groups
- Order: top → right → bottom → left (clockwise direction)
0.9.2 - 2025-01-04
- Configuration: Removed "primary" from default
custom_colorslist- The default config should not include example custom colors
- Users should add their own custom colors as needed
- Tests: Added tests for custom pattern configuration
test_custom_pattern_from_pyproject: Tests custom patterns viapyproject.tomltest_custom_pattern_from_config_file: Tests custom patterns via custom config file- Both tests verify JSX
classNamepattern as example of extensibility - Ensures all patterns (HTML, CSS, custom) work correctly together
- Demonstrates correct TOML syntax for both configuration methods
- Documentation: Clarified that
class_patternsreplace (not extend) defaults- Updated README.md with explicit warning about replacement behavior
- Updated configuration.toml with IMPORTANT note about preserving defaults
- Updated example.tailwhip.toml with complete example showing default patterns
- Added JSX example showing how to include defaults when adding custom patterns
0.9.1 - 2025-01-04
-
CI/CD: GitHub Actions workflow for linting
- Runs ruff check to verify code quality
- Runs ruff format check to ensure consistent code formatting
- Added ruff to dev dependencies
-
Documentation: PyPI version badge in README
-
Pattern System: Extensible pattern matching for multiple syntaxes
- New
class_patternsconfiguration with regex and template support - Built-in support for HTML
classand CSS@apply - Users can add custom patterns for JSX, Vue, Svelte, and other frameworks
- All patterns use consistent
(?P<classes>...)named group requirement - Template-based reconstruction using named groups from regex matches
- New
-
Configuration: Updated
example.tailwhip.tomlwith comprehensive documentation- Aligned structure and descriptions with main
configuration.toml - Added clearer usage examples for common customization scenarios
- Improved comments and organization for better user guidance
- Aligned structure and descriptions with main
-
Architecture: Unified pattern processing system
- Replaced separate
class_regexandapply_regexwithclass_patternslist - Single
process_pattern()function handles all syntax types - New
Patterndataclass for compiled regex patterns - Compiled patterns stored in
config.APPLY_PATTERNS
- Replaced separate
- Deprecated Functions: Removed
process_html()andprocess_css()- All functionality now available through
process_text() - Tests updated to use unified
process_text()function
- All functionality now available through
0.9 - 2025-11-04
-
CI/CD: GitHub Actions workflow for automated testing
- Python matrix testing across versions 3.11, 3.12, 3.13, and 3.14
- Runs on push and pull requests to main branch
- Uses uv for fast dependency management
-
Documentation Enhancements
- CI/CD status badge in README
- Python version support badge
- MIT license badge
- Direct link to CHANGELOG.md from README
-
Testing Infrastructure
- Comprehensive tests for file writing functionality
- Edge case coverage for file operations
- Coverage configuration with proper exclusions
-
Verbosity Levels: New DIFF mode for showing changes
- Enhanced output options for reviewing modifications
- Better visibility into what will be changed
- Configuration Access: Refactored to use direct attribute access instead of dictionary keys
- Cleaner, more Pythonic API
- Better IDE autocomplete support
- Documentation: Corrected README usage example for
--configurationflag syntax
- Code Cleanup: Removed unused
datatypes.pymodule
0.9b0 - 2025-01-04
-
Configuration System: Complete configuration management with Dynaconf
- Support for
pyproject.tomlvia[tool.tailwhip]section - Support for custom configuration files via
--configurationflag - Clear configuration precedence: defaults < pyproject.toml < custom config < CLI arguments
- Comprehensive configuration documentation in
configuration.tomlwith examples and recommendations
- Support for
-
Configuration Options: New customizable settings
verbosity: Control output detail level (0-3)write_mode: Safe dry-run mode by defaultdefault_globs: Customize file patterns to processskip_expressions: Add template engine syntax to skipcustom_colors: Define custom Tailwind colors from your configutility_groupsandvariant_groups: Fine-tune sorting behavior (advanced)
-
CLI Enhancements
--configuration/-cflag to specify custom config file- Improved help text and error messages
- Configuration validation and error handling
-
Testing Infrastructure
- Comprehensive CLI and configuration precedence tests
- Dynamic test fixtures using temporary directories (no stub files in repo)
- Module docstrings for all test files
- Configuration reset fixture to prevent test pollution
-
Documentation
- Complete configuration guide in README.md
- Examples for
pyproject.tomland custom config files - Configuration precedence documentation
- Detailed comments in
configuration.toml
-
Configuration Architecture: Migrated from simple constants to Dynaconf-based system
- Centralized configuration in
configuration.py - Dynamic recompilation of regex patterns on config updates
- Type-safe configuration with
TailwhipConfigclass
- Centralized configuration in
-
Unknown Class Sorting: Unknown classes now sort at the front (before matched patterns)
-
Test Files: Tests now use temporary directories instead of static testdata files
- Cleaner repository (no stub files)
- Better test isolation
- Faster test setup
- Handle
UnicodeDecodeErrorwhen reading files - now skips unreadable files gracefully - Configuration value types properly validated and converted
- Test pollution between test runs via autouse reset fixture
- Simplified pyproject.toml retrieval logic
- Refactored constants handling with centralized pattern compilation
- Improved file discovery with generic glob setup
- Better thread context management for parallel processing
- Code organization and type improvements
The initial alpha releases established the core functionality of Tailwhip.
-
Tailwind Class Sorting: Core sorting algorithm based on official Tailwind CSS class ordering
- Utility class grouping (layout, spacing, typography, visual effects, etc.)
- Variant sorting (responsive breakpoints, pseudo-classes, state modifiers)
- Alphabetical sorting within groups
-
Template Engine Support: Automatic detection and skipping of template syntax
- Support for Django, Jinja2, Liquid, ERB, and other templating languages
- Classes with template expressions (
{{ }},{% %},<% %>) are left unchanged
-
File Processing: Batch processing with multiple file types
- HTML and CSS file support
@applydirective sorting in CSS- Glob pattern support for file discovery
-
CLI Interface: Command-line tool with essential options
- Dry-run mode by default (safe preview of changes)
--writeflag to apply changes- Verbosity controls (
-v,-vv,-vvv) --quietmode for minimal output
-
Error Handling: Robust file processing
- Skip unreadable files (Unicode errors)
- Skip nonexistent paths gracefully
- Continue processing on individual file errors
- 0.9a1 - Initial release with core sorting functionality
- 0.9a2 - Bug fixes, improved error handling, and type hint improvements
- 0.9a3 - Enhanced template syntax handling and documentation updates