Skip to content

Commit 70da435

Browse files
committed
update: refactoring code
1 parent 410bb3c commit 70da435

File tree

27 files changed

+264
-150
lines changed

27 files changed

+264
-150
lines changed

.github/workflows/android-ci-generated-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
on:
1111
# Triggers the workflow on push or pull request events but only for default and protected branches
1212
workflow_dispatch:
13-
# The workflow will be dispatched to the default queue
13+
# The workflow will be dispatched to the default queue
1414

1515
jobs:
1616
build:

.github/workflows/android-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
branches: [ master ]
1616

1717
workflow_dispatch:
18-
# The workflow will be dispatched to the default queue
18+
# The workflow will be dispatched to the default queue
1919

2020
jobs:
2121
build:

.github/workflows/detekt-analysis.yml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
pull_request:
2020
branches: [ master ]
2121
schedule:
22-
- cron: '27 4 * * 1'
22+
- cron: '27 4 * * 1'
2323

2424
# Allows you to run this workflow manually from the Actions tab
2525
workflow_dispatch:
@@ -39,65 +39,65 @@ jobs:
3939

4040
# Steps represent a sequence of tasks that will be executed as part of the job
4141
steps:
42-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
43-
- uses: actions/checkout@v2
42+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
43+
- uses: actions/checkout@v2
4444

45-
# Gets the download URL associated with the $DETEKT_RELEASE_TAG
46-
- name: Get Detekt download URL
47-
id: detekt_info
48-
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: |
51-
DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query='
52-
query getReleaseAssetDownloadUrl($tagName: String!) {
53-
repository(name: "detekt", owner: "detekt") {
54-
release(tagName: $tagName) {
55-
releaseAssets(name: "detekt", first: 1) {
56-
nodes {
57-
downloadUrl
45+
# Gets the download URL associated with the $DETEKT_RELEASE_TAG
46+
- name: Get Detekt download URL
47+
id: detekt_info
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
DETEKT_DOWNLOAD_URL=$( gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query='
52+
query getReleaseAssetDownloadUrl($tagName: String!) {
53+
repository(name: "detekt", owner: "detekt") {
54+
release(tagName: $tagName) {
55+
releaseAssets(name: "detekt", first: 1) {
56+
nodes {
57+
downloadUrl
58+
}
5859
}
5960
}
6061
}
6162
}
62-
}
63-
' | \
64-
jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' )
65-
echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL"
63+
' | \
64+
jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' )
65+
echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL"
6666
67-
# Sets up the detekt cli
68-
- name: Setup Detekt
69-
run: |
70-
dest=$( mktemp -d )
71-
curl --request GET \
72-
--url ${{ steps.detekt_info.outputs.download_url }} \
73-
--silent \
74-
--location \
75-
--output $dest/detekt
76-
chmod a+x $dest/detekt
77-
echo $dest >> $GITHUB_PATH
67+
# Sets up the detekt cli
68+
- name: Setup Detekt
69+
run: |
70+
dest=$( mktemp -d )
71+
curl --request GET \
72+
--url ${{ steps.detekt_info.outputs.download_url }} \
73+
--silent \
74+
--location \
75+
--output $dest/detekt
76+
chmod a+x $dest/detekt
77+
echo $dest >> $GITHUB_PATH
7878
79-
# Performs static analysis using Detekt
80-
- name: Run Detekt
81-
continue-on-error: true
82-
run: |
83-
detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
79+
# Performs static analysis using Detekt
80+
- name: Run Detekt
81+
continue-on-error: true
82+
run: |
83+
detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
8484
85-
# Modifies the SARIF output produced by Detekt so that absolute URIs are relative
86-
# This is so we can easily map results onto their source files
87-
# This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA
88-
- name: Make artifact location URIs relative
89-
continue-on-error: true
90-
run: |
91-
echo "$(
92-
jq \
93-
--arg github_workspace ${{ github.workspace }} \
94-
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
95-
${{ github.workspace }}/detekt.sarif.json
96-
)" > ${{ github.workspace }}/detekt.sarif.json
85+
# Modifies the SARIF output produced by Detekt so that absolute URIs are relative
86+
# This is so we can easily map results onto their source files
87+
# This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA
88+
- name: Make artifact location URIs relative
89+
continue-on-error: true
90+
run: |
91+
echo "$(
92+
jq \
93+
--arg github_workspace ${{ github.workspace }} \
94+
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
95+
${{ github.workspace }}/detekt.sarif.json
96+
)" > ${{ github.workspace }}/detekt.sarif.json
9797
98-
# Uploads results to GitHub repository using the upload-sarif action
99-
- uses: github/codeql-action/upload-sarif@v1
100-
with:
101-
# Path to SARIF file relative to the root of the repository
102-
sarif_file: ${{ github.workspace }}/detekt.sarif.json
103-
checkout_path: ${{ github.workspace }}
98+
# Uploads results to GitHub repository using the upload-sarif action
99+
- uses: github/codeql-action/upload-sarif@v1
100+
with:
101+
# Path to SARIF file relative to the root of the repository
102+
sarif_file: ${{ github.workspace }}/detekt.sarif.json
103+
checkout_path: ${{ github.workspace }}

CODE_OF_CONDUCT.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## Our Pledge
44

5-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
6+
pledge to making participation in our project and our community a harassment-free experience for
7+
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
8+
of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
69

710
## Our Standards
811

@@ -19,28 +22,45 @@ Examples of unacceptable behavior by participants include:
1922
* The use of sexualized language or imagery and unwelcome sexual attention or advances
2023
* Trolling, insulting/derogatory comments, and personal or political attacks
2124
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
25+
* Publishing others' private information, such as a physical or electronic address, without explicit
26+
permission
2327
* Other conduct which could reasonably be considered inappropriate in a professional setting
2428

2529
## Our Responsibilities
2630

27-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
31+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
32+
expected to take appropriate and fair corrective action in response to any instances of unacceptable
33+
behavior.
2834

29-
Project maintainers 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
35+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
36+
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
37+
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
38+
threatening, offensive, or harmful.
3039

3140
## Scope
3241

33-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
42+
This Code of Conduct applies both within project spaces and in public spaces when an individual is
43+
representing the project or its community. Examples of representing a project or community include
44+
using an official project e-mail address, posting via an official social media account, or acting as
45+
an appointed representative at an online or offline event. Representation of a project may be
46+
further defined and clarified by project maintainers.
3447

3548
## Enforcement
3649

37-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
50+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
51+
the project team at [email protected]. The project team will review and investigate all
52+
complaints, and will respond in a way that it deems appropriate to the circumstances. The project
53+
team is obligated to maintain confidentiality with regard to the reporter of an incident. Further
54+
details of specific enforcement policies may be posted separately.
3855

39-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
56+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
57+
temporary or permanent repercussions as determined by other members of the project's leadership.
4058

4159
## Attribution
4260

43-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
61+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
62+
at [http://contributor-covenant.org/version/1/4][version]
4463

4564
[homepage]: http://contributor-covenant.org
65+
4666
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)