zhangshenghang opened a new pull request, #2519:
URL: https://github.com/apache/hertzbeat/pull/2519

   ## What's changed?
   
   #2518
   
   Support Markdown file formatting
   
   Formatting can be done via `spotless apply`
   
![image](https://github.com/user-attachments/assets/ff4629d3-d26b-4af5-8888-40b88b8606ea)
   
   At the same time, if it does not meet the specifications during compilation, 
it will be detected
   
   effect:
   
![image](https://github.com/user-attachments/assets/8be5dff2-a63e-4df9-994b-d36586254c67)
   
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   
   
   @tomsun28 Implemented through the following configuration,
   
   ```xml
   <plugin>
                   <groupId>com.diffplug.spotless</groupId>
                   <artifactId>spotless-maven-plugin</artifactId>
                   <version>2.40.0</version>
                   <configuration>
                       <skip>false</skip>
                       <markdown>
                           <includes>
                               <include>home/docs/**/*.md</include>
                           </includes>
                           <flexmark />
                           <replaceRegex>
                               <name>Markdown Formatter</name>
                               
<searchRegex>(^-*\n$)([\s\S]*?)(-+$)</searchRegex>
                               <replacement>---$2---</replacement>
                           </replaceRegex>
                       </markdown>
                       <upToDateChecking>
                           <enabled>true</enabled>
                       </upToDateChecking>
                   </configuration>
                   <executions>
                       <execution>
                           <id>spotless-check</id>
                           <goals>
                               <goal>check</goal>
                           </goals>
                           <phase>validate</phase>
                       </execution>
                   </executions>
               </plugin>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to