Skip to content

Commit

Permalink
docs: Move formatting section to CONTRIBUTING.md, add Sonar build badge
Browse files Browse the repository at this point in the history
  • Loading branch information
epochcoder committed Jan 15, 2025
1 parent 48242f5 commit 4b2dbb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ Please use [the mailing list](https://groups.google.com/group/mybatis-user) inst
- It is a good idea to discuss your changes on [the mailing list](https://groups.google.com/group/mybatis-user) to get feedback from the community.
- If you have a patch with unit tests, send a pull request. Please see the [Contributing code](CONTRIBUTING.md#contributing-code) section.


## Improving documentation

- Documentations are placed under [src/site](https://github.com/mybatis/mybatis-3/tree/master/src/site) directory in [the xdoc format](https://maven.apache.org/doxia/references/xdoc-format.html), so it is basically the same as creating a patch to contribute documentation changes. Please see the [Contributing code](CONTRIBUTING.md#contributing-code) section.

## Contributing code

### Formatting

Mybatis-core is now being auto formatted. Given nature of some code logic with mybatis, it is more appropriate to force a formatting structure manually for snippets such as sql statements. To do so, add following blocks around code.

- ```// @formatter:off``` to start the block of unformatted code
- ```// @formatter:on``` to end the block of unformatted code

If comment sections need same behaviour such as javadocs, note that the entire block must be around entire comment as direct usage does not properly indicate that formatter treats it all as one comment block regardless.

### Copyright and License

- You are the author of your contributions and will always be.
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MyBatis SQL Mapper Framework for Java

[![build](https://github.com/mybatis/mybatis-3/actions/workflows/ci.yaml/badge.svg)](https://github.com/mybatis/mybatis-3/actions?query=workflow%3A%22Java+CI%22)
[![Coverage Status](https://coveralls.io/repos/mybatis/mybatis-3/badge.svg?branch=master&service=github)](https://coveralls.io/github/mybatis/mybatis-3?branch=master)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mybatis_mybatis-3&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=mybatis_mybatis-3)
[![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.mybatis/mybatis.svg)](https://oss.sonatype.org/content/repositories/snapshots/org/mybatis/mybatis/)
[![License](https://img.shields.io/:license-apache-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
Expand All @@ -25,12 +26,7 @@ Essentials
Contributions
-------------

Mybatis-core is now being auto formatted. Given nature of some code logic with mybatis, it is more appropriate to force a formatting structure manually for snippets such as sql statements. To do so, add following blocks around code.

- ```// @formatter:off``` to start the block of unformatted code
- ```// @formatter:on``` to end the block of unformatted code

If comment sections need same behaviour such as javadocs, note that the entire block must be around entire comment as direct usage does not properly indicate that formatter treats it all as one comment block regardless.
See [here](CONTRIBUTING.md)

Tests
-----
Expand Down

0 comments on commit 4b2dbb0

Please sign in to comment.