Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Linting

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- develop
- main

jobs:
build:
name: Linting
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Super-linter
uses: super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: /
MARKDOWN_CONFIG_FILE: '.markdownlint.json'
VALIDATE_CHECKOV: false
VALIDATE_JSCPD: false
VALIDATE_KOTLIN: false
VALIDATE_JSON_PRETTIER: false
VALIDATE_MARKDOWN_PRETTIER: false
VALIDATE_YAML_PRETTIER: false

- name: Set up JDK
uses: actions/[email protected]
with:
distribution: zulu
java-version: 21
cache: gradle
- run: ./gradlew lint
- name: Lint Foundation module
uses: yutailang0119/action-android-lint@v4
with:
report-path: foundation/build/reports/*.xml
- name: Lint Components module
uses: yutailang0119/action-android-lint@v4
with:
report-path: components/build/reports/*.xml
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"no-duplicate-heading": {
"siblings_only": true
}
}
24 changes: 14 additions & 10 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -126,7 +126,11 @@ For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org

[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

[Mozilla CoC]: https://github.com/mozilla/diversity

[FAQ]: https://www.contributor-covenant.org/faq

[translations]: https://www.contributor-covenant.org/translations
172 changes: 107 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Contributing to Android Jetpack Compose Library

Thank you for considering contributing to our Android Jetpack Compose Library project. Your contributions help make this project better for everyone.
Thank you for considering contributing to our Android Jetpack Compose Library
project. Your contributions help make this project better for everyone.

## Table of Contents

1. [Code of Conduct](#code-of-conduct)
2. [How to Contribute](#how-to-contribute)
3. [Reporting Issues](#reporting-issues)
Expand All @@ -15,138 +17,178 @@ Thank you for considering contributing to our Android Jetpack Compose Library pr
10. [Creating ADRs](#creating-adrs)

## Code of Conduct
This project adheres to a [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report any unacceptable behavior to [[email protected]](mailto:[email protected]).

This project adheres to a [Code of Conduct](./CODE_OF_CONDUCT.md). By
participating, you are expected to uphold this code. Please report any
unacceptable behavior
to [[email protected]](mailto:[email protected]).

## How to Contribute

### Reporting Issues
If you find a bug or have a feature request, please open an issue in the [issue tracker](https://github.com/your-repo/compose-library/issues). Be sure to include:
- A descriptive title.
- A detailed explanation of the issue or request.
- Steps to reproduce the issue (if applicable).
- Any relevant screenshots or logs.

If you find a bug or have a feature request, please open an issue in
the [issue tracker](https://github.com/your-repo/compose-library/issues). Be
sure to include:

* A descriptive title.
* A detailed explanation of the issue or request.
* Steps to reproduce the issue (if applicable).
* Any relevant screenshots or logs.

### Pull Requests
We welcome your pull requests! To ensure a smooth process, please follow these steps:

We welcome your pull requests! To ensure a smooth process, please follow these
steps:

1. **Fork the Repository:**
- Create your own copy of the repository by clicking the `Fork` button on GitHub.
* Create your own copy of the repository by clicking the `Fork` button on
GitHub.

2. **Clone the Forked Repository:**
- `git clone https://github.com/your-username/compose-library.git`
* `git clone https://github.com/your-username/compose-library.git`

3. **Create a New Branch:**
- `git checkout -b feature/your-feature-name`
* `git checkout -b feature/your-feature-name`

4. **Make Your Changes:**
- Develop your feature or fix on the new branch. Ensure that you follow the [coding standards](#coding-standards).
* Develop your feature or fix on the new branch. Ensure that you follow
the [coding standards](#coding-standards).

5. **Commit Your Changes:**
- Use clear and concise commit messages.
- `git commit -m "Add a concise and descriptive commit message"`
* Use clear and concise commit messages.
* `git commit -m "Add a concise and descriptive commit message"`

6. **Push Your Changes:**
- `git push origin feature/your-feature-name`
* `git push origin feature/your-feature-name`

7. **Submit a Pull Request:**
- Go to the original repository and click `New pull request`.
- Provide a detailed description of your changes.
- Link to any relevant issues or ADRs if applicable.
* Go to the original repository and click `New pull request`.
* Provide a detailed description of your changes.
* Link to any relevant issues or ADRs if applicable.

## Development Setup

Follow these steps to set up your development environment:

1. **Clone the Repository:**
- `git clone https://github.com/your-repo/compose-library.git`
* `git clone https://github.com/your-repo/compose-library.git`

2. **Navigate to the Project Directory:**
- `cd compose-library`
* `cd compose-library`

3. **Open the Project in Android Studio:**
- Open the project folder in Android Studio:
- File > Open... and select the cloned repository folder.
* Open the project folder in Android Studio:
* File > Open... and select the cloned repository folder.

4. **Sync Project with Gradle Files:**
- Android Studio should automatically resolve and fetch dependencies when you open the project.
* Android Studio should automatically resolve and fetch dependencies when
you open the project.

5. **Run Tests:**
- Ensure all tests pass by selecting `Run > Run...` and choosing the test configuration.
* Ensure all tests pass by selecting `Run > Run...` and choosing the test
configuration.

## Coding Standards

Please adhere to the following coding standards to ensure consistency:

- Follow the Kotlin Coding Conventions.
- Follow Markdown and YAML style guides:
- Markdown: Follow the [Markdown Guide](https://www.markdownguide.org/basic-syntax/).
- YAML: Adhere to typical YAML syntax and style rules.
* Follow the Kotlin Coding Conventions.
* Follow Markdown and YAML style guides:
* Markdown: Follow
the [Markdown Guide](https://www.markdownguide.org/basic-syntax/).
* YAML: Adhere to typical YAML syntax and style rules.

## Code Quality
To maintain high code quality, we use the following linters and tools in our CI/CD pipeline. Please ensure your code adheres to these standards before submitting a pull request:

To maintain high code quality, we use the following linters and tools in our
CI/CD pipeline. Please ensure your code adheres to these standards before
submitting a pull request:

1. **Android Lint:**
- Android Lint checks the code for potential bugs, stylistic errors, and other issues.
- You can run Android Lint manually using the following command:
```sh
./gradlew lint
```
* Android Lint checks the code for potential bugs, stylistic errors, and
other issues.
* You can run Android Lint manually using the following command:

```sh
./gradlew lint
```

2. **Markdown Lint:**
- Linting for Markdown can be done using `markdownlint-cli`:
```sh
npm install -g markdownlint-cli
markdownlint '**/*.md'
```
* Linting for Markdown can be done using `markdownlint-cli`:

```sh
npm install -g markdownlint-cli
markdownlint '**/*.md'
```

3. **YAML Lint:**
- Linting for YAML files can be done using `yamllint`:
```sh
brew install yamllint
yamllint .
```
* Linting for YAML files can be done using `yamllint`:

```sh
brew install yamllint
yamllint .
```

### CI/CD Integration
Our CI/CD pipeline will automatically run these linters on every pull request to ensure code quality. Here is a summary of the checks performed:

- **Android Lint:** Ensures Android code adheres to style and quality guidelines.
- **Markdown Lint:** Checks Markdown files for style and syntax correctness.
- **YAML Lint:** Checks YAML files for syntax errors and style issues.
Our CI/CD pipeline will automatically run these linters on every pull request to
ensure code quality. Here is a summary of the checks performed:

* **Android Lint:** Ensures Android code adheres to style and quality
guidelines.
* **Markdown Lint:** Checks Markdown files for style and syntax correctness.
* **YAML Lint:** Checks YAML files for syntax errors and style issues.

Make sure your code passes these checks before opening a pull request.

## Documentation

Good documentation helps others understand your code. Please:

- Update the `DEVELOPMENT.md` file if your changes affect the development process.
- Ensure your code is well-commented, especially for complex logic.
- Update or create relevant ADRs in the `docs/adr` directory.
* Update the `DEVELOPMENT.md` file if your changes affect the development
process.
* Ensure your code is well-commented, especially for complex logic.
* Update or create relevant ADRs in the `docs/adr` directory.

## Running Tests

To run the test suite:

1. **Open the Project in Android Studio:**
- Open the project folder in Android Studio.
* Open the project folder in Android Studio.

2. **Run Tests:**
- Run the test suite by selecting `Run > Run Tests` or by using the command:
```sh
./gradlew testDebugUnitTest
./gradlew connectedAndroidTest
```
* Run the test suite by selecting `Run > Run Tests` or by using the command:

```sh
./gradlew testDebugUnitTest
./gradlew connectedAndroidTest
```

Ensure that all tests pass before submitting your pull request.

## Creating ADRs
Architecture Decision Records (ADRs) document significant architectural decisions made during the project. When you need to record an architectural decision, follow these steps:

Architecture Decision Records (ADRs) document significant architectural
decisions made during the project. When you need to record an architectural
decision, follow these steps:

1. **Create an ADR Document:**
- ADRs should be created in the `docs/adr` directory.
- Use the template provided in `docs/adr-xx-Template.md`.
* ADRs should be created in the `docs/adr` directory.
* Use the template provided in `docs/adr-xx-Template.md`.

2. **Document the Decision:**
- Follow the structure in the template.
* Follow the structure in the template.

3. **Review and Approval:**
- Submit the ADR for review by creating a pull request.
- The ADR must be approved by the Maintainers/Codeowners before it is merged. This ensures that all architectural decisions are aligned with the project's overall strategy.
* Submit the ADR for review by creating a pull request.
* The ADR must be approved by the Maintainers/Codeowners before it is
merged. This ensures that all architectural decisions are aligned with the
project's overall strategy.

## Thank You

## Thank You!
Thank you for contributing to the Android Jetpack Compose Library project. Your efforts help improve the project for everyone. We appreciate your time and dedication!
Thank you for contributing to the Android Jetpack Compose Library project. Your
efforts help improve the project for everyone. We appreciate your time and
dedication!
Loading