diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index baca9f24..ac3dd905 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,43 +29,39 @@ jobs: # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/semantic_release.yml b/.github/workflows/semantic_release.yml index 43427ef5..bab540d1 100644 --- a/.github/workflows/semantic_release.yml +++ b/.github/workflows/semantic_release.yml @@ -74,5 +74,5 @@ jobs: - name: Push changes to dev uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: dev + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: dev diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 1944aa52..0d8e0200 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,8 +1,9 @@ +--- name: Mark stale issues and pull requests on: schedule: - - cron: "30 1 * * *" + - cron: "30 1 * * *" jobs: stale: @@ -10,10 +11,34 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'The issue is stale and will be closed shortly.' - stale-pr-message: 'The PR is stale and will be closed shortly.' - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + exempt-issue-labels: 'help-wanted' + exempt-pr-labels: 'help-wanted' + stale-issue-message: 'The issue has received no activity for 60 days and will be closed in a week.' + stale-pr-message: 'The PR has received no activity for 60 days and will be closed in a week.' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 21 + days-before-close: -1 + only-labels: 'feature' + stale-issue-message: >- + This feature request has been labelled as *help wanted* since + there has been no activity in the last 3 weeks. It will not be + closed automatically. + stale-issue-label: 'help-wanted' + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 21 + days-before-close: -1 + only-labels: 'bug' + stale-issue-message: >- + This bug report has been labelled as *help wanted* since + there has been no activity in the last 3 weeks. It will not be + closed automatically. + stale-issue-label: 'help-wanted' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 3fce3e96..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ ci ] - pull_request: - branches: [ ci ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Downloading translations - run: | - docker run -v /tmp/lokalise:/opt/dest lokalise/lokalise-cli-2 lokalise2 --token "${{ secrets.lokalise_token }}" --project-id 465185555eee18dd537ca6.39714580 file download --format json --unzip-to /opt/dest --original-filenames=false --export-sort a_z --placeholder-format icu - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - ls /tmp/lokalise/locale diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..448e0990 --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +extends: default + +rules: + document-start: disable + indentation: + spaces: 2 + truthy: + allowed-values: ['true', 'false', 'on'] + line-length: + max: 120140 diff --git a/custom_components/alexa_media/__init__.py b/custom_components/alexa_media/__init__.py index d62d2c83..8485859e 100644 --- a/custom_components/alexa_media/__init__.py +++ b/custom_components/alexa_media/__init__.py @@ -859,6 +859,7 @@ async def ws_handler(message_obj): ) elif command in [ "PUSH_DELETE_DOPPLER_ACTIVITIES", # delete Alexa history + "PUSH_LIST_CHANGE", # clear a shopping list https://github.com/custom-components/alexa_media_player/issues/1190 "PUSH_LIST_ITEM_CHANGE", # update shopping list "PUSH_CONTENT_FOCUS_CHANGE", # likely prime related refocus "PUSH_DEVICE_SETUP_STATE_CHANGE", # likely device changes mid setup diff --git a/custom_components/alexa_media/alexa_media.py b/custom_components/alexa_media/alexa_media.py index 27da6253..16b9c625 100644 --- a/custom_components/alexa_media/alexa_media.py +++ b/custom_components/alexa_media/alexa_media.py @@ -1,7 +1,7 @@ """ Alexa Devices Base Class. -# SPDX-License-Identifier: Apache-2.0 +SPDX-License-Identifier: Apache-2.0 For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 diff --git a/custom_components/alexa_media/manifest.json b/custom_components/alexa_media/manifest.json index 9da12922..32f4bcc5 100644 --- a/custom_components/alexa_media/manifest.json +++ b/custom_components/alexa_media/manifest.json @@ -7,5 +7,5 @@ "issue_tracker": "https://github.com/custom-components/alexa_media_player/issues", "dependencies": ["persistent_notification", "http"], "codeowners": ["@keatontaylor", "@alandtse"], - "requirements": ["alexapy==1.24.1", "packaging~=20.3", "wrapt~=1.12.1"] + "requirements": ["alexapy==1.24.2", "packaging~=20.3", "wrapt~=1.12.1"] } diff --git a/poetry.lock b/poetry.lock index 5a7fa643..ff1565ed 100644 --- a/poetry.lock +++ b/poetry.lock @@ -967,6 +967,18 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "yamllint" +version = "1.26.0" +description = "A linter for YAML files." +category = "dev" +optional = false +python-versions = ">=3.5.*" + +[package.dependencies] +pathspec = ">=0.5.3" +pyyaml = "*" + [[package]] name = "yarl" version = "1.6.3" @@ -994,7 +1006,7 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "17793cfc86dc40d33db60cbb9e027e7be5e5b46d270eeb8b7f6c41b4484d8db6" +content-hash = "18abf017c30e137574d00a1f2a74a96fec8bc1f38f1b331c5002ecf546bd6467" [metadata.files] aiofiles = [ @@ -1738,6 +1750,10 @@ voluptuous-serialize = [ wrapt = [ {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, ] +yamllint = [ + {file = "yamllint-1.26.0-py2.py3-none-any.whl", hash = "sha256:8a5f8e442f49309eaf3e9d7232ce76f2fc8026f5c0c0b164b83f33fed1399637"}, + {file = "yamllint-1.26.0.tar.gz", hash = "sha256:b0e4c89985c7f5f8451c2eb8c67d804d10ac13a4abe031cbf49bdf3465d01087"}, +] yarl = [ {file = "yarl-1.6.3-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:0355a701b3998dcd832d0dc47cc5dedf3874f966ac7f870e0f3a6788d802d434"}, {file = "yarl-1.6.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:bafb450deef6861815ed579c7a6113a879a6ef58aed4c3a4be54400ae8871478"}, diff --git a/pyproject.toml b/pyproject.toml index 20feddd6..ed195d77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ black = {version = "^20.8b1", allow-prereleases = true} pytest = "^6.2.2" homeassistant = "^2021.2.3" codespell = "^2.0.0" +yamllint = "^1.26.0" [build-system] requires = ["poetry-core>=1.0.0"]