https://github.com/atiq-cs/codeformatter
Formats code to a consistent style for competitive programming solutions
https://github.com/atiq-cs/codeformatter
c-sharp code-prettify formatting net-core
Last synced: 3 months ago
JSON representation
Formats code to a consistent style for competitive programming solutions
- Host: GitHub
- URL: https://github.com/atiq-cs/codeformatter
- Owner: atiq-cs
- License: gpl-3.0
- Created: 2018-10-05T22:20:59.000Z (over 7 years ago)
- Default Branch: dev
- Last Pushed: 2025-04-02T02:37:06.000Z (about 1 year ago)
- Last Synced: 2025-07-22T19:45:16.220Z (11 months ago)
- Topics: c-sharp, code-prettify, formatting, net-core
- Language: C#
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Code Formatter
Formats source code to a consistent style that I follow for my competitive programming solution
source files.
Following actions are automatically applied on the source file,
- Tab replacement
- Indentation Fix (both inside/outside comment)
- Comment style fixing
Additionally, it supports simulation or `noop`.
Here's an example input file,
/***************************************************************************
* Problem Name: Palindromic Substrings
* Problem URL : https://leetcode.com/problems/palindromic-substrings/
* Date : Oct 17 2017
* Complexity : O(n^3) Time, O(n) space
* Author : Atiq Rahman
* Status : Accepted
* Notes : Track palandrome for each index
* meta : tag-dp, tag-string, tag-leetcode-easy
***************************************************************************/
After formatting it looks like,
/***************************************************************************************************
* Title : Palindromic Substrings
* URL : https://leetcode.com/problems/palindromic-substrings/
* Date : 2017-10-17
* Comp : O(n^3) Time, O(n) space
* Author: Atiq Rahman
* Status: Accepted
* Notes : Track palandrome for each index
* meta : tag-dp, tag-string, tag-leetcode-easy
***************************************************************************************************/
As we can see above it,
- changes max column wrap to 100,
- formats date
- Changes Key Value (on left side each line before :) to shorter format.
For More information on this software please have a look at the
[wiki](https://github.com/atiq-cs/CodeFormatter/wiki/Design-Requirements)
Example from old `Properties\launchSettings.json`,
```
"commandLineArgs": " --path D:\\Code\\PSolving\\general-solving \\leetcode\\0162_find-peak-element.cs--simulate"
```