Skip to content

Conversation

@brandbarr
Copy link
Owner

@brandbarr brandbarr commented Sep 3, 2025

  • Added .prettierrc.json configuration for consistent Apex code formatting
    • Standardized indentation across all .cls files to use tabs (4-space width)
    • Configured Prettier with prettier-plugin-apex for proper Apex syntax support

Background

Analysis of the existing codebase revealed mixed indentation patterns across 32 Apex classes:

  • 6,588 lines (73.7%) used tab indentation
  • 2,345 lines (26.3%) used space indentation
  • Several files had inconsistent mixing of both styles

Changes Made

Configuration:

  • printWidth: 120 - Accommodates existing long comment lines
  • useTabs: true - Aligns with majority usage pattern (73.7% of codebase)
  • tabWidth: 4 - Maintains existing 4-character indentation width
  • singleQuote: true - Matches existing string literal style
  • bracketSameLine: false - Preserves existing brace placement
  • Added prettier-plugin-apex for proper Apex language support

Files Standardized:

  • All 32 .cls files now use consistent tab indentation
  • Eliminated mixed indentation within individual files
  • Preserved existing code structure and logic

Testing

  • Verified formatting preserves all existing functionality
  • Confirmed Prettier correctly handles Apex-specific syntax
  • All original spelling/grammar fixes from previous commits maintained

- Updated README.md for better structure and clarity.
- Reformatted JSON and Apex class files for consistent indentation.
- Enhanced documentation in various classes, including fflib_Application and fflib_ISObjectDomain, to improve readability and understanding.
- Fixed minor typos and whitespace issues in test classes and mocks.
@brandbarr brandbarr changed the title Brandbarr/prettier format Implement Prettier Formatting Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants