Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
young146777 committed Sep 12, 2024
0 parents commit 2e53c25
Show file tree
Hide file tree
Showing 74 changed files with 6,049 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 8
ij_smart_tabs = false

[{*.kt,*.kts}]
# https://pinterest.github.io/ktlint/rules/configuration-ktlint/

ktlint_code_style = android_studio

#ktlint_standard = disabled # Disable all rulesg from the `standard` rule set provided by KtLint

# Enable the rules from the `standard` rule set provided by KtLint

# Disable the rules from the 'standard' rule set provided by KtLint
ktlint_standard_discouraged-comment-location = disabled
ktlint_standard_comment-wrapping = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_class-naming = disabled

# trailing_comma rules still have issue.
# https://github.com/pinterest/ktlint/issues/1557
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
# https://github.com/pinterest/ktlint/issues/1733
ktlint_standard_no-semi = disabled

## `Set from...` on the right -> (`Predefined style`) -> `Kotlin style guide` (Kotlin plugin 1.2.20+).
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL

## open `Code Generation` tab
# uncheck `Line comment at first column`;
ij_kotlin_line_comment_at_first_column = false
# select `Add a space at comment start`
ij_kotlin_line_comment_add_space = true

## open `Compose` tab
# select `Enable Compose formatting for Modifiers`
ij_kotlin_use_custom_formatting_for_modifiers = true

## open `Imports tab`
# select `Use single name import` (all of them);
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647

## open `Wrapping and Braces` tab
# change `Keep Maximum Blank Lines` / `In declarations` & `In code` to 1
ij_kotlin_keep_blank_lines_in_declarations = 1
ij_kotlin_keep_blank_lines_in_code = 1
# and `Before '}'` to 0
ij_kotlin_keep_blank_lines_before_right_brace = 0

## open `Wrapping and Braces` tab
# uncheck `Function declaration parameters` / `Align when multiline`.
ij_kotlin_align_multiline_parameters = false

## open `Tabs and Indents` tab
# change `Continuation indent` to the same value as `Indent` (4 by default)
continuation_indent_size = 4
ij_continuation_indent_size = 4

# Other: Insert imports for nested classes -> false
ij_kotlin_import_nested_classes = false
# Import Layout: import all other imports, then import all alias imports
ij_kotlin_imports_layout = *,^

# When these values are set any values, disabled trailing_comma rules are activated
#ij_kotlin_allow_trailing_comma = false
#ij_kotlin_allow_trailing_comma_on_call_site = false

# For Jetpack Compose & Tests
ktlint_function_naming_ignore_when_annotated_with=Composable, Test

[{*.xsl,*.xsd,*.xml}]
ij_continuation_indent_size = 4
ij_xml_use_custom_settings = true
ij_xml_block_comment_at_first_column = true
ij_xml_keep_indents_on_empty_lines = false
ij_xml_line_comment_at_first_column = true

[{*.yml,*.yaml}]
indent_size = 2
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true

[{*.md,*.markdown}]
max_line_length = 99999
trim_trailing_whitespace = false

[*.json]
indent_size = 2
130 changes: 130 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy on non-main branches (true/false)'
required: false
default: 'false'
jobs:
lint:
runs-on: [ self-hosted, macOS ]
steps:
- name: Check out Repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_KEY }}
ssh-strict: false

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
overwrite-settings: false

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Lint with Gradle
run: ./gradlew ktlintCheck

test:
needs: [lint]
runs-on: [ self-hosted, macOS ]
steps:
- name: Check out Repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_KEY }}
ssh-strict: false


- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
overwrite-settings: false

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Lint with Gradle
run: ./gradlew ktlintCheck

build:
needs: [lint, test]
runs-on: [ self-hosted, macOS ]
steps:
- name: Check out Repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_KEY }}
ssh-strict: false

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
overwrite-settings: false

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean assembleRelease

deploy:
needs: [lint, test, build]
runs-on: [ self-hosted, macOS ]
if: ${{ github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') }}
outputs:
gradle-args: ${{ steps.set-args.outputs.gradle-args }}
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_KEY }}
ssh-strict: false

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
overwrite-settings: false

- name: Determine Gradle Arguments
id: set-args
run: |
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
echo "::set-output name=gradle-args::-PsnapshotBuild=false"
else
echo "::set-output name=gradle-args::-PsnapshotBuild=true"
fi
- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew clean assembleRelease

- name: Deploy with Gradle
env:
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publish ${{ steps.set-args.outputs.gradle-args }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
132 changes: 132 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

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,
and learning from the experience
* 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
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,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available 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
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# How to contribute to WebAuthn Kotlin

First of all, thank you so much for taking your time to contribute!
WebAuthn Kotlin is not very different from any other open source projects.
It will be fantastic if you help us by doing any of the following:

- File an issue in [the issue tracker](https://github.com/line/webauthn-kotlin/issues)
to report bugs and propose new features and improvements.
- Ask a question using [the issue tracker](https://github.com/line/webauthn-kotlin/issues).
- Contribute your work by sending [a pull request](https://github.com/line/webauthn-kotlin/pulls).

## Contributor license agreement

When you are sending a pull request and it's a non-trivial change beyond fixing
typos, please sign [the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/webauthn-kotlin).
Please [contact us](mailto:[email protected]) if you need the CCLA
(corporate contributor license agreement).

## Code of conduct

We expect contributors to follow [our code of conduct](./CODE_OF_CONDUCT.md).
Loading

0 comments on commit 2e53c25

Please sign in to comment.