From b74610efb4f8e7e5aadcd61b5d34fea1e46142c7 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Wed, 20 Mar 2024 07:29:29 -0700 Subject: [PATCH] senzing-factory/build-resources#69 add linting (#18) --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ------------------- .../ISSUE_TEMPLATE/documentation_request.md | 26 ------------- .github/ISSUE_TEMPLATE/feature_request.md | 17 --------- .../add-dependabot-request-to-project.yaml | 26 ------------- .../workflows/add-labels-standardized.yaml | 2 +- .../add-to-project-g2-python-dependabot.yaml | 23 +++++++++++ .../workflows/add-to-project-g2-python.yaml | 25 ++++++------ .github/workflows/add-to-project2.yaml | 26 ------------- .github/workflows/lint-workflows.yaml | 17 +++++++++ .../workflows/move-pr-to-done-dependabot.yaml | 12 ++++++ .github/workflows/pylint.yaml | 15 +++++--- .pylintrc | 2 +- PULL_REQUEST_TEMPLATE.md | 13 ------- README.md | 4 -- 14 files changed, 76 insertions(+), 170 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/documentation_request.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/workflows/add-dependabot-request-to-project.yaml create mode 100644 .github/workflows/add-to-project-g2-python-dependabot.yaml delete mode 100644 .github/workflows/add-to-project2.yaml create mode 100644 .github/workflows/lint-workflows.yaml create mode 100644 .github/workflows/move-pr-to-done-dependabot.yaml delete mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index d3a80d7..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - -- OS: [e.g. iOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] - -**Smartphone (please complete the following information):** - -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/documentation_request.md b/.github/ISSUE_TEMPLATE/documentation_request.md deleted file mode 100644 index c18a3fa..0000000 --- a/.github/ISSUE_TEMPLATE/documentation_request.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: Documentation request -about: Identify an area for improvement in documentation - ---- - -**What is the URL of the documentation?** - -- **Example:** https://github.com/Senzing/template-docker#external-database - - *Note:* This URL includes the web page and the section of the documentation. - -**What can be improved?** - -A clear and concise description of what can be improved. -Examples: - -- "I don't understand where the ${XYZ} variable is set." -- "There seems to be a step missing between 'X' and 'Z'. I don't know how to get to 'Z'." -- "When I run `command sub-command ...` I get the following error:" -- "I don't know what is meant by 'gerble barb gazoink` in the instructions". - -**Additional context** - -Add any other context or screenshots to help describe the documentation improvement. -If you think the documentation improvement is operating system specific, -please indicate which operating system is being used. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 066b2d9..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/add-dependabot-request-to-project.yaml b/.github/workflows/add-dependabot-request-to-project.yaml deleted file mode 100644 index 1801052..0000000 --- a/.github/workflows/add-dependabot-request-to-project.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Based on -# - https://github.com/srggrs/assign-one-project-github-action - -name: Add dependabot pull requests to project - -on: - pull_request: - types: - - opened - - reopened - -env: - GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }} - CREATOR: ${{ github.event.pull_request.user.login }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - steps: - - name: Assign pull request to project - env: - BOOL: ${{ contains( env.CREATOR, 'dependabot' ) }} - uses: Senzing/github-action-add-issue-to-project@main - if: ${{ env.BOOL == 'true' }} - with: - project: 'https://github.com/orgs/Senzing/projects/9' diff --git a/.github/workflows/add-labels-standardized.yaml b/.github/workflows/add-labels-standardized.yaml index c20a712..1360a67 100644 --- a/.github/workflows/add-labels-standardized.yaml +++ b/.github/workflows/add-labels-standardized.yaml @@ -1,4 +1,4 @@ -name: 'add labels standardized' +name: add labels standardized on: issues: diff --git a/.github/workflows/add-to-project-g2-python-dependabot.yaml b/.github/workflows/add-to-project-g2-python-dependabot.yaml new file mode 100644 index 0000000..c94d033 --- /dev/null +++ b/.github/workflows/add-to-project-g2-python-dependabot.yaml @@ -0,0 +1,23 @@ +name: add to project community dependabot + +on: + pull_request: + branches: [main] + +env: + CREATOR: ${{ github.event.pull_request.user.login }} + GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }} + +jobs: + add-to-project-dependabot: + name: add issue to Senzing Community project + runs-on: ubuntu-latest + + steps: + - name: assign issue to project + env: + BOOL: ${{ contains( env.CREATOR, 'dependabot' ) }} + if: ${{ env.BOOL == 'true' }} + uses: senzing-factory/github-action-add-issue-to-project@v1 + with: + project: "https://github.com/orgs/Senzing/projects/${{ vars.SENZING_PROJECT_G2_PYTHON }}" diff --git a/.github/workflows/add-to-project-g2-python.yaml b/.github/workflows/add-to-project-g2-python.yaml index 3b3e1ce..a44fdc1 100644 --- a/.github/workflows/add-to-project-g2-python.yaml +++ b/.github/workflows/add-to-project-g2-python.yaml @@ -1,22 +1,21 @@ -# Based on -# - https://github.com/srggrs/assign-one-project-github-action - -name: Auto Assign issue to project +name: add to project community on: issues: types: - - reopened - opened -env: - GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }} + - reopened jobs: - assign_one_project: + add-to-project: + name: add issue to project runs-on: ubuntu-latest + steps: - - name: Assign issues to project - uses: Senzing/github-action-add-issue-to-project@main - with: - project: 'https://github.com/orgs/Senzing/projects/8' - column_name: 'Backlog' + - name: assign issue to project + env: + GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }} + uses: senzing-factory/github-action-add-issue-to-project@v1 + with: + project: "https://github.com/orgs/Senzing/projects/${{ vars.SENZING_PROJECT_G2_PYTHON }}" + column_name: "Backlog" diff --git a/.github/workflows/add-to-project2.yaml b/.github/workflows/add-to-project2.yaml deleted file mode 100644 index 5ca66cc..0000000 --- a/.github/workflows/add-to-project2.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Based on -# - https://github.com/srggrs/assign-one-project-github-action - -name: Auto Assign issue to Project - -on: - issues: - types: - - reopened - - opened -env: - GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }} - REPO_URL: ${{ github.event.repository.url}} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - steps: - - name: Assign issues in repo with topics to repositories - uses: Senzing/github-action-add-issue-to-project@1.0.0 - with: - project1: 'https://github.com/orgs/Senzing/projects/8' - project2: 'https://github.com/orgs/Senzing/projects/9' - topic1: 't-g2-python' - topic2: 't-gdev' - column_name: 'Backlog' diff --git a/.github/workflows/lint-workflows.yaml b/.github/workflows/lint-workflows.yaml new file mode 100644 index 0000000..1bcd936 --- /dev/null +++ b/.github/workflows/lint-workflows.yaml @@ -0,0 +1,17 @@ +name: lint workflows + +on: + push: + branches-ignore: [main] + pull_request: + branches: [main] + +permissions: + contents: read + packages: read + pull-requests: read + statuses: write + +jobs: + lint-workflows: + uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v1 diff --git a/.github/workflows/move-pr-to-done-dependabot.yaml b/.github/workflows/move-pr-to-done-dependabot.yaml new file mode 100644 index 0000000..582a1b0 --- /dev/null +++ b/.github/workflows/move-pr-to-done-dependabot.yaml @@ -0,0 +1,12 @@ +name: move pr to done dependabot + +on: + pull_request: + branches: [main] + types: [closed] + +jobs: + move-pr-to-done-dependabot: + secrets: + SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }} + uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done.yaml@v1 diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml index d3f42fb..1c8a249 100644 --- a/.github/workflows/pylint.yaml +++ b/.github/workflows/pylint.yaml @@ -1,23 +1,28 @@ -name: Pylint +name: pylint on: [push] jobs: - build: + pylint: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.8", "3.9", "3.10"] + steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + + - name: set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + + - name: install dependencies run: | python -m pip install --upgrade pip pip install pylint - - name: Analysing the code with pylint + + - name: analysing the code with pylint run: | + # shellcheck disable=SC2046 pylint $(git ls-files '*.py') diff --git a/.pylintrc b/.pylintrc index 760ad8e..d5f564c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,7 +11,7 @@ disable= missing-function-docstring, missing-module-docstring, multiple-statements, - no-self-use, + no-member, redefined-outer-name, too-many-branches, trailing-newlines, diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 0b11a2f..0000000 --- a/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,13 +0,0 @@ -# Pull request questions - -## Which issue does this address - -Issue number: #nnn - -## Why was change needed - -??? - -## What does change improve - -??? diff --git a/README.md b/README.md index 38ab268..a717149 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,3 @@ SSN. UPINs were assigned to physicians as well as certain non-physician practiti *Note: The Downloadable Database does not contain SSNs or EINs. Therefore, verification of specific individuals or entities through the use of the SSN or EIN must be done via the Online Searchable Database.* - - - -