diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6524ff2817..990dabc1d9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. { "name": "Homebrew/brew", - "image": "ghcr.io/homebrew/brew:master", + "image": "ghcr.io/homebrew/brew:main", "workspaceFolder": "/home/linuxbrew/.linuxbrew/Homebrew", "workspaceMount": "source=${localWorkspaceFolder},target=/home/linuxbrew/.linuxbrew/Homebrew,type=bind,consistency=cached", "onCreateCommand": ".devcontainer/on-create-command.sh", diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 3e115fa9b2..5ecd26994f 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -4,7 +4,7 @@ type: "Bug" body: - type: markdown attributes: - value: Please note we will close your issue without comment if you do not correctly fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again. + value: Please note we may close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information (even if you consider them irrelevant). If you are unwilling to use the issue template, we may block you from ever submitting future issues to Homebrew. - type: textarea attributes: render: shell @@ -16,10 +16,10 @@ body: label: Verification description: Please verify that you've followed these steps. If you cannot truthfully check these boxes, open a discussion at https://github.com/orgs/Homebrew/discussions instead. options: - - label: My "`brew doctor` output" above says `Your system is ready to brew.` and am still able to reproduce my issue. - required: true - label: I ran `brew update` twice and am still able to reproduce my issue. required: true + - label: My "`brew doctor` output" above says `Your system is ready to brew` or a definitely unrelated `Tier` message. + required: true - label: This issue's title and/or description do not reference a single formula e.g. `brew install wget`. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead. required: true - type: textarea diff --git a/.github/codeql/extensions/homebrew-actions.yml b/.github/codeql/extensions/homebrew-actions.yml new file mode 100644 index 0000000000..8d4091650b --- /dev/null +++ b/.github/codeql/extensions/homebrew-actions.yml @@ -0,0 +1,7 @@ +# This file is synced from the `.github` repository, do not modify it directly. +extensions: + - addsTo: + pack: codeql/actions-all + extensible: trustedActionsOwnerDataModel + data: + - ["Homebrew"] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 725bc3c373..9c9b936332 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,72 +1,71 @@ +# This file is synced from the `.github` repository, do not modify it directly. +--- version: 2 - -updates: - - package-ecosystem: github-actions - directory: / +multi-ecosystem-groups: + all: schedule: interval: weekly - allow: - - dependency-type: all - # The actions in triage-issues.yml are updated in the Homebrew/.github repo - ignore: - - dependency-name: actions/stale - groups: - artifacts: - patterns: - - actions/*-artifact - open-pull-requests-limit: 10 + day: friday + time: '08:00' + timezone: Etc/UTC +updates: +- package-ecosystem: github-actions + directory: "/" + multi-ecosystem-group: all + patterns: + - "*" + allow: + - dependency-type: all + cooldown: + default-days: 1 + include: + - "*" +- package-ecosystem: bundler + directories: + - "/Library/Homebrew" + multi-ecosystem-group: all + patterns: + - "*" + allow: + - dependency-type: all + cooldown: + default-days: 1 + semver-major-days: 14 + semver-minor-days: 7 + semver-patch-days: 1 + include: + - "*" +- package-ecosystem: docker + directory: "/" + multi-ecosystem-group: all + patterns: + - "*" + allow: + - dependency-type: all +- package-ecosystem: devcontainers + directory: "/" + multi-ecosystem-group: all + patterns: + - "*" + allow: + - dependency-type: all + cooldown: + default-days: 1 + include: + - "*" +- package-ecosystem: pip + directories: + - "/Library/Homebrew/formula-analytics/" + multi-ecosystem-group: all + patterns: + - "*" + allow: + - dependency-type: all + cooldown: + default-days: 1 + semver-major-days: 14 + semver-minor-days: 7 + semver-patch-days: 1 + include: + - "*" - - package-ecosystem: bundler - directory: /Library/Homebrew - schedule: - interval: daily - allow: - - dependency-type: all - groups: - rspec: - patterns: - - "rspec*" - sorbet: - patterns: - - "sorbet*" - open-pull-requests-limit: 10 - - - package-ecosystem: npm - directory: / - schedule: - interval: daily - allow: - - dependency-type: all - open-pull-requests-limit: 10 - - - package-ecosystem: docker - directory: / - schedule: - interval: daily - allow: - - dependency-type: all - open-pull-requests-limit: 10 - - - package-ecosystem: devcontainers - directory: / - schedule: - interval: daily - allow: - - dependency-type: all - open-pull-requests-limit: 10 - - - package-ecosystem: pip - directory: / - schedule: - interval: daily - allow: - - dependency-type: all - open-pull-requests-limit: 10 - - - package-ecosystem: pip - directory: /Library/Homebrew/formula-analytics/ - schedule: - interval: daily - allow: - - dependency-type: all - open-pull-requests-limit: 10 diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index d35fac7a95..c0714936fb 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -1,18 +1,12 @@ -name: actionlint +# This file is synced from the `.github` repository, do not modify it directly. +name: Actionlint on: push: branches: + - main - master pull_request: - paths: - - '.github/workflows/*.ya?ml' - - '.github/actionlint.yaml' - -env: - HOMEBREW_DEVELOPER: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - HOMEBREW_NO_ENV_HINTS: 1 defaults: run: @@ -22,16 +16,25 @@ concurrency: group: "actionlint-${{ github.ref }}" cancel-in-progress: ${{ github.event_name == 'pull_request' }} +env: + HOMEBREW_DEVELOPER: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_ENV_HINTS: 1 + permissions: {} jobs: workflow_syntax: if: github.repository_owner == 'Homebrew' runs-on: ubuntu-latest + permissions: + contents: read + container: + image: ghcr.io/homebrew/ubuntu22.04:main steps: - name: Set up Homebrew id: setup-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -40,31 +43,44 @@ jobs: - name: Install tools run: brew install actionlint shellcheck zizmor - - name: Set up GITHUB_WORKSPACE + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - run: zizmor --format sarif . > results.sarif env: - HOMEBREW_REPOSITORY: ${{ steps.setup-homebrew.outputs.repository-path }} - run: | - # Annotations work only relative to GITHUB_WORKSPACE - (shopt -s dotglob; rm -rf "${GITHUB_WORKSPACE:?}"/*; mv "${HOMEBREW_REPOSITORY:?}"/* "$GITHUB_WORKSPACE") - rmdir "$HOMEBREW_REPOSITORY" - ln -vs "$GITHUB_WORKSPACE" "$HOMEBREW_REPOSITORY" - - echo "::add-matcher::.github/actionlint-matcher.json" - - - run: | - # NOTE: exit code intentionally suppressed here - zizmor --format sarif . > results.sarif || true + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload SARIF file uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + # We can't use the SARIF file when triggered by `merge_group` so we don't upload it. + if: always() && github.event_name != 'merge_group' with: name: results.sarif path: results.sarif + - name: Set up actionlint + run: | + # In homebrew-core, setting `shell: /bin/bash` prevents shellcheck from running on + # those steps, so let's change them to `shell: bash` temporarily for better linting. + sed -i 's|shell: /bin/bash -x|shell: bash -x|' .github/workflows/*.y*ml + + # In homebrew-core, the JSON matcher needs to be accessible to the container host. + cp "$(brew --repository)/.github/actionlint-matcher.json" "$HOME" + + echo "::add-matcher::$HOME/actionlint-matcher.json" + - run: actionlint upload_sarif: needs: workflow_syntax + # We want to always upload this even if `actionlint` failed. + # This is only available on public repositories. + if: > + always() && + !contains(fromJSON('["cancelled", "skipped"]'), needs.workflow_syntax.result) && + !github.event.repository.private && + github.event_name != 'merge_group' runs-on: ubuntu-latest permissions: contents: read @@ -77,7 +93,7 @@ jobs: path: results.sarif - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: sarif_file: results.sarif category: zizmor diff --git a/.github/workflows/autogenerated-files.yml b/.github/workflows/autogenerated-files.yml index 8dfed9e38d..236e57c42a 100644 --- a/.github/workflows/autogenerated-files.yml +++ b/.github/workflows/autogenerated-files.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 939da5f9e7..72f4919cea 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,10 +3,9 @@ name: "CodeQL" on: push: branches: + - main - master pull_request: - branches: - - master defaults: run: @@ -28,7 +27,7 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 with: languages: ruby config: | @@ -36,4 +35,4 @@ jobs: - Library/Homebrew/vendor - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4d8f0dc1cd..8f363bd1ff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,7 @@ on: pull_request: push: branches: + - main - master merge_group: release: @@ -38,8 +39,8 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Fetch origin/master from Git - run: git fetch origin master + - name: Fetch origin/HEAD from Git + run: git fetch origin HEAD - name: Determine build attributes id: attributes @@ -83,12 +84,16 @@ jobs: ) fi elif [[ "${GITHUB_EVENT_NAME}" == "push" && - "${GITHUB_REF}" == "refs/heads/master" && + ("${GITHUB_REF}" == "refs/heads/master" || "${GITHUB_REF}" == "refs/heads/main") && "${version}" == "22.04" ]]; then tags+=( + "ghcr.io/homebrew/brew:main" "ghcr.io/homebrew/brew:master" + "ghcr.io/homebrew/ubuntu${version}:main" "ghcr.io/homebrew/ubuntu${version}:master" + "homebrew/brew:main" "homebrew/brew:master" + "homebrew/ubuntu${version}:main" "homebrew/ubuntu${version}:master" ) fi @@ -160,11 +165,11 @@ jobs: fetch-depth: 0 persist-credentials: false - - name: Fetch origin/master from Git - run: git fetch origin master + - name: Fetch origin/HEAD from Git + run: git fetch origin HEAD - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 with: cache-binary: false @@ -190,7 +195,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image - uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0 + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: context: . load: true @@ -227,7 +232,7 @@ jobs: - name: Deploy the Docker image by digest id: digest if: fromJSON(steps.attributes.outputs.push) - uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0 + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: context: . cache-from: type=registry,ref=ghcr.io/homebrew/ubuntu${{ matrix.version }}:cache @@ -263,7 +268,7 @@ jobs: version: ${{ fromJSON(needs.generate-tags.outputs.matrix) }} steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 with: cache-binary: false diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fbf0b15eab..dbac948702 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -52,7 +52,7 @@ jobs: run: vale docs/ - name: Install Ruby - uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 with: bundler-cache: true working-directory: docs @@ -67,7 +67,13 @@ jobs: - name: Generate formulae.brew.sh API samples if: github.repository == 'Homebrew/formulae.brew.sh' working-directory: docs - run: ../script/generate-api-samples.rb + run: ../script/generate-api-samples.rb --template + + - name: Cache HTML Proofer + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: tmp/.htmlproofer + key: ${{ runner.os }}-htmlproofer - name: Build the site and check for broken links working-directory: docs diff --git a/.github/workflows/doctor.yml b/.github/workflows/doctor.yml index 7dfa3abbbe..a697a85815 100644 --- a/.github/workflows/doctor.yml +++ b/.github/workflows/doctor.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -55,7 +55,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false diff --git a/.github/workflows/pkg-installer.yml b/.github/workflows/pkg-installer.yml index 2b23ea501a..577d0fd527 100644 --- a/.github/workflows/pkg-installer.yml +++ b/.github/workflows/pkg-installer.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -135,7 +135,7 @@ jobs: fi - name: Generate build provenance - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: Homebrew-${{ steps.homebrew-version.outputs.version }}.pkg @@ -230,17 +230,15 @@ jobs: --password "${PKG_APPLE_ID_APP_SPECIFIC_PASSWORD}" --wait - - name: Install gh - run: brew install gh - - name: Upload installer to GitHub release if: github.event_name == 'release' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} INSTALLER_PATH: ${{ needs.build.outputs.installer_path }} - run: gh release upload --repo Homebrew/brew - "${GITHUB_REF//refs\/tags\//}" - "${INSTALLER_PATH}" + run: | + VERSION="${INSTALLER_PATH#Homebrew-}" + VERSION="${VERSION%.pkg}" + gh release upload --repo Homebrew/brew "${VERSION}" "${INSTALLER_PATH}" issue: needs: [build, test, upload] @@ -253,7 +251,7 @@ jobs: issues: write steps: - name: Open, update, or close pkg installer issue - uses: Homebrew/actions/create-or-update-issue@master + uses: Homebrew/actions/create-or-update-issue@main with: title: Failed to publish pkg installer body: > @@ -261,7 +259,7 @@ jobs: ${{ github.ref_name }}. No pkg installer was uploaded to the GitHub release. labels: bug,release blocker - update-existing: ${{ contains(needs.*.result, 'failure') }} + update-existing: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} close-existing: ${{ needs.upload.result == 'success' }} close-from-author: github-actions[bot] close-comment: > diff --git a/.github/workflows/rubydoc.yml b/.github/workflows/rubydoc.yml index 14cd028923..44343e12ff 100644 --- a/.github/workflows/rubydoc.yml +++ b/.github/workflows/rubydoc.yml @@ -3,6 +3,7 @@ name: Ruby Documentation CI on: push: branches: + - main - master pull_request: @@ -28,7 +29,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -42,7 +43,7 @@ jobs: persist-credentials: false - name: Install Ruby - uses: ruby/setup-ruby@cb0fda56a307b8c78d38320cd40d9eb22a3bf04e # v1.242.0 + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 with: bundler-cache: true working-directory: rubydoc diff --git a/.github/workflows/schemas.yml b/.github/workflows/sbom.yml similarity index 66% rename from .github/workflows/schemas.yml rename to .github/workflows/sbom.yml index 43b47a31f4..9bc5db2892 100644 --- a/.github/workflows/schemas.yml +++ b/.github/workflows/sbom.yml @@ -1,9 +1,10 @@ -name: Update schema data +name: Update SBOM schema on: push: paths: - - .github/workflows/schemas.yml + - .github/workflows/sbom.yml branches-ignore: + - main - master schedule: - cron: "0 0 * * *" @@ -17,25 +18,25 @@ defaults: shell: bash -xeuo pipefail {0} jobs: - spdx: + sbom: if: github.repository == 'Homebrew/brew' runs-on: ubuntu-latest steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false test-bot: false - name: Configure Git user - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot - name: Set up commit signing - uses: Homebrew/actions/setup-commit-signing@master + uses: Homebrew/actions/setup-commit-signing@main with: signing_key: ${{ secrets.BREWTESTBOT_SSH_SIGNING_KEY }} @@ -55,7 +56,7 @@ jobs: git checkout "${BRANCH}" git checkout "Library/Homebrew/data/schemas" else - git checkout --no-track -B "${BRANCH}" origin/master + git checkout --no-track -B "${BRANCH}" origin/HEAD fi # Intentionally tracking 2.3.x to match what we output in sbom.rb. 3.0 also doesn't have a JSON Schema. @@ -67,9 +68,10 @@ jobs: if ! git diff --exit-code Library/Homebrew/data/schemas then git add "Library/Homebrew/data/schemas" - git commit -m "data/schemas: update schema data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/schemas.yml)." + git commit -m "data/schemas: update schema data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/schemas.yml)." + echo "committed=true" >> "$GITHUB_OUTPUT" - PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")" + PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state" || true)" if [[ "${PULL_REQUEST_STATE}" != "OPEN" ]] then echo "pull_request=true" >> "$GITHUB_OUTPUT" @@ -78,13 +80,13 @@ jobs: - name: Push commits if: steps.update.outputs.committed == 'true' - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }} branch: ${{ steps.update.outputs.branch }} force: true - origin_branch: "master" + origin_branch: "HEAD" - name: Open a pull request if: steps.update.outputs.pull_request == 'true' @@ -92,3 +94,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} + + issue: + needs: sbom + if: always() && github.event_name == 'schedule' + runs-on: ubuntu-latest + env: + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + permissions: + # To create or update issues + issues: write + steps: + - name: Open, update, or close schema issue + uses: Homebrew/actions/create-or-update-issue@main + with: + title: Failed to update SBOM schema + body: > + The SBOM schema workflow [failed](${{ env.RUN_URL }}). No SBOM schema was updated. + labels: bug + update-existing: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + close-existing: ${{ needs.sbom.result == 'success' }} + close-from-author: github-actions[bot] + close-comment: > + The SBOM schema workflow [succeeded](${{ env.RUN_URL }}). Closing this issue. diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index d9ce901d48..bfec7cdde5 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -10,6 +10,7 @@ on: paths: - .github/workflows/sorbet.yml branches-ignore: + - main - master schedule: - cron: "0 0 * * *" @@ -29,7 +30,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -37,13 +38,13 @@ jobs: - name: Configure Git user if: github.event_name != 'pull_request' - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot - name: Set up commit signing if: github.event_name != 'pull_request' - uses: Homebrew/actions/setup-commit-signing@master + uses: Homebrew/actions/setup-commit-signing@main with: signing_key: ${{ secrets.BREWTESTBOT_SSH_SIGNING_KEY }} @@ -63,7 +64,7 @@ jobs: git checkout "${BRANCH}" git checkout "Library/Homebrew/sorbet" else - git checkout --no-track -B "${BRANCH}" origin/master + git checkout --no-track -B "${BRANCH}" origin/HEAD fi fi @@ -80,17 +81,17 @@ jobs: then git add "Library/Homebrew/sorbet" git commit -m "sorbet: Update RBI files." \ - -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." + -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sorbet.yml) workflow." if ! git diff --stat --exit-code "Library/Homebrew" then git add "Library/Homebrew/" git commit -m "sorbet: Autobump sigils via Spoom" \ - -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." + -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/sorbet.yml) workflow." fi echo "committed=true" >> "$GITHUB_OUTPUT" - PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")" + PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state" || true)" if [[ "${PULL_REQUEST_STATE}" != "OPEN" ]] then echo "pull_request=true" >> "$GITHUB_OUTPUT" @@ -99,13 +100,13 @@ jobs: - name: Push commits if: steps.commit.outputs.committed == 'true' - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }} branch: ${{ steps.update.outputs.branch }} force: true - origin_branch: "master" + origin_branch: "HEAD" - name: Open a pull request if: steps.commit.outputs.pull_request == 'true' @@ -113,3 +114,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} + + issue: + needs: tapioca + if: always() && github.event_name == 'schedule' + runs-on: ubuntu-latest + env: + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + permissions: + # To create or update issues + issues: write + steps: + - name: Open, update, or close Sorbet issue + uses: Homebrew/actions/create-or-update-issue@main + with: + title: Failed to update RBI files + body: > + The Sorbet workflow [failed](${{ env.RUN_URL }}). No RBI files were updated. + labels: bug + update-existing: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + close-existing: ${{ needs.tapioca.result == 'success' }} + close-from-author: github-actions[bot] + close-comment: > + The Sorbet workflow [succeeded](${{ env.RUN_URL }}). Closing this issue. diff --git a/.github/workflows/spdx.yml b/.github/workflows/spdx.yml index a67f827e3c..c6e38fabe5 100644 --- a/.github/workflows/spdx.yml +++ b/.github/workflows/spdx.yml @@ -4,6 +4,7 @@ on: paths: - .github/workflows/spdx.yml branches-ignore: + - main - master schedule: - cron: "0 0 * * *" @@ -23,19 +24,19 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false test-bot: false - name: Configure Git user - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot - name: Set up commit signing - uses: Homebrew/actions/setup-commit-signing@master + uses: Homebrew/actions/setup-commit-signing@main with: signing_key: ${{ secrets.BREWTESTBOT_SSH_SIGNING_KEY }} @@ -55,15 +56,16 @@ jobs: git checkout "${BRANCH}" git checkout "Library/Homebrew/data/spdx" else - git checkout --no-track -B "${BRANCH}" origin/master + git checkout --no-track -B "${BRANCH}" origin/HEAD fi if brew update-license-data then git add "Library/Homebrew/data/spdx" - git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." + git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/spdx.yml)." + echo "committed=true" >> "$GITHUB_OUTPUT" - PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")" + PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state" || true)" if [[ "${PULL_REQUEST_STATE}" != "OPEN" ]] then echo "pull_request=true" >> "$GITHUB_OUTPUT" @@ -72,13 +74,13 @@ jobs: - name: Push commits if: steps.update.outputs.committed == 'true' - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }} branch: ${{ steps.update.outputs.branch }} force: true - origin_branch: "master" + origin_branch: "HEAD" - name: Open a pull request if: steps.update.outputs.pull_request == 'true' @@ -86,3 +88,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} + + issue: + needs: spdx + if: always() && github.event_name == 'schedule' + runs-on: ubuntu-latest + env: + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + permissions: + # To create or update issues + issues: write + steps: + - name: Open, update, or close SPDX issue + uses: Homebrew/actions/create-or-update-issue@main + with: + title: Failed to update SPDX license data + body: > + The SPDX license data workflow [failed](${{ env.RUN_URL }}). No SPDX license data was updated. + labels: bug + update-existing: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + close-existing: ${{ needs.spdx.result == 'success' }} + close-from-author: github-actions[bot] + close-comment: > + The SPDX license data workflow [succeeded](${{ env.RUN_URL }}). Closing this issue. diff --git a/.github/workflows/sponsors-maintainers-man-completions.yml b/.github/workflows/sponsors-maintainers-man-completions.yml index 214964efa2..c74ead84ba 100644 --- a/.github/workflows/sponsors-maintainers-man-completions.yml +++ b/.github/workflows/sponsors-maintainers-man-completions.yml @@ -3,6 +3,7 @@ name: Update sponsors, maintainers, manpage and completions on: push: branches: + - main - master paths: - .github/workflows/sponsors-maintainers-man-completions.yml @@ -32,19 +33,19 @@ jobs: steps: - name: Setup Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false test-bot: false - name: Configure Git user - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot - name: Set up commit signing - uses: Homebrew/actions/setup-commit-signing@master + uses: Homebrew/actions/setup-commit-signing@main with: signing_key: ${{ secrets.BREWTESTBOT_SSH_SIGNING_KEY }} @@ -60,7 +61,7 @@ jobs: run: | git fetch origin - if [[ -n "$GITHUB_REF_NAME" && "$GITHUB_REF_NAME" != "master" ]] + if [[ -n "$GITHUB_REF_NAME" && "$GITHUB_REF_NAME" != "master" && "$GITHUB_REF_NAME" != "main" ]] then BRANCH="$GITHUB_REF_NAME" else @@ -76,7 +77,7 @@ jobs: "manpages/brew.1" \ "completions" else - git checkout --force --no-track -B "${BRANCH}" origin/master + git checkout --force --no-track -B "${BRANCH}" origin/HEAD fi if brew update-sponsors @@ -111,7 +112,7 @@ jobs: if [[ -n "${COMMITTED-}" ]] then echo "committed=true" >> "$GITHUB_OUTPUT" - PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state")" + PULL_REQUEST_STATE="$(gh pr view --json=state | jq -r ".state" || true)" if [[ "${PULL_REQUEST_STATE}" != "OPEN" ]] then echo "pull_request=true" >> "$GITHUB_OUTPUT" @@ -124,7 +125,7 @@ jobs: - name: Push commits if: steps.update.outputs.committed == 'true' - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }} @@ -137,3 +138,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }} working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} + + issue: + needs: updates + if: always() && github.event_name == 'schedule' + runs-on: ubuntu-latest + env: + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + permissions: + # To create or update issues + issues: write + steps: + - name: Open, update, or close sponsors, maintainers, manpage and completions issue + uses: Homebrew/actions/create-or-update-issue@main + with: + title: Failed to update sponsors, maintainers, manpage and completions + body: > + The sponsors, maintainers, manpage and completions workflow [failed](${{ env.RUN_URL }}). No sponsors, maintainers, manpage and completions were updated. + labels: bug + update-existing: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + close-existing: ${{ needs.updates.result == 'success' }} + close-from-author: github-actions[bot] + close-comment: > + The sponsors, maintainers, manpage and completions workflow [succeeded](${{ env.RUN_URL }}). Closing this issue. diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 608d2e65e9..c4bfc33e0e 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -38,7 +38,7 @@ jobs: pull-requests: write steps: - name: Mark/Close Stale Issues and Pull Requests - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 + uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 21 @@ -68,7 +68,7 @@ jobs: pull-requests: write steps: - name: Mark/Close Stale `bump-formula-pr` and `bump-cask-pr` Pull Requests - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 + uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 2 diff --git a/.github/workflows/sync-default-branches.yml b/.github/workflows/sync-default-branches.yml new file mode 100644 index 0000000000..b171b3c992 --- /dev/null +++ b/.github/workflows/sync-default-branches.yml @@ -0,0 +1,64 @@ +name: Sync default branches + +on: + push: + branches: + - main + - master + pull_request: + paths: + - .github/workflows/sync-default-branches.yml + +permissions: {} + +defaults: + run: + shell: bash -xeuo pipefail {0} + +concurrency: + group: "sync-default-branches-${{ github.ref }}" + cancel-in-progress: true + +jobs: + sync: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Configure Git user + uses: Homebrew/actions/git-user-config@main + with: + username: github-actions[bot] + + - name: Determine source and target branches + id: branches + run: | + if [[ "${GITHUB_REF_NAME}" == "main" ]]; then + target="master" + source="main" + else + target="main" + source="master" + fi + echo "target=${target}" >> "$GITHUB_OUTPUT" + echo "source=${source}" >> "$GITHUB_OUTPUT" + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 1 + persist-credentials: true + + - name: Get target SHA + id: sha + run: | + TARGET_SHA=$(git ls-remote origin "refs/heads/${SOURCE_BRANCH}" | cut -f1) + echo "target=${TARGET_SHA}" >> "$GITHUB_OUTPUT" + env: + SOURCE_BRANCH: ${{ steps.branches.outputs.source }} + + - name: Push target branch + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' + run: git push origin "${TARGET_SHA}:refs/heads/${TARGET_BRANCH}" --force + env: + TARGET_SHA: ${{ steps.sha.outputs.target }} + TARGET_BRANCH: ${{ steps.branches.outputs.target }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1a0275205a..3663cc2a85 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,7 @@ name: CI on: push: branches: + - main - master pull_request: merge_group: @@ -32,7 +33,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -80,11 +81,11 @@ jobs: name: tap syntax needs: syntax if: github.repository_owner == 'Homebrew' - runs-on: macos-14 + runs-on: macos-15 steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: true cask: true @@ -135,13 +136,13 @@ jobs: if: github.repository_owner == 'Homebrew' && github.event_name != 'push' runs-on: ubuntu-latest container: - image: ghcr.io/homebrew/brew:master + image: ghcr.io/homebrew/brew:main steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: - core: true + core: false cask: false test-bot: false @@ -162,7 +163,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: true cask: true @@ -185,14 +186,14 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false test-bot: false - name: Configure Git user - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot @@ -213,14 +214,14 @@ jobs: strategy: matrix: include: - - name: update-test (Ubuntu) + - name: update-test (Linux) runs-on: ubuntu-latest - name: update-test (macOS) - runs-on: macos-15 + runs-on: macos-latest steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -237,7 +238,6 @@ jobs: name: ${{ matrix.name }} needs: syntax runs-on: ${{ matrix.runs-on }} - container: ${{ matrix.container }} strategy: matrix: include: @@ -247,23 +247,16 @@ jobs: - name: tests (generic OS) test-flags: --generic --coverage runs-on: ubuntu-latest - - name: tests (Ubuntu 24.04) + - name: tests (Linux) test-flags: --coverage runs-on: ubuntu-24.04 - - name: tests (Ubuntu 22.04) - test-flags: --coverage - runs-on: ubuntu-22.04 - - name: tests (Ubuntu 20.04) - test-flags: --coverage - runs-on: ubuntu-latest - container: ghcr.io/homebrew/ubuntu20.04:latest - - name: tests (macOS 15 arm64) + - name: tests (macOS) test-flags: --coverage runs-on: macos-15 steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: # We only test needs_homebrew_core tests on macOS because # homebrew/core is not available by default on GitHub-hosted Ubuntu @@ -335,7 +328,7 @@ jobs: filenames=$(find Library/Homebrew/test/junit -name 'rspec*.xml' -print | tr '\n' ',') echo "filenames=${filenames%,}" >> "$GITHUB_OUTPUT" - - uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0 + - uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 with: working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} files: ${{ steps.junit_xml.outputs.filenames }} @@ -349,7 +342,7 @@ jobs: disable_search: true token: ${{ secrets.CODECOV_TOKEN }} - test-default-formula: + test-bot: name: ${{ matrix.name }} needs: syntax if: github.repository_owner == 'Homebrew' && github.event_name != 'push' @@ -358,36 +351,76 @@ jobs: strategy: matrix: include: - - name: test default formula (Ubuntu 24.04) - runs-on: ubuntu-latest + - name: test-bot (Linux arm64) + runs-on: ubuntu-24.04-arm container: ghcr.io/homebrew/ubuntu24.04:latest - - name: test default formula (Ubuntu 22.04) + - name: test-bot (Linux x86_64) runs-on: ubuntu-latest - container: ghcr.io/homebrew/ubuntu22.04:master - - name: test default formula (Ubuntu 20.04) + container: ghcr.io/homebrew/ubuntu22.04:main + # Use Debian Old Stable for testing Homebrew's glibc support. + - name: test-bot (Linux Homebrew glibc) runs-on: ubuntu-latest - container: ghcr.io/homebrew/ubuntu20.04:latest - - name: test default formula (macOS 13 x86_64) + container: debian:oldstable + - name: test-bot (macOS x86_64) runs-on: macos-13 - - name: test default formula (macOS 15 arm64) + - name: test-bot (macOS arm64) runs-on: macos-15 env: HOMEBREW_TEST_BOT_ANALYTICS: 1 HOMEBREW_ENFORCE_SBOM: 1 steps: + - name: Install Homebrew and Homebrew's dependencies + # All other images are built from our Homebrew Dockerfile. + # This is the only one that needs to be set up manually. + if: matrix.container == 'debian:oldstable' + run: | + # Slimmed down version from the Homebrew Dockerfile + apt-get update + apt-get install -y --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + file \ + g++ \ + git-core \ + less \ + locales \ + make \ + netbase \ + patch \ + procps \ + sudo \ + uuid-runtime \ + tzdata + + # Install Homebrew + mkdir -p /home/linuxbrew/.linuxbrew/bin + # Don't do shallow clone or it's unshallowed by "Set up Homebrew" + git clone https://github.com/Homebrew/brew.git /home/linuxbrew/.linuxbrew/Homebrew + cd /home/linuxbrew/.linuxbrew/bin + ln -s ../Homebrew/bin/brew brew + echo "/home/linuxbrew/.linuxbrew/bin" >>"$GITHUB_PATH" + - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: - core: true + core: false cask: false test-bot: true - run: brew test-bot --only-cleanup-before - name: Setup environment variables - if: matrix.container == 'ghcr.io/homebrew/ubuntu20.04:latest' - run: echo "HOMEBREW_GLIBC_TESTING=1" >> "$GITHUB_ENV" + run: | + # Set enviroment variables to bypass `brew doctor` failures on Tier >=2 configurations + if [[ "${MATRIX_NAME}" == "test-bot (Linux arm64)" ]]; then + echo "HOMEBREW_ARM64_TESTING=1" >> "$GITHUB_ENV" + elif [[ "${MATRIX_NAME}" == "test-bot (Linux Homebrew glibc)" ]]; then + echo "HOMEBREW_GLIBC_TESTING=1" >> "$GITHUB_ENV" + fi + env: + MATRIX_NAME: ${{ matrix.name }} - run: brew test-bot --only-setup @@ -395,7 +428,7 @@ jobs: - run: brew test-bot --only-formulae --only-json-tab --test-default-formula - test-brew-bundle-services: + bundle-and-services: name: ${{ matrix.name }} needs: syntax if: github.repository_owner == 'Homebrew' && github.event_name != 'push' @@ -403,23 +436,21 @@ jobs: strategy: matrix: include: - - name: test brew bundle and brew services (Ubuntu) + - name: bundle and services (Linux) runs-on: ubuntu-latest - - name: test brew bundle and brew services (macOS) - runs-on: macos-15 + - name: bundle and services (macOS) + runs-on: macos-latest steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: - core: true + core: false cask: false test-bot: false - run: brew test-bot --only-cleanup-before - - run: brew test-bot --only-setup - - name: Run brew bundle and brew services integration tests run: | cat <> Brewfile @@ -449,19 +480,22 @@ jobs: brew services cleanup brew bundle cleanup --force - test-analytics: - runs-on: ${{ matrix.os }} + analytics: + name: ${{ matrix.name }} + runs-on: ${{ matrix.runs-on }} strategy: matrix: - os: - - ubuntu-latest - - macos-latest + include: + - name: analytics (Linux) + runs-on: ubuntu-latest + - name: analytics (macOS) + runs-on: macos-latest needs: syntax if: github.repository_owner == 'Homebrew' && github.event_name != 'push' steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main - name: Setup Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 diff --git a/.github/workflows/vendor-gems.yml b/.github/workflows/vendor-gems.yml index f931fcc13d..75135a0609 100644 --- a/.github/workflows/vendor-gems.yml +++ b/.github/workflows/vendor-gems.yml @@ -9,6 +9,7 @@ on: paths: - .github/workflows/vendor-gems.yml branches-ignore: + - main - master workflow_dispatch: inputs: @@ -31,7 +32,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false @@ -39,13 +40,13 @@ jobs: - name: Configure Git user if: github.event_name == 'workflow_dispatch' - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main with: username: BrewTestBot - name: Set up commit signing if: github.event_name == 'workflow_dispatch' - uses: Homebrew/actions/setup-commit-signing@master + uses: Homebrew/actions/setup-commit-signing@main with: signing_key: ${{ secrets.BREWTESTBOT_SSH_SIGNING_KEY }} @@ -100,7 +101,7 @@ jobs: - name: Push to pull request if: github.event_name == 'workflow_dispatch' - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: token: ${{ steps.app-token.outputs.token }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }} diff --git a/.github/workflows/vendor-version.yml b/.github/workflows/vendor-version.yml index fe317b3119..028f373260 100644 --- a/.github/workflows/vendor-version.yml +++ b/.github/workflows/vendor-version.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: core: false cask: false diff --git a/.github/zizmor.yml b/.github/zizmor.yml index 37fe3fad56..465fbd2c2e 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -1,3 +1,4 @@ +# This file is synced from the `.github` repository, do not modify it directly. rules: unpinned-uses: config: diff --git a/.gitignore b/.gitignore index bb824a889e..27c0fedbf0 100644 --- a/.gitignore +++ b/.gitignore @@ -116,6 +116,7 @@ **/vendor/bundle/ruby/*/gems/rdoc-*/ **/vendor/bundle/ruby/*/gems/redcarpet-*/ **/vendor/bundle/ruby/*/gems/regexp_parser-*/ +**/vendor/bundle/ruby/*/gems/require-hooks-*/ **/vendor/bundle/ruby/*/gems/rexml-*/ **/vendor/bundle/ruby/*/gems/rspec-*/ **/vendor/bundle/ruby/*/gems/rspec-core-*/ @@ -164,6 +165,7 @@ !/completions !/docs !/manpages +!/CODEOWNERS # Unignore our packaging files !/package @@ -172,6 +174,7 @@ # Ignore generated documentation site /docs/_site /docs/.jekyll-metadata +/docs/tmp/.htmlproofer /docs/vendor /docs/Gemfile.lock diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 0000000000..49ec5f4a56 --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,11 @@ +{ + "servers": { + "Homebrew": { + "type": "stdio", + "command": "brew", + "args": [ + "mcp-server" + ] + } + } +} diff --git a/.vscode/ruby-lsp-activate.sh b/.vscode/ruby-lsp-activate.sh index 142acf76b4..8a3fba7c19 100755 --- a/.vscode/ruby-lsp-activate.sh +++ b/.vscode/ruby-lsp-activate.sh @@ -1,5 +1,12 @@ #!/bin/bash -HOMEBREW_PREFIX="$(cd "$(dirname "$0")"/../ && pwd)" +if [[ -n "${BASH_SOURCE[0]}" ]]; then + SCRIPT_PATH="${BASH_SOURCE[0]}" +elif [[ -n "${ZSH_VERSION}" ]]; then + SCRIPT_PATH="${(%):-%x}" +else + SCRIPT_PATH="$0" +fi +HOMEBREW_PREFIX="$(cd "$(dirname "${SCRIPT_PATH}")"/../ && pwd)" "${HOMEBREW_PREFIX}/bin/brew" install-bundler-gems --add-groups=style,typecheck,vscode >/dev/null 2>&1 diff --git a/.vscode/settings.json b/.vscode/settings.json index fae9f4229f..14ab39c7be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,7 +40,6 @@ "id": "default", "name": "Brew Typecheck", "description": "Default configuration", - "cwd": "${workspaceFolder}", "command": [ "./bin/brew", "typecheck", diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000..b76c645caf --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,11 @@ +# Note that the naming of this file is incorrect for our case: these people do not "own" the provided files but are +# people with write-access to this repository who wish to approve changes to these files. +# +# Their review is required to merge PRs that change these files. +# +# To be explicit: we will never accept changes to this file adding people from outside the Homebrew GitHub +# organisation. If you are not a Homebrew maintainer: you do not personally "own" or "maintain" any files. +# +# Note: @Homebrew/plc does not have write-access to this repository, and therefore cannot be listed in this file. + +docs/Support-Tiers.md @Homebrew/tsc @MikeMcQuaid diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index a5362c95d6..6ca33502f8 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -26,7 +26,7 @@ AllCops: Include: - "**/*.rbi" Exclude: - - "Homebrew/sorbet/rbi/{dsl,gems}/**/*.rbi" + - "Homebrew/sorbet/rbi/{annotations,dsl,gems}/**/*.rbi" - "Homebrew/sorbet/rbi/parser*.rbi" - "Homebrew/bin/*" - "Homebrew/vendor/**/*" @@ -216,6 +216,10 @@ Naming/MethodParameterName: merge: - AllowedNames +# Allows a nicer API for boolean methods with side effects. +Naming/PredicateMethod: + AllowBangMethods: true + # Both styles are used depending on context, # e.g. `sha256` and `something_countable_1`. Naming/VariableNumber: @@ -304,7 +308,7 @@ Sorbet/StrictSigil: - "Homebrew/utils/ruby_check_version_script.rb" # A standalone script. - "Homebrew/{standalone,startup}/*.rb" # These are loaded before sorbet-runtime - "Homebrew/test/**/*.rb" - - "Homebrew/bundle/{brew_dumper,checker,commands/exec}.rb" # These aren't typed: true yet. + - "Homebrew/bundle/{formula_dumper,checker,commands/exec}.rb" # These aren't typed: true yet. Sorbet/TrueSigil: Enabled: true diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index eb1ac0740f..9ef9b0adc0 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -10,7 +10,13 @@ Homebrew/MoveToExtendOS: - "{extend,test,requirements}/**/*" - "os.rb" -Naming/PredicateName: +# We don't use Sorbet for RSpec tests so let's disable this there. +Sorbet/BlockMethodDefinition: + Exclude: + - test/**/* + +# Want to preserve our own API for these methods for now. +Naming/PredicatePrefix: inherit_mode: merge: - AllowedMethods @@ -25,6 +31,7 @@ Style/Documentation: - Homebrew Include: - abstract_command.rb + - autobump_constants.rb - cask/cask.rb - cask/dsl.rb - cask/dsl/version.rb diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 8053d3bb79..629829ca5c 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -4,20 +4,20 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.2) bindata (2.5.1) coderay (1.1.3) concurrent-ruby (1.3.5) - csv (3.3.4) + csv (3.3.5) diff-lcs (1.6.2) docile (1.4.1) elftools (1.3.1) bindata (~> 2) erubi (1.13.1) hana (1.3.7) - json (2.12.0) + json (2.12.2) json_schemer (2.4.0) bigdecimal hana (~> 1.3) @@ -32,7 +32,7 @@ GEM minitest (5.25.5) netrc (0.11.0) parallel (1.27.0) - parallel_tests (5.2.0) + parallel_tests (5.3.0) parallel parser (3.3.8.0) ast (~> 2.4.1) @@ -48,37 +48,38 @@ GEM pycall (1.5.2) racc (1.8.1) rainbow (3.1.1) - rbi (0.3.3) + rbi (0.3.6) prism (~> 1.0) rbs (>= 3.4.4) - sorbet-runtime (>= 0.5.9204) - rbs (3.9.4) + rbs (4.0.0.dev.4) logger + prism (>= 1.3.0) redcarpet (3.6.1) regexp_parser (2.10.0) + require-hooks (0.2.2) rexml (3.4.1) - rspec (3.13.0) + rspec (3.13.1) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.3) + rspec-core (3.13.5) rspec-support (~> 3.13.0) - rspec-expectations (3.13.4) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-github (3.0.0) rspec-core (~> 3.0) - rspec-mocks (3.13.4) + rspec-mocks (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-sorbet (1.9.2) sorbet-runtime - rspec-support (3.13.3) + rspec-support (3.13.4) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.75.6) + rubocop (1.77.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -86,10 +87,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.45.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.45.1) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-md (2.0.1) @@ -102,15 +103,17 @@ GEM rubocop-rspec (3.6.0) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) - rubocop-sorbet (0.10.0) - rubocop (>= 1) - ruby-lsp (0.23.21) + rubocop-sorbet (0.10.5) + lint_roller + rubocop (>= 1.75.2) + ruby-lsp (0.24.2) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) - rbs (>= 3, < 4) + rbs (>= 3, < 5) sorbet-runtime (>= 0.5.10782) ruby-macho (4.1.0) - ruby-prof (1.7.1) + ruby-prof (1.7.2) + base64 ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) @@ -122,38 +125,40 @@ GEM simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) simpleidn (0.2.3) - sorbet (0.5.12117) - sorbet-static (= 0.5.12117) - sorbet-runtime (0.5.12117) - sorbet-static (0.5.12117-aarch64-linux) - sorbet-static (0.5.12117-universal-darwin) - sorbet-static (0.5.12117-x86_64-linux) - sorbet-static-and-runtime (0.5.12117) - sorbet (= 0.5.12117) - sorbet-runtime (= 0.5.12117) - spoom (1.6.3) + sorbet (0.5.12222) + sorbet-static (= 0.5.12222) + sorbet-runtime (0.5.12222) + sorbet-static (0.5.12222-aarch64-linux) + sorbet-static (0.5.12222-universal-darwin) + sorbet-static (0.5.12222-x86_64-linux) + sorbet-static-and-runtime (0.5.12222) + sorbet (= 0.5.12222) + sorbet-runtime (= 0.5.12222) + spoom (1.7.4) erubi (>= 1.10.0) prism (>= 0.28.0) rbi (>= 0.3.3) + rbs (>= 4.0.0.dev.4) rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) stackprof (0.2.27) - tapioca (0.16.11) + tapioca (0.17.6) benchmark bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (~> 0.2) + rbi (>= 0.3.1) + require-hooks (>= 0.2.2) sorbet-static-and-runtime (>= 0.5.11087) - spoom (>= 1.2.0) + spoom (>= 1.7.0) thor (>= 1.2.0) yard-sorbet thor (1.3.2) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - vernier (1.7.1) + vernier (1.8.0) warning (1.5.0) yard (0.9.37) yard-sorbet (0.9.0) diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 46fd38bb3f..099613ac95 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -39,12 +39,12 @@ class PATH self end - sig { params(block: T.proc.params(arg0: String).returns(T::Boolean)).returns(T.self_type) } + sig { params(block: T.proc.params(arg0: String).returns(BasicObject)).returns(T.self_type) } def select(&block) self.class.new(@paths.select(&block)) end - sig { params(block: T.proc.params(arg0: String).returns(T::Boolean)).returns(T.self_type) } + sig { params(block: T.proc.params(arg0: String).returns(BasicObject)).returns(T.self_type) } def reject(&block) self.class.new(@paths.reject(&block)) end diff --git a/Library/Homebrew/aliases/alias.rb b/Library/Homebrew/aliases/alias.rb index 37e95d3e8a..143c760784 100644 --- a/Library/Homebrew/aliases/alias.rb +++ b/Library/Homebrew/aliases/alias.rb @@ -75,14 +75,16 @@ module Homebrew EOS else <<~EOS - # + #: * `#{name}` [args...] + #: `brew #{name}` is an alias for *command* + # This is a Homebrew alias script. It'll be called when the user # types `brew #{name}`. Any remaining arguments are passed to # this script. You can retrieve those with $*, or only the first # one with $1. Please keep your script on one line. - # TODO Replace the line below with your script - echo "Hello I'm brew alias "#{name}" and my args are:" $1 + # TODO: Replace the line below with your script + echo "Hello I'm 'brew "#{name}"' and my args are:" $* EOS end diff --git a/Library/Homebrew/aliases/aliases.rb b/Library/Homebrew/aliases/aliases.rb index 48887b4c4c..a684816442 100644 --- a/Library/Homebrew/aliases/aliases.rb +++ b/Library/Homebrew/aliases/aliases.rb @@ -29,36 +29,36 @@ module Homebrew Alias.new(name).remove end - sig { params(only: T::Array[String], block: T.proc.params(target: String, cmd: String).void).void } + sig { params(only: T::Array[String], block: T.proc.params(name: String, command: String).void).void } def self.each(only, &block) Dir["#{HOMEBREW_ALIASES}/*"].each do |path| next if path.end_with? "~" # skip Emacs-like backup files next if File.directory?(path) - _shebang, _meta, *lines = File.readlines(path) - target = File.basename(path) - next if !only.empty? && only.exclude?(target) + _shebang, meta, *lines = File.readlines(path) + name = T.must(meta)[/alias: brew (\S+)/, 1] || File.basename(path) + next if !only.empty? && only.exclude?(name) lines.reject! { |line| line.start_with?("#") || line =~ /^\s*$/ } first_line = T.must(lines.first) - cmd = first_line.chomp - cmd.sub!(/ \$\*$/, "") + command = first_line.chomp + command.sub!(/ \$\*$/, "") - if cmd.start_with? "brew " - cmd.sub!(/^brew /, "") + if command.start_with? "brew " + command.sub!(/^brew /, "") else - cmd = "!#{cmd}" + command = "!#{command}" end - yield target, cmd if block.present? + yield name, command if block.present? end end sig { params(aliases: String).void } def self.show(*aliases) - each([*aliases]) do |target, cmd| - puts "brew alias #{target}='#{cmd}'" - existing_alias = Alias.new(target, cmd) + each([*aliases]) do |name, command| + puts "brew alias #{name}='#{command}'" + existing_alias = Alias.new(name, command) existing_alias.link unless existing_alias.symlink.exist? end end diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index 2a4a920c21..57051063b5 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "api/analytics" @@ -11,10 +11,10 @@ module Homebrew module API extend Cachable - HOMEBREW_CACHE_API = (HOMEBREW_CACHE/"api").freeze - HOMEBREW_CACHE_API_SOURCE = (HOMEBREW_CACHE/"api-source").freeze + HOMEBREW_CACHE_API = T.let((HOMEBREW_CACHE/"api").freeze, Pathname) + HOMEBREW_CACHE_API_SOURCE = T.let((HOMEBREW_CACHE/"api-source").freeze, Pathname) - sig { params(endpoint: String).returns(Hash) } + sig { params(endpoint: String).returns(T::Hash[String, T.untyped]) } def self.fetch(endpoint) return cache[endpoint] if cache.present? && cache.key?(endpoint) @@ -33,7 +33,8 @@ module Homebrew end sig { - params(endpoint: String, target: Pathname, stale_seconds: Integer).returns([T.any(Array, Hash), T::Boolean]) + params(endpoint: String, target: Pathname, + stale_seconds: Integer).returns([T.any(T::Array[T.untyped], T::Hash[String, T.untyped]), T::Boolean]) } def self.fetch_json_api_file(endpoint, target: HOMEBREW_CACHE_API/endpoint, stale_seconds: Homebrew::EnvConfig.api_auto_update_secs.to_i) @@ -96,7 +97,8 @@ module Homebrew mtime = insecure_download ? Time.new(1970, 1, 1) : Time.now FileUtils.touch(target, mtime:) unless skip_download - JSON.parse(target.read(encoding: Encoding::UTF_8), freeze: true) + # Can use `target.read` again when/if https://github.com/sorbet/sorbet/pull/8999 is merged/released. + JSON.parse(File.read(target, encoding: Encoding::UTF_8), freeze: true) rescue JSON::ParserError target.unlink retry_count += 1 @@ -122,14 +124,17 @@ module Homebrew end end - sig { params(json: Hash).returns(Hash) } - def self.merge_variations(json) + sig { + params(json: T::Hash[String, T.untyped], + bottle_tag: ::Utils::Bottles::Tag).returns(T::Hash[String, T.untyped]) + } + def self.merge_variations(json, bottle_tag: T.unsafe(nil)) return json unless json.key?("variations") - bottle_tag = ::Utils::Bottles::Tag.new(system: Homebrew::SimulateSystem.current_os, - arch: Homebrew::SimulateSystem.current_arch) + bottle_tag ||= Homebrew::SimulateSystem.current_tag - if (variation = json.dig("variations", bottle_tag.to_s).presence) + if (variation = json.dig("variations", bottle_tag.to_s).presence) || + (variation = json.dig("variations", bottle_tag.to_sym).presence) json = json.merge(variation) end @@ -137,7 +142,7 @@ module Homebrew end sig { params(names: T::Array[String], type: String, regenerate: T::Boolean).returns(T::Boolean) } - def self.write_names_file(names, type, regenerate:) + def self.write_names_file!(names, type, regenerate:) names_path = HOMEBREW_CACHE_API/"#{type}_names.txt" if !names_path.exist? || regenerate names_path.write(names.join("\n")) @@ -147,7 +152,10 @@ module Homebrew false end - sig { params(json_data: Hash).returns([T::Boolean, T.any(String, Array, Hash)]) } + sig { + params(json_data: T::Hash[String, T.untyped]) + .returns([T::Boolean, T.any(String, T::Array[T.untyped], T::Hash[String, T.untyped])]) + } private_class_method def self.verify_and_parse_jws(json_data) signatures = json_data["signatures"] homebrew_signature = signatures&.find { |sig| sig.dig("header", "kid") == "homebrew-1" } diff --git a/Library/Homebrew/api/analytics.rb b/Library/Homebrew/api/analytics.rb index 2bf4a62e49..ce105b9fd9 100644 --- a/Library/Homebrew/api/analytics.rb +++ b/Library/Homebrew/api/analytics.rb @@ -10,7 +10,6 @@ module Homebrew def analytics_api_path "analytics" end - alias generic_analytics_api_path analytics_api_path sig { params(category: String, days: T.any(Integer, String)).returns(T::Hash[String, T.untyped]) } def fetch(category, days) diff --git a/Library/Homebrew/api/cask.rb b/Library/Homebrew/api/cask.rb index 03b94f848a..c5e6e5a6d0 100644 --- a/Library/Homebrew/api/cask.rb +++ b/Library/Homebrew/api/cask.rb @@ -1,7 +1,7 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true -require "extend/cachable" +require "cachable" require "api/download" module Homebrew @@ -12,16 +12,23 @@ module Homebrew DEFAULT_API_FILENAME = "cask.jws.json" + sig { returns(String) } + def self.api_filename + return DEFAULT_API_FILENAME unless ENV.fetch("HOMEBREW_USE_INTERNAL_API", false) + + "cask.#{SimulateSystem.current_tag}.jws.json" + end + private_class_method :cache - sig { params(token: String).returns(Hash) } + sig { params(token: String).returns(T::Hash[String, T.untyped]) } def self.fetch(token) Homebrew::API.fetch "cask/#{token}.json" end sig { params(cask: ::Cask::Cask).returns(::Cask::Cask) } def self.source_download(cask) - path = cask.ruby_source_path.to_s || "Casks/#{cask.token}.rb" + path = cask.ruby_source_path.to_s sha256 = cask.ruby_source_checksum[:sha256] checksum = Checksum.new(sha256) if sha256 git_head = cask.tap_git_head || "HEAD" @@ -40,13 +47,14 @@ module Homebrew .load(config: cask.config) end + sig { returns(Pathname) } def self.cached_json_file_path - HOMEBREW_CACHE_API/DEFAULT_API_FILENAME + HOMEBREW_CACHE_API/api_filename end sig { returns(T::Boolean) } def self.download_and_cache_data! - json_casks, updated = Homebrew::API.fetch_json_api_file DEFAULT_API_FILENAME + json_casks, updated = Homebrew::API.fetch_json_api_file api_filename cache["renames"] = {} cache["casks"] = json_casks.to_h do |json_cask| @@ -63,7 +71,7 @@ module Homebrew end private_class_method :download_and_cache_data! - sig { returns(T::Hash[String, Hash]) } + sig { returns(T::Hash[String, T::Hash[String, T.untyped]]) } def self.all_casks unless cache.key?("casks") json_updated = download_and_cache_data! @@ -87,7 +95,7 @@ module Homebrew def self.write_names(regenerate: false) download_and_cache_data! unless cache.key?("casks") - Homebrew::API.write_names_file(all_casks.keys, "cask", regenerate:) + Homebrew::API.write_names_file!(all_casks.keys, "cask", regenerate:) end end end diff --git a/Library/Homebrew/api/formula.rb b/Library/Homebrew/api/formula.rb index 1bcd622da4..44f118bbdb 100644 --- a/Library/Homebrew/api/formula.rb +++ b/Library/Homebrew/api/formula.rb @@ -1,7 +1,7 @@ # typed: strict # frozen_string_literal: true -require "extend/cachable" +require "cachable" require "api/download" module Homebrew @@ -12,6 +12,13 @@ module Homebrew DEFAULT_API_FILENAME = "formula.jws.json" + sig { returns(String) } + def self.api_filename + return DEFAULT_API_FILENAME unless ENV.fetch("HOMEBREW_USE_INTERNAL_API", false) + + "internal/formula.#{SimulateSystem.current_tag}.jws.json" + end + private_class_method :cache sig { params(name: String).returns(T::Hash[String, T.untyped]) } @@ -42,12 +49,12 @@ module Homebrew sig { returns(Pathname) } def self.cached_json_file_path - HOMEBREW_CACHE_API/DEFAULT_API_FILENAME + HOMEBREW_CACHE_API/api_filename end sig { returns(T::Boolean) } def self.download_and_cache_data! - json_formulae, updated = Homebrew::API.fetch_json_api_file DEFAULT_API_FILENAME + json_formulae, updated = Homebrew::API.fetch_json_api_file api_filename cache["aliases"] = {} cache["renames"] = {} @@ -122,7 +129,7 @@ module Homebrew def self.write_names_and_aliases(regenerate: false) download_and_cache_data! unless cache.key?("formulae") - return unless Homebrew::API.write_names_file(all_formulae.keys, "formula", regenerate:) + return unless Homebrew::API.write_names_file!(all_formulae.keys, "formula", regenerate:) (HOMEBREW_CACHE_API/"formula_aliases.txt").open("w") do |file| all_aliases.each do |alias_name, real_name| diff --git a/Library/Homebrew/extend/api_hashable.rb b/Library/Homebrew/api_hashable.rb similarity index 59% rename from Library/Homebrew/extend/api_hashable.rb rename to Library/Homebrew/api_hashable.rb index e1e4098e95..7c64f378d9 100644 --- a/Library/Homebrew/extend/api_hashable.rb +++ b/Library/Homebrew/api_hashable.rb @@ -1,22 +1,26 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true # Used to substitute common paths with generic placeholders when generating JSON for the API. module APIHashable + sig { void } def generating_hash! return if generating_hash? # Apply monkeypatches for API generation - @old_homebrew_prefix = HOMEBREW_PREFIX - @old_homebrew_cellar = HOMEBREW_CELLAR - @old_home = Dir.home + @old_homebrew_prefix = T.let(HOMEBREW_PREFIX, T.nilable(Pathname)) + @old_homebrew_cellar = T.let(HOMEBREW_CELLAR, T.nilable(Pathname)) + @old_home = T.let(Dir.home, T.nilable(String)) + @old_git_config_global = T.let(ENV.fetch("GIT_CONFIG_GLOBAL", nil), T.nilable(String)) Object.send(:remove_const, :HOMEBREW_PREFIX) Object.const_set(:HOMEBREW_PREFIX, Pathname.new(HOMEBREW_PREFIX_PLACEHOLDER)) ENV["HOME"] = HOMEBREW_HOME_PLACEHOLDER + ENV["GIT_CONFIG_GLOBAL"] = File.join(@old_home, ".gitconfig") - @generating_hash = true + @generating_hash = T.let(true, T.nilable(T::Boolean)) end + sig { void } def generated_hash! return unless generating_hash? @@ -24,10 +28,12 @@ module APIHashable Object.send(:remove_const, :HOMEBREW_PREFIX) Object.const_set(:HOMEBREW_PREFIX, @old_homebrew_prefix) ENV["HOME"] = @old_home + ENV["GIT_CONFIG_GLOBAL"] = @old_git_config_global @generating_hash = false end + sig { returns(T::Boolean) } def generating_hash? @generating_hash ||= false @generating_hash == true diff --git a/Library/Homebrew/ast_constants.rb b/Library/Homebrew/ast_constants.rb index fa31aef6ed..c6ec8eb61c 100644 --- a/Library/Homebrew/ast_constants.rb +++ b/Library/Homebrew/ast_constants.rb @@ -52,4 +52,4 @@ FORMULA_COMPONENT_PRECEDENCE_LIST = T.let([ [{ name: :caveats, type: :method_definition }], [{ name: :plist_options, type: :method_call }, { name: :plist, type: :method_definition }], [{ name: :test, type: :block_call }], -].freeze, T::Array[[{ name: Symbol, type: Symbol }]]) +].freeze, T::Array[T::Array[{ name: Symbol, type: Symbol }]]) diff --git a/Library/Homebrew/attestation.rb b/Library/Homebrew/attestation.rb index 44f1a4d0b3..d55125fbc9 100644 --- a/Library/Homebrew/attestation.rb +++ b/Library/Homebrew/attestation.rb @@ -64,12 +64,8 @@ module Homebrew sig { returns(T::Boolean) } def self.enabled? return false if Homebrew::EnvConfig.no_verify_attestations? - return true if Homebrew::EnvConfig.verify_attestations? - return false if ENV.fetch("CI", false) - return false if OS.not_tier_one_configuration? - # Always check credentials last to avoid unnecessary credential extraction. - (Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?) && GitHub::API.credentials.present? + Homebrew::EnvConfig.verify_attestations? end # Returns a path to a suitable `gh` executable for attestation verification. diff --git a/Library/Homebrew/autobump_constants.rb b/Library/Homebrew/autobump_constants.rb index 0803803fe6..baf7ecdf5a 100644 --- a/Library/Homebrew/autobump_constants.rb +++ b/Library/Homebrew/autobump_constants.rb @@ -1,10 +1,15 @@ # typed: strict # frozen_string_literal: true -# TODO: add more reasons here +NO_AUTOBUMP_REASONS_INTERNAL = T.let({ + extract_plist: "livecheck uses `:extract_plist` strategy", + latest_version: "`version` is set to `:latest`", +}.freeze, T::Hash[Symbol, String]) + +# The valid symbols for passing to `no_autobump!` in a `Formula` or `Cask`. +# @api public NO_AUTOBUMP_REASONS_LIST = T.let({ incompatible_version_format: "incompatible version format", bumped_by_upstream: "bumped by upstream", - extract_plist: "livecheck uses `:extract_plist` strategy", - latest_version: "`version` is set to `:latest`", -}.freeze, T::Hash[Symbol, String]) + requires_manual_review: "a manual review of this package is required for inclusion in autobump", +}.merge(NO_AUTOBUMP_REASONS_INTERNAL).freeze, T::Hash[Symbol, String]) diff --git a/Library/Homebrew/bottle.rb b/Library/Homebrew/bottle.rb index 6aa2aa3f26..a2351fd89c 100644 --- a/Library/Homebrew/bottle.rb +++ b/Library/Homebrew/bottle.rb @@ -91,7 +91,7 @@ class Bottle def fetch(verify_download_integrity: true, timeout: nil, quiet: false) resource.fetch(verify_download_integrity:, timeout:, quiet:) rescue DownloadError - raise unless fallback_on_error + raise unless fallback_on_error? fetch_tab retry @@ -121,7 +121,7 @@ class Bottle begin resource.fetch(timeout:, quiet:) rescue DownloadError - raise unless fallback_on_error + raise unless fallback_on_error? retry rescue Resource::BottleManifest::Error @@ -193,7 +193,7 @@ class Bottle specs end - def fallback_on_error + def fallback_on_error? # Use the default bottle domain as a fallback mirror if @resource.url.start_with?(Homebrew::EnvConfig.bottle_domain) && Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index beaaa1a3a8..56f2a5d58a 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -531,9 +531,9 @@ GIT_REVISION=$("${HOMEBREW_GIT}" -C "${HOMEBREW_REPOSITORY}" rev-parse HEAD 2>/d if [[ -z "${GIT_REVISION}" ]] then read -r GIT_HEAD 2>/dev/null <"${HOMEBREW_REPOSITORY}/.git/HEAD" - if [[ "${GIT_HEAD}" == "ref: refs/heads/master" ]] + if [[ "${GIT_HEAD}" == "ref: refs/heads/main" ]] then - read -r GIT_REVISION 2>/dev/null <"${HOMEBREW_REPOSITORY}/.git/refs/heads/master" + read -r GIT_REVISION 2>/dev/null <"${HOMEBREW_REPOSITORY}/.git/refs/heads/main" elif [[ "${GIT_HEAD}" == "ref: refs/heads/stable" ]] then read -r GIT_REVISION 2>/dev/null <"${HOMEBREW_REPOSITORY}/.git/refs/heads/stable" @@ -600,6 +600,11 @@ case "$1" in homebrew-version exit 0 ;; + mcp-server) + source "${HOMEBREW_LIBRARY}/Homebrew/cmd/mcp-server.sh" + homebrew-mcp-server "$@" + exit 0 + ;; esac # TODO: bump version when new macOS is released or announced and update references in: @@ -609,6 +614,8 @@ esac # and, if needed: # - MacOSVersion::SYMBOLS HOMEBREW_MACOS_NEWEST_UNSUPPORTED="16" +# TODO: bump version when new macOS is released +HOMEBREW_MACOS_NEWEST_SUPPORTED="15" # TODO: bump version when new macOS is released and update references in: # - docs/Installation.md # - HOMEBREW_MACOS_OLDEST_SUPPORTED in .github/workflows/pkg-installer.yml @@ -836,6 +843,7 @@ export HOMEBREW_OS_VERSION export HOMEBREW_MACOS_VERSION export HOMEBREW_MACOS_VERSION_NUMERIC export HOMEBREW_MACOS_NEWEST_UNSUPPORTED +export HOMEBREW_MACOS_NEWEST_SUPPORTED export HOMEBREW_MACOS_OLDEST_SUPPORTED export HOMEBREW_MACOS_OLDEST_ALLOWED export HOMEBREW_USER_AGENT @@ -1078,6 +1086,22 @@ else export HOMEBREW_GITHUB_PACKAGES_AUTH="Bearer QQ==" fi +# Avoid picking up any random `sudo` in `PATH`. +if [[ -x /usr/bin/sudo ]] +then + SUDO=/usr/bin/sudo +else + # Do this after ensuring we're using default Bash builtins. + SUDO="$(command -v sudo 2>/dev/null)" +fi + +# Reset sudo timestamp to avoid running unauthorized sudo commands +if [[ -n "${SUDO}" ]] +then + "${SUDO}" --reset-timestamp 2>/dev/null || true +fi +unset SUDO + if [[ -n "${HOMEBREW_BASH_COMMAND}" ]] then # source rather than executing directly to ensure the entire file is read into diff --git a/Library/Homebrew/bundle.rb b/Library/Homebrew/bundle.rb index e5676f1094..5fe4d93c63 100644 --- a/Library/Homebrew/bundle.rb +++ b/Library/Homebrew/bundle.rb @@ -41,7 +41,7 @@ module Homebrew sig { returns(T::Boolean) } def mas_installed? - @mas_installed ||= which_formula("mas") + @mas_installed ||= which_formula?("mas") end sig { returns(T::Boolean) } @@ -59,7 +59,7 @@ module Homebrew sig { returns(T::Boolean) } def whalebrew_installed? - @whalebrew_installed ||= which_formula("whalebrew") + @whalebrew_installed ||= which_formula?("whalebrew") end sig { returns(T::Boolean) } @@ -70,7 +70,7 @@ module Homebrew end sig { params(name: String).returns(T::Boolean) } - def which_formula(name) + def which_formula?(name) formula = Formulary.factory(name) ENV["PATH"] = "#{formula.opt_bin}:#{ENV.fetch("PATH", nil)}" if formula.any_version_installed? which(name).present? @@ -130,6 +130,9 @@ module Homebrew @formula_versions_from_env[formula_env_name] end + sig { void } + def prepend_pkgconf_path_if_needed!; end + sig { void } def reset! @mas_installed = T.let(nil, T.nilable(T::Boolean)) diff --git a/Library/Homebrew/bundle/brew_checker.rb b/Library/Homebrew/bundle/brew_checker.rb index 31fefc66b5..3697ccc271 100644 --- a/Library/Homebrew/bundle/brew_checker.rb +++ b/Library/Homebrew/bundle/brew_checker.rb @@ -1,7 +1,7 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -require "bundle/brew_installer" +require "bundle/formula_installer" module Homebrew module Bundle @@ -11,7 +11,7 @@ module Homebrew PACKAGE_TYPE_NAME = "Formula" def installed_and_up_to_date?(formula, no_upgrade: false) - Homebrew::Bundle::BrewInstaller.formula_installed_and_up_to_date?(formula, no_upgrade:) + Homebrew::Bundle::FormulaInstaller.formula_installed_and_up_to_date?(formula, no_upgrade:) end end end diff --git a/Library/Homebrew/bundle/brew_service_checker.rb b/Library/Homebrew/bundle/brew_service_checker.rb index 235b76ac90..9476c742c7 100644 --- a/Library/Homebrew/bundle/brew_service_checker.rb +++ b/Library/Homebrew/bundle/brew_service_checker.rb @@ -24,8 +24,8 @@ module Homebrew end def entry_to_formula(entry) - require "bundle/brew_installer" - Homebrew::Bundle::BrewInstaller.new(entry.name, entry.options) + require "bundle/formula_installer" + Homebrew::Bundle::FormulaInstaller.new(entry.name, entry.options) end def formula_needs_to_start?(formula) @@ -38,8 +38,8 @@ module Homebrew end def lookup_old_name(service_name) - require "bundle/brew_dumper" - @old_names ||= Homebrew::Bundle::BrewDumper.formula_oldnames + require "bundle/formula_dumper" + @old_names ||= Homebrew::Bundle::FormulaDumper.formula_oldnames old_name = @old_names[service_name] old_name ||= @old_names[service_name.split("/").last] old_name diff --git a/Library/Homebrew/bundle/cask_dumper.rb b/Library/Homebrew/bundle/cask_dumper.rb index b3381d1ae8..ef1059b7e4 100644 --- a/Library/Homebrew/bundle/cask_dumper.rb +++ b/Library/Homebrew/bundle/cask_dumper.rb @@ -8,6 +8,7 @@ module Homebrew @casks = nil @cask_names = nil @cask_hash = nil + @cask_oldnames = nil end def self.cask_names @@ -38,6 +39,25 @@ module Homebrew end.join("\n") end + def self.cask_oldnames + return @cask_oldnames if @cask_oldnames + + @cask_oldnames = {} + casks.each do |c| + oldnames = c.old_tokens + next if oldnames.blank? + + oldnames.each do |oldname| + @cask_oldnames[oldname] = c.full_name + if c.full_name.include? "/" # tap cask + tap_name = c.full_name.rpartition("/").first + @cask_oldnames["#{tap_name}/#{oldname}"] = c.full_name + end + end + end + @cask_oldnames + end + def self.formula_dependencies(cask_list) return [] unless Bundle.cask_installed? return [] if cask_list.blank? diff --git a/Library/Homebrew/bundle/cask_installer.rb b/Library/Homebrew/bundle/cask_installer.rb index 4014666d73..b56a491c2d 100644 --- a/Library/Homebrew/bundle/cask_installer.rb +++ b/Library/Homebrew/bundle/cask_installer.rb @@ -18,7 +18,7 @@ module Homebrew Homebrew::Bundle::CaskDumper.cask_is_outdated_using_greedy?(name) end - def self.preinstall(name, no_upgrade: false, verbose: false, **options) + def self.preinstall!(name, no_upgrade: false, verbose: false, **options) if installed_casks.include?(name) && !upgrading?(no_upgrade, name, options) puts "Skipping install of #{name} cask. It is already installed." if verbose return false @@ -27,7 +27,7 @@ module Homebrew true end - def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) + def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) return true unless preinstall full_name = options.fetch(:full_name, name) @@ -87,12 +87,25 @@ module Homebrew !cask_upgradable?(cask) end + def self.cask_in_array?(cask, array) + return true if array.include?(cask) + return true if array.include?(cask.split("/").last) + + require "bundle/cask_dumper" + old_names = Homebrew::Bundle::CaskDumper.cask_oldnames + old_name = old_names[cask] + old_name ||= old_names[cask.split("/").last] + return true if old_name && array.include?(old_name) + + false + end + def self.cask_installed?(cask) - installed_casks.include? cask + cask_in_array?(cask, installed_casks) end def self.cask_upgradable?(cask) - outdated_casks.include? cask + cask_in_array?(cask, outdated_casks) end def self.installed_casks diff --git a/Library/Homebrew/bundle/checker.rb b/Library/Homebrew/bundle/checker.rb index 411e0d8c0b..ed8628a269 100644 --- a/Library/Homebrew/bundle/checker.rb +++ b/Library/Homebrew/bundle/checker.rb @@ -1,4 +1,4 @@ -# typed: false # rubocop:todo Sorbet/TrueSigil +# typed: true # frozen_string_literal: true module Homebrew @@ -23,7 +23,7 @@ module Homebrew else "needs to be installed or updated." end - "#{self.class::PACKAGE_TYPE_NAME} #{name} #{reason}" + "#{self.class.const_get(:PACKAGE_TYPE_NAME)} #{name} #{reason}" end def full_check(packages, no_upgrade:) @@ -33,7 +33,7 @@ module Homebrew def checkable_entries(all_entries) require "bundle/skipper" - all_entries.select { |e| e.type == self.class::PACKAGE_TYPE } + all_entries.select { |e| e.type == self.class.const_get(:PACKAGE_TYPE) } .reject(&Bundle::Skipper.method(:skip?)) end @@ -139,14 +139,14 @@ module Homebrew def self.reset! require "bundle/cask_dumper" - require "bundle/brew_dumper" + require "bundle/formula_dumper" require "bundle/mac_app_store_dumper" require "bundle/tap_dumper" require "bundle/brew_services" @dsl = nil Homebrew::Bundle::CaskDumper.reset! - Homebrew::Bundle::BrewDumper.reset! + Homebrew::Bundle::FormulaDumper.reset! Homebrew::Bundle::MacAppStoreDumper.reset! Homebrew::Bundle::TapDumper.reset! Homebrew::Bundle::BrewServices.reset! diff --git a/Library/Homebrew/bundle/commands/add.rb b/Library/Homebrew/bundle/commands/add.rb index fe26cd8a28..60718601fb 100644 --- a/Library/Homebrew/bundle/commands/add.rb +++ b/Library/Homebrew/bundle/commands/add.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "bundle/adder" @@ -7,6 +7,7 @@ module Homebrew module Bundle module Commands module Add + sig { params(args: String, type: Symbol, global: T::Boolean, file: T.nilable(String)).void } def self.run(*args, type:, global:, file:) Homebrew::Bundle::Adder.add(*args, type:, global:, file:) end diff --git a/Library/Homebrew/bundle/commands/cleanup.rb b/Library/Homebrew/bundle/commands/cleanup.rb index a42f07d980..9eb6847f44 100644 --- a/Library/Homebrew/bundle/commands/cleanup.rb +++ b/Library/Homebrew/bundle/commands/cleanup.rb @@ -10,7 +10,7 @@ module Homebrew module Cleanup def self.reset! require "bundle/cask_dumper" - require "bundle/brew_dumper" + require "bundle/formula_dumper" require "bundle/tap_dumper" require "bundle/vscode_extension_dumper" require "bundle/brew_services" @@ -19,29 +19,30 @@ module Homebrew @kept_casks = nil @kept_formulae = nil Homebrew::Bundle::CaskDumper.reset! - Homebrew::Bundle::BrewDumper.reset! + Homebrew::Bundle::FormulaDumper.reset! Homebrew::Bundle::TapDumper.reset! Homebrew::Bundle::VscodeExtensionDumper.reset! Homebrew::Bundle::BrewServices.reset! end - def self.run(global: false, file: nil, force: false, zap: false, dsl: nil) + def self.run(global: false, file: nil, force: false, zap: false, dsl: nil, + formulae: true, casks: true, taps: true, vscode: true) @dsl ||= dsl - casks = casks_to_uninstall(global:, file:) - formulae = formulae_to_uninstall(global:, file:) - taps = taps_to_untap(global:, file:) - vscode_extensions = vscode_extensions_to_uninstall(global:, file:) + casks = casks ? casks_to_uninstall(global:, file:) : [] + formulae = formulae ? formulae_to_uninstall(global:, file:) : [] + taps = taps ? taps_to_untap(global:, file:) : [] + vscode_extensions = vscode ? vscode_extensions_to_uninstall(global:, file:) : [] if force if casks.any? args = zap ? ["--zap"] : [] Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--cask", *args, "--force", *casks - puts "Uninstalled #{casks.size} cask#{(casks.size == 1) ? "" : "s"}" + puts "Uninstalled #{casks.size} cask#{"s" if casks.size != 1}" end if formulae.any? Kernel.system HOMEBREW_BREW_FILE, "uninstall", "--formula", "--force", *formulae - puts "Uninstalled #{formulae.size} formula#{(formulae.size == 1) ? "" : "e"}" + puts "Uninstalled #{formulae.size} formula#{"e" if formulae.size != 1}" end Kernel.system HOMEBREW_BREW_FILE, "untap", *taps if taps.any? @@ -100,11 +101,11 @@ module Homebrew def self.formulae_to_uninstall(global: false, file: nil) kept_formulae = self.kept_formulae(global:, file:) - require "bundle/brew_dumper" - require "bundle/brew_installer" - current_formulae = Homebrew::Bundle::BrewDumper.formulae + require "bundle/formula_dumper" + require "bundle/formula_installer" + current_formulae = Homebrew::Bundle::FormulaDumper.formulae current_formulae.reject! do |f| - Homebrew::Bundle::BrewInstaller.formula_in_array?(f[:full_name], kept_formulae) + Homebrew::Bundle::FormulaInstaller.formula_in_array?(f[:full_name], kept_formulae) end # Don't try to uninstall formulae with keepme references @@ -118,7 +119,7 @@ module Homebrew private_class_method def self.kept_formulae(global: false, file: nil) require "bundle/brewfile" - require "bundle/brew_dumper" + require "bundle/formula_dumper" require "bundle/cask_dumper" @kept_formulae ||= begin @@ -127,12 +128,13 @@ module Homebrew kept_formulae = @dsl.entries.select { |e| e.type == :brew }.map(&:name) kept_formulae += Homebrew::Bundle::CaskDumper.formula_dependencies(kept_casks) kept_formulae.map! do |f| - Homebrew::Bundle::BrewDumper.formula_aliases[f] || - Homebrew::Bundle::BrewDumper.formula_oldnames[f] || - f + Homebrew::Bundle::FormulaDumper.formula_aliases.fetch( + f, + Homebrew::Bundle::FormulaDumper.formula_oldnames.fetch(f, f), + ) end - kept_formulae + recursive_dependencies(Homebrew::Bundle::BrewDumper.formulae, kept_formulae) + kept_formulae + recursive_dependencies(Homebrew::Bundle::FormulaDumper.formulae, kept_formulae) end end @@ -141,7 +143,11 @@ module Homebrew return @kept_casks if @kept_casks @dsl ||= Brewfile.read(global:, file:) - @kept_casks = @dsl.entries.select { |e| e.type == :cask }.map(&:name) + kept_casks = @dsl.entries.select { |e| e.type == :cask }.flat_map(&:name) + kept_casks.map! do |c| + Homebrew::Bundle::CaskDumper.cask_oldnames.fetch(c, c) + end + @kept_casks = kept_casks end private_class_method def self.recursive_dependencies(current_formulae, formulae_names, top_level: true) diff --git a/Library/Homebrew/bundle/commands/dump.rb b/Library/Homebrew/bundle/commands/dump.rb index a8938c137d..98e943a9ca 100644 --- a/Library/Homebrew/bundle/commands/dump.rb +++ b/Library/Homebrew/bundle/commands/dump.rb @@ -7,9 +7,10 @@ module Homebrew module Bundle module Commands module Dump - def self.run(global:, file:, describe:, force:, no_restart:, taps:, brews:, casks:, mas:, whalebrew:, vscode:) + def self.run(global:, file:, describe:, force:, no_restart:, taps:, formulae:, casks:, mas:, whalebrew:, + vscode:) Homebrew::Bundle::Dumper.dump_brewfile( - global:, file:, describe:, force:, no_restart:, taps:, brews:, casks:, mas:, whalebrew:, vscode:, + global:, file:, describe:, force:, no_restart:, taps:, formulae:, casks:, mas:, whalebrew:, vscode:, ) end end diff --git a/Library/Homebrew/bundle/commands/exec.rb b/Library/Homebrew/bundle/commands/exec.rb index 543d84114b..b6c698ff28 100644 --- a/Library/Homebrew/bundle/commands/exec.rb +++ b/Library/Homebrew/bundle/commands/exec.rb @@ -1,4 +1,4 @@ -# typed: false # rubocop:todo Sorbet/TrueSigil +# typed: true # frozen_string_literal: true require "English" @@ -13,6 +13,16 @@ module Homebrew module Exec PATH_LIKE_ENV_REGEX = /.+#{File::PATH_SEPARATOR}/ + sig { + params( + args: String, + global: T::Boolean, + file: T.nilable(String), + subcommand: String, + services: T::Boolean, + check: T::Boolean, + ).void + } def self.run(*args, global: false, file: nil, subcommand: "", services: false, check: false) if check require "bundle/commands/check" @@ -25,9 +35,9 @@ module Homebrew # Setup Homebrew's ENV extensions ENV.activate_extensions! - raise UsageError, "No command to execute was specified!" if args.blank? command = args.first + raise UsageError, "No command to execute was specified!" if command.blank? require "bundle/brewfile" @dsl = Brewfile.read(global:, file:) @@ -64,14 +74,8 @@ module Homebrew ENV.prepend_path "PATH", Pathname.new(dep_root)/"shims" end - # Setup pkg-config, if present, to help locate packages - # Only need this on Linux as Homebrew provides a shim on macOS - # TODO: use extend/OS here - # rubocop:todo Homebrew/MoveToExtendOS - if OS.linux? && (pkgconf = Formulary.factory("pkgconf")) && pkgconf.any_version_installed? - ENV.prepend_path "PATH", pkgconf.opt_bin.to_s - end - # rubocop:enable Homebrew/MoveToExtendOS + # Setup pkgconf, if needed, to help locate packages + Bundle.prepend_pkgconf_path_if_needed! # For commands which aren't either absolute or relative # Add the command directory to PATH, since it may get blown away by superenv @@ -170,15 +174,29 @@ module Homebrew end end return + elsif subcommand == "sh" + preferred_path = Utils::Shell.preferred_path(default: "/bin/bash") + notice = unless Homebrew::EnvConfig.no_env_hints? + <<~EOS + Your shell has been configured to use a build environment from your `Brewfile`. + This should help you build stuff. + Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). + When done, type `exit`. + EOS + end + ENV["HOMEBREW_FORCE_API_AUTO_UPDATE"] = nil + args = [Utils::Shell.shell_with_prompt("brew bundle", preferred_path:, notice:)] end if services require "bundle/brew_services" - exit_code = 0 + exit_code = T.let(0, Integer) run_services(@dsl.entries) do Kernel.system(*args) - exit_code = $CHILD_STATUS.exitstatus + if (system_exit_code = $CHILD_STATUS&.exitstatus) + exit_code = system_exit_code + end end exit!(exit_code) else @@ -191,7 +209,7 @@ module Homebrew entries: T::Array[Homebrew::Bundle::Dsl::Entry], _block: T.proc.params( entry: Homebrew::Bundle::Dsl::Entry, - info: T::Hash[String, T.anything], + info: T::Hash[String, T.untyped], service_file: Pathname, conflicting_services: T::Array[T::Hash[String, T.anything]], ).void, @@ -271,7 +289,7 @@ module Homebrew map_service_info(entries) do |entry, info, service_file, conflicting_services| # Don't restart if already running this version loaded_file = Pathname.new(info["loaded_file"].to_s) - next if info["running"] && loaded_file&.file? && loaded_file&.realpath == service_file.realpath + next if info["running"] && loaded_file.file? && loaded_file.realpath == service_file.realpath if info["running"] && !Bundle::BrewServices.stop(info["name"], keep: true) opoo "Failed to stop #{info["name"]} service" diff --git a/Library/Homebrew/bundle/commands/install.rb b/Library/Homebrew/bundle/commands/install.rb index a8ce0bdfd0..03ce65774e 100644 --- a/Library/Homebrew/bundle/commands/install.rb +++ b/Library/Homebrew/bundle/commands/install.rb @@ -11,7 +11,7 @@ module Homebrew def self.run(global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, force: false, quiet: false) @dsl = Brewfile.read(global:, file:) - Homebrew::Bundle::Installer.install( + Homebrew::Bundle::Installer.install!( @dsl.entries, global:, file:, no_lock:, no_upgrade:, verbose:, force:, quiet:, ) || exit(1) diff --git a/Library/Homebrew/bundle/commands/list.rb b/Library/Homebrew/bundle/commands/list.rb index af55fdedb8..595a698ec0 100644 --- a/Library/Homebrew/bundle/commands/list.rb +++ b/Library/Homebrew/bundle/commands/list.rb @@ -8,11 +8,11 @@ module Homebrew module Bundle module Commands module List - def self.run(global:, file:, brews:, casks:, taps:, mas:, whalebrew:, vscode:) + def self.run(global:, file:, formulae:, casks:, taps:, mas:, whalebrew:, vscode:) parsed_entries = Brewfile.read(global:, file:).entries Homebrew::Bundle::Lister.list( parsed_entries, - brews:, casks:, taps:, mas:, whalebrew:, vscode:, + formulae:, casks:, taps:, mas:, whalebrew:, vscode:, ) end end diff --git a/Library/Homebrew/bundle/dumper.rb b/Library/Homebrew/bundle/dumper.rb index e4ced529be..c46fb7ea52 100644 --- a/Library/Homebrew/bundle/dumper.rb +++ b/Library/Homebrew/bundle/dumper.rb @@ -13,9 +13,9 @@ module Homebrew true end - def self.build_brewfile(describe:, no_restart:, brews:, taps:, casks:, mas:, whalebrew:, vscode:) + def self.build_brewfile(describe:, no_restart:, formulae:, taps:, casks:, mas:, whalebrew:, vscode:) require "bundle/tap_dumper" - require "bundle/brew_dumper" + require "bundle/formula_dumper" require "bundle/cask_dumper" require "bundle/mac_app_store_dumper" require "bundle/whalebrew_dumper" @@ -23,7 +23,7 @@ module Homebrew content = [] content << TapDumper.dump if taps - content << BrewDumper.dump(describe:, no_restart:) if brews + content << FormulaDumper.dump(describe:, no_restart:) if formulae content << CaskDumper.dump(describe:) if casks content << MacAppStoreDumper.dump if mas content << WhalebrewDumper.dump if whalebrew @@ -31,11 +31,11 @@ module Homebrew "#{content.reject(&:empty?).join("\n")}\n" end - def self.dump_brewfile(global:, file:, describe:, force:, no_restart:, brews:, taps:, casks:, mas:, whalebrew:, - vscode:) + def self.dump_brewfile(global:, file:, describe:, force:, no_restart:, formulae:, taps:, casks:, mas:, + whalebrew:, vscode:) path = brewfile_path(global:, file:) can_write_to_brewfile?(path, force:) - content = build_brewfile(describe:, no_restart:, taps:, brews:, casks:, mas:, whalebrew:, vscode:) + content = build_brewfile(describe:, no_restart:, taps:, formulae:, casks:, mas:, whalebrew:, vscode:) write_file path, content end diff --git a/Library/Homebrew/bundle/brew_dumper.rb b/Library/Homebrew/bundle/formula_dumper.rb similarity index 91% rename from Library/Homebrew/bundle/brew_dumper.rb rename to Library/Homebrew/bundle/formula_dumper.rb index 403c92eec6..b39514137f 100644 --- a/Library/Homebrew/bundle/brew_dumper.rb +++ b/Library/Homebrew/bundle/formula_dumper.rb @@ -1,4 +1,4 @@ -# typed: false # rubocop:todo Sorbet/TrueSigil +# typed: true # frozen_string_literal: true require "json" @@ -7,10 +7,8 @@ require "tsort" module Homebrew module Bundle # TODO: refactor into multiple modules - module BrewDumper - module_function - - def reset! + module FormulaDumper + def self.reset! require "bundle/brew_services" Homebrew::Bundle::BrewServices.reset! @@ -21,14 +19,14 @@ module Homebrew @formula_oldnames = nil end - def formulae + def self.formulae return @formulae if @formulae formulae_by_full_name @formulae end - def formulae_by_full_name(name = nil) + def self.formulae_by_full_name(name = nil) return @formulae_by_full_name[name] if name.present? && @formulae_by_full_name&.key?(name) require "formula" @@ -51,11 +49,11 @@ module Homebrew {} end - def formulae_by_name(name) + def self.formulae_by_name(name) formulae_by_full_name(name) || @formulae_by_name[name] end - def dump(describe: false, no_restart: false) + def self.dump(describe: false, no_restart: false) require "bundle/brew_services" requested_formula = formulae.select do |f| @@ -77,7 +75,7 @@ module Homebrew end.join("\n") end - def formula_aliases + def self.formula_aliases return @formula_aliases if @formula_aliases @formula_aliases = {} @@ -96,7 +94,7 @@ module Homebrew @formula_aliases end - def formula_oldnames + def self.formula_oldnames return @formula_oldnames if @formula_oldnames @formula_oldnames = {} @@ -115,7 +113,7 @@ module Homebrew @formula_oldnames end - def add_formula(formula) + private_class_method def self.add_formula(formula) hash = formula_to_hash formula @formulae_by_name[hash[:name]] = hash @@ -123,9 +121,8 @@ module Homebrew hash end - private_class_method :add_formula - def formula_to_hash(formula) + private_class_method def self.formula_to_hash(formula) keg = if formula.linked? link = true if formula.keg_only? formula.linked_keg @@ -185,17 +182,21 @@ module Homebrew official_tap: formula.tap&.official? || false, } end - private_class_method :formula_to_hash class Topo < Hash include TSort + + def each_key(&block) + keys.each(&block) + end alias tsort_each_node each_key + def tsort_each_child(node, &block) fetch(node.downcase).sort.each(&block) end end - def sort!(formulae) + private_class_method def self.sort!(formulae) # Step 1: Sort by formula full name while putting tap formulae behind core formulae. # So we can have a nicer output. formulae = formulae.sort do |a, b| @@ -230,15 +231,14 @@ module Homebrew odie <<~EOS Formulae dependency graph sorting failed (likely due to a circular dependency): - #{cycle_first}: #{topo[cycle_first]} - #{cycle_last}: #{topo[cycle_last]} + #{cycle_first}: #{topo[cycle_first] if topo} + #{cycle_last}: #{topo[cycle_last] if topo} Please run the following commands and try again: brew update brew uninstall --ignore-dependencies --force #{cycle_first} #{cycle_last} brew install #{cycle_first} #{cycle_last} EOS end - private_class_method :sort! end end end diff --git a/Library/Homebrew/bundle/brew_installer.rb b/Library/Homebrew/bundle/formula_installer.rb similarity index 86% rename from Library/Homebrew/bundle/brew_installer.rb rename to Library/Homebrew/bundle/formula_installer.rb index 9b08213aec..a2f4792a16 100644 --- a/Library/Homebrew/bundle/brew_installer.rb +++ b/Library/Homebrew/bundle/formula_installer.rb @@ -3,19 +3,19 @@ module Homebrew module Bundle - class BrewInstaller + class FormulaInstaller def self.reset! @installed_formulae = nil @outdated_formulae = nil @pinned_formulae = nil end - def self.preinstall(name, no_upgrade: false, verbose: false, **options) - new(name, options).preinstall(no_upgrade:, verbose:) + def self.preinstall!(name, no_upgrade: false, verbose: false, **options) + new(name, options).preinstall!(no_upgrade:, verbose:) end - def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) - new(name, options).install(preinstall:, no_upgrade:, verbose:, force:) + def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false, **options) + new(name, options).install!(preinstall:, no_upgrade:, verbose:, force:) end def initialize(name, options = {}) @@ -31,7 +31,7 @@ module Homebrew @changed = nil end - def preinstall(no_upgrade: false, verbose: false) + def preinstall!(no_upgrade: false, verbose: false) if installed? && (self.class.no_upgrade_with_args?(no_upgrade, @name) || !upgradable?) puts "Skipping install of #{@name} formula. It is already installed." if verbose @changed = nil @@ -41,7 +41,7 @@ module Homebrew true end - def install(preinstall: true, no_upgrade: false, verbose: false, force: false) + def install!(preinstall: true, no_upgrade: false, verbose: false, force: false) install_result = if preinstall install_change_state!(no_upgrade:, verbose:, force:) else @@ -80,9 +80,9 @@ module Homebrew return false unless resolve_conflicts!(verbose:) if installed? - upgrade!(verbose:, force:) + upgrade_formula!(verbose:, force:) else - install!(verbose:, force:) + install_formula!(verbose:, force:) end end @@ -179,13 +179,13 @@ module Homebrew return true if array.include?(formula) return true if array.include?(formula.split("/").last) - require "bundle/brew_dumper" - old_names = Homebrew::Bundle::BrewDumper.formula_oldnames + require "bundle/formula_dumper" + old_names = Homebrew::Bundle::FormulaDumper.formula_oldnames old_name = old_names[formula] old_name ||= old_names[formula.split("/").last] return true if old_name && array.include?(old_name) - resolved_full_name = Homebrew::Bundle::BrewDumper.formula_aliases[formula] + resolved_full_name = Homebrew::Bundle::FormulaDumper.formula_aliases[formula] return false unless resolved_full_name return true if array.include?(resolved_full_name) return true if array.include?(resolved_full_name.split("/").last) @@ -219,14 +219,14 @@ module Homebrew end def self.formulae - require "bundle/brew_dumper" - Homebrew::Bundle::BrewDumper.formulae + require "bundle/formula_dumper" + Homebrew::Bundle::FormulaDumper.formulae end private def installed? - BrewInstaller.formula_installed?(@name) + FormulaInstaller.formula_installed?(@name) end def linked? @@ -242,7 +242,7 @@ module Homebrew end def upgradable? - BrewInstaller.formula_upgradable?(@name) + FormulaInstaller.formula_upgradable?(@name) end def conflicts_with @@ -250,8 +250,8 @@ module Homebrew conflicts_with = Set.new conflicts_with += @conflicts_with_arg - require "bundle/brew_dumper" - if (formula = Homebrew::Bundle::BrewDumper.formulae_by_full_name(@full_name)) && + require "bundle/formula_dumper" + if (formula = Homebrew::Bundle::FormulaDumper.formulae_by_full_name(@full_name)) && (formula_conflicts_with = formula[:conflicts_with]) conflicts_with += formula_conflicts_with end @@ -262,7 +262,7 @@ module Homebrew def resolve_conflicts!(verbose:) conflicts_with.each do |conflict| - next unless BrewInstaller.formula_installed?(conflict) + next unless FormulaInstaller.formula_installed?(conflict) if verbose puts <<~EOS @@ -282,7 +282,7 @@ module Homebrew true end - def install!(verbose:, force:) + def install_formula!(verbose:, force:) install_args = @args.dup install_args << "--force" << "--overwrite" if force install_args << "--skip-link" if @link == false @@ -293,12 +293,12 @@ module Homebrew return false end - BrewInstaller.installed_formulae << @name + FormulaInstaller.installed_formulae << @name @changed = true true end - def upgrade!(verbose:, force:) + def upgrade_formula!(verbose:, force:) upgrade_args = [] upgrade_args << "--force" if force with_args = " with #{upgrade_args.join(" ")}" if upgrade_args.present? diff --git a/Library/Homebrew/bundle/installer.rb b/Library/Homebrew/bundle/installer.rb index d576693220..61f5ce198b 100644 --- a/Library/Homebrew/bundle/installer.rb +++ b/Library/Homebrew/bundle/installer.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true require "bundle/dsl" -require "bundle/brew_installer" +require "bundle/formula_installer" require "bundle/cask_installer" require "bundle/mac_app_store_installer" require "bundle/whalebrew_installer" @@ -13,8 +13,8 @@ require "bundle/skipper" module Homebrew module Bundle module Installer - def self.install(entries, global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, - force: false, quiet: false) + def self.install!(entries, global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, + force: false, quiet: false) success = 0 failure = 0 @@ -27,8 +27,8 @@ module Homebrew cls = case type when :brew options = entry.options - verb = "Upgrading" if Homebrew::Bundle::BrewInstaller.formula_upgradable?(name) - Homebrew::Bundle::BrewInstaller + verb = "Upgrading" if Homebrew::Bundle::FormulaInstaller.formula_upgradable?(name) + Homebrew::Bundle::FormulaInstaller when :cask options = entry.options verb = "Upgrading" if Homebrew::Bundle::CaskInstaller.cask_upgradable?(name) @@ -49,7 +49,7 @@ module Homebrew next if cls.nil? next if Homebrew::Bundle::Skipper.skip? entry - preinstall = if cls.preinstall(*args, **options, no_upgrade:, verbose:) + preinstall = if cls.preinstall!(*args, **options, no_upgrade:, verbose:) puts Formatter.success("#{verb} #{name}") true else @@ -57,7 +57,7 @@ module Homebrew false end - if cls.install(*args, **options, + if cls.install!(*args, **options, preinstall:, no_upgrade:, verbose:, force:) success += 1 else diff --git a/Library/Homebrew/bundle/lister.rb b/Library/Homebrew/bundle/lister.rb index f5022bfc4c..a813ac6cf5 100644 --- a/Library/Homebrew/bundle/lister.rb +++ b/Library/Homebrew/bundle/lister.rb @@ -4,14 +4,14 @@ module Homebrew module Bundle module Lister - def self.list(entries, brews:, casks:, taps:, mas:, whalebrew:, vscode:) + def self.list(entries, formulae:, casks:, taps:, mas:, whalebrew:, vscode:) entries.each do |entry| - puts entry.name if show?(entry.type, brews:, casks:, taps:, mas:, whalebrew:, vscode:) + puts entry.name if show?(entry.type, formulae:, casks:, taps:, mas:, whalebrew:, vscode:) end end - private_class_method def self.show?(type, brews:, casks:, taps:, mas:, whalebrew:, vscode:) - return true if brews && type == :brew + private_class_method def self.show?(type, formulae:, casks:, taps:, mas:, whalebrew:, vscode:) + return true if formulae && type == :brew return true if casks && type == :cask return true if taps && type == :tap return true if mas && type == :mas diff --git a/Library/Homebrew/bundle/mac_app_store_installer.rb b/Library/Homebrew/bundle/mac_app_store_installer.rb index faa49d362a..343b3467ed 100644 --- a/Library/Homebrew/bundle/mac_app_store_installer.rb +++ b/Library/Homebrew/bundle/mac_app_store_installer.rb @@ -11,7 +11,7 @@ module Homebrew @outdated_app_ids = nil end - def self.preinstall(name, id, no_upgrade: false, verbose: false) + def self.preinstall!(name, id, no_upgrade: false, verbose: false) unless Bundle.mas_installed? puts "Installing mas. It is not currently installed." if verbose Bundle.brew("install", "mas", verbose:) @@ -27,7 +27,7 @@ module Homebrew true end - def self.install(name, id, preinstall: true, no_upgrade: false, verbose: false, force: false) + def self.install!(name, id, preinstall: true, no_upgrade: false, verbose: false, force: false) return true unless preinstall if app_id_installed?(id) diff --git a/Library/Homebrew/bundle/skipper.rb b/Library/Homebrew/bundle/skipper.rb index f2788907a2..84699c51b3 100644 --- a/Library/Homebrew/bundle/skipper.rb +++ b/Library/Homebrew/bundle/skipper.rb @@ -9,21 +9,8 @@ module Homebrew class << self sig { params(entry: Dsl::Entry, silent: T::Boolean).returns(T::Boolean) } def skip?(entry, silent: false) - require "bundle/brew_dumper" + require "bundle/formula_dumper" - # TODO: use extend/OS here - # rubocop:todo Homebrew/MoveToExtendOS - if (Hardware::CPU.arm? || OS.linux?) && - Homebrew.default_prefix? && - entry.type == :brew && entry.name.exclude?("/") && - (formula = BrewDumper.formulae_by_full_name(entry.name)) && - formula[:official_tap] && - !formula[:bottled] - reason = Hardware::CPU.arm? ? "Apple Silicon" : "Linux" - puts Formatter.warning "Skipping #{entry.name} (no bottle for #{reason})" unless silent - return true - end - # rubocop:enable Homebrew/MoveToExtendOS return true if @failed_taps&.any? do |tap| prefix = "#{tap}/" entry.name.start_with?(prefix) || entry.options[:full_name]&.start_with?(prefix) diff --git a/Library/Homebrew/bundle/tap_installer.rb b/Library/Homebrew/bundle/tap_installer.rb index 77718e116d..7989a42f2b 100644 --- a/Library/Homebrew/bundle/tap_installer.rb +++ b/Library/Homebrew/bundle/tap_installer.rb @@ -4,7 +4,7 @@ module Homebrew module Bundle module TapInstaller - def self.preinstall(name, verbose: false, **_options) + def self.preinstall!(name, verbose: false, **_options) if installed_taps.include? name puts "Skipping install of #{name} tap. It is already installed." if verbose return false @@ -13,13 +13,12 @@ module Homebrew true end - def self.install(name, preinstall: true, verbose: false, force: false, **options) + def self.install!(name, preinstall: true, verbose: false, force: false, **options) return true unless preinstall puts "Installing #{name} tap. It is not currently installed." if verbose args = [] args << "--force" if force - args.append("--force-auto-update") if options[:force_auto_update] success = if options[:clone_target] Bundle.brew("tap", name, options[:clone_target], *args, verbose:) diff --git a/Library/Homebrew/bundle/vscode_extension_installer.rb b/Library/Homebrew/bundle/vscode_extension_installer.rb index 22e10be431..408aa57ffe 100644 --- a/Library/Homebrew/bundle/vscode_extension_installer.rb +++ b/Library/Homebrew/bundle/vscode_extension_installer.rb @@ -8,7 +8,7 @@ module Homebrew @installed_extensions = nil end - def self.preinstall(name, no_upgrade: false, verbose: false) + def self.preinstall!(name, no_upgrade: false, verbose: false) if !Bundle.vscode_installed? && Bundle.cask_installed? puts "Installing visual-studio-code. It is not currently installed." if verbose Bundle.brew("install", "--cask", "visual-studio-code", verbose:) @@ -24,7 +24,7 @@ module Homebrew true end - def self.install(name, preinstall: true, no_upgrade: false, verbose: false, force: false) + def self.install!(name, preinstall: true, no_upgrade: false, verbose: false, force: false) return true unless preinstall return true if extension_installed?(name) diff --git a/Library/Homebrew/bundle/whalebrew_installer.rb b/Library/Homebrew/bundle/whalebrew_installer.rb index d9dd75387d..a5566c4923 100644 --- a/Library/Homebrew/bundle/whalebrew_installer.rb +++ b/Library/Homebrew/bundle/whalebrew_installer.rb @@ -8,7 +8,7 @@ module Homebrew @installed_images = nil end - def self.preinstall(name, verbose: false, **_options) + def self.preinstall!(name, verbose: false, **_options) unless Bundle.whalebrew_installed? puts "Installing whalebrew. It is not currently installed." if verbose Bundle.brew("install", "--formula", "whalebrew", verbose:) @@ -23,7 +23,7 @@ module Homebrew true end - def self.install(name, preinstall: true, verbose: false, force: false, **_options) + def self.install!(name, preinstall: true, verbose: false, force: false, **_options) odeprecated "`brew bundle` `whalebrew` support", "using `whalebrew` directly" return true unless preinstall diff --git a/Library/Homebrew/extend/cachable.rb b/Library/Homebrew/cachable.rb similarity index 100% rename from Library/Homebrew/extend/cachable.rb rename to Library/Homebrew/cachable.rb diff --git a/Library/Homebrew/cask/artifact/abstract_artifact.rb b/Library/Homebrew/cask/artifact/abstract_artifact.rb index 09ed1fabe8..f9199256f6 100644 --- a/Library/Homebrew/cask/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/artifact/abstract_artifact.rb @@ -139,7 +139,11 @@ module Cask def initialize(cask, *dsl_args) @cask = cask + @dirmethod = nil @dsl_args = dsl_args.deep_dup + @dsl_key = nil + @english_article = nil + @english_name = nil end def config diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index dc01d74545..e33c6431b2 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -41,7 +41,9 @@ module Cask super target = target_hash[:target] + @source = nil @source_string = source.to_s + @target = nil @target_string = target.to_s end diff --git a/Library/Homebrew/cask/artifact_set.rb b/Library/Homebrew/cask/artifact_set.rb index 517debcd25..8f1da460b4 100644 --- a/Library/Homebrew/cask/artifact_set.rb +++ b/Library/Homebrew/cask/artifact_set.rb @@ -1,9 +1,14 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true module Cask # Sorted set containing all cask artifacts. class ArtifactSet < ::Set + extend T::Generic + + Elem = type_member(:out) { { fixed: Artifact::AbstractArtifact } } + + sig { params(block: T.nilable(T.proc.params(arg0: Elem).returns(T.untyped))).void } def each(&block) return enum_for(T.must(__method__)) { size } unless block @@ -11,6 +16,7 @@ module Cask self end + sig { returns(T::Array[Artifact::AbstractArtifact]) } def to_a super.sort end diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 0dbd453b93..f4bb7eb924 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -27,7 +27,7 @@ module Cask sig { params( - cask: ::Cask::Cask, download: T::Boolean, quarantine: T::Boolean, token_conflicts: T.nilable(T::Boolean), + cask: ::Cask::Cask, download: T::Boolean, quarantine: T::Boolean, online: T.nilable(T::Boolean), strict: T.nilable(T::Boolean), signing: T.nilable(T::Boolean), new_cask: T.nilable(T::Boolean), only: T::Array[String], except: T::Array[String] ).void @@ -35,14 +35,13 @@ module Cask def initialize( cask, download: false, quarantine: false, - token_conflicts: nil, online: nil, strict: nil, signing: nil, + online: nil, strict: nil, signing: nil, new_cask: nil, only: [], except: [] ) - # `new_cask` implies `online`, `token_conflicts`, `strict` and `signing` + # `new_cask` implies `online`, `strict` and `signing` online = new_cask if online.nil? strict = new_cask if strict.nil? signing = new_cask if signing.nil? - token_conflicts = new_cask if token_conflicts.nil? # `online` and `signing` imply `download` download ||= online || signing @@ -53,7 +52,6 @@ module Cask @strict = strict @signing = signing @new_cask = new_cask - @token_conflicts = token_conflicts @only = only @except = except end @@ -70,9 +68,6 @@ module Cask sig { returns(T::Boolean) } def strict? = !!@strict - sig { returns(T::Boolean) } - def token_conflicts? = !!@token_conflicts - sig { returns(::Cask::Audit) } def run! only_audits = @only @@ -430,15 +425,10 @@ module Cask sig { void } def audit_token_conflicts - return unless token_conflicts? - Homebrew.with_no_api_env do return unless core_formula_names.include?(cask.token) - add_error( - "possible duplicate, cask token conflicts with Homebrew core formula: #{Formatter.url(core_formula_url)}", - strict_only: true, - ) + add_error("cask token conflicts with an existing homebrew/core formula: #{Formatter.url(core_formula_url)}") end end @@ -606,7 +596,10 @@ module Cask def audit_rosetta return if (url = cask.url).nil? return unless online? + # Rosetta 2 is only for ARM-capable macOS versions, which are Big Sur (11.x) and later return if Homebrew::SimulateSystem.current_arch != :arm + return if MacOSVersion::SYMBOLS.fetch(Homebrew::SimulateSystem.current_os, "10") < "11" + return if cask.depends_on.macos&.maximum_version.to_s < "11" odebug "Auditing Rosetta 2 requirement" @@ -640,7 +633,7 @@ module Cask # binary stanza can contain shell scripts, so we just continue if lipo fails. next unless result.success? - odebug result.merged_output + odebug "Architectures: #{result.merged_output}" unless /arm64|x86_64/.match?(result.merged_output) add_error "Artifacts architecture is no longer supported by macOS!", @@ -650,11 +643,12 @@ module Cask supports_arm = result.merged_output.include?("arm64") mentions_rosetta = cask.caveats.include?("requires Rosetta 2") + requires_intel = cask.depends_on.arch&.any? { |arch| arch[:type] == :intel } if supports_arm && mentions_rosetta - add_error "Artifacts does not require Rosetta 2 but the caveats say otherwise!", + add_error "Artifacts do not require Rosetta 2 but the caveats say otherwise!", location: url.location - elsif !supports_arm && !mentions_rosetta + elsif !supports_arm && !mentions_rosetta && !requires_intel add_error "Artifacts require Rosetta 2 but this is not indicated by the caveats!", location: url.location end @@ -698,45 +692,53 @@ module Cask return unless online? return unless strict? - odebug "Auditing minimum OS version" + odebug "Auditing minimum macOS version" - plist_min_os = cask_plist_min_os - sparkle_min_os = livecheck_min_os + bundle_min_os = cask_bundle_min_os + sparkle_min_os = cask_sparkle_min_os + app_min_os = [bundle_min_os, sparkle_min_os].compact.max debug_messages = [] - debug_messages << "Plist #{plist_min_os}" if plist_min_os - debug_messages << "Sparkle #{sparkle_min_os}" if sparkle_min_os - odebug "Detected minimum OS version: #{debug_messages.join(" | ")}" unless debug_messages.empty? - min_os = [plist_min_os, sparkle_min_os].compact.max - - return if min_os.nil? || min_os <= HOMEBREW_MACOS_OLDEST_ALLOWED + debug_messages << "from artifact: #{bundle_min_os.to_sym}" if bundle_min_os + debug_messages << "from upstream: #{sparkle_min_os.to_sym}" if sparkle_min_os + odebug "Detected minimum macOS: #{app_min_os.to_sym} (#{debug_messages.join(" | ")})" if app_min_os + return if app_min_os.nil? || app_min_os <= HOMEBREW_MACOS_OLDEST_ALLOWED on_system_block_min_os = cask.on_system_block_min_os - cask_min_os = [on_system_block_min_os, cask.depends_on.macos&.minimum_version].compact.max - odebug "Declared minimum OS version: #{cask_min_os&.to_sym}" - return if cask_min_os&.to_sym == min_os.to_sym - return if cask.on_system_blocks_exist? && - OnSystem.arch_condition_met?(:arm) && + depends_on_min_os = cask.depends_on.macos&.minimum_version + + cask_min_os = [on_system_block_min_os, depends_on_min_os].compact.max + debug_messages = [] + debug_messages << "from on_system block: #{on_system_block_min_os.to_sym}" if on_system_block_min_os + if depends_on_min_os > HOMEBREW_MACOS_OLDEST_ALLOWED + debug_messages << "from depends_on stanza: #{depends_on_min_os.to_sym}" + end + odebug "Declared minimum macOS: #{cask_min_os.to_sym} (#{debug_messages.join(" | ").presence || "default"})" + return if cask_min_os.to_sym == app_min_os.to_sym + # ignore declared minimum OS < 11.x when auditing as ARM a cask with arch-specific artifacts + return if OnSystem.arch_condition_met?(:arm) && + cask.on_system_blocks_exist? && cask_min_os.present? && cask_min_os < MacOSVersion.new("11") - min_os_definition = if cask_min_os.present? - if on_system_block_min_os.present? && - on_system_block_min_os > cask.depends_on.macos&.minimum_version - "a block with a minimum OS version of #{cask_min_os.to_sym.inspect}" + min_os_definition = if cask_min_os > HOMEBREW_MACOS_OLDEST_ALLOWED + definition = if T.must(on_system_block_min_os.to_s <=> depends_on_min_os.to_s).positive? + "an on_system block" else - cask_min_os.to_sym.inspect + "a depends_on stanza" end + "#{definition} with a minimum macOS version of #{cask_min_os.to_sym.inspect}" else - "no minimum OS version" + "no minimum macOS version" end - add_error "Upstream defined #{min_os.to_sym.inspect} as the minimum OS version " \ + source = T.must(bundle_min_os.to_s <=> sparkle_min_os.to_s).positive? ? "Artifact" : "Upstream" + add_error "#{source} defined #{app_min_os.to_sym.inspect} as the minimum macOS version " \ "but the cask declared #{min_os_definition}", strict_only: true end sig { returns(T.nilable(MacOSVersion)) } - def livecheck_min_os + def cask_sparkle_min_os return unless online? return unless cask.livecheck_defined? return if cask.livecheck.strategy != :sparkle @@ -769,10 +771,10 @@ module Cask end sig { returns(T.nilable(MacOSVersion)) } - def cask_plist_min_os + def cask_bundle_min_os return unless online? - plist_min_os = T.let(nil, T.untyped) + min_os = T.let(nil, T.untyped) @staged_path ||= cask.staged_path extract_artifacts do |artifacts, tmpdir| @@ -783,13 +785,33 @@ module Cask next unless File.exist?(plist_path) plist = system_command!("plutil", args: ["-convert", "xml1", "-o", "-", plist_path]).plist - plist_min_os = plist["LSMinimumSystemVersion"].presence - break if plist_min_os + min_os = plist["LSMinimumSystemVersion"].presence + break if min_os + + next unless (main_binary = get_plist_main_binary(path)) + next if !File.exist?(main_binary) || File.open(main_binary, "rb") { |f| f.read(2) == "#!" } + + macho = MachO.open(main_binary) + min_os = case macho + when MachO::MachOFile + [ + macho[:LC_VERSION_MIN_MACOSX].first&.version_string, + macho[:LC_BUILD_VERSION].first&.minos_string, + ] + when MachO::FatFile + macho.machos.map do |slice| + [ + slice[:LC_VERSION_MIN_MACOSX].first&.version_string, + slice[:LC_BUILD_VERSION].first&.minos_string, + ] + end.flatten + end.compact.min + break if min_os end end begin - MacOSVersion.new(plist_min_os).strip_patch + MacOSVersion.new(min_os).strip_patch rescue MacOSVersion::Error nil end diff --git a/Library/Homebrew/cask/auditor.rb b/Library/Homebrew/cask/auditor.rb index 9fd21f2154..32c0e61aaa 100644 --- a/Library/Homebrew/cask/auditor.rb +++ b/Library/Homebrew/cask/auditor.rb @@ -11,17 +11,17 @@ module Cask params( cask: ::Cask::Cask, audit_download: T::Boolean, audit_online: T.nilable(T::Boolean), audit_strict: T.nilable(T::Boolean), audit_signing: T.nilable(T::Boolean), - audit_token_conflicts: T.nilable(T::Boolean), audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean, + audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean, any_named_args: T::Boolean, language: T.nilable(String), only: T::Array[String], except: T::Array[String] ).returns(T::Set[String]) } def self.audit( cask, audit_download: false, audit_online: nil, audit_strict: nil, audit_signing: nil, - audit_token_conflicts: nil, audit_new_cask: nil, quarantine: false, any_named_args: false, language: nil, + audit_new_cask: nil, quarantine: false, any_named_args: false, language: nil, only: [], except: [] ) new( - cask, audit_download:, audit_online:, audit_strict:, audit_signing:, audit_token_conflicts:, + cask, audit_download:, audit_online:, audit_strict:, audit_signing:, audit_new_cask:, quarantine:, any_named_args:, language:, only:, except: ).audit end @@ -36,7 +36,7 @@ module Cask params( cask: ::Cask::Cask, audit_download: T::Boolean, audit_online: T.nilable(T::Boolean), audit_strict: T.nilable(T::Boolean), audit_signing: T.nilable(T::Boolean), - audit_token_conflicts: T.nilable(T::Boolean), audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean, + audit_new_cask: T.nilable(T::Boolean), quarantine: T::Boolean, any_named_args: T::Boolean, language: T.nilable(String), only: T::Array[String], except: T::Array[String] ).void } @@ -46,7 +46,6 @@ module Cask audit_online: nil, audit_strict: nil, audit_signing: nil, - audit_token_conflicts: nil, audit_new_cask: nil, quarantine: false, any_named_args: false, @@ -61,7 +60,6 @@ module Cask @audit_strict = audit_strict @audit_signing = audit_signing @quarantine = quarantine - @audit_token_conflicts = audit_token_conflicts @any_named_args = any_named_args @language = language @only = only @@ -127,15 +125,14 @@ module Cask def audit_cask_instance(cask) audit = Audit.new( cask, - online: @audit_online, - strict: @audit_strict, - signing: @audit_signing, - new_cask: @audit_new_cask, - token_conflicts: @audit_token_conflicts, - download: @audit_download, - quarantine: @quarantine, - only: @only, - except: @except, + online: @audit_online, + strict: @audit_strict, + signing: @audit_signing, + new_cask: @audit_new_cask, + download: @audit_download, + quarantine: @quarantine, + only: @only, + except: @except, ) audit.run! end diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 4ce56d4011..b59b876072 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -8,7 +8,7 @@ require "cask/dsl" require "cask/metadata" require "cask/tab" require "utils/bottles" -require "extend/api_hashable" +require "api_hashable" module Cask # An instance of a cask. @@ -416,16 +416,14 @@ module Cask if @dsl.on_system_blocks_exist? begin - OnSystem::ALL_OS_ARCH_COMBINATIONS.each do |os, arch| - bottle_tag = ::Utils::Bottles::Tag.new(system: os, arch:) - next unless bottle_tag.valid_combination? + OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag| next if bottle_tag.linux? && @dsl.os.nil? next if bottle_tag.macos? && depends_on.macos && !@dsl.depends_on_set_in_block? && !depends_on.macos.allows?(bottle_tag.to_macos_version) - Homebrew::SimulateSystem.with(os:, arch:) do + Homebrew::SimulateSystem.with_tag(bottle_tag) do refresh to_h.each do |key, value| diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index bdf4bded72..4dd39bfc0f 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -6,6 +6,7 @@ require "cask/cask" require "uri" require "utils/curl" require "extend/hash/keys" +require "api" module Cask # Loads a cask from various sources. @@ -104,8 +105,8 @@ module Cask return end - return if %w[.rb .json].exclude?(path.extname) return unless path.expand_path.exist? + return if invalid_path?(path) return if Homebrew::EnvConfig.forbid_packages_from_paths? && !path.realpath.to_s.start_with?("#{Caskroom.path}/", "#{HOMEBREW_LIBRARY}/Taps/") @@ -113,6 +114,14 @@ module Cask new(path) end + sig { params(pathname: Pathname, valid_extnames: T::Array[String]).returns(T::Boolean) } + def self.invalid_path?(pathname, valid_extnames: %w[.rb .json]) + return true if valid_extnames.exclude?(pathname.extname) + + @invalid_basenames ||= %w[INSTALL_RECEIPT.json sbom.spdx.json].freeze + @invalid_basenames.include?(pathname.basename.to_s) + end + attr_reader :token, :path sig { params(path: T.any(Pathname, String), token: String).void } @@ -135,8 +144,10 @@ module Cask @content = path.read(encoding: "UTF-8") @config = config - if path.extname == ".json" - return FromAPILoader.new(token, from_json: JSON.parse(@content), path:).load(config:) + if !self.class.invalid_path?(path, valid_extnames: %w[.json]) && + (from_json = JSON.parse(@content).presence) && + from_json.is_a?(Hash) + return FromAPILoader.new(token, from_json:, path:).load(config:) end begin @@ -284,7 +295,7 @@ module Cask sig { returns(Pathname) } attr_reader :path - sig { returns(T.nilable(Hash)) } + sig { returns(T.nilable(T::Hash[String, T.untyped])) } attr_reader :from_json sig { @@ -306,7 +317,13 @@ module Cask new("#{tap}/#{token}") end - sig { params(token: String, from_json: Hash, path: T.nilable(Pathname)).void } + sig { + params( + token: String, + from_json: T.nilable(T::Hash[String, T.untyped]), + path: T.nilable(Pathname), + ).void + } def initialize(token, from_json: T.unsafe(nil), path: nil) @token = token.sub(%r{^homebrew/(?:homebrew-)?cask/}i, "") @sourcefile_path = path || Homebrew::API::Cask.cached_json_file_path @@ -400,7 +417,7 @@ module Cask container(**container_hash) end - json_cask[:artifacts].each do |artifact| + json_cask[:artifacts]&.each do |artifact| # convert generic string replacements into actual ones artifact = cask.loader.from_h_gsubs(artifact, appdir) key = artifact.keys.first diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 2387eabb30..22a55c4f1f 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -26,7 +26,7 @@ require "cask/dsl/version" require "cask/url" require "cask/utils" -require "extend/on_system" +require "on_system" module Cask # Class representing the domain-specific language used for casks. @@ -69,7 +69,6 @@ module Cask ].freeze DSL_METHODS = Set.new([ - :appcast, :arch, :artifacts, :auto_updates, @@ -123,15 +122,21 @@ module Cask sig { params(cask: Cask).void } def initialize(cask) - # NOTE: Variables set by `set_unique_stanza` must be initialized to `nil`. - @auto_updates = T.let(nil, T.nilable(T::Boolean)) + # NOTE: `:"@#{stanza}"` variables set by `set_unique_stanza` must be + # initialized to `nil`. @arch = T.let(nil, T.nilable(String)) + @arch_set_in_block = T.let(false, T::Boolean) @artifacts = T.let(ArtifactSet.new, ArtifactSet) + @auto_updates = T.let(nil, T.nilable(T::Boolean)) + @auto_updates_set_in_block = T.let(false, T::Boolean) + @autobump = T.let(true, T::Boolean) @called_in_on_system_block = T.let(false, T::Boolean) @cask = T.let(cask, Cask) @caveats = T.let(DSL::Caveats.new(cask), DSL::Caveats) @conflicts_with = T.let(nil, T.nilable(DSL::ConflictsWith)) + @conflicts_with_set_in_block = T.let(false, T::Boolean) @container = T.let(nil, T.nilable(DSL::Container)) + @container_set_in_block = T.let(false, T::Boolean) @depends_on = T.let(DSL::DependsOn.new, DSL::DependsOn) @depends_on_set_in_block = T.let(false, T::Boolean) @deprecated = T.let(false, T::Boolean) @@ -140,29 +145,32 @@ module Cask @deprecation_replacement_cask = T.let(nil, T.nilable(String)) @deprecation_replacement_formula = T.let(nil, T.nilable(String)) @desc = T.let(nil, T.nilable(String)) + @desc_set_in_block = T.let(false, T::Boolean) @disable_date = T.let(nil, T.nilable(Date)) @disable_reason = T.let(nil, T.nilable(T.any(String, Symbol))) @disable_replacement_cask = T.let(nil, T.nilable(String)) @disable_replacement_formula = T.let(nil, T.nilable(String)) @disabled = T.let(false, T::Boolean) @homepage = T.let(nil, T.nilable(String)) + @homepage_set_in_block = T.let(false, T::Boolean) @language_blocks = T.let({}, T::Hash[T::Array[String], Proc]) @language_eval = T.let(nil, T.nilable(String)) @livecheck = T.let(Livecheck.new(cask), Livecheck) @livecheck_defined = T.let(false, T::Boolean) @name = T.let([], T::Array[String]) - @autobump = T.let(true, T::Boolean) @no_autobump_defined = T.let(false, T::Boolean) @on_system_blocks_exist = T.let(false, T::Boolean) - @os = T.let(nil, T.nilable(String)) @on_system_block_min_os = T.let(nil, T.nilable(MacOSVersion)) + @os = T.let(nil, T.nilable(String)) + @os_set_in_block = T.let(false, T::Boolean) @sha256 = T.let(nil, T.nilable(T.any(Checksum, Symbol))) + @sha256_set_in_block = T.let(false, T::Boolean) @staged_path = T.let(nil, T.nilable(Pathname)) @token = T.let(cask.token, String) @url = T.let(nil, T.nilable(URL)) + @url_set_in_block = T.let(false, T::Boolean) @version = T.let(nil, T.nilable(DSL::Version)) - - set_no_autobump! + @version_set_in_block = T.let(false, T::Boolean) end sig { returns(T::Boolean) } @@ -177,13 +185,6 @@ module Cask sig { returns(T::Boolean) } def livecheck_defined? = @livecheck_defined - sig { void } - def set_no_autobump! - return if @livecheck.strategy != :extract_plist - - no_autobump! because: :extract_plist - end - sig { returns(T::Boolean) } def on_system_blocks_exist? = @on_system_blocks_exist @@ -225,7 +226,7 @@ module Cask raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only appear once.") end - if instance_variable_defined?(:"@#{stanza}_set_in_block") && @called_in_on_system_block + if instance_variable_get(:"@#{stanza}_set_in_block") && @called_in_on_system_block raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only be overridden once.") end end @@ -485,7 +486,7 @@ module Cask def add_implicit_macos_dependency return if (cask_depends_on = @depends_on).present? && cask_depends_on.macos.present? - depends_on macos: ">= :#{MacOSVersion::SYMBOLS.key MacOSVersion::SYMBOLS.values.min}" + depends_on macos: ">= #{MacOSVersion.new(HOMEBREW_MACOS_OLDEST_ALLOWED).to_sym.inspect}" end # Declare conflicts that keep a cask from installing or working correctly. @@ -547,6 +548,8 @@ module Cask @livecheck_defined = true @livecheck.instance_eval(&block) + no_autobump! because: :extract_plist if @livecheck.strategy == :extract_plist + @livecheck end # Whether the cask contains a `livecheck` block. This is a legacy alias diff --git a/Library/Homebrew/cask/dsl/base.rb b/Library/Homebrew/cask/dsl/base.rb index 900889a59e..e9932dae84 100644 --- a/Library/Homebrew/cask/dsl/base.rb +++ b/Library/Homebrew/cask/dsl/base.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true require "cask/utils" -require "extend/on_system" +require "on_system" module Cask class DSL diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index 7a5756f9c0..ddaf48698f 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -52,16 +52,17 @@ module Cask raise "Only a single 'depends_on macos' is allowed." if defined?(@macos) # workaround for https://github.com/sorbet/sorbet/issues/6860 - first_arg = args.first&.to_s + first_arg = args.first + first_arg_s = first_arg&.to_s begin @macos = if args.count > 1 MacOSRequirement.new([args], comparator: "==") - elsif MacOSVersion::SYMBOLS.key?(args.first) + elsif first_arg.is_a?(Symbol) && MacOSVersion::SYMBOLS.key?(first_arg) MacOSRequirement.new([args.first], comparator: "==") - elsif (md = /^\s*(?<|>|[=<>]=)\s*:(?\S+)\s*$/.match(first_arg)) + elsif (md = /^\s*(?<|>|[=<>]=)\s*:(?\S+)\s*$/.match(first_arg_s)) MacOSRequirement.new([T.must(md[:version]).to_sym], comparator: md[:comparator]) - elsif (md = /^\s*(?<|>|[=<>]=)\s*(?\S+)\s*$/.match(first_arg)) + elsif (md = /^\s*(?<|>|[=<>]=)\s*(?\S+)\s*$/.match(first_arg_s)) MacOSRequirement.new([md[:version]], comparator: md[:comparator]) # This is not duplicate of the first case: see `args.first` and a different comparator. else # rubocop:disable Lint/DuplicateBranch diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index de73305989..689ba95a0b 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -4,6 +4,7 @@ require "formula_installer" require "unpack_strategy" require "utils/topological_hash" +require "utils/analytics" require "cask/config" require "cask/download" @@ -149,7 +150,7 @@ module Cask oh1 "Installing Cask #{Formatter.identifier(@cask)}" # GitHub Actions globally disables Gatekeeper. - opoo "macOS's Gatekeeper has been disabled for this Cask" if !quarantine? && !GitHub::Actions.env_set? + opoo_outside_github_actions "macOS's Gatekeeper has been disabled for this Cask" unless quarantine? stage @cask.config = @cask.default_config.merge(old_config) @@ -188,7 +189,7 @@ on_request: true) when :deprecated opoo message_full when :disabled - GitHub::Actions.puts_annotation_if_env_set(:error, message) + GitHub::Actions.puts_annotation_if_env_set!(:error, message) raise CaskCannotBeInstalledError.new(@cask, message) end end @@ -303,6 +304,20 @@ on_request: true) next if artifact.is_a?(Artifact::Binary) && !binaries? + artifact = T.cast( + artifact, + T.any( + Artifact::AbstractFlightBlock, + Artifact::Installer, + Artifact::KeyboardLayout, + Artifact::Mdimporter, + Artifact::Moved, + Artifact::Pkg, + Artifact::Qlplugin, + Artifact::Symlinked, + ), + ) + artifact.install_phase( command: @command, verbose: verbose?, adopt: adopt?, auto_updates: @cask.auto_updates, force: force?, predecessor: @@ -548,6 +563,18 @@ on_request: true) artifacts.each do |artifact| if artifact.respond_to?(:uninstall_phase) + artifact = T.cast( + artifact, + T.any( + Artifact::AbstractFlightBlock, + Artifact::KeyboardLayout, + Artifact::Moved, + Artifact::Qlplugin, + Artifact::Symlinked, + Artifact::Uninstall, + ), + ) + odebug "Uninstalling artifact of class #{artifact.class}" artifact.uninstall_phase( command: @command, @@ -562,6 +589,8 @@ on_request: true) next unless artifact.respond_to?(:post_uninstall_phase) + artifact = T.cast(artifact, Artifact::Uninstall) + odebug "Post-uninstalling artifact of class #{artifact.class}" artifact.post_uninstall_phase( command: @command, @@ -575,7 +604,6 @@ on_request: true) def zap load_installed_caskfile! - ohai "Implied `brew uninstall --cask #{@cask}`" uninstall_artifacts if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty? opoo "No zap stanza present for Cask '#{@cask}'" @@ -764,10 +792,10 @@ on_request: true) if installed_caskfile&.exist? begin - @cask = CaskLoader.load(installed_caskfile) + @cask = CaskLoader.load_from_installed_caskfile(installed_caskfile) return - rescue CaskInvalidError - # could be caused by trying to load outdated caskfile + rescue CaskInvalidError, CaskUnavailableError + # could be caused by trying to load outdated or deleted caskfile end end diff --git a/Library/Homebrew/cask/tab.rb b/Library/Homebrew/cask/tab.rb index f7e12a3bcb..b6bc7a54da 100644 --- a/Library/Homebrew/cask/tab.rb +++ b/Library/Homebrew/cask/tab.rb @@ -5,10 +5,24 @@ require "tab" module Cask class Tab < ::AbstractTab - attr_accessor :uninstall_flight_blocks, :uninstall_artifacts + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :uninstall_flight_blocks + + sig { returns(T.nilable(T::Array[T.untyped])) } + attr_accessor :uninstall_artifacts + + sig { params(attributes: T::Hash[String, T.untyped]).void } + def initialize(attributes = {}) + @uninstall_flight_blocks = T.let(nil, T.nilable(T::Boolean)) + @uninstall_artifacts = T.let(nil, T.nilable(T::Array[T.untyped])) + + super + end # Instantiates a {Tab} for a new installation of a cask. - def self.create(cask) + sig { override.params(formula_or_cask: T.any(Formula, Cask)).returns(T.attached_class) } + def self.create(formula_or_cask) + cask = T.cast(formula_or_cask, Cask) tab = super tab.tabfile = cask.metadata_main_container_path/FILENAME @@ -23,6 +37,7 @@ module Cask # Returns a {Tab} for an already installed cask, # or a fake one if the cask is not installed. + sig { params(cask: Cask).returns(T.attached_class) } def self.for_cask(cask) path = cask.metadata_main_container_path/FILENAME @@ -40,6 +55,7 @@ module Cask tab end + sig { returns(T.attached_class) } def self.empty tab = super tab.uninstall_flight_blocks = false @@ -76,10 +92,12 @@ module Cask runtime_deps end + sig { returns(T.nilable(String)) } def version source["version"] end + sig { params(_args: T.untyped).returns(String) } def to_json(*_args) attributes = { "homebrew_version" => homebrew_version, @@ -98,6 +116,7 @@ module Cask JSON.pretty_generate(attributes) end + sig { returns(String) } def to_s s = ["Installed"] s << "using the formulae.brew.sh API" if loaded_from_api diff --git a/Library/Homebrew/cask/upgrade.rb b/Library/Homebrew/cask/upgrade.rb index b6a077de52..d289753ce7 100644 --- a/Library/Homebrew/cask/upgrade.rb +++ b/Library/Homebrew/cask/upgrade.rb @@ -23,7 +23,7 @@ module Cask require_sha: T.nilable(T::Boolean), ).returns(T::Boolean) } - def self.upgrade_casks( + def self.upgrade_casks!( *casks, args:, force: false, @@ -134,7 +134,7 @@ module Cask return true if caught_exceptions.empty? raise MultipleCaskErrors, caught_exceptions if caught_exceptions.count > 1 - raise caught_exceptions.fetch(0) if caught_exceptions.count == 1 + raise caught_exceptions.fetch(0) if caught_exceptions.one? false end diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index c6c9fc9b03..0f82c65abf 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -11,11 +11,12 @@ module Cask T.any(URI::Generic, String, [T.any(URI::Generic, String), T::Hash[Symbol, T.untyped]]) end + # Methods for the `url` stanza. class DSL sig { returns(T.any(URI::Generic, String)) } attr_reader :uri - sig { returns(T.nilable(T::Array[String])) } + sig { returns(T.nilable(T::Hash[T.any(Symbol, String), String])) } attr_reader :revisions sig { returns(T.nilable(T::Boolean)) } @@ -57,7 +58,7 @@ module Cask # @api public branch: T.nilable(String), # @api public - revisions: T.nilable(T::Array[String]), + revisions: T.nilable(T::Hash[T.any(Symbol, String), String]), # @api public revision: T.nilable(String), # @api public @@ -87,7 +88,7 @@ module Cask specs[:using] = @using = T.let(using, T.any(T::Class[AbstractDownloadStrategy], Symbol, NilClass)) specs[:tag] = @tag = T.let(tag, T.nilable(String)) specs[:branch] = @branch = T.let(branch, T.nilable(String)) - specs[:revisions] = @revisions = T.let(revisions, T.nilable(T::Array[String])) + specs[:revisions] = @revisions = T.let(revisions, T.nilable(T::Hash[T.any(Symbol, String), String])) specs[:revision] = @revision = T.let(revision, T.nilable(String)) specs[:trust_cert] = @trust_cert = T.let(trust_cert, T.nilable(T::Boolean)) specs[:cookies] = @cookies = T.let(cookies, T.nilable(T::Hash[String, String])) @@ -101,6 +102,7 @@ module Cask end end + # Allow passing a block to the `url` stanza. class BlockDSL # Allow accessing the URL associated with page contents. class PageWithURL < SimpleDelegator @@ -197,7 +199,7 @@ module Cask using: T.any(T::Class[AbstractDownloadStrategy], Symbol, NilClass), tag: T.nilable(String), branch: T.nilable(String), - revisions: T.nilable(T::Array[String]), + revisions: T.nilable(T::Hash[T.any(Symbol, String), String]), revision: T.nilable(String), trust_cert: T.nilable(T::Boolean), cookies: T.nilable(T::Hash[String, String]), diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index b843926058..1636add08d 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -14,40 +14,54 @@ class Caveats sig { params(formula: Formula).void } def initialize(formula) @formula = formula + @caveats = T.let(nil, T.nilable(String)) + @completions_and_elisp = T.let(nil, T.nilable(T::Array[String])) end sig { returns(String) } def caveats - caveats = [] - build = formula.build - begin - formula.build = Tab.for_formula(formula) - string = formula.caveats.to_s - caveats << "#{string.chomp}\n" unless string.empty? - ensure - formula.build = build + @caveats ||= begin + caveats = [] + build = formula.build + begin + formula.build = Tab.for_formula(formula) + string = formula.caveats.to_s + caveats << "#{string.chomp}\n" unless string.empty? + ensure + formula.build = build + end + caveats << keg_only_text + caveats << service_caveats + caveats.compact.join("\n") end - caveats << keg_only_text - - valid_shells = [:bash, :zsh, :fish, :pwsh].freeze - current_shell = Utils::Shell.preferred || Utils::Shell.parent - shells = if current_shell.present? && - (shell_sym = current_shell.to_sym) && - valid_shells.include?(shell_sym) - [shell_sym] - else - valid_shells - end - shells.each do |shell| - caveats << function_completion_caveats(shell) - end - - caveats << service_caveats - caveats << elisp_caveats - caveats.compact.join("\n") end - delegate [:empty?, :to_s] => :caveats + sig { returns(T::Boolean) } + def empty? + caveats.blank? && completions_and_elisp.blank? + end + + delegate [:to_s] => :caveats + + sig { returns(T::Array[String]) } + def completions_and_elisp + @completions_and_elisp ||= begin + valid_shells = [:bash, :zsh, :fish, :pwsh].freeze + current_shell = Utils::Shell.preferred || Utils::Shell.parent + shells = if current_shell.present? && + (shell_sym = current_shell.to_sym) && + valid_shells.include?(shell_sym) + [shell_sym] + else + valid_shells + end + completions_and_elisp = shells.map do |shell| + function_completion_caveats(shell) + end + completions_and_elisp << elisp_caveats + completions_and_elisp.compact + end + end sig { params(skip_reason: T::Boolean).returns(T.nilable(String)) } def keg_only_text(skip_reason: false) @@ -180,7 +194,7 @@ class Caveats startup = formula.service.requires_root? if Utils::Service.running?(formula) s << "To restart #{formula.full_name} after an upgrade:" - s << " #{startup ? "sudo " : ""}brew services restart #{formula.full_name}" + s << " #{"sudo " if startup}brew services restart #{formula.full_name}" elsif startup s << "To start #{formula.full_name} now and restart at startup:" s << " sudo brew services start #{formula.full_name}" diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index b6cc9f836a..0798ff30c4 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -195,7 +195,7 @@ module Homebrew return false unless (name = basename.to_s[/\A(.*?)--/, 1]) cask = begin - Cask::CaskLoader.load(name) + Cask::CaskLoader.load(name, warn: false) rescue Cask::CaskError nil end diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index 83931ba902..1047b10265 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -571,6 +571,7 @@ module Homebrew end return unless available return if Context.current.quiet? + return if cask&.old_tokens&.include?(ref) opoo package_conflicts_message(ref, loaded_type, cask) end diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index eda01f6274..9d6e4b3314 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -208,11 +208,15 @@ module Homebrew return if global_switch description = option_description(description, *names, hidden:) - process_option(*names, description, type: :switch, hidden:) unless disable - + env, counterpart = env + if env && @non_global_processed_options.any? + affix = counterpart ? " and `#{counterpart}` is passed." : "." + description += " Enabled by default if `$HOMEBREW_#{env.upcase}` is set#{affix}" + end if replacement || disable description += " (#{disable ? "disabled" : "deprecated"}#{"; replaced by #{replacement}" if replacement})" end + process_option(*names, description, type: :switch, hidden:) unless disable @parser.public_send(method, *names, *wrap_option_desc(description)) do |value| # This odeprecated should stick around indefinitely. diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb index e0a2a50307..90f505942d 100644 --- a/Library/Homebrew/cmd/--env.rb +++ b/Library/Homebrew/cmd/--env.rb @@ -31,7 +31,7 @@ module Homebrew sig { override.void } def run ENV.activate_extensions! - T.cast(ENV, Superenv).deps = args.named.to_formulae if superenv?(nil) + ENV.deps = args.named.to_formulae if superenv?(nil) ENV.setup_build_environment shell = if args.plain? diff --git a/Library/Homebrew/cmd/alias.rb b/Library/Homebrew/cmd/alias.rb index 85272c67de..35a9a546e9 100755 --- a/Library/Homebrew/cmd/alias.rb +++ b/Library/Homebrew/cmd/alias.rb @@ -8,13 +8,14 @@ module Homebrew module Cmd class Alias < AbstractCommand cmd_args do - usage_banner "`alias` [ ... | =]" + usage_banner "`alias` [`--edit`] [|=]" description <<~EOS - Show existing aliases. If no aliases are given, print the whole list. + Show an alias's command. If no alias is given, print the whole list. EOS switch "--edit", description: "Edit aliases in a text editor. Either one or all aliases may be opened at once. " \ "If the given alias doesn't exist it'll be pre-populated with a template." + named_args max: 1 end diff --git a/Library/Homebrew/cmd/bundle.rb b/Library/Homebrew/cmd/bundle.rb index 84e6b3ab23..577a7e3849 100755 --- a/Library/Homebrew/cmd/bundle.rb +++ b/Library/Homebrew/cmd/bundle.rb @@ -73,11 +73,10 @@ module Homebrew description: "`install` prints output from commands as they are run. " \ "`check` lists all missing dependencies." switch "--no-upgrade", - env: :bundle_no_upgrade, description: "`install` does not run `brew upgrade` on outdated dependencies. " \ "`check` does not check for outdated dependencies. " \ - "Note they may still be upgraded by `brew install` if needed. " \ - "This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." + "Note they may still be upgraded by `brew install` if needed.", + env: :bundle_no_upgrade switch "--upgrade", description: "`install` runs `brew upgrade` on outdated dependencies, " \ "even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set." @@ -87,41 +86,36 @@ module Homebrew switch "--install", description: "Run `install` before continuing to other operations e.g. `exec`." switch "--services", - env: :bundle_services, - description: "Temporarily start services while running the `exec` or `sh` command. " \ - "This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set." + description: "Temporarily start services while running the `exec` or `sh` command.", + env: :bundle_services switch "-f", "--force", description: "`install` runs with `--force`/`--overwrite`. " \ "`dump` overwrites an existing `Brewfile`. " \ "`cleanup` actually performs its cleanup operations." switch "--cleanup", - env: :bundle_install_cleanup, - description: "`install` performs cleanup operation, same as running `cleanup --force`. " \ - "This is enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and " \ - "`--global` is passed." + description: "`install` performs cleanup operation, same as running `cleanup --force`.", + env: [:bundle_install_cleanup, "--global"] switch "--all", description: "`list` all dependencies." - switch "--formula", "--brews", - description: "`list` or `dump` Homebrew formula dependencies." + switch "--formula", "--formulae", "--brews", + description: "`list`, `dump` or `cleanup` Homebrew formula dependencies." switch "--cask", "--casks", - description: "`list` or `dump` Homebrew cask dependencies." + description: "`list`, `dump` or `cleanup` Homebrew cask dependencies." switch "--tap", "--taps", - description: "`list` or `dump` Homebrew tap dependencies." + description: "`list`, `dump` or `cleanup` Homebrew tap dependencies." switch "--mas", description: "`list` or `dump` Mac App Store dependencies." switch "--whalebrew", description: "`list` or `dump` Whalebrew dependencies." switch "--vscode", - description: "`list` or `dump` VSCode (and forks/variants) extensions." + description: "`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions." switch "--no-vscode", - env: :bundle_dump_no_vscode, - description: "`dump` without VSCode (and forks/variants) extensions. " \ - "This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set." + description: "`dump` without VSCode (and forks/variants) extensions.", + env: :bundle_dump_no_vscode switch "--describe", - env: :bundle_dump_describe, description: "`dump` adds a description comment above each line, unless the " \ - "dependency does not have a description. " \ - "This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set." + "dependency does not have a description.", + env: :bundle_dump_describe switch "--no-restart", description: "`dump` does not add `restart_service` to formula lines." switch "--zap", @@ -168,7 +162,7 @@ module Homebrew zap = args.zap? Homebrew::Bundle.upgrade_formulae = args.upgrade_formulae - no_type_args = !args.brews? && !args.casks? && !args.taps? && !args.mas? && !args.whalebrew? && !args.vscode? + no_type_args = [args.formulae?, args.casks?, args.taps?, args.mas?, args.whalebrew?, args.vscode?].none? if args.install? if [nil, "install", "upgrade"].include?(subcommand) @@ -215,7 +209,7 @@ module Homebrew describe: args.describe?, no_restart: args.no_restart?, taps: args.taps? || no_type_args, - brews: args.brews? || no_type_args, + formulae: args.formulae? || no_type_args, casks: args.casks? || no_type_args, mas: args.mas? || no_type_args, whalebrew: args.whalebrew? || no_type_args, @@ -226,7 +220,13 @@ module Homebrew exec_editor(Homebrew::Bundle::Brewfile.path(global:, file:)) when "cleanup" require "bundle/commands/cleanup" - Homebrew::Bundle::Commands::Cleanup.run(global:, file:, force:, zap:) + Homebrew::Bundle::Commands::Cleanup.run( + global:, file:, force:, zap:, + formulae: args.formulae? || no_type_args, + casks: args.casks? || no_type_args, + taps: args.taps? || no_type_args, + vscode: args.vscode? || no_type_args + ) when "check" require "bundle/commands/check" Homebrew::Bundle::Commands::Check.run(global:, file:, no_upgrade:, verbose:) @@ -235,7 +235,7 @@ module Homebrew Homebrew::Bundle::Commands::List.run( global:, file:, - brews: args.brews? || args.all? || no_type_args, + formulae: args.formulae? || args.all? || no_type_args, casks: args.casks? || args.all?, taps: args.taps? || args.all?, mas: args.mas? || args.all?, @@ -243,9 +243,9 @@ module Homebrew vscode: args.vscode? || args.all?, ) when "add", "remove" - # We intentionally omit the `s` from `brews`, `casks`, and `taps` for ease of handling later. + # We intentionally omit the s from `brews`, `casks`, and `taps` for ease of handling later. type_hash = { - brew: args.brews?, + brew: args.formulae?, cask: args.casks?, tap: args.taps?, mas: args.mas?, @@ -276,17 +276,7 @@ module Homebrew _subcommand, *named_args = args.named named_args when "sh" - preferred_path = Utils::Shell.preferred_path(default: "/bin/bash") - notice = unless Homebrew::EnvConfig.no_env_hints? - <<~EOS - Your shell has been configured to use a build environment from your `Brewfile`. - This should help you build stuff. - Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). - When done, type `exit`. - EOS - end - ENV["HOMEBREW_FORCE_API_AUTO_UPDATE"] = nil - [Utils::Shell.shell_with_prompt("brew bundle", preferred_path:, notice:)] + ["sh"] when "env" ["env"] end diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index 5aeb277dbc..5506093641 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -18,8 +18,7 @@ module Homebrew If any version of each formula argument is installed and no other options are passed, this command displays their actual runtime dependencies (similar - to `brew linkage`), which may differ from the current versions' stated - dependencies if the installed versions are outdated. + to `brew linkage`), which may differ from a formula's declared dependencies. *Note:* `--missing` and `--skip-recommended` have precedence over `--include-*`. EOS @@ -92,26 +91,50 @@ module Homebrew raise UsageError, "`brew deps --arch=all` is not supported" if args.arch == "all" os, arch = T.must(args.os_arch_combinations.first) - all = args.eval_all? + eval_all = args.eval_all? Formulary.enable_factory_cache! SimulateSystem.with(os:, arch:) do - recursive = !args.direct? - installed = args.installed? || dependents(args.named.to_formulae_and_casks).all?(&:any_version_installed?) + @use_runtime_dependencies = true - @use_runtime_dependencies = installed && recursive && - !args.tree? && - !args.graph? && - !args.HEAD? && - !args.include_implicit? && - !args.include_build? && - !args.include_test? && - !args.include_optional? && - !args.skip_recommended? && - !args.missing? && - args.os.nil? && - args.arch.nil? + installed = args.installed? || dependents(args.named.to_formulae_and_casks).all?(&:any_version_installed?) + unless installed + not_using_runtime_dependencies_reason = if args.installed? + "not all the named formulae were installed" + else + "`--installed` was not passed" + end + + @use_runtime_dependencies = false + end + + %w[direct tree graph HEAD skip_recommended missing + include_implicit include_build include_test include_optional].each do |arg| + next unless args.public_send("#{arg}?") + + not_using_runtime_dependencies_reason = "--#{arg.tr("_", "-")} was passed" + + @use_runtime_dependencies = false + end + + %w[os arch].each do |arg| + next if args.public_send(arg).nil? + + not_using_runtime_dependencies_reason = "--#{arg.tr("_", "-")} was passed" + + @use_runtime_dependencies = false + end + + if !@use_runtime_dependencies && !Homebrew::EnvConfig.no_env_hints? + opoo <<~EOS + `brew deps` is not the actual runtime dependencies because #{not_using_runtime_dependencies_reason}! + This means dependencies may differ from a formula's declared dependencies. + Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). + EOS + end + + recursive = !args.direct? if args.tree? || args.graph? dependents = if args.named.present? @@ -141,9 +164,9 @@ module Homebrew puts_deps_tree(dependents, recursive:) return - elsif all + elsif eval_all puts_deps(sorted_dependents( - Formula.all(eval_all: args.eval_all?) + Cask::Cask.all(eval_all: args.eval_all?), + Formula.all(eval_all:) + Cask::Cask.all(eval_all:), ), recursive:) return elsif !args.no_named? && args.for_each? diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 9b87d7b6aa..72d73a6a1c 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -25,7 +25,8 @@ module Homebrew "it is interpreted as a regular expression." switch "--eval-all", description: "Evaluate all available formulae and casks, whether installed or not, to search their " \ - "descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set." + "descriptions.", + env: :eval_all switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", @@ -47,7 +48,7 @@ module Homebrew end if search_type.present? - if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + if !args.eval_all? && Homebrew::EnvConfig.no_install_from_api? raise UsageError, "`brew desc --search` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end diff --git a/Library/Homebrew/cmd/developer.rb b/Library/Homebrew/cmd/developer.rb index 0c4feb5134..6442bfb1ef 100644 --- a/Library/Homebrew/cmd/developer.rb +++ b/Library/Homebrew/cmd/developer.rb @@ -9,7 +9,7 @@ module Homebrew cmd_args do description <<~EOS Control Homebrew's developer mode. When developer mode is enabled, - `brew update` will update Homebrew to the latest commit on the `master` + `brew update` will update Homebrew to the latest commit on the `main` branch instead of the latest stable version along with some other behaviour changes. `brew developer` [`state`]: @@ -38,7 +38,7 @@ module Homebrew puts "However, `brew update` will update to the latest stable tag because " \ "#{Tty.bold}HOMEBREW_UPDATE_TO_TAG#{Tty.reset} is set." else - puts "`brew update` will update to the latest commit on the `master` branch." + puts "`brew update` will update to the latest commit on the `main` branch." end else puts "`brew update` will update to the latest stable tag." diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 08b4de03d4..6c12d1c233 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -1,11 +1,11 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "abstract_command" require "formula" require "fetch" require "cask/download" -require "retryable_download" +require "download_queue" module Homebrew module Cmd @@ -69,49 +69,6 @@ module Homebrew named_args [:formula, :cask], min: 1 end - def concurrency - @concurrency ||= args.concurrency&.to_i || 1 - end - - def download_queue - @download_queue ||= begin - require "download_queue" - DownloadQueue.new(concurrency) - end - end - - class Spinner - FRAMES = [ - "⠋", - "⠙", - "⠚", - "⠞", - "⠖", - "⠦", - "⠴", - "⠲", - "⠳", - "⠓", - ].freeze - - sig { void } - def initialize - @start = Time.now - @i = 0 - end - - sig { returns(String) } - def to_s - now = Time.now - if @start + 0.1 < now - @start = now - @i = (@i + 1) % FRAMES.count - end - - FRAMES.fetch(@i) - end - end - sig { override.void } def run Formulary.enable_factory_cache! @@ -136,7 +93,7 @@ module Homebrew bucket.each do |formula_or_cask| case formula_or_cask when Formula - formula = T.cast(formula_or_cask, Formula) + formula = formula_or_cask ref = formula.loaded_from_api? ? formula.full_name : formula.path os_arch_combinations.each do |os, arch| @@ -171,9 +128,9 @@ module Homebrew end if (manifest_resource = bottle.github_packages_manifest_resource) - fetch_downloadable(manifest_resource) + download_queue.enqueue(manifest_resource) end - fetch_downloadable(bottle) + download_queue.enqueue(bottle) rescue Interrupt raise rescue => e @@ -189,14 +146,16 @@ module Homebrew next if fetched_bottle - fetch_downloadable(formula.resource) - - formula.resources.each do |r| - fetch_downloadable(r) - r.patches.each { |patch| fetch_downloadable(patch.resource) if patch.external? } + if (resource = formula.resource) + download_queue.enqueue(resource) end - formula.patchlist.each { |patch| fetch_downloadable(patch.resource) if patch.external? } + formula.resources.each do |r| + download_queue.enqueue(r) + r.patches.each { |patch| download_queue.enqueue(patch.resource) if patch.external? } + end + + formula.patchlist.each { |patch| download_queue.enqueue(patch.resource) if patch.external? } end end else @@ -216,131 +175,34 @@ module Homebrew quarantine = true if quarantine.nil? download = Cask::Download.new(cask, quarantine:) - fetch_downloadable(download) + download_queue.enqueue(download) end end end end - if concurrency == 1 - downloads.each do |downloadable, promise| - promise.wait! - rescue ChecksumMismatchError => e - opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" - Homebrew.failed = true if downloadable.is_a?(Resource::Patch) - end - else - spinner = Spinner.new - remaining_downloads = downloads.dup - previous_pending_line_count = 0 - - begin - $stdout.print Tty.hide_cursor - $stdout.flush - - output_message = lambda do |downloadable, future, last| - status = case future.state - when :fulfilled - "#{Tty.green}✔︎#{Tty.reset}" - when :rejected - "#{Tty.red}✘#{Tty.reset}" - when :pending, :processing - "#{Tty.blue}#{spinner}#{Tty.reset}" - else - raise future.state.to_s - end - - message = "#{downloadable.download_type.capitalize} #{downloadable.name}" - $stdout.print "#{status} #{message}#{"\n" unless last}" - $stdout.flush - - if future.rejected? - if (e = future.reason).is_a?(ChecksumMismatchError) - opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" - Homebrew.failed = true if downloadable.is_a?(Resource::Patch) - next 2 - else - message = future.reason.to_s - onoe message - Homebrew.failed = true - next message.count("\n") - end - end - - 1 - end - - until remaining_downloads.empty? - begin - finished_states = [:fulfilled, :rejected] - - finished_downloads, remaining_downloads = remaining_downloads.partition do |_, future| - finished_states.include?(future.state) - end - - finished_downloads.each do |downloadable, future| - previous_pending_line_count -= 1 - $stdout.print Tty.clear_to_end - $stdout.flush - output_message.call(downloadable, future, false) - end - - previous_pending_line_count = 0 - max_lines = [concurrency, Tty.height].min - remaining_downloads.each_with_index do |(downloadable, future), i| - break if previous_pending_line_count >= max_lines - - $stdout.print Tty.clear_to_end - $stdout.flush - last = i == max_lines - 1 || i == remaining_downloads.count - 1 - previous_pending_line_count += output_message.call(downloadable, future, last) - end - - if previous_pending_line_count.positive? - if (previous_pending_line_count - 1).zero? - $stdout.print Tty.move_cursor_beginning - else - $stdout.print Tty.move_cursor_up_beginning(previous_pending_line_count - 1) - end - $stdout.flush - end - - sleep 0.05 - rescue Interrupt - remaining_downloads.each do |_, future| - # FIXME: Implement cancellation of running downloads. - end - - download_queue.cancel - - if previous_pending_line_count.positive? - $stdout.print Tty.move_cursor_down(previous_pending_line_count - 1) - $stdout.flush - end - - raise - end - end - ensure - $stdout.print Tty.show_cursor - $stdout.flush - end - end + download_queue.start ensure download_queue.shutdown end private - def downloads - @downloads ||= {} + sig { returns(Integer) } + def concurrency + @concurrency ||= T.let(args.concurrency&.to_i || 1, T.nilable(Integer)) end - def fetch_downloadable(downloadable) - downloads[downloadable] ||= begin - tries = args.retry? ? {} : { tries: 1 } - download_queue.enqueue(RetryableDownload.new(downloadable, **tries), force: args.force?) - end + sig { returns(Integer) } + def retries + @retries ||= T.let(args.retry? ? FETCH_MAX_TRIES : 0, T.nilable(Integer)) + end + + sig { returns(DownloadQueue) } + def download_queue + @download_queue ||= T.let(begin + DownloadQueue.new(concurrency:, retries:, force: args.force?) + end, T.nilable(DownloadQueue)) end end end diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 5b9fda067d..58012652fc 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "abstract_command" @@ -18,7 +18,7 @@ module Homebrew class Info < AbstractCommand VALID_DAYS = %w[30 90 365].freeze VALID_FORMULA_CATEGORIES = %w[install install-on-request build-error].freeze - VALID_CATEGORIES = (VALID_FORMULA_CATEGORIES + %w[cask-install os-version]).freeze + VALID_CATEGORIES = T.let((VALID_FORMULA_CATEGORIES + %w[cask-install os-version]).freeze, T::Array[String]) cmd_args do description <<~EOS @@ -57,7 +57,7 @@ module Homebrew switch "--eval-all", depends_on: "--json", description: "Evaluate all available formulae and casks, whether installed or not, to print their " \ - "JSON. Implied if `$HOMEBREW_EVAL_ALL` is set." + "JSON." switch "--variations", depends_on: "--json", description: "Include the variations hash in each formula's JSON output." @@ -96,14 +96,15 @@ module Homebrew end print_analytics - elsif args.json - all = args.eval_all? - - print_json(all) + elsif (json = args.json) + print_json(json, args.eval_all?) elsif args.github? raise FormulaOrCaskUnspecifiedError if args.no_named? - exec_browser(*args.named.to_formulae_and_casks.map { |f| github_info(f) }) + exec_browser(*args.named.to_formulae_and_casks.map do |formula_keg_or_cask| + formula_or_cask = T.cast(formula_keg_or_cask, T.any(Formula, Cask::Cask)) + github_info(formula_or_cask) + end) elsif args.no_named? print_statistics else @@ -111,6 +112,7 @@ module Homebrew end end + sig { params(remote: String, path: String).returns(String) } def github_remote_path(remote, path) if remote =~ %r{^(?:https?://|git(?:@|://))github\.com[:/](.+)/(.+?)(?:\.git)?$} "https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/blob/HEAD/#{path}" @@ -175,6 +177,7 @@ module Homebrew end end + sig { params(version: T.any(T::Boolean, String)).returns(Symbol) } def json_version(version) version_hash = { true => :default, @@ -187,16 +190,16 @@ module Homebrew version_hash[version] end - sig { params(all: T::Boolean).void } - def print_json(all) - raise FormulaOrCaskUnspecifiedError if !(all || args.installed?) && args.no_named? + sig { params(json: T.any(T::Boolean, String), eval_all: T::Boolean).void } + def print_json(json, eval_all) + raise FormulaOrCaskUnspecifiedError if !(eval_all || args.installed?) && args.no_named? - json = case json_version(args.json) + json = case json_version(json) when :v1, :default raise UsageError, "Cannot specify `--cask` when using `--json=v1`!" if args.cask? - formulae = if all - Formula.all(eval_all: args.eval_all?).sort + formulae = if eval_all + Formula.all(eval_all:).sort elsif args.installed? Formula.installed.sort else @@ -210,10 +213,10 @@ module Homebrew end when :v2 formulae, casks = T.let( - if all + if eval_all [ - Formula.all(eval_all: args.eval_all?).sort, - Cask::Cask.all(eval_all: args.eval_all?).sort_by(&:full_name), + Formula.all(eval_all:).sort, + Cask::Cask.all(eval_all:).sort_by(&:full_name), ] elsif args.installed? [Formula.installed.sort, Cask::Caskroom.casks.sort_by(&:full_name)] @@ -240,25 +243,31 @@ module Homebrew puts JSON.pretty_generate(json) end + sig { params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(String) } def github_info(formula_or_cask) - return formula_or_cask.path if formula_or_cask.tap.blank? || formula_or_cask.tap.remote.blank? - path = case formula_or_cask when Formula formula = formula_or_cask - formula.path.relative_path_from(T.must(formula.tap).path) + tap = formula.tap + return formula.path.to_s if tap.blank? || tap.remote.blank? + + formula.path.relative_path_from(tap.path) when Cask::Cask cask = formula_or_cask + tap = cask.tap + return cask.sourcefile_path.to_s if tap.blank? || tap.remote.blank? + if cask.sourcefile_path.blank? || cask.sourcefile_path.extname != ".rb" - return "#{cask.tap.default_remote}/blob/HEAD/#{cask.tap.relative_cask_path(cask.token)}" + return "#{tap.default_remote}/blob/HEAD/#{tap.relative_cask_path(cask.token)}" end - cask.sourcefile_path.relative_path_from(cask.tap.path) + cask.sourcefile_path.relative_path_from(tap.path) end - github_remote_path(formula_or_cask.tap.remote, path) + github_remote_path(tap.remote, path.to_s) end + sig { params(formula: Formula).void } def info_formula(formula) specs = [] @@ -356,6 +365,7 @@ module Homebrew Utils::Analytics.formula_output(formula, args:) end + sig { params(dependencies: T::Array[Dependency]).returns(String) } def decorate_dependencies(dependencies) deps_status = dependencies.map do |dep| if dep.satisfied?([]) @@ -367,6 +377,7 @@ module Homebrew deps_status.join(", ") end + sig { params(requirements: T::Array[Requirement]).returns(String) } def decorate_requirements(requirements) req_status = requirements.map do |req| req_s = req.display_s @@ -375,12 +386,14 @@ module Homebrew req_status.join(", ") end + sig { params(dep: Dependency).returns(String) } def dep_display_s(dep) return dep.name if dep.option_tags.empty? "#{dep.name} #{dep.option_tags.map { |o| "--#{o}" }.join(" ")}" end + sig { params(cask: Cask::Cask).void } def info_cask(cask) require "cask/info" diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 517414f9fe..2ef3b7c74b 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -33,8 +33,8 @@ module Homebrew description: "If brewing fails, open an interactive debugging session with access to IRB " \ "or a shell inside the temporary build directory." switch "--display-times", - env: :display_install_times, - description: "Print install times for each package at the end of the run." + description: "Print install times for each package at the end of the run.", + env: :display_install_times switch "-f", "--force", description: "Install formulae without checking for previously installed keg-only or " \ "non-migrated versions. When installing casks, overwrite existing files " \ @@ -44,9 +44,9 @@ module Homebrew switch "-n", "--dry-run", description: "Show what would be installed, but do not actually install anything." switch "--ask", - env: :ask, description: "Ask for confirmation before downloading and installing formulae. " \ - "Print bottles and dependencies download size and install size." + "Print download and install sizes of bottles and dependencies.", + env: :ask [ [:switch, "--formula", "--formulae", { description: "Treat all named arguments as formulae.", @@ -259,7 +259,7 @@ module Homebrew if !Homebrew::EnvConfig.no_install_upgrade? && installed_casks.any? require "cask/upgrade" - Cask::Upgrade.upgrade_casks( + Cask::Upgrade.upgrade_casks!( *installed_casks, force: args.force?, dry_run: args.dry_run?, @@ -310,9 +310,7 @@ module Homebrew Install.perform_preinstall_checks_once Install.check_cc_argv(args.cc) - Install.ask_formulae(installed_formulae, args: args) if args.ask? - - Install.install_formulae( + formulae_installer = Install.formula_installers( installed_formulae, installed_on_request: !args.as_dependency?, installed_as_dependency: args.as_dependency?, @@ -338,9 +336,10 @@ module Homebrew skip_link: args.skip_link?, ) - Upgrade.check_installed_dependents( + dependants = Upgrade.dependants( installed_formulae, flags: args.flags_only, + ask: args.ask?, installed_on_request: !args.as_dependency?, force_bottle: args.force_bottle?, build_from_source_formulae: args.build_from_source_formulae, @@ -354,6 +353,28 @@ module Homebrew dry_run: args.dry_run?, ) + # Main block: if asking the user is enabled, show dependency and size information. + Install.ask_formulae(formulae_installer, dependants, args: args) if args.ask? + + Install.install_formulae(formulae_installer, + dry_run: args.dry_run?, + verbose: args.verbose?) + + Upgrade.upgrade_dependents( + dependants, installed_formulae, + flags: args.flags_only, + dry_run: args.dry_run?, + force_bottle: args.force_bottle?, + build_from_source_formulae: args.build_from_source_formulae, + interactive: args.interactive?, + keep_tmp: args.keep_tmp?, + debug_symbols: args.debug_symbols?, + force: args.force?, + debug: args.debug?, + quiet: args.quiet?, + verbose: args.verbose? + ) + Cleanup.periodic_clean!(dry_run: args.dry_run?) Homebrew.messages.display_messages(display_times: args.display_times?) diff --git a/Library/Homebrew/cmd/mcp-server.rb b/Library/Homebrew/cmd/mcp-server.rb new file mode 100644 index 0000000000..9a31e2a3e4 --- /dev/null +++ b/Library/Homebrew/cmd/mcp-server.rb @@ -0,0 +1,23 @@ +# typed: strong +# frozen_string_literal: true + +require "abstract_command" +require "shell_command" + +module Homebrew + module Cmd + class McpServerCmd < AbstractCommand + # This is a shell command as MCP servers need a faster startup time + # than a normal Homebrew Ruby command allows. + include ShellCommand + + cmd_args do + description <<~EOS + Starts the Homebrew MCP (Model Context Protocol) server. + EOS + switch "-d", "--debug", description: "Enable debug logging to stderr." + switch "--ping", description: "Start the server, act as if receiving a ping and then exit.", hidden: true + end + end + end +end diff --git a/Library/Homebrew/cmd/mcp-server.sh b/Library/Homebrew/cmd/mcp-server.sh new file mode 100644 index 0000000000..692eec5ed4 --- /dev/null +++ b/Library/Homebrew/cmd/mcp-server.sh @@ -0,0 +1,14 @@ +# Documentation defined in Library/Homebrew/cmd/mcp-server.rb + +# This is a shell command as MCP servers need a faster startup time +# than a normal Homebrew Ruby command allows. + +# HOMEBREW_LIBRARY is set by brew.sh +# HOMEBREW_BREW_FILE is set by extend/ENV/super.rb +# shellcheck disable=SC2154 +homebrew-mcp-server() { + source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh" + setup-ruby-path + export HOMEBREW_VERSION + "${HOMEBREW_RUBY_PATH}" "-r${HOMEBREW_LIBRARY}/Homebrew/mcp_server.rb" -e "Homebrew::McpServer.new.run" "$@" +} diff --git a/Library/Homebrew/cmd/nodenv-sync.rb b/Library/Homebrew/cmd/nodenv-sync.rb index 6c6d1d61de..0e9a704b29 100644 --- a/Library/Homebrew/cmd/nodenv-sync.rb +++ b/Library/Homebrew/cmd/nodenv-sync.rb @@ -52,8 +52,8 @@ module Homebrew version = Keg.new(path).version major_version = version.major.to_i - minor_version = version.minor.to_i || 0 - patch_version = version.patch.to_i || 0 + minor_version = version.minor.to_i + patch_version = version.patch.to_i minor_version_range, patch_version_range = if Homebrew::EnvConfig.env_sync_strict? # Only create symlinks for the exact installed patch version. diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index ad62093461..89528692eb 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -18,7 +18,8 @@ module Homebrew description: "Show options for formulae that are currently installed." switch "--eval-all", description: "Evaluate all available formulae and casks, whether installed or not, to show their " \ - "options." + "options.", + env: :eval_all flag "--command=", description: "Show options for the specified ." @@ -29,10 +30,10 @@ module Homebrew sig { override.void } def run - all = args.eval_all? + eval_all = args.eval_all? - if all - puts_options(Formula.all(eval_all: args.eval_all?).sort) + if eval_all + puts_options(Formula.all(eval_all:).sort) elsif args.installed? puts_options(Formula.installed.sort) elsif args.command.present? diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index 3acc2fcf84..6b4d81f179 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -32,12 +32,10 @@ module Homebrew "formula is outdated. Otherwise, the repository's HEAD will only be checked for " \ "updates when a new stable or development version has been released." switch "-g", "--greedy", - env: :upgrade_greedy, - description: "Also include outdated casks with `auto_updates true` or `version :latest`." - + description: "Also include outdated casks with `auto_updates true` or `version :latest`.", + env: :upgrade_greedy switch "--greedy-latest", description: "Also include outdated casks including those with `version :latest`." - switch "--greedy-auto-updates", description: "Also include outdated casks including those with `auto_updates true`." diff --git a/Library/Homebrew/cmd/pin.rb b/Library/Homebrew/cmd/pin.rb index 91a9608efe..0dc3633642 100644 --- a/Library/Homebrew/cmd/pin.rb +++ b/Library/Homebrew/cmd/pin.rb @@ -25,7 +25,7 @@ module Homebrew if f.pinned? opoo "#{f.name} already pinned" elsif !f.pinnable? - onoe "#{f.name} not installed" + ofail "#{f.name} not installed" else f.pin end diff --git a/Library/Homebrew/cmd/rbenv-sync.rb b/Library/Homebrew/cmd/rbenv-sync.rb index 41aa7a6f9a..6165e2b223 100644 --- a/Library/Homebrew/cmd/rbenv-sync.rb +++ b/Library/Homebrew/cmd/rbenv-sync.rb @@ -53,7 +53,7 @@ module Homebrew version = Keg.new(path).version major_version = version.major.to_i minor_version = version.minor.to_i - patch_version = version.patch.to_i || 0 + patch_version = version.patch.to_i patch_version_range = if Homebrew::EnvConfig.env_sync_strict? # Only create symlinks for the exact installed patch version. diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 6919beb28b..c38beaaceb 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -24,8 +24,8 @@ module Homebrew switch "--syntax", description: "Syntax-check all of Homebrew's Ruby files (if no is passed)." switch "--eval-all", - description: "Evaluate all available formulae and casks, whether installed or not. " \ - "Implied if `$HOMEBREW_EVAL_ALL` is set." + description: "Evaluate all available formulae and casks, whether installed or not.", + env: :eval_all switch "--no-simulate", description: "Don't simulate other system configurations when checking formulae and casks." @@ -49,7 +49,7 @@ module Homebrew options[:os_arch_combinations] = args.os_arch_combinations if args.os || args.arch taps = if args.no_named? - if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + unless args.eval_all? raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 2c1208e54a..e0dd7182dc 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -32,8 +32,8 @@ module Homebrew description: "If brewing fails, open an interactive debugging session with access to IRB " \ "or a shell inside the temporary build directory." switch "--display-times", - env: :display_install_times, - description: "Print install times for each package at the end of the run." + description: "Print install times for each package at the end of the run.", + env: :display_install_times switch "-f", "--force", description: "Install without checking for previously installed keg-only or " \ "non-migrated versions." @@ -41,7 +41,7 @@ module Homebrew description: "Print the verification and post-install steps." switch "--ask", description: "Ask for confirmation before downloading and upgrading formulae. " \ - "Print bottles and dependencies download size, install and net install size.", + "Print download, install and net install sizes of bottles and dependencies.", env: :ask [ [:switch, "--formula", "--formulae", { description: "Treat all named arguments as formulae." }], @@ -130,16 +130,13 @@ module Homebrew unless formulae.empty? Install.perform_preinstall_checks_once - # If asking the user is enabled, show dependency and size information. - Install.ask_formulae(formulae, args: args) if args.ask? - - formulae.each do |formula| + install_context = formulae.map do |formula| if formula.pinned? onoe "#{formula.full_name} is pinned. You must unpin it to reinstall." next end Migrator.migrate_if_needed(formula, force: args.force?) - Homebrew::Reinstall.reinstall_formula( + Homebrew::Reinstall.build_install_context( formula, flags: args.flags_only, force_bottle: args.force_bottle?, @@ -153,12 +150,12 @@ module Homebrew verbose: args.verbose?, git: args.git?, ) - Cleanup.install_formula_clean!(formula) end - Upgrade.check_installed_dependents( + dependants = Upgrade.dependants( formulae, flags: args.flags_only, + ask: args.ask?, force_bottle: args.force_bottle?, build_from_source_formulae: args.build_from_source_formulae, interactive: args.interactive?, @@ -169,6 +166,43 @@ module Homebrew quiet: args.quiet?, verbose: args.verbose?, ) + + formulae_installer = install_context.map(&:formula_installer) + + # Main block: if asking the user is enabled, show dependency and size information. + Install.ask_formulae(formulae_installer, dependants, args: args) if args.ask? + + install_context.each do |f| + Homebrew::Reinstall.reinstall_formula( + f, + flags: args.flags_only, + force_bottle: args.force_bottle?, + build_from_source_formulae: args.build_from_source_formulae, + interactive: args.interactive?, + keep_tmp: args.keep_tmp?, + debug_symbols: args.debug_symbols?, + force: args.force?, + debug: args.debug?, + quiet: args.quiet?, + verbose: args.verbose?, + git: args.git?, + ) + Cleanup.install_formula_clean!(f.formula) + end + + Upgrade.upgrade_dependents( + dependants, formulae, + flags: args.flags_only, + force_bottle: args.force_bottle?, + build_from_source_formulae: args.build_from_source_formulae, + interactive: args.interactive?, + keep_tmp: args.keep_tmp?, + debug_symbols: args.debug_symbols?, + force: args.force?, + debug: args.debug?, + quiet: args.quiet?, + verbose: args.verbose? + ) end if casks.any? diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 3ac96b7e66..92e700aeeb 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -40,7 +40,8 @@ module Homebrew switch "--eval-all", depends_on: "--desc", description: "Evaluate all available formulae and casks, whether installed or not, to search their " \ - "descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set." + "descriptions.", + env: :eval_all switch "--pull-request", description: "Search for GitHub pull requests containing ." switch "--open", @@ -64,13 +65,13 @@ module Homebrew sig { override.void } def run - return if search_package_manager + return if search_package_manager! query = args.named.join(" ") string_or_regex = Search.query_regexp(query) if args.desc? - if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api? + if !args.eval_all? && Homebrew::EnvConfig.no_install_from_api? raise UsageError, "`brew search --desc` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end @@ -107,7 +108,7 @@ module Homebrew end sig { returns(T::Boolean) } - def search_package_manager + def search_package_manager! package_manager = PACKAGE_MANAGERS.find { |name,| args.public_send(:"#{name}?") } return false if package_manager.nil? diff --git a/Library/Homebrew/cmd/shellenv.rb b/Library/Homebrew/cmd/shellenv.rb index 03c530f502..6e5c959046 100644 --- a/Library/Homebrew/cmd/shellenv.rb +++ b/Library/Homebrew/cmd/shellenv.rb @@ -13,18 +13,20 @@ module Homebrew description <<~EOS Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh - Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`. + Print export statements. When run in a shell, this installation of Homebrew will be added to your + `$PATH`, `$MANPATH`, and `$INFOPATH`. The variables `$HOMEBREW_PREFIX`, `$HOMEBREW_CELLAR` and `$HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` directories - are first and second respectively in your `PATH`. Consider adding evaluation of this command's output to + are first and second respectively in your `$PATH`. Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.bash_profile` or ~/.zprofile` on macOS and ~/.bashrc` or ~/.zshrc` on Linux) with: `eval "$(brew shellenv)"` The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output POSIX exports. EOS + named_args :shell end end diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index bca5486604..8aacf5c6e9 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -63,6 +63,8 @@ module Homebrew puts info else info = "" + default_branches = %w[main master].freeze + taps.each_with_index do |tap, i| puts unless i.zero? info = "#{tap}: " @@ -79,7 +81,7 @@ module Homebrew info += "\norigin: #{tap.remote}" if tap.remote != tap.default_remote info += "\nHEAD: #{tap.git_head || "(none)"}" info += "\nlast commit: #{tap.git_last_commit || "never"}" - info += "\nbranch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master" + info += "\nbranch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch) else info += "Not installed" end diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 17fbfb5639..d29cda4a63 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -33,16 +33,14 @@ module Homebrew "integration.", replacement: false, disable: true - switch "--[no-]force-auto-update", - hidden: true switch "--custom-remote", description: "Install or change a tap with a custom remote. Useful for mirrors." switch "--repair", description: "Add missing symlinks to tap manpages and shell completions. Correct git remote " \ "refs for any taps where upstream HEAD branch has been renamed." switch "--eval-all", - description: "Evaluate all the formulae, casks and aliases in the new tap to check validity. " \ - "Implied if `$HOMEBREW_EVAL_ALL` is set." + description: "Evaluate all formulae, casks and aliases in the new tap to check their validity.", + env: :eval_all switch "-f", "--force", description: "Force install core taps even under API mode." @@ -64,7 +62,7 @@ module Homebrew tap.install clone_target: args.named.second, custom_remote: args.custom_remote?, quiet: args.quiet?, - verify: args.eval_all? || Homebrew::EnvConfig.eval_all?, + verify: args.eval_all?, force: args.force? rescue Tap::InvalidNameError, TapRemoteMismatchError, TapNoCustomRemoteError => e odie e diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 91395f4e98..c74b725e7e 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "abstract_command" @@ -39,13 +39,15 @@ module Homebrew private + sig { void } def auto_update_header - @auto_update_header ||= begin + @auto_update_header ||= T.let(begin ohai "Auto-updated Homebrew!" if args.auto_update? true - end + end, T.nilable(T::Boolean)) end + sig { void } def output_update_report # Run `brew update` (again) if we've got a linuxbrew-core CoreTap if CoreTap.instance.installed? && CoreTap.instance.linuxbrew_core? && @@ -293,14 +295,17 @@ module Homebrew EOS end + sig { returns(String) } def no_changes_message "No changes to formulae or casks." end + sig { params(revision: String).returns(String) } def shorten_revision(revision) Utils.popen_read("git", "-C", HOMEBREW_REPOSITORY, "rev-parse", "--short", revision).chomp end + sig { void } def tap_or_untap_core_taps_if_necessary return if ENV["HOMEBREW_UPDATE_TEST"] @@ -320,10 +325,11 @@ module Homebrew return if (HOMEBREW_PREFIX/".homebrewdocker").exist? tap_output_header_printed = T.let(false, T::Boolean) + default_branches = %w[main master].freeze [CoreTap.instance, CoreCaskTap.instance].each do |tap| next unless tap.installed? - if tap.git_branch == "master" && + if default_branches.include?(tap.git_branch) && (Date.parse(T.must(tap.git_repository.last_commit_date)) <= Date.today.prev_month) ohai "#{tap.name} is old and unneeded, untapping to save space..." tap.uninstall @@ -339,6 +345,7 @@ module Homebrew end end + sig { params(repository: Pathname).void } def link_completions_manpages_and_docs(repository = HOMEBREW_REPOSITORY) command = "brew update" Utils::Link.link_completions(repository, command) @@ -351,10 +358,12 @@ module Homebrew EOS end + sig { void } def migrate_gcc_dependents_if_needed # do nothing end + sig { void } def analytics_message return if Utils::Analytics.messages_displayed? return if Utils::Analytics.no_message_output? @@ -384,6 +393,7 @@ module Homebrew Utils::Analytics.messages_displayed! if $stdout.tty? end + sig { void } def donation_message return if Settings.read("donationmessage") == "true" @@ -394,6 +404,7 @@ module Homebrew Settings.write "donationmessage", true if $stdout.tty? end + sig { void } def install_from_api_message return if Settings.read("installfromapimessage") == "true" @@ -418,30 +429,38 @@ require "extend/os/cmd/update-report" class Reporter class ReporterRevisionUnsetError < RuntimeError + sig { params(var_name: String).void } def initialize(var_name) super "#{var_name} is unset!" end end + sig { + params(tap: Tap, api_names_txt: T.nilable(Pathname), api_names_before_txt: T.nilable(Pathname), + api_dir_prefix: T.nilable(Pathname)).void + } def initialize(tap, api_names_txt: nil, api_names_before_txt: nil, api_dir_prefix: nil) @tap = tap # This is slightly involved/weird but all the #report logic is shared so it's worth it. if installed_from_api?(api_names_txt, api_names_before_txt, api_dir_prefix) - @api_names_txt = api_names_txt - @api_names_before_txt = api_names_before_txt - @api_dir_prefix = api_dir_prefix + @api_names_txt = T.let(api_names_txt, T.nilable(Pathname)) + @api_names_before_txt = T.let(api_names_before_txt, T.nilable(Pathname)) + @api_dir_prefix = T.let(api_dir_prefix, T.nilable(Pathname)) else initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{tap.repository_var_suffix}" - @initial_revision = ENV[initial_revision_var].to_s + @initial_revision = T.let(ENV[initial_revision_var].to_s, String) raise ReporterRevisionUnsetError, initial_revision_var if @initial_revision.empty? current_revision_var = "HOMEBREW_UPDATE_AFTER#{tap.repository_var_suffix}" - @current_revision = ENV[current_revision_var].to_s + @current_revision = T.let(ENV[current_revision_var].to_s, String) raise ReporterRevisionUnsetError, current_revision_var if @current_revision.empty? end + + @report = T.let(nil, T.nilable(T::Hash[Symbol, T::Array[String]])) end + sig { params(auto_update: T::Boolean).returns(T::Hash[Symbol, T::Array[String]]) } def report(auto_update: false) return @report if @report @@ -482,9 +501,9 @@ class Reporter case status when "A", "D" full_name = tap.formula_file_to_name(src) - name = full_name.split("/").last + name = T.must(full_name.split("/").last) new_tap = tap.tap_migrations[name] - @report[status.to_sym] << full_name unless new_tap + @report[T.must(status).to_sym] << full_name unless new_tap when "M" name = tap.formula_file_to_name(src) @@ -584,6 +603,7 @@ class Reporter @report end + sig { returns(T::Boolean) } def updated? if installed_from_api? diff.present? @@ -592,9 +612,10 @@ class Reporter end end + sig { void } def migrate_tap_migration - (report[:D] + report[:DC]).each do |full_name| - name = full_name.split("/").last + (Array(report[:D]) + Array(report[:DC])).each do |full_name| + name = T.must(full_name.split("/").last) new_tap_name = tap.tap_migrations[name] next if new_tap_name.nil? # skip if not in tap_migrations list. @@ -609,7 +630,7 @@ class Reporter end # This means it is a cask - if report[:DC].include? full_name + if Array(report[:DC]).include? full_name next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist? new_tap = Tap.fetch(new_tap_name) @@ -675,12 +696,14 @@ class Reporter end end + sig { void } def migrate_cask_rename Cask::Caskroom.casks.each do |cask| Cask::Migrator.migrate_if_needed(cask) end end + sig { params(force: T::Boolean, verbose: T::Boolean).void } def migrate_formula_rename(force:, verbose:) Formula.installed.each do |formula| next unless Migrator.needs_migration?(formula) @@ -704,14 +727,36 @@ class Reporter private - attr_reader :tap, :initial_revision, :current_revision, :api_names_txt, :api_names_before_txt, :api_dir_prefix + sig { returns(Tap) } + attr_reader :tap + sig { returns(String) } + attr_reader :initial_revision + + sig { returns(String) } + attr_reader :current_revision + + sig { returns(T.nilable(Pathname)) } + attr_reader :api_names_txt + + sig { returns(T.nilable(Pathname)) } + attr_reader :api_names_before_txt + + sig { returns(T.nilable(Pathname)) } + attr_reader :api_dir_prefix + + sig { + params(api_names_txt: T.nilable(Pathname), api_names_before_txt: T.nilable(Pathname), + api_dir_prefix: T.nilable(Pathname)).returns(T::Boolean) + } def installed_from_api?(api_names_txt = @api_names_txt, api_names_before_txt = @api_names_before_txt, api_dir_prefix = @api_dir_prefix) !api_names_txt.nil? && !api_names_before_txt.nil? && !api_dir_prefix.nil? end + sig { returns(String) } def diff + @diff ||= T.let(nil, T.nilable(String)) @diff ||= if installed_from_api? # Hack `git diff` output with regexes to look like `git diff-tree` output. # Yes, I know this is a bit filthy but it saves duplicating the #report logic. @@ -719,12 +764,14 @@ class Reporter header_regex = /^(---|\+\+\+) / add_delete_characters = ["+", "-"].freeze + api_dir_prefix_basename = T.must(api_dir_prefix).basename + diff_output.lines.filter_map do |line| next if line.match?(header_regex) next unless add_delete_characters.include?(line[0]) - line.sub(/^\+/, "A #{api_dir_prefix.basename}/") - .sub(/^-/, "D #{api_dir_prefix.basename}/") + line.sub(/^\+/, "A #{api_dir_prefix_basename}/") + .sub(/^-/, "D #{api_dir_prefix_basename}/") .sub(/$/, ".rb") .chomp end.join("\n") @@ -738,28 +785,33 @@ class Reporter end class ReporterHub + sig { returns(T::Array[Reporter]) } attr_reader :reporters sig { void } def initialize - @hash = {} - @reporters = [] + @hash = T.let({}, T::Hash[Symbol, T::Array[String]]) + @reporters = T.let([], T::Array[Reporter]) end + sig { params(key: Symbol).returns(T::Array[String]) } def select_formula_or_cask(key) @hash.fetch(key, []) end + sig { params(reporter: Reporter, auto_update: T::Boolean).void } def add(reporter, auto_update: false) @reporters << reporter report = reporter.report(auto_update:).delete_if { |_k, v| v.empty? } @hash.update(report) { |_key, oldval, newval| oldval.concat(newval) } end + sig { returns(T::Boolean) } def empty? @hash.empty? end + sig { params(auto_update: T::Boolean).void } def dump(auto_update: false) unless Homebrew::EnvConfig.no_update_report_new? dump_new_formula_report @@ -814,22 +866,41 @@ class ReporterHub private + sig { void } def dump_new_formula_report formulae = select_formula_or_cask(:A).sort.reject { |name| installed?(name) } + return if formulae.blank? - output_dump_formula_or_cask_report "New Formulae", formulae + ohai "New Formulae" + formulae.each do |formula| + if (desc = description(formula)) + puts "#{formula}: #{desc}" + else + puts formula + end + end end + sig { void } def dump_new_cask_report - return if Homebrew::SimulateSystem.simulating_or_running_on_linux? + return unless Cask::Caskroom.any_casks_installed? casks = select_formula_or_cask(:AC).sort.filter_map do |name| name.split("/").last unless cask_installed?(name) end + return if casks.blank? - output_dump_formula_or_cask_report "New Casks", casks + ohai "New Casks" + casks.each do |cask| + if (desc = cask_description(cask)) + puts "#{cask}: #{desc}" + else + puts cask + end + end end + sig { void } def dump_deleted_formula_report formulae = select_formula_or_cask(:D).sort.filter_map do |name| pretty_uninstalled(name) if installed?(name) @@ -838,40 +909,84 @@ class ReporterHub output_dump_formula_or_cask_report "Deleted Installed Formulae", formulae end + sig { void } def dump_deleted_cask_report return if Homebrew::SimulateSystem.simulating_or_running_on_linux? casks = select_formula_or_cask(:DC).sort.filter_map do |name| - name = name.split("/").last + name = T.must(name.split("/").last) pretty_uninstalled(name) if cask_installed?(name) end output_dump_formula_or_cask_report "Deleted Installed Casks", casks end + sig { params(title: String, formulae_or_casks: T::Array[String]).void } def output_dump_formula_or_cask_report(title, formulae_or_casks) return if formulae_or_casks.blank? ohai title, Formatter.columns(formulae_or_casks.sort) end + sig { params(formula: String).returns(T::Boolean) } def installed?(formula) (HOMEBREW_CELLAR/formula.split("/").last).directory? end + sig { params(formula: String).returns(T::Boolean) } def outdated?(formula) Formula[formula].outdated? rescue FormulaUnavailableError false end + sig { params(cask: String).returns(T::Boolean) } def cask_installed?(cask) (Cask::Caskroom.path/cask).directory? end + sig { params(cask: String).returns(T::Boolean) } def cask_outdated?(cask) Cask::CaskLoader.load(cask).outdated? rescue Cask::CaskError false end + + sig { returns(T::Array[T.untyped]) } + def all_formula_json + return @all_formula_json if @all_formula_json + + @all_formula_json = T.let(nil, T.nilable(T::Array[T.untyped])) + all_formula_json, = Homebrew::API.fetch_json_api_file "formula.jws.json" + all_formula_json = T.cast(all_formula_json, T::Array[T.untyped]) + @all_formula_json = all_formula_json + end + + sig { returns(T::Array[T.untyped]) } + def all_cask_json + return @all_cask_json if @all_cask_json + + @all_cask_json = T.let(nil, T.nilable(T::Array[T.untyped])) + all_cask_json, = Homebrew::API.fetch_json_api_file "cask.jws.json" + all_cask_json = T.cast(all_cask_json, T::Array[T.untyped]) + @all_cask_json = all_cask_json + end + + sig { params(formula: String).returns(T.nilable(String)) } + def description(formula) + return if Homebrew::EnvConfig.no_install_from_api? + + all_formula_json.find { |f| f["name"] == formula } + &.fetch("desc", nil) + &.presence + end + + sig { params(cask: String).returns(T.nilable(String)) } + def cask_description(cask) + return if Homebrew::EnvConfig.no_install_from_api? + + all_cask_json.find { |f| f["token"] == cask } + &.fetch("desc", nil) + &.presence + end end diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index efb3796146..f8e1818e22 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -54,9 +54,10 @@ git_init_if_necessary() { fi git config remote.origin.url "${HOMEBREW_BREW_GIT_REMOTE}" git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + git config fetch.prune true git fetch --force --tags origin git remote set-head origin --auto >/dev/null - git reset --hard origin/master + git reset --hard origin/HEAD SKIP_FETCH_BREW_REPOSITORY=1 set +e trap - EXIT @@ -77,9 +78,10 @@ git_init_if_necessary() { fi git config remote.origin.url "${HOMEBREW_CORE_GIT_REMOTE}" git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git fetch --force origin refs/heads/master:refs/remotes/origin/master + git config fetch.prune true + git fetch --force origin git remote set-head origin --auto >/dev/null - git reset --hard origin/master + git reset --hard origin/HEAD SKIP_FETCH_CORE_REPOSITORY=1 set +e trap - EXIT @@ -110,7 +112,7 @@ upstream_branch() { upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null)" fi upstream_branch="${upstream_branch#refs/remotes/origin/}" - [[ -z "${upstream_branch}" ]] && upstream_branch="master" + [[ -z "${upstream_branch}" ]] && upstream_branch="main" echo "${upstream_branch}" } @@ -242,7 +244,7 @@ merge_or_rebase() { Could not 'git stash' in ${DIR}! Please stash/commit manually if you need to keep your changes or, if not, run: cd ${DIR} - git reset --hard origin/master + git reset --hard origin/HEAD EOS fi git reset --hard "${QUIET_ARGS[@]}" @@ -250,6 +252,14 @@ EOS fi INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)" + MAIN_MIGRATION_REQUIRED= + if [[ "${INITIAL_BRANCH}" == "master" && + ("${DIR}" == "${HOMEBREW_REPOSITORY}" || "${DIR}" == "${HOMEBREW_CORE_REPOSITORY}" || "${DIR}" == "${HOMEBREW_CASK_REPOSITORY}") ]] + then + # Migrate master to main for Homebrew/brew, homebrew-core or homebrew-cask + MAIN_MIGRATION_REQUIRED="1" + fi + if [[ -n "${UPSTREAM_TAG}" ]] || [[ "${INITIAL_BRANCH}" != "${UPSTREAM_BRANCH}" && -n "${INITIAL_BRANCH}" ]] then @@ -260,10 +270,12 @@ EOS then git checkout --force "${UPSTREAM_BRANCH}" "${QUIET_ARGS[@]}" else - if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" ]] && - [[ "${INITIAL_BRANCH}" != "master" ]] + if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" && "${UPSTREAM_BRANCH}" != "main" ]] && + [[ "${INITIAL_BRANCH}" != "master" && "${INITIAL_BRANCH}" != "main" ]] then - git branch --force "master" "origin/master" "${QUIET_ARGS[@]}" + local detected_upstream_branch + detected_upstream_branch="$(upstream_branch)" + git branch --force "${detected_upstream_branch}" "origin/${detected_upstream_branch}" "${QUIET_ARGS[@]}" fi git checkout --force -B "${UPSTREAM_BRANCH}" "${REMOTE_REF}" "${QUIET_ARGS[@]}" @@ -313,7 +325,7 @@ EOS if [[ -n "${HOMEBREW_NO_UPDATE_CLEANUP}" ]] then - if [[ "${INITIAL_BRANCH}" != "${UPSTREAM_BRANCH}" && -n "${INITIAL_BRANCH}" ]] && + if [[ -z "${MAIN_MIGRATION_REQUIRED}" && "${INITIAL_BRANCH}" != "${UPSTREAM_BRANCH}" && -n "${INITIAL_BRANCH}" ]] && [[ ! "${INITIAL_BRANCH}" =~ ^v[0-9]+\.[0-9]+\.[0-9]|stable$ ]] then git checkout "${INITIAL_BRANCH}" "${QUIET_ARGS[@]}" @@ -324,6 +336,11 @@ EOS pop_stash_message fi + if [[ -n "${MAIN_MIGRATION_REQUIRED}" && -n "$(git config branch.main.remote 2>/dev/null || true)" ]] + then + git branch -d "${QUIET_ARGS[@]}" master + fi + trap - SIGINT } @@ -541,7 +558,8 @@ EOS echo "HOMEBREW_CORE_GIT_REMOTE set: using ${HOMEBREW_CORE_GIT_REMOTE} as the Homebrew/homebrew-core Git remote." git remote set-url origin "${HOMEBREW_CORE_GIT_REMOTE}" git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git fetch --force origin refs/heads/master:refs/remotes/origin/master + git config fetch.prune true + git fetch --force origin SKIP_FETCH_CORE_REPOSITORY=1 fi @@ -642,9 +660,9 @@ EOS UPDATING_MESSAGE_SHOWN=1 fi - # The upstream repository's default branch may not be master; + # The upstream repository's default branch may not be main or master; # check refs/remotes/origin/HEAD to see what the default - # origin branch name is, and use that. If not set, fall back to "master". + # origin branch name is, and use that. If not set, fall back to "main". # the refspec ensures that the default upstream branch gets updated ( UPSTREAM_REPOSITORY_URL="$(git config remote.origin.url)" @@ -664,6 +682,16 @@ EOS UPSTREAM_REPOSITORY_TOKEN="${BASH_REMATCH[1]#*:}" fi + MAIN_MIGRATION_REQUIRED= + if [[ "${UPSTREAM_BRANCH_DIR}" == "master" && + ("${DIR}" == "${HOMEBREW_REPOSITORY}" || "${DIR}" == "${HOMEBREW_CORE_REPOSITORY}" || "${DIR}" == "${HOMEBREW_CASK_REPOSITORY}") ]] + then + # Migrate master to main for Homebrew/brew, homebrew-core or homebrew-cask + MAIN_MIGRATION_REQUIRED=1 + UPSTREAM_BRANCH_DIR="main" + declare UPSTREAM_BRANCH"${TAP_VAR}"="main" + fi + if [[ -n "${UPSTREAM_REPOSITORY}" ]] then # UPSTREAM_REPOSITORY_TOKEN is parsed (if exists) from UPSTREAM_REPOSITORY_URL @@ -725,32 +753,59 @@ EOS local tmp_failure_file="${DIR}/.git/TMP_FETCH_FAILURES" rm -f "${tmp_failure_file}" - if [[ -n "${HOMEBREW_UPDATE_AUTO}" ]] + if ! git fetch --tags --force "${QUIET_ARGS[@]}" origin \ + "refs/heads/${UPSTREAM_BRANCH_DIR}:refs/remotes/origin/${UPSTREAM_BRANCH_DIR}" 2>>"${tmp_failure_file}" then - git fetch --tags --force "${QUIET_ARGS[@]}" origin \ - "refs/heads/${UPSTREAM_BRANCH_DIR}:refs/remotes/origin/${UPSTREAM_BRANCH_DIR}" 2>/dev/null - else - # Capture stderr to tmp_failure_file - if ! git fetch --tags --force "${QUIET_ARGS[@]}" origin \ - "refs/heads/${UPSTREAM_BRANCH_DIR}:refs/remotes/origin/${UPSTREAM_BRANCH_DIR}" 2>>"${tmp_failure_file}" + if [[ -f "${tmp_failure_file}" ]] then - # Reprint fetch errors to stderr - [[ -f "${tmp_failure_file}" ]] && cat "${tmp_failure_file}" 1>&2 - - if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]] + local git_errors + git_errors="$(cat "${tmp_failure_file}")" + # Attempt migration from master to main branch. + if [[ "${git_errors}" == "fatal: couldn't find remote ref refs/heads/master" ]] then - TAP="${DIR#"${HOMEBREW_LIBRARY}"/Taps/}" - echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}" - else - echo "Fetching ${DIR} failed!" >>"${update_failed_file}" - - if [[ -f "${tmp_failure_file}" ]] && - [[ "$(cat "${tmp_failure_file}")" == "fatal: couldn't find remote ref refs/heads/${UPSTREAM_BRANCH_DIR}" ]] + if git fetch --tags --force "${QUIET_ARGS[@]}" origin \ + "refs/heads/main:refs/remotes/origin/main" 2>>"${tmp_failure_file}" then - echo "${DIR}" >>"${missing_remote_ref_dirs_file}" + rm -f "${DIR}/.git/refs/remotes/origin/HEAD" "${DIR}/.git/refs/remotes/origin/master" + UPSTREAM_BRANCH_DIR="$(upstream_branch)" + declare UPSTREAM_BRANCH"${TAP_VAR}"="${UPSTREAM_BRANCH_DIR}" + git branch -m master main "${QUIET_ARGS[@]}" + git branch -u origin/main main "${QUIET_ARGS[@]}" + rm -f "${tmp_failure_file}" + exit fi fi + + rm -f "${tmp_failure_file}" fi + + # Don't output errors if HOMEBREW_UPDATE_AUTO is set. + if [[ -n "${HOMEBREW_UPDATE_AUTO}" ]] + then + exit + fi + + # Reprint fetch errors to stderr + [[ -n "${git_errors}" ]] && echo "${git_errors}" 1>&2 + + if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]] + then + TAP="${DIR#"${HOMEBREW_LIBRARY}"/Taps/}" + echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}" + else + echo "Fetching ${DIR} failed!" >>"${update_failed_file}" + + if [[ -f "${tmp_failure_file}" ]] && + [[ "$(cat "${tmp_failure_file}")" == "fatal: couldn't find remote ref refs/heads/${UPSTREAM_BRANCH_DIR}" ]] + then + echo "${DIR}" >>"${missing_remote_ref_dirs_file}" + fi + fi + fi + + if [[ -n "${MAIN_MIGRATION_REQUIRED}" ]] + then + git remote set-head origin --auto >/dev/null fi rm -f "${tmp_failure_file}" diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 9895706138..63a3eb4b6a 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -29,8 +29,8 @@ module Homebrew description: "If brewing fails, open an interactive debugging session with access to IRB " \ "or a shell inside the temporary build directory." switch "--display-times", - env: :display_install_times, - description: "Print install times for each package at the end of the run." + description: "Print install times for each package at the end of the run.", + env: :display_install_times switch "-f", "--force", description: "Install formulae without checking for previously installed keg-only or " \ "non-migrated versions. When installing casks, overwrite existing files " \ @@ -41,7 +41,7 @@ module Homebrew description: "Show what would be upgraded, but do not actually upgrade anything." switch "--ask", description: "Ask for confirmation before downloading and upgrading formulae. " \ - "Print bottles and dependencies download size, install and net install size.", + "Print download, install and net install sizes of bottles and dependencies.", env: :ask [ [:switch, "--formula", "--formulae", { @@ -137,8 +137,8 @@ module Homebrew formulae = Homebrew::Attestation.sort_formulae_for_install(formulae) if Homebrew::Attestation.enabled? - upgrade_outdated_formulae(formulae) unless only_upgrade_casks - upgrade_outdated_casks(casks) unless only_upgrade_formulae + upgrade_outdated_formulae!(formulae) unless only_upgrade_casks + upgrade_outdated_casks!(casks) unless only_upgrade_formulae Cleanup.periodic_clean!(dry_run: args.dry_run?) @@ -148,7 +148,7 @@ module Homebrew private sig { params(formulae: T::Array[Formula]).returns(T::Boolean) } - def upgrade_outdated_formulae(formulae) + def upgrade_outdated_formulae!(formulae) return false if args.cask? if args.build_from_source? @@ -220,10 +220,7 @@ module Homebrew Install.perform_preinstall_checks_once - # Main block: if asking the user is enabled, show dependency and size information. - Install.ask_formulae(formulae_to_install, args: args) if args.ask? - - Upgrade.upgrade_formulae( + formulae_installer = Upgrade.formula_installers( formulae_to_install, flags: args.flags_only, dry_run: args.dry_run?, @@ -239,10 +236,13 @@ module Homebrew verbose: args.verbose?, ) - Upgrade.check_installed_dependents( + return false if formulae_installer.blank? + + dependants = Upgrade.dependants( formulae_to_install, flags: args.flags_only, dry_run: args.dry_run?, + ask: args.ask?, force_bottle: args.force_bottle?, build_from_source_formulae: args.build_from_source_formulae, interactive: args.interactive?, @@ -254,16 +254,38 @@ module Homebrew verbose: args.verbose?, ) + # Main block: if asking the user is enabled, show dependency and size information. + Install.ask_formulae(formulae_installer, dependants, args: args) if args.ask? + + Upgrade.upgrade_formulae(formulae_installer, + dry_run: args.dry_run?, + verbose: args.verbose?) + + Upgrade.upgrade_dependents( + dependants, formulae_to_install, + flags: args.flags_only, + dry_run: args.dry_run?, + force_bottle: args.force_bottle?, + build_from_source_formulae: args.build_from_source_formulae, + interactive: args.interactive?, + keep_tmp: args.keep_tmp?, + debug_symbols: args.debug_symbols?, + force: args.force?, + debug: args.debug?, + quiet: args.quiet?, + verbose: args.verbose? + ) + true end sig { params(casks: T::Array[Cask::Cask]).returns(T::Boolean) } - def upgrade_outdated_casks(casks) + def upgrade_outdated_casks!(casks) return false if args.formula? Install.ask_casks casks if args.ask? - Cask::Upgrade.upgrade_casks( + Cask::Upgrade.upgrade_casks!( *casks, force: args.force?, greedy: args.greedy?, diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index a515751a3d..818cb91113 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -36,7 +36,8 @@ module Homebrew description: "Only list formulae and casks that are not currently installed." switch "--eval-all", description: "Evaluate all available formulae and casks, whether installed or not, to show " \ - "their dependents." + "their dependents.", + env: :eval_all switch "--include-implicit", description: "Include formulae that have as an implicit dependency for " \ "downloading and unpacking source files." @@ -119,17 +120,17 @@ module Homebrew deps else - all = args.eval_all? + eval_all = args.eval_all? - if !args.installed? && !(all || Homebrew::EnvConfig.eval_all?) + if !args.installed? && !eval_all raise UsageError, "`brew uses` needs `--installed` or `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end if show_formulae_and_casks || args.formula? - deps += args.installed? ? Formula.installed : Formula.all(eval_all: args.eval_all?) + deps += args.installed? ? Formula.installed : Formula.all(eval_all:) end if show_formulae_and_casks || args.cask? - deps += args.installed? ? Cask::Caskroom.casks : Cask::Cask.all(eval_all: args.eval_all?) + deps += args.installed? ? Cask::Caskroom.casks : Cask::Cask.all(eval_all:) end if args.missing? diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 8825d9fccd..3d58dab372 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -101,6 +101,7 @@ fetch() { local first_try=1 local vendor_locations local temporary_path + local curl_exit_code=0 curl_args=() @@ -149,19 +150,27 @@ fetch() { # HOMEBREW_CURL is set by brew.sh (and isn't misspelt here) # shellcheck disable=SC2153 "${HOMEBREW_CURL}" "${curl_args[@]}" -C - "${url}" -o "${temporary_path}" - if [[ $? -eq 33 ]] + curl_exit_code="$?" + if [[ "${curl_exit_code}" -eq 33 ]] then [[ -n "${HOMEBREW_QUIET}" ]] || echo "Trying a full download" >&2 rm -f "${temporary_path}" "${HOMEBREW_CURL}" "${curl_args[@]}" "${url}" -o "${temporary_path}" + curl_exit_code="$?" fi else "${HOMEBREW_CURL}" "${curl_args[@]}" "${url}" -o "${temporary_path}" + curl_exit_code="$?" fi [[ -f "${temporary_path}" ]] && break done + if [[ "${curl_exit_code}" -ne 0 ]] + then + rm -f "${temporary_path}" + fi + if [[ ! -f "${temporary_path}" ]] then vendor_locations="$(printf " - %s\n" "${VENDOR_URLs[@]}")" diff --git a/Library/Homebrew/data/schemas/sbom.json b/Library/Homebrew/data/schemas/sbom.json index a04cb525d5..687453268f 100644 --- a/Library/Homebrew/data/schemas/sbom.json +++ b/Library/Homebrew/data/schemas/sbom.json @@ -1,12 +1,12 @@ { "$schema" : "https://json-schema.org/draft/2019-09/schema", "$id" : "http://spdx.org/rdf/terms/2.3", - "title" : "SPDX 2.3", + "title" : "SPDX 2.3.1-dev", "type" : "object", "properties" : { "$schema": { "type": "string", - "description": "Reference the SPDX 2.3 JSON schema." + "description": "Reference the SPDX 2.3.1 JSON schema." }, "SPDXID" : { "type" : "string", @@ -90,7 +90,7 @@ "enum" : [ "SHA1", "BLAKE3", "SHA3-384", "SHA256", "SHA384", "BLAKE2b-512", "BLAKE2b-256", "SHA3-512", "MD2", "ADLER32", "MD4", "SHA3-256", "BLAKE2b-384", "SHA512", "MD6", "MD5", "SHA224" ] }, "checksumValue" : { - "description" : "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "description" : "The checksumValue property provides a lower case hexadecimal encoded digest value produced using a specific algorithm.", "type" : "string" } }, @@ -270,10 +270,10 @@ } }, "attributionTexts" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "array", "items" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "string" } }, @@ -293,7 +293,7 @@ "enum" : [ "SHA1", "BLAKE3", "SHA3-384", "SHA256", "SHA384", "BLAKE2b-512", "BLAKE2b-256", "SHA3-512", "MD2", "ADLER32", "MD4", "SHA3-256", "BLAKE2b-384", "SHA512", "MD6", "MD5", "SHA224" ] }, "checksumValue" : { - "description" : "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "description" : "The checksumValue property provides a lower case hexadecimal encoded digest value produced using a specific algorithm.", "type" : "string" } }, @@ -375,10 +375,10 @@ "type" : "string" }, "licenseInfoFromFiles" : { - "description" : "The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of alllicenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", + "description" : "The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of all licenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", "type" : "array", "items" : { - "description" : "License expression for licenseInfoFromFiles. See SPDX Annex D for the license expression syntax. The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of alllicenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", + "description" : "License expression for licenseInfoFromFiles. See SPDX Annex D for the license expression syntax. The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of all licenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", "type" : "string" } }, @@ -417,7 +417,7 @@ "primaryPackagePurpose" : { "description" : "This field provides information about the primary purpose of the identified package. Package Purpose is intrinsic to how the package is being used rather than the content of the package.", "type" : "string", - "enum" : [ "OTHER", "INSTALL", "ARCHIVE", "FIRMWARE", "APPLICATION", "FRAMEWORK", "LIBRARY", "CONTAINER", "SOURCE", "DEVICE", "OPERATING_SYSTEM", "FILE" ] + "enum" : [ "OTHER", "INSTALL", "ARCHIVE", "FIRMWARE", "APPLICATION", "FRAMEWORK", "LIBRARY", "CONTAINER", "SOURCE", "DEVICE", "OPERATING-SYSTEM", "FILE" ] }, "releaseDate" : { "description" : "This field provides a place for recording the date the package was released.", @@ -494,10 +494,10 @@ } }, "attributionTexts" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "array", "items" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "string" } }, @@ -514,7 +514,7 @@ "enum" : [ "SHA1", "BLAKE3", "SHA3-384", "SHA256", "SHA384", "BLAKE2b-512", "BLAKE2b-256", "SHA3-512", "MD2", "ADLER32", "MD4", "SHA3-256", "BLAKE2b-384", "SHA512", "MD6", "MD5", "SHA224" ] }, "checksumValue" : { - "description" : "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "description" : "The checksumValue property provides a lower case hexadecimal encoded digest value produced using a specific algorithm.", "type" : "string" } }, @@ -624,10 +624,10 @@ } }, "attributionTexts" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "array", "items" : { - "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "description" : "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConcluded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", "type" : "string" } }, @@ -709,7 +709,7 @@ } }, "snippetFromFile" : { - "description" : "SPDX ID for File. File containing the SPDX element (e.g. the file contaning a snippet).", + "description" : "SPDX ID for File. File containing the SPDX element (e.g. the file containing a snippet).", "type" : "string" } }, diff --git a/Library/Homebrew/data/spdx/spdx_exceptions.json b/Library/Homebrew/data/spdx/spdx_exceptions.json index b6178f6ef9..db8d7dcdfe 100644 --- a/Library/Homebrew/data/spdx/spdx_exceptions.json +++ b/Library/Homebrew/data/spdx/spdx_exceptions.json @@ -1,11 +1,11 @@ { - "licenseListVersion": "3.26.0", + "licenseListVersion": "3.27.0", "exceptions": [ { "reference": "https://spdx.org/licenses/389-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/389-exception.json", - "referenceNumber": 54, + "referenceNumber": 36, "name": "389 Directory Server Exception", "licenseExceptionId": "389-exception", "seeAlso": [ @@ -17,7 +17,7 @@ "reference": "https://spdx.org/licenses/Asterisk-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Asterisk-exception.json", - "referenceNumber": 25, + "referenceNumber": 16, "name": "Asterisk exception", "licenseExceptionId": "Asterisk-exception", "seeAlso": [ @@ -29,7 +29,7 @@ "reference": "https://spdx.org/licenses/Asterisk-linking-protocols-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Asterisk-linking-protocols-exception.json", - "referenceNumber": 42, + "referenceNumber": 22, "name": "Asterisk linking protocols exception", "licenseExceptionId": "Asterisk-linking-protocols-exception", "seeAlso": [ @@ -40,7 +40,7 @@ "reference": "https://spdx.org/licenses/Autoconf-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Autoconf-exception-2.0.json", - "referenceNumber": 17, + "referenceNumber": 2, "name": "Autoconf exception 2.0", "licenseExceptionId": "Autoconf-exception-2.0", "seeAlso": [ @@ -52,7 +52,7 @@ "reference": "https://spdx.org/licenses/Autoconf-exception-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Autoconf-exception-3.0.json", - "referenceNumber": 20, + "referenceNumber": 51, "name": "Autoconf exception 3.0", "licenseExceptionId": "Autoconf-exception-3.0", "seeAlso": [ @@ -63,7 +63,7 @@ "reference": "https://spdx.org/licenses/Autoconf-exception-generic.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Autoconf-exception-generic.json", - "referenceNumber": 66, + "referenceNumber": 73, "name": "Autoconf generic exception", "licenseExceptionId": "Autoconf-exception-generic", "seeAlso": [ @@ -77,7 +77,7 @@ "reference": "https://spdx.org/licenses/Autoconf-exception-generic-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Autoconf-exception-generic-3.0.json", - "referenceNumber": 16, + "referenceNumber": 40, "name": "Autoconf generic exception for GPL-3.0", "licenseExceptionId": "Autoconf-exception-generic-3.0", "seeAlso": [ @@ -88,7 +88,7 @@ "reference": "https://spdx.org/licenses/Autoconf-exception-macro.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Autoconf-exception-macro.json", - "referenceNumber": 41, + "referenceNumber": 63, "name": "Autoconf macro exception", "licenseExceptionId": "Autoconf-exception-macro", "seeAlso": [ @@ -101,7 +101,7 @@ "reference": "https://spdx.org/licenses/Bison-exception-1.24.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bison-exception-1.24.json", - "referenceNumber": 34, + "referenceNumber": 56, "name": "Bison exception 1.24", "licenseExceptionId": "Bison-exception-1.24", "seeAlso": [ @@ -112,7 +112,7 @@ "reference": "https://spdx.org/licenses/Bison-exception-2.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bison-exception-2.2.json", - "referenceNumber": 50, + "referenceNumber": 28, "name": "Bison exception 2.2", "licenseExceptionId": "Bison-exception-2.2", "seeAlso": [ @@ -123,7 +123,7 @@ "reference": "https://spdx.org/licenses/Bootloader-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bootloader-exception.json", - "referenceNumber": 67, + "referenceNumber": 65, "name": "Bootloader Distribution Exception", "licenseExceptionId": "Bootloader-exception", "seeAlso": [ @@ -134,7 +134,7 @@ "reference": "https://spdx.org/licenses/CGAL-linking-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CGAL-linking-exception.json", - "referenceNumber": 43, + "referenceNumber": 74, "name": "CGAL Linking Exception", "licenseExceptionId": "CGAL-linking-exception", "seeAlso": [ @@ -146,7 +146,7 @@ "reference": "https://spdx.org/licenses/Classpath-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Classpath-exception-2.0.json", - "referenceNumber": 69, + "referenceNumber": 67, "name": "Classpath exception 2.0", "licenseExceptionId": "Classpath-exception-2.0", "seeAlso": [ @@ -158,7 +158,7 @@ "reference": "https://spdx.org/licenses/CLISP-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CLISP-exception-2.0.json", - "referenceNumber": 1, + "referenceNumber": 10, "name": "CLISP exception 2.0", "licenseExceptionId": "CLISP-exception-2.0", "seeAlso": [ @@ -169,7 +169,7 @@ "reference": "https://spdx.org/licenses/cryptsetup-OpenSSL-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/cryptsetup-OpenSSL-exception.json", - "referenceNumber": 53, + "referenceNumber": 46, "name": "cryptsetup OpenSSL exception", "licenseExceptionId": "cryptsetup-OpenSSL-exception", "seeAlso": [ @@ -177,14 +177,26 @@ "https://gitlab.nic.cz/datovka/datovka/-/blob/develop/COPYING", "https://github.com/nbs-system/naxsi/blob/951123ad456bdf5ac94e8d8819342fe3d49bc002/naxsi_src/naxsi_raw.c", "http://web.mit.edu/jgross/arch/amd64_deb60/bin/mosh", - "https://sourceforge.net/p/linux-ima/ima-evm-utils/ci/master/tree/src/evmctl.c#l30" + "https://sourceforge.net/p/linux-ima/ima-evm-utils/ci/master/tree/src/evmctl.c#l30", + "https://github.com/ocaml-omake/omake/blob/master/LICENSE.OMake#L20" + ] + }, + { + "reference": "https://spdx.org/licenses/Digia-Qt-LGPL-exception-1.1.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Digia-Qt-LGPL-exception-1.1.json", + "referenceNumber": 48, + "name": "Digia Qt LGPL Exception version 1.1", + "licenseExceptionId": "Digia-Qt-LGPL-exception-1.1", + "seeAlso": [ + "https://src.fedoraproject.org/rpms/qtlockedfile/blob/rawhide/f/LGPL_EXCEPTION" ] }, { "reference": "https://spdx.org/licenses/DigiRule-FOSS-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DigiRule-FOSS-exception.json", - "referenceNumber": 13, + "referenceNumber": 53, "name": "DigiRule FOSS License Exception", "licenseExceptionId": "DigiRule-FOSS-exception", "seeAlso": [ @@ -195,7 +207,7 @@ "reference": "https://spdx.org/licenses/eCos-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/eCos-exception-2.0.json", - "referenceNumber": 58, + "referenceNumber": 61, "name": "eCos exception 2.0", "licenseExceptionId": "eCos-exception-2.0", "seeAlso": [ @@ -206,7 +218,7 @@ "reference": "https://spdx.org/licenses/erlang-otp-linking-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/erlang-otp-linking-exception.json", - "referenceNumber": 38, + "referenceNumber": 13, "name": "Erlang/OTP Linking Exception", "licenseExceptionId": "erlang-otp-linking-exception", "seeAlso": [ @@ -219,7 +231,7 @@ "reference": "https://spdx.org/licenses/Fawkes-Runtime-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Fawkes-Runtime-exception.json", - "referenceNumber": 12, + "referenceNumber": 21, "name": "Fawkes Runtime Exception", "licenseExceptionId": "Fawkes-Runtime-exception", "seeAlso": [ @@ -230,7 +242,7 @@ "reference": "https://spdx.org/licenses/FLTK-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FLTK-exception.json", - "referenceNumber": 8, + "referenceNumber": 66, "name": "FLTK exception", "licenseExceptionId": "FLTK-exception", "seeAlso": [ @@ -241,7 +253,7 @@ "reference": "https://spdx.org/licenses/fmt-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/fmt-exception.json", - "referenceNumber": 2, + "referenceNumber": 77, "name": "fmt exception", "licenseExceptionId": "fmt-exception", "seeAlso": [ @@ -253,7 +265,7 @@ "reference": "https://spdx.org/licenses/Font-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Font-exception-2.0.json", - "referenceNumber": 59, + "referenceNumber": 35, "name": "Font exception 2.0", "licenseExceptionId": "Font-exception-2.0", "seeAlso": [ @@ -264,7 +276,7 @@ "reference": "https://spdx.org/licenses/freertos-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/freertos-exception-2.0.json", - "referenceNumber": 37, + "referenceNumber": 23, "name": "FreeRTOS Exception 2.0", "licenseExceptionId": "freertos-exception-2.0", "seeAlso": [ @@ -275,7 +287,7 @@ "reference": "https://spdx.org/licenses/GCC-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GCC-exception-2.0.json", - "referenceNumber": 27, + "referenceNumber": 14, "name": "GCC Runtime Library exception 2.0", "licenseExceptionId": "GCC-exception-2.0", "seeAlso": [ @@ -287,7 +299,7 @@ "reference": "https://spdx.org/licenses/GCC-exception-2.0-note.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GCC-exception-2.0-note.json", - "referenceNumber": 47, + "referenceNumber": 20, "name": "GCC Runtime Library exception 2.0 - note variant", "licenseExceptionId": "GCC-exception-2.0-note", "seeAlso": [ @@ -298,7 +310,7 @@ "reference": "https://spdx.org/licenses/GCC-exception-3.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GCC-exception-3.1.json", - "referenceNumber": 65, + "referenceNumber": 25, "name": "GCC Runtime Library exception 3.1", "licenseExceptionId": "GCC-exception-3.1", "seeAlso": [ @@ -309,7 +321,7 @@ "reference": "https://spdx.org/licenses/Gmsh-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Gmsh-exception.json", - "referenceNumber": 24, + "referenceNumber": 26, "name": "Gmsh exception", "licenseExceptionId": "Gmsh-exception", "seeAlso": [ @@ -320,7 +332,7 @@ "reference": "https://spdx.org/licenses/GNAT-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GNAT-exception.json", - "referenceNumber": 14, + "referenceNumber": 69, "name": "GNAT exception", "licenseExceptionId": "GNAT-exception", "seeAlso": [ @@ -331,7 +343,7 @@ "reference": "https://spdx.org/licenses/GNOME-examples-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GNOME-examples-exception.json", - "referenceNumber": 19, + "referenceNumber": 76, "name": "GNOME examples exception", "licenseExceptionId": "GNOME-examples-exception", "seeAlso": [ @@ -343,7 +355,7 @@ "reference": "https://spdx.org/licenses/GNU-compiler-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GNU-compiler-exception.json", - "referenceNumber": 57, + "referenceNumber": 58, "name": "GNU Compiler Exception", "licenseExceptionId": "GNU-compiler-exception", "seeAlso": [ @@ -354,7 +366,7 @@ "reference": "https://spdx.org/licenses/gnu-javamail-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/gnu-javamail-exception.json", - "referenceNumber": 63, + "referenceNumber": 64, "name": "GNU JavaMail exception", "licenseExceptionId": "gnu-javamail-exception", "seeAlso": [ @@ -365,7 +377,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-389-ds-base-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-389-ds-base-exception.json", - "referenceNumber": 64, + "referenceNumber": 18, "name": "GPL-3.0 389 DS Base Exception", "licenseExceptionId": "GPL-3.0-389-ds-base-exception", "seeAlso": [] @@ -374,7 +386,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-interface-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-interface-exception.json", - "referenceNumber": 44, + "referenceNumber": 78, "name": "GPL-3.0 Interface Exception", "licenseExceptionId": "GPL-3.0-interface-exception", "seeAlso": [ @@ -385,7 +397,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-linking-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-linking-exception.json", - "referenceNumber": 10, + "referenceNumber": 68, "name": "GPL-3.0 Linking Exception", "licenseExceptionId": "GPL-3.0-linking-exception", "seeAlso": [ @@ -396,7 +408,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-linking-source-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-linking-source-exception.json", - "referenceNumber": 71, + "referenceNumber": 62, "name": "GPL-3.0 Linking Exception (with Corresponding Source)", "licenseExceptionId": "GPL-3.0-linking-source-exception", "seeAlso": [ @@ -408,7 +420,7 @@ "reference": "https://spdx.org/licenses/GPL-CC-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-CC-1.0.json", - "referenceNumber": 18, + "referenceNumber": 33, "name": "GPL Cooperation Commitment 1.0", "licenseExceptionId": "GPL-CC-1.0", "seeAlso": [ @@ -420,7 +432,7 @@ "reference": "https://spdx.org/licenses/GStreamer-exception-2005.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GStreamer-exception-2005.json", - "referenceNumber": 72, + "referenceNumber": 4, "name": "GStreamer Exception (2005)", "licenseExceptionId": "GStreamer-exception-2005", "seeAlso": [ @@ -431,7 +443,7 @@ "reference": "https://spdx.org/licenses/GStreamer-exception-2008.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GStreamer-exception-2008.json", - "referenceNumber": 6, + "referenceNumber": 41, "name": "GStreamer Exception (2008)", "licenseExceptionId": "GStreamer-exception-2008", "seeAlso": [ @@ -442,7 +454,7 @@ "reference": "https://spdx.org/licenses/harbour-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/harbour-exception.json", - "referenceNumber": 7, + "referenceNumber": 59, "name": "harbour exception", "licenseExceptionId": "harbour-exception", "seeAlso": [ @@ -453,7 +465,7 @@ "reference": "https://spdx.org/licenses/i2p-gpl-java-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/i2p-gpl-java-exception.json", - "referenceNumber": 40, + "referenceNumber": 9, "name": "i2p GPL+Java Exception", "licenseExceptionId": "i2p-gpl-java-exception", "seeAlso": [ @@ -464,7 +476,7 @@ "reference": "https://spdx.org/licenses/Independent-modules-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Independent-modules-exception.json", - "referenceNumber": 61, + "referenceNumber": 45, "name": "Independent Module Linking exception", "licenseExceptionId": "Independent-modules-exception", "seeAlso": [ @@ -475,7 +487,7 @@ "reference": "https://spdx.org/licenses/KiCad-libraries-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/KiCad-libraries-exception.json", - "referenceNumber": 68, + "referenceNumber": 44, "name": "KiCad Libraries Exception", "licenseExceptionId": "KiCad-libraries-exception", "seeAlso": [ @@ -486,7 +498,7 @@ "reference": "https://spdx.org/licenses/LGPL-3.0-linking-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-3.0-linking-exception.json", - "referenceNumber": 33, + "referenceNumber": 32, "name": "LGPL-3.0 Linking Exception", "licenseExceptionId": "LGPL-3.0-linking-exception", "seeAlso": [ @@ -499,7 +511,7 @@ "reference": "https://spdx.org/licenses/libpri-OpenH323-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/libpri-OpenH323-exception.json", - "referenceNumber": 55, + "referenceNumber": 19, "name": "libpri OpenH323 exception", "licenseExceptionId": "libpri-OpenH323-exception", "seeAlso": [ @@ -510,7 +522,7 @@ "reference": "https://spdx.org/licenses/Libtool-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Libtool-exception.json", - "referenceNumber": 15, + "referenceNumber": 71, "name": "Libtool Exception", "licenseExceptionId": "Libtool-exception", "seeAlso": [ @@ -522,7 +534,7 @@ "reference": "https://spdx.org/licenses/Linux-syscall-note.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-syscall-note.json", - "referenceNumber": 22, + "referenceNumber": 37, "name": "Linux Syscall Note", "licenseExceptionId": "Linux-syscall-note", "seeAlso": [ @@ -533,7 +545,7 @@ "reference": "https://spdx.org/licenses/LLGPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LLGPL.json", - "referenceNumber": 3, + "referenceNumber": 24, "name": "LLGPL Preamble", "licenseExceptionId": "LLGPL", "seeAlso": [ @@ -544,7 +556,7 @@ "reference": "https://spdx.org/licenses/LLVM-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LLVM-exception.json", - "referenceNumber": 74, + "referenceNumber": 72, "name": "LLVM Exception", "licenseExceptionId": "LLVM-exception", "seeAlso": [ @@ -555,7 +567,7 @@ "reference": "https://spdx.org/licenses/LZMA-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LZMA-exception.json", - "referenceNumber": 32, + "referenceNumber": 30, "name": "LZMA exception", "licenseExceptionId": "LZMA-exception", "seeAlso": [ @@ -566,7 +578,7 @@ "reference": "https://spdx.org/licenses/mif-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mif-exception.json", - "referenceNumber": 75, + "referenceNumber": 29, "name": "Macros and Inline Functions Exception", "licenseExceptionId": "mif-exception", "seeAlso": [ @@ -579,7 +591,7 @@ "reference": "https://spdx.org/licenses/mxml-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mxml-exception.json", - "referenceNumber": 21, + "referenceNumber": 38, "name": "mxml Exception", "licenseExceptionId": "mxml-exception", "seeAlso": [ @@ -591,7 +603,7 @@ "reference": "https://spdx.org/licenses/Nokia-Qt-exception-1.1.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/Nokia-Qt-exception-1.1.json", - "referenceNumber": 51, + "referenceNumber": 47, "name": "Nokia Qt LGPL exception 1.1", "licenseExceptionId": "Nokia-Qt-exception-1.1", "seeAlso": [ @@ -602,7 +614,7 @@ "reference": "https://spdx.org/licenses/OCaml-LGPL-linking-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OCaml-LGPL-linking-exception.json", - "referenceNumber": 35, + "referenceNumber": 42, "name": "OCaml LGPL Linking Exception", "licenseExceptionId": "OCaml-LGPL-linking-exception", "seeAlso": [ @@ -613,7 +625,7 @@ "reference": "https://spdx.org/licenses/OCCT-exception-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OCCT-exception-1.0.json", - "referenceNumber": 70, + "referenceNumber": 17, "name": "Open CASCADE Exception 1.0", "licenseExceptionId": "OCCT-exception-1.0", "seeAlso": [ @@ -624,7 +636,7 @@ "reference": "https://spdx.org/licenses/OpenJDK-assembly-exception-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OpenJDK-assembly-exception-1.0.json", - "referenceNumber": 77, + "referenceNumber": 11, "name": "OpenJDK Assembly exception 1.0", "licenseExceptionId": "OpenJDK-assembly-exception-1.0", "seeAlso": [ @@ -635,7 +647,7 @@ "reference": "https://spdx.org/licenses/openvpn-openssl-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/openvpn-openssl-exception.json", - "referenceNumber": 9, + "referenceNumber": 3, "name": "OpenVPN OpenSSL Exception", "licenseExceptionId": "openvpn-openssl-exception", "seeAlso": [ @@ -647,18 +659,29 @@ "reference": "https://spdx.org/licenses/PCRE2-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PCRE2-exception.json", - "referenceNumber": 76, + "referenceNumber": 12, "name": "PCRE2 exception", "licenseExceptionId": "PCRE2-exception", "seeAlso": [ "https://www.pcre.org/licence.txt" ] }, + { + "reference": "https://spdx.org/licenses/polyparse-exception.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/polyparse-exception.json", + "referenceNumber": 54, + "name": "Polyparse Exception", + "licenseExceptionId": "polyparse-exception", + "seeAlso": [ + "https://hackage.haskell.org/package/polyparse-1.13/src/COPYRIGHT" + ] + }, { "reference": "https://spdx.org/licenses/PS-or-PDF-font-exception-20170817.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PS-or-PDF-font-exception-20170817.json", - "referenceNumber": 4, + "referenceNumber": 43, "name": "PS/PDF font exception (2017-08-17)", "licenseExceptionId": "PS-or-PDF-font-exception-20170817", "seeAlso": [ @@ -669,7 +692,7 @@ "reference": "https://spdx.org/licenses/QPL-1.0-INRIA-2004-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/QPL-1.0-INRIA-2004-exception.json", - "referenceNumber": 48, + "referenceNumber": 50, "name": "INRIA QPL 1.0 2004 variant exception", "licenseExceptionId": "QPL-1.0-INRIA-2004-exception", "seeAlso": [ @@ -681,7 +704,7 @@ "reference": "https://spdx.org/licenses/Qt-GPL-exception-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Qt-GPL-exception-1.0.json", - "referenceNumber": 45, + "referenceNumber": 34, "name": "Qt GPL exception 1.0", "licenseExceptionId": "Qt-GPL-exception-1.0", "seeAlso": [ @@ -692,7 +715,7 @@ "reference": "https://spdx.org/licenses/Qt-LGPL-exception-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Qt-LGPL-exception-1.1.json", - "referenceNumber": 73, + "referenceNumber": 39, "name": "Qt LGPL exception 1.1", "licenseExceptionId": "Qt-LGPL-exception-1.1", "seeAlso": [ @@ -703,7 +726,7 @@ "reference": "https://spdx.org/licenses/Qwt-exception-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Qwt-exception-1.0.json", - "referenceNumber": 11, + "referenceNumber": 79, "name": "Qwt exception 1.0", "licenseExceptionId": "Qwt-exception-1.0", "seeAlso": [ @@ -714,7 +737,7 @@ "reference": "https://spdx.org/licenses/romic-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/romic-exception.json", - "referenceNumber": 28, + "referenceNumber": 6, "name": "Romic Exception", "licenseExceptionId": "romic-exception", "seeAlso": [ @@ -730,7 +753,7 @@ "reference": "https://spdx.org/licenses/RRDtool-FLOSS-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RRDtool-FLOSS-exception-2.0.json", - "referenceNumber": 29, + "referenceNumber": 7, "name": "RRDtool FLOSS exception 2.0", "licenseExceptionId": "RRDtool-FLOSS-exception-2.0", "seeAlso": [ @@ -742,7 +765,7 @@ "reference": "https://spdx.org/licenses/SANE-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SANE-exception.json", - "referenceNumber": 26, + "referenceNumber": 27, "name": "SANE Exception", "licenseExceptionId": "SANE-exception", "seeAlso": [ @@ -755,7 +778,7 @@ "reference": "https://spdx.org/licenses/SHL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SHL-2.0.json", - "referenceNumber": 30, + "referenceNumber": 5, "name": "Solderpad Hardware License v2.0", "licenseExceptionId": "SHL-2.0", "seeAlso": [ @@ -766,7 +789,7 @@ "reference": "https://spdx.org/licenses/SHL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SHL-2.1.json", - "referenceNumber": 36, + "referenceNumber": 1, "name": "Solderpad Hardware License v2.1", "licenseExceptionId": "SHL-2.1", "seeAlso": [ @@ -777,7 +800,7 @@ "reference": "https://spdx.org/licenses/stunnel-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/stunnel-exception.json", - "referenceNumber": 60, + "referenceNumber": 49, "name": "stunnel Exception", "licenseExceptionId": "stunnel-exception", "seeAlso": [ @@ -788,7 +811,7 @@ "reference": "https://spdx.org/licenses/SWI-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SWI-exception.json", - "referenceNumber": 46, + "referenceNumber": 15, "name": "SWI exception", "licenseExceptionId": "SWI-exception", "seeAlso": [ @@ -799,7 +822,7 @@ "reference": "https://spdx.org/licenses/Swift-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Swift-exception.json", - "referenceNumber": 56, + "referenceNumber": 52, "name": "Swift Exception", "licenseExceptionId": "Swift-exception", "seeAlso": [ @@ -811,7 +834,7 @@ "reference": "https://spdx.org/licenses/Texinfo-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Texinfo-exception.json", - "referenceNumber": 62, + "referenceNumber": 60, "name": "Texinfo exception", "licenseExceptionId": "Texinfo-exception", "seeAlso": [ @@ -822,7 +845,7 @@ "reference": "https://spdx.org/licenses/u-boot-exception-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/u-boot-exception-2.0.json", - "referenceNumber": 5, + "referenceNumber": 8, "name": "U-Boot exception 2.0", "licenseExceptionId": "u-boot-exception-2.0", "seeAlso": [ @@ -833,7 +856,7 @@ "reference": "https://spdx.org/licenses/UBDL-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UBDL-exception.json", - "referenceNumber": 23, + "referenceNumber": 75, "name": "Unmodified Binary Distribution exception", "licenseExceptionId": "UBDL-exception", "seeAlso": [ @@ -844,7 +867,7 @@ "reference": "https://spdx.org/licenses/Universal-FOSS-exception-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Universal-FOSS-exception-1.0.json", - "referenceNumber": 52, + "referenceNumber": 70, "name": "Universal FOSS Exception, Version 1.0", "licenseExceptionId": "Universal-FOSS-exception-1.0", "seeAlso": [ @@ -855,7 +878,7 @@ "reference": "https://spdx.org/licenses/vsftpd-openssl-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/vsftpd-openssl-exception.json", - "referenceNumber": 39, + "referenceNumber": 55, "name": "vsftpd OpenSSL exception", "licenseExceptionId": "vsftpd-openssl-exception", "seeAlso": [ @@ -868,7 +891,7 @@ "reference": "https://spdx.org/licenses/WxWindows-exception-3.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/WxWindows-exception-3.1.json", - "referenceNumber": 49, + "referenceNumber": 31, "name": "WxWindows Library Exception 3.1", "licenseExceptionId": "WxWindows-exception-3.1", "seeAlso": [ @@ -879,7 +902,7 @@ "reference": "https://spdx.org/licenses/x11vnc-openssl-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/x11vnc-openssl-exception.json", - "referenceNumber": 31, + "referenceNumber": 57, "name": "x11vnc OpenSSL Exception", "licenseExceptionId": "x11vnc-openssl-exception", "seeAlso": [ @@ -887,5 +910,5 @@ ] } ], - "releaseDate": "2024-12-30T00:00:00Z" + "releaseDate": "2025-07-01T00:00:00Z" } \ No newline at end of file diff --git a/Library/Homebrew/data/spdx/spdx_licenses.json b/Library/Homebrew/data/spdx/spdx_licenses.json index 541444700e..8970ea00c7 100644 --- a/Library/Homebrew/data/spdx/spdx_licenses.json +++ b/Library/Homebrew/data/spdx/spdx_licenses.json @@ -1,11 +1,11 @@ { - "licenseListVersion": "3.26.0", + "licenseListVersion": "3.27.0", "licenses": [ { "reference": "https://spdx.org/licenses/0BSD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/0BSD.json", - "referenceNumber": 502, + "referenceNumber": 316, "name": "BSD Zero Clause License", "licenseId": "0BSD", "seeAlso": [ @@ -18,7 +18,7 @@ "reference": "https://spdx.org/licenses/3D-Slicer-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/3D-Slicer-1.0.json", - "referenceNumber": 490, + "referenceNumber": 61, "name": "3D Slicer License v1.0", "licenseId": "3D-Slicer-1.0", "seeAlso": [ @@ -31,7 +31,7 @@ "reference": "https://spdx.org/licenses/AAL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AAL.json", - "referenceNumber": 136, + "referenceNumber": 424, "name": "Attribution Assurance License", "licenseId": "AAL", "seeAlso": [ @@ -43,7 +43,7 @@ "reference": "https://spdx.org/licenses/Abstyles.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Abstyles.json", - "referenceNumber": 641, + "referenceNumber": 252, "name": "Abstyles License", "licenseId": "Abstyles", "seeAlso": [ @@ -55,7 +55,7 @@ "reference": "https://spdx.org/licenses/AdaCore-doc.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AdaCore-doc.json", - "referenceNumber": 403, + "referenceNumber": 315, "name": "AdaCore Doc License", "licenseId": "AdaCore-doc", "seeAlso": [ @@ -69,7 +69,7 @@ "reference": "https://spdx.org/licenses/Adobe-2006.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Adobe-2006.json", - "referenceNumber": 131, + "referenceNumber": 658, "name": "Adobe Systems Incorporated Source Code License Agreement", "licenseId": "Adobe-2006", "seeAlso": [ @@ -81,7 +81,7 @@ "reference": "https://spdx.org/licenses/Adobe-Display-PostScript.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Adobe-Display-PostScript.json", - "referenceNumber": 366, + "referenceNumber": 499, "name": "Adobe Display PostScript License", "licenseId": "Adobe-Display-PostScript", "seeAlso": [ @@ -93,7 +93,7 @@ "reference": "https://spdx.org/licenses/Adobe-Glyph.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Adobe-Glyph.json", - "referenceNumber": 510, + "referenceNumber": 492, "name": "Adobe Glyph List License", "licenseId": "Adobe-Glyph", "seeAlso": [ @@ -105,7 +105,7 @@ "reference": "https://spdx.org/licenses/Adobe-Utopia.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Adobe-Utopia.json", - "referenceNumber": 591, + "referenceNumber": 554, "name": "Adobe Utopia Font License", "licenseId": "Adobe-Utopia", "seeAlso": [ @@ -117,7 +117,7 @@ "reference": "https://spdx.org/licenses/ADSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ADSL.json", - "referenceNumber": 45, + "referenceNumber": 76, "name": "Amazon Digital Services License", "licenseId": "ADSL", "seeAlso": [ @@ -129,7 +129,7 @@ "reference": "https://spdx.org/licenses/AFL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AFL-1.1.json", - "referenceNumber": 428, + "referenceNumber": 7, "name": "Academic Free License v1.1", "licenseId": "AFL-1.1", "seeAlso": [ @@ -143,7 +143,7 @@ "reference": "https://spdx.org/licenses/AFL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AFL-1.2.json", - "referenceNumber": 292, + "referenceNumber": 480, "name": "Academic Free License v1.2", "licenseId": "AFL-1.2", "seeAlso": [ @@ -157,7 +157,7 @@ "reference": "https://spdx.org/licenses/AFL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AFL-2.0.json", - "referenceNumber": 356, + "referenceNumber": 41, "name": "Academic Free License v2.0", "licenseId": "AFL-2.0", "seeAlso": [ @@ -170,7 +170,7 @@ "reference": "https://spdx.org/licenses/AFL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AFL-2.1.json", - "referenceNumber": 219, + "referenceNumber": 682, "name": "Academic Free License v2.1", "licenseId": "AFL-2.1", "seeAlso": [ @@ -183,7 +183,7 @@ "reference": "https://spdx.org/licenses/AFL-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AFL-3.0.json", - "referenceNumber": 121, + "referenceNumber": 343, "name": "Academic Free License v3.0", "licenseId": "AFL-3.0", "seeAlso": [ @@ -197,7 +197,7 @@ "reference": "https://spdx.org/licenses/Afmparse.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Afmparse.json", - "referenceNumber": 328, + "referenceNumber": 84, "name": "Afmparse License", "licenseId": "Afmparse", "seeAlso": [ @@ -209,7 +209,7 @@ "reference": "https://spdx.org/licenses/AGPL-1.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/AGPL-1.0.json", - "referenceNumber": 326, + "referenceNumber": 38, "name": "Affero General Public License v1.0", "licenseId": "AGPL-1.0", "seeAlso": [ @@ -222,7 +222,7 @@ "reference": "https://spdx.org/licenses/AGPL-1.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AGPL-1.0-only.json", - "referenceNumber": 404, + "referenceNumber": 415, "name": "Affero General Public License v1.0 only", "licenseId": "AGPL-1.0-only", "seeAlso": [ @@ -234,7 +234,7 @@ "reference": "https://spdx.org/licenses/AGPL-1.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AGPL-1.0-or-later.json", - "referenceNumber": 444, + "referenceNumber": 24, "name": "Affero General Public License v1.0 or later", "licenseId": "AGPL-1.0-or-later", "seeAlso": [ @@ -246,7 +246,7 @@ "reference": "https://spdx.org/licenses/AGPL-3.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/AGPL-3.0.json", - "referenceNumber": 517, + "referenceNumber": 427, "name": "GNU Affero General Public License v3.0", "licenseId": "AGPL-3.0", "seeAlso": [ @@ -260,7 +260,7 @@ "reference": "https://spdx.org/licenses/AGPL-3.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AGPL-3.0-only.json", - "referenceNumber": 180, + "referenceNumber": 191, "name": "GNU Affero General Public License v3.0 only", "licenseId": "AGPL-3.0-only", "seeAlso": [ @@ -274,7 +274,7 @@ "reference": "https://spdx.org/licenses/AGPL-3.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AGPL-3.0-or-later.json", - "referenceNumber": 543, + "referenceNumber": 469, "name": "GNU Affero General Public License v3.0 or later", "licenseId": "AGPL-3.0-or-later", "seeAlso": [ @@ -288,7 +288,7 @@ "reference": "https://spdx.org/licenses/Aladdin.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Aladdin.json", - "referenceNumber": 67, + "referenceNumber": 495, "name": "Aladdin Free Public License", "licenseId": "Aladdin", "seeAlso": [ @@ -301,7 +301,7 @@ "reference": "https://spdx.org/licenses/AMD-newlib.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AMD-newlib.json", - "referenceNumber": 413, + "referenceNumber": 437, "name": "AMD newlib License", "licenseId": "AMD-newlib", "seeAlso": [ @@ -313,7 +313,7 @@ "reference": "https://spdx.org/licenses/AMDPLPA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AMDPLPA.json", - "referenceNumber": 529, + "referenceNumber": 194, "name": "AMD\u0027s plpa_map.c License", "licenseId": "AMDPLPA", "seeAlso": [ @@ -325,7 +325,7 @@ "reference": "https://spdx.org/licenses/AML.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AML.json", - "referenceNumber": 553, + "referenceNumber": 644, "name": "Apple MIT License", "licenseId": "AML", "seeAlso": [ @@ -337,7 +337,7 @@ "reference": "https://spdx.org/licenses/AML-glslang.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AML-glslang.json", - "referenceNumber": 27, + "referenceNumber": 439, "name": "AML glslang variant License", "licenseId": "AML-glslang", "seeAlso": [ @@ -350,7 +350,7 @@ "reference": "https://spdx.org/licenses/AMPAS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/AMPAS.json", - "referenceNumber": 79, + "referenceNumber": 15, "name": "Academy of Motion Picture Arts and Sciences BSD", "licenseId": "AMPAS", "seeAlso": [ @@ -362,7 +362,7 @@ "reference": "https://spdx.org/licenses/ANTLR-PD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ANTLR-PD.json", - "referenceNumber": 454, + "referenceNumber": 25, "name": "ANTLR Software Rights Notice", "licenseId": "ANTLR-PD", "seeAlso": [ @@ -374,7 +374,7 @@ "reference": "https://spdx.org/licenses/ANTLR-PD-fallback.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ANTLR-PD-fallback.json", - "referenceNumber": 635, + "referenceNumber": 218, "name": "ANTLR Software Rights Notice with license fallback", "licenseId": "ANTLR-PD-fallback", "seeAlso": [ @@ -386,7 +386,7 @@ "reference": "https://spdx.org/licenses/any-OSI.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/any-OSI.json", - "referenceNumber": 117, + "referenceNumber": 74, "name": "Any OSI License", "licenseId": "any-OSI", "seeAlso": [ @@ -398,7 +398,7 @@ "reference": "https://spdx.org/licenses/any-OSI-perl-modules.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/any-OSI-perl-modules.json", - "referenceNumber": 286, + "referenceNumber": 230, "name": "Any OSI License - Perl Modules", "licenseId": "any-OSI-perl-modules", "seeAlso": [ @@ -412,7 +412,7 @@ "reference": "https://spdx.org/licenses/Apache-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Apache-1.0.json", - "referenceNumber": 347, + "referenceNumber": 379, "name": "Apache License 1.0", "licenseId": "Apache-1.0", "seeAlso": [ @@ -425,7 +425,7 @@ "reference": "https://spdx.org/licenses/Apache-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Apache-1.1.json", - "referenceNumber": 628, + "referenceNumber": 111, "name": "Apache License 1.1", "licenseId": "Apache-1.1", "seeAlso": [ @@ -439,12 +439,13 @@ "reference": "https://spdx.org/licenses/Apache-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Apache-2.0.json", - "referenceNumber": 418, + "referenceNumber": 162, "name": "Apache License 2.0", "licenseId": "Apache-2.0", "seeAlso": [ "https://www.apache.org/licenses/LICENSE-2.0", - "https://opensource.org/licenses/Apache-2.0" + "https://opensource.org/licenses/Apache-2.0", + "https://opensource.org/license/apache-2-0" ], "isOsiApproved": true, "isFsfLibre": true @@ -453,7 +454,7 @@ "reference": "https://spdx.org/licenses/APAFML.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APAFML.json", - "referenceNumber": 575, + "referenceNumber": 474, "name": "Adobe Postscript AFM License", "licenseId": "APAFML", "seeAlso": [ @@ -465,7 +466,7 @@ "reference": "https://spdx.org/licenses/APL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APL-1.0.json", - "referenceNumber": 233, + "referenceNumber": 127, "name": "Adaptive Public License 1.0", "licenseId": "APL-1.0", "seeAlso": [ @@ -477,7 +478,7 @@ "reference": "https://spdx.org/licenses/App-s2p.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/App-s2p.json", - "referenceNumber": 612, + "referenceNumber": 155, "name": "App::s2p License", "licenseId": "App-s2p", "seeAlso": [ @@ -489,7 +490,7 @@ "reference": "https://spdx.org/licenses/APSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APSL-1.0.json", - "referenceNumber": 263, + "referenceNumber": 86, "name": "Apple Public Source License 1.0", "licenseId": "APSL-1.0", "seeAlso": [ @@ -502,7 +503,7 @@ "reference": "https://spdx.org/licenses/APSL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APSL-1.1.json", - "referenceNumber": 381, + "referenceNumber": 23, "name": "Apple Public Source License 1.1", "licenseId": "APSL-1.1", "seeAlso": [ @@ -514,7 +515,7 @@ "reference": "https://spdx.org/licenses/APSL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APSL-1.2.json", - "referenceNumber": 262, + "referenceNumber": 265, "name": "Apple Public Source License 1.2", "licenseId": "APSL-1.2", "seeAlso": [ @@ -526,7 +527,7 @@ "reference": "https://spdx.org/licenses/APSL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/APSL-2.0.json", - "referenceNumber": 438, + "referenceNumber": 568, "name": "Apple Public Source License 2.0", "licenseId": "APSL-2.0", "seeAlso": [ @@ -539,7 +540,7 @@ "reference": "https://spdx.org/licenses/Arphic-1999.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Arphic-1999.json", - "referenceNumber": 122, + "referenceNumber": 649, "name": "Arphic Public License", "licenseId": "Arphic-1999", "seeAlso": [ @@ -551,7 +552,7 @@ "reference": "https://spdx.org/licenses/Artistic-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Artistic-1.0.json", - "referenceNumber": 580, + "referenceNumber": 388, "name": "Artistic License 1.0", "licenseId": "Artistic-1.0", "seeAlso": [ @@ -564,7 +565,7 @@ "reference": "https://spdx.org/licenses/Artistic-1.0-cl8.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Artistic-1.0-cl8.json", - "referenceNumber": 205, + "referenceNumber": 291, "name": "Artistic License 1.0 w/clause 8", "licenseId": "Artistic-1.0-cl8", "seeAlso": [ @@ -576,7 +577,7 @@ "reference": "https://spdx.org/licenses/Artistic-1.0-Perl.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Artistic-1.0-Perl.json", - "referenceNumber": 183, + "referenceNumber": 20, "name": "Artistic License 1.0 (Perl)", "licenseId": "Artistic-1.0-Perl", "seeAlso": [ @@ -588,7 +589,7 @@ "reference": "https://spdx.org/licenses/Artistic-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Artistic-2.0.json", - "referenceNumber": 519, + "referenceNumber": 217, "name": "Artistic License 2.0", "licenseId": "Artistic-2.0", "seeAlso": [ @@ -599,11 +600,35 @@ "isOsiApproved": true, "isFsfLibre": true }, + { + "reference": "https://spdx.org/licenses/Artistic-dist.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Artistic-dist.json", + "referenceNumber": 511, + "name": "Artistic License 1.0 (dist)", + "licenseId": "Artistic-dist", + "seeAlso": [ + "https://github.com/pexip/os-perl/blob/833cf4c86cc465ccfc627ff16db67e783156a248/debian/copyright#L2720-L2845" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Aspell-RU.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Aspell-RU.json", + "referenceNumber": 231, + "name": "Aspell Russian License", + "licenseId": "Aspell-RU", + "seeAlso": [ + "https://ftp.gnu.org/gnu/aspell/dict/ru/aspell6-ru-0.99f7-1.tar.bz2" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/ASWF-Digital-Assets-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ASWF-Digital-Assets-1.0.json", - "referenceNumber": 380, + "referenceNumber": 340, "name": "ASWF Digital Assets License version 1.0", "licenseId": "ASWF-Digital-Assets-1.0", "seeAlso": [ @@ -615,7 +640,7 @@ "reference": "https://spdx.org/licenses/ASWF-Digital-Assets-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ASWF-Digital-Assets-1.1.json", - "referenceNumber": 7, + "referenceNumber": 153, "name": "ASWF Digital Assets License 1.1", "licenseId": "ASWF-Digital-Assets-1.1", "seeAlso": [ @@ -627,7 +652,7 @@ "reference": "https://spdx.org/licenses/Baekmuk.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Baekmuk.json", - "referenceNumber": 434, + "referenceNumber": 311, "name": "Baekmuk License", "licenseId": "Baekmuk", "seeAlso": [ @@ -639,7 +664,7 @@ "reference": "https://spdx.org/licenses/Bahyph.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bahyph.json", - "referenceNumber": 312, + "referenceNumber": 505, "name": "Bahyph License", "licenseId": "Bahyph", "seeAlso": [ @@ -651,7 +676,7 @@ "reference": "https://spdx.org/licenses/Barr.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Barr.json", - "referenceNumber": 93, + "referenceNumber": 420, "name": "Barr License", "licenseId": "Barr", "seeAlso": [ @@ -663,7 +688,7 @@ "reference": "https://spdx.org/licenses/bcrypt-Solar-Designer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/bcrypt-Solar-Designer.json", - "referenceNumber": 624, + "referenceNumber": 167, "name": "bcrypt Solar Designer License", "licenseId": "bcrypt-Solar-Designer", "seeAlso": [ @@ -675,7 +700,7 @@ "reference": "https://spdx.org/licenses/Beerware.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Beerware.json", - "referenceNumber": 429, + "referenceNumber": 556, "name": "Beerware License", "licenseId": "Beerware", "seeAlso": [ @@ -688,7 +713,7 @@ "reference": "https://spdx.org/licenses/Bitstream-Charter.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bitstream-Charter.json", - "referenceNumber": 530, + "referenceNumber": 47, "name": "Bitstream Charter Font License", "licenseId": "Bitstream-Charter", "seeAlso": [ @@ -701,7 +726,7 @@ "reference": "https://spdx.org/licenses/Bitstream-Vera.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Bitstream-Vera.json", - "referenceNumber": 194, + "referenceNumber": 208, "name": "Bitstream Vera Font License", "licenseId": "Bitstream-Vera", "seeAlso": [ @@ -714,7 +739,7 @@ "reference": "https://spdx.org/licenses/BitTorrent-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BitTorrent-1.0.json", - "referenceNumber": 669, + "referenceNumber": 156, "name": "BitTorrent Open Source License v1.0", "licenseId": "BitTorrent-1.0", "seeAlso": [ @@ -726,7 +751,7 @@ "reference": "https://spdx.org/licenses/BitTorrent-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BitTorrent-1.1.json", - "referenceNumber": 583, + "referenceNumber": 325, "name": "BitTorrent Open Source License v1.1", "licenseId": "BitTorrent-1.1", "seeAlso": [ @@ -739,7 +764,7 @@ "reference": "https://spdx.org/licenses/blessing.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/blessing.json", - "referenceNumber": 667, + "referenceNumber": 680, "name": "SQLite Blessing", "licenseId": "blessing", "seeAlso": [ @@ -752,7 +777,7 @@ "reference": "https://spdx.org/licenses/BlueOak-1.0.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BlueOak-1.0.0.json", - "referenceNumber": 191, + "referenceNumber": 51, "name": "Blue Oak Model License 1.0.0", "licenseId": "BlueOak-1.0.0", "seeAlso": [ @@ -764,7 +789,7 @@ "reference": "https://spdx.org/licenses/Boehm-GC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Boehm-GC.json", - "referenceNumber": 540, + "referenceNumber": 92, "name": "Boehm-Demers-Weiser GC License", "licenseId": "Boehm-GC", "seeAlso": [ @@ -778,7 +803,7 @@ "reference": "https://spdx.org/licenses/Boehm-GC-without-fee.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Boehm-GC-without-fee.json", - "referenceNumber": 606, + "referenceNumber": 466, "name": "Boehm-Demers-Weiser GC License (without fee)", "licenseId": "Boehm-GC-without-fee", "seeAlso": [ @@ -790,7 +815,7 @@ "reference": "https://spdx.org/licenses/Borceux.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Borceux.json", - "referenceNumber": 500, + "referenceNumber": 335, "name": "Borceux license", "licenseId": "Borceux", "seeAlso": [ @@ -802,7 +827,7 @@ "reference": "https://spdx.org/licenses/Brian-Gladman-2-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Brian-Gladman-2-Clause.json", - "referenceNumber": 582, + "referenceNumber": 198, "name": "Brian Gladman 2-Clause License", "licenseId": "Brian-Gladman-2-Clause", "seeAlso": [ @@ -815,7 +840,7 @@ "reference": "https://spdx.org/licenses/Brian-Gladman-3-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Brian-Gladman-3-Clause.json", - "referenceNumber": 360, + "referenceNumber": 675, "name": "Brian Gladman 3-Clause License", "licenseId": "Brian-Gladman-3-Clause", "seeAlso": [ @@ -827,7 +852,7 @@ "reference": "https://spdx.org/licenses/BSD-1-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-1-Clause.json", - "referenceNumber": 101, + "referenceNumber": 286, "name": "BSD 1-Clause License", "licenseId": "BSD-1-Clause", "seeAlso": [ @@ -839,7 +864,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause.json", - "referenceNumber": 61, + "referenceNumber": 430, "name": "BSD 2-Clause \"Simplified\" License", "licenseId": "BSD-2-Clause", "seeAlso": [ @@ -852,7 +877,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause-Darwin.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Darwin.json", - "referenceNumber": 300, + "referenceNumber": 477, "name": "BSD 2-Clause - Ian Darwin variant", "licenseId": "BSD-2-Clause-Darwin", "seeAlso": [ @@ -864,7 +889,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause-first-lines.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-first-lines.json", - "referenceNumber": 271, + "referenceNumber": 543, "name": "BSD 2-Clause - first lines requirement", "licenseId": "BSD-2-Clause-first-lines", "seeAlso": [ @@ -877,7 +902,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.json", - "referenceNumber": 388, + "referenceNumber": 622, "name": "BSD 2-Clause FreeBSD License", "licenseId": "BSD-2-Clause-FreeBSD", "seeAlso": [ @@ -890,7 +915,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-NetBSD.json", - "referenceNumber": 230, + "referenceNumber": 531, "name": "BSD 2-Clause NetBSD License", "licenseId": "BSD-2-Clause-NetBSD", "seeAlso": [ @@ -903,7 +928,7 @@ "reference": "https://spdx.org/licenses/BSD-2-Clause-Patent.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Patent.json", - "referenceNumber": 601, + "referenceNumber": 584, "name": "BSD-2-Clause Plus Patent License", "licenseId": "BSD-2-Clause-Patent", "seeAlso": [ @@ -911,11 +936,24 @@ ], "isOsiApproved": true }, + { + "reference": "https://spdx.org/licenses/BSD-2-Clause-pkgconf-disclaimer.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-pkgconf-disclaimer.json", + "referenceNumber": 624, + "name": "BSD 2-Clause pkgconf disclaimer variant", + "licenseId": "BSD-2-Clause-pkgconf-disclaimer", + "seeAlso": [ + "https://github.com/audacious-media-player/audacious/blob/master/src/audacious/main.cc", + "https://github.com/audacious-media-player/audacious/blob/master/COPYING" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/BSD-2-Clause-Views.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-2-Clause-Views.json", - "referenceNumber": 568, + "referenceNumber": 536, "name": "BSD 2-Clause with views sentence", "licenseId": "BSD-2-Clause-Views", "seeAlso": [ @@ -929,7 +967,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause.json", - "referenceNumber": 258, + "referenceNumber": 567, "name": "BSD 3-Clause \"New\" or \"Revised\" License", "licenseId": "BSD-3-Clause", "seeAlso": [ @@ -943,7 +981,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-acpica.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-acpica.json", - "referenceNumber": 613, + "referenceNumber": 277, "name": "BSD 3-Clause acpica variant", "licenseId": "BSD-3-Clause-acpica", "seeAlso": [ @@ -955,7 +993,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-Attribution.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Attribution.json", - "referenceNumber": 511, + "referenceNumber": 159, "name": "BSD with attribution", "licenseId": "BSD-3-Clause-Attribution", "seeAlso": [ @@ -967,7 +1005,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-Clear.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Clear.json", - "referenceNumber": 26, + "referenceNumber": 259, "name": "BSD 3-Clause Clear License", "licenseId": "BSD-3-Clause-Clear", "seeAlso": [ @@ -980,7 +1018,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-flex.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-flex.json", - "referenceNumber": 99, + "referenceNumber": 205, "name": "BSD 3-Clause Flex variant", "licenseId": "BSD-3-Clause-flex", "seeAlso": [ @@ -992,7 +1030,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-HP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-HP.json", - "referenceNumber": 346, + "referenceNumber": 643, "name": "Hewlett-Packard BSD variant license", "licenseId": "BSD-3-Clause-HP", "seeAlso": [ @@ -1004,7 +1042,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-LBNL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-LBNL.json", - "referenceNumber": 243, + "referenceNumber": 6, "name": "Lawrence Berkeley National Labs BSD variant license", "licenseId": "BSD-3-Clause-LBNL", "seeAlso": [ @@ -1016,7 +1054,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-Modification.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Modification.json", - "referenceNumber": 489, + "referenceNumber": 497, "name": "BSD 3-Clause Modification", "licenseId": "BSD-3-Clause-Modification", "seeAlso": [ @@ -1028,7 +1066,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Military-License.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Military-License.json", - "referenceNumber": 102, + "referenceNumber": 498, "name": "BSD 3-Clause No Military License", "licenseId": "BSD-3-Clause-No-Military-License", "seeAlso": [ @@ -1041,7 +1079,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.json", - "referenceNumber": 545, + "referenceNumber": 108, "name": "BSD 3-Clause No Nuclear License", "licenseId": "BSD-3-Clause-No-Nuclear-License", "seeAlso": [ @@ -1053,7 +1091,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.json", - "referenceNumber": 185, + "referenceNumber": 239, "name": "BSD 3-Clause No Nuclear License 2014", "licenseId": "BSD-3-Clause-No-Nuclear-License-2014", "seeAlso": [ @@ -1065,7 +1103,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.json", - "referenceNumber": 465, + "referenceNumber": 606, "name": "BSD 3-Clause No Nuclear Warranty", "licenseId": "BSD-3-Clause-No-Nuclear-Warranty", "seeAlso": [ @@ -1077,7 +1115,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-Open-MPI.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Open-MPI.json", - "referenceNumber": 108, + "referenceNumber": 637, "name": "BSD 3-Clause Open MPI variant", "licenseId": "BSD-3-Clause-Open-MPI", "seeAlso": [ @@ -1090,7 +1128,7 @@ "reference": "https://spdx.org/licenses/BSD-3-Clause-Sun.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-3-Clause-Sun.json", - "referenceNumber": 496, + "referenceNumber": 240, "name": "BSD 3-Clause Sun Microsystems", "licenseId": "BSD-3-Clause-Sun", "seeAlso": [ @@ -1102,7 +1140,7 @@ "reference": "https://spdx.org/licenses/BSD-4-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause.json", - "referenceNumber": 416, + "referenceNumber": 227, "name": "BSD 4-Clause \"Original\" or \"Old\" License", "licenseId": "BSD-4-Clause", "seeAlso": [ @@ -1115,7 +1153,7 @@ "reference": "https://spdx.org/licenses/BSD-4-Clause-Shortened.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause-Shortened.json", - "referenceNumber": 387, + "referenceNumber": 269, "name": "BSD 4 Clause Shortened", "licenseId": "BSD-4-Clause-Shortened", "seeAlso": [ @@ -1127,7 +1165,7 @@ "reference": "https://spdx.org/licenses/BSD-4-Clause-UC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-4-Clause-UC.json", - "referenceNumber": 123, + "referenceNumber": 21, "name": "BSD-4-Clause (University of California-Specific)", "licenseId": "BSD-4-Clause-UC", "seeAlso": [ @@ -1139,7 +1177,7 @@ "reference": "https://spdx.org/licenses/BSD-4.3RENO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-4.3RENO.json", - "referenceNumber": 373, + "referenceNumber": 434, "name": "BSD 4.3 RENO License", "licenseId": "BSD-4.3RENO", "seeAlso": [ @@ -1152,7 +1190,7 @@ "reference": "https://spdx.org/licenses/BSD-4.3TAHOE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-4.3TAHOE.json", - "referenceNumber": 355, + "referenceNumber": 685, "name": "BSD 4.3 TAHOE License", "licenseId": "BSD-4.3TAHOE", "seeAlso": [ @@ -1165,7 +1203,7 @@ "reference": "https://spdx.org/licenses/BSD-Advertising-Acknowledgement.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Advertising-Acknowledgement.json", - "referenceNumber": 488, + "referenceNumber": 345, "name": "BSD Advertising Acknowledgement License", "licenseId": "BSD-Advertising-Acknowledgement", "seeAlso": [ @@ -1177,7 +1215,7 @@ "reference": "https://spdx.org/licenses/BSD-Attribution-HPND-disclaimer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Attribution-HPND-disclaimer.json", - "referenceNumber": 69, + "referenceNumber": 506, "name": "BSD with Attribution and HPND disclaimer", "licenseId": "BSD-Attribution-HPND-disclaimer", "seeAlso": [ @@ -1189,7 +1227,7 @@ "reference": "https://spdx.org/licenses/BSD-Inferno-Nettverk.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Inferno-Nettverk.json", - "referenceNumber": 197, + "referenceNumber": 535, "name": "BSD-Inferno-Nettverk", "licenseId": "BSD-Inferno-Nettverk", "seeAlso": [ @@ -1201,7 +1239,7 @@ "reference": "https://spdx.org/licenses/BSD-Protection.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Protection.json", - "referenceNumber": 546, + "referenceNumber": 163, "name": "BSD Protection License", "licenseId": "BSD-Protection", "seeAlso": [ @@ -1213,7 +1251,7 @@ "reference": "https://spdx.org/licenses/BSD-Source-beginning-file.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Source-beginning-file.json", - "referenceNumber": 421, + "referenceNumber": 383, "name": "BSD Source Code Attribution - beginning of file variant", "licenseId": "BSD-Source-beginning-file", "seeAlso": [ @@ -1225,7 +1263,7 @@ "reference": "https://spdx.org/licenses/BSD-Source-Code.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Source-Code.json", - "referenceNumber": 214, + "referenceNumber": 450, "name": "BSD Source Code Attribution", "licenseId": "BSD-Source-Code", "seeAlso": [ @@ -1237,7 +1275,7 @@ "reference": "https://spdx.org/licenses/BSD-Systemics.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Systemics.json", - "referenceNumber": 160, + "referenceNumber": 602, "name": "Systemics BSD variant license", "licenseId": "BSD-Systemics", "seeAlso": [ @@ -1249,7 +1287,7 @@ "reference": "https://spdx.org/licenses/BSD-Systemics-W3Works.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSD-Systemics-W3Works.json", - "referenceNumber": 652, + "referenceNumber": 422, "name": "Systemics W3Works BSD variant license", "licenseId": "BSD-Systemics-W3Works", "seeAlso": [ @@ -1261,7 +1299,7 @@ "reference": "https://spdx.org/licenses/BSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BSL-1.0.json", - "referenceNumber": 272, + "referenceNumber": 130, "name": "Boost Software License 1.0", "licenseId": "BSL-1.0", "seeAlso": [ @@ -1275,7 +1313,7 @@ "reference": "https://spdx.org/licenses/BUSL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/BUSL-1.1.json", - "referenceNumber": 318, + "referenceNumber": 234, "name": "Business Source License 1.1", "licenseId": "BUSL-1.1", "seeAlso": [ @@ -1287,7 +1325,7 @@ "reference": "https://spdx.org/licenses/bzip2-1.0.5.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/bzip2-1.0.5.json", - "referenceNumber": 556, + "referenceNumber": 412, "name": "bzip2 and libbzip2 License v1.0.5", "licenseId": "bzip2-1.0.5", "seeAlso": [ @@ -1300,7 +1338,7 @@ "reference": "https://spdx.org/licenses/bzip2-1.0.6.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/bzip2-1.0.6.json", - "referenceNumber": 638, + "referenceNumber": 243, "name": "bzip2 and libbzip2 License v1.0.6", "licenseId": "bzip2-1.0.6", "seeAlso": [ @@ -1314,7 +1352,7 @@ "reference": "https://spdx.org/licenses/C-UDA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/C-UDA-1.0.json", - "referenceNumber": 345, + "referenceNumber": 660, "name": "Computational Use of Data Agreement v1.0", "licenseId": "C-UDA-1.0", "seeAlso": [ @@ -1327,7 +1365,7 @@ "reference": "https://spdx.org/licenses/CAL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CAL-1.0.json", - "referenceNumber": 137, + "referenceNumber": 305, "name": "Cryptographic Autonomy License 1.0", "licenseId": "CAL-1.0", "seeAlso": [ @@ -1340,7 +1378,7 @@ "reference": "https://spdx.org/licenses/CAL-1.0-Combined-Work-Exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CAL-1.0-Combined-Work-Exception.json", - "referenceNumber": 660, + "referenceNumber": 569, "name": "Cryptographic Autonomy License 1.0 (Combined Work Exception)", "licenseId": "CAL-1.0-Combined-Work-Exception", "seeAlso": [ @@ -1353,7 +1391,7 @@ "reference": "https://spdx.org/licenses/Caldera.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Caldera.json", - "referenceNumber": 323, + "referenceNumber": 483, "name": "Caldera License", "licenseId": "Caldera", "seeAlso": [ @@ -1365,7 +1403,7 @@ "reference": "https://spdx.org/licenses/Caldera-no-preamble.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Caldera-no-preamble.json", - "referenceNumber": 630, + "referenceNumber": 401, "name": "Caldera License (without preamble)", "licenseId": "Caldera-no-preamble", "seeAlso": [ @@ -1377,7 +1415,7 @@ "reference": "https://spdx.org/licenses/Catharon.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Catharon.json", - "referenceNumber": 397, + "referenceNumber": 581, "name": "Catharon License", "licenseId": "Catharon", "seeAlso": [ @@ -1389,7 +1427,7 @@ "reference": "https://spdx.org/licenses/CATOSL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CATOSL-1.1.json", - "referenceNumber": 175, + "referenceNumber": 97, "name": "Computer Associates Trusted Open Source License 1.1", "licenseId": "CATOSL-1.1", "seeAlso": [ @@ -1401,7 +1439,7 @@ "reference": "https://spdx.org/licenses/CC-BY-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-1.0.json", - "referenceNumber": 232, + "referenceNumber": 559, "name": "Creative Commons Attribution 1.0 Generic", "licenseId": "CC-BY-1.0", "seeAlso": [ @@ -1413,7 +1451,7 @@ "reference": "https://spdx.org/licenses/CC-BY-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-2.0.json", - "referenceNumber": 473, + "referenceNumber": 441, "name": "Creative Commons Attribution 2.0 Generic", "licenseId": "CC-BY-2.0", "seeAlso": [ @@ -1425,7 +1463,7 @@ "reference": "https://spdx.org/licenses/CC-BY-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-2.5.json", - "referenceNumber": 521, + "referenceNumber": 292, "name": "Creative Commons Attribution 2.5 Generic", "licenseId": "CC-BY-2.5", "seeAlso": [ @@ -1437,7 +1475,7 @@ "reference": "https://spdx.org/licenses/CC-BY-2.5-AU.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-2.5-AU.json", - "referenceNumber": 459, + "referenceNumber": 126, "name": "Creative Commons Attribution 2.5 Australia", "licenseId": "CC-BY-2.5-AU", "seeAlso": [ @@ -1449,7 +1487,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0.json", - "referenceNumber": 107, + "referenceNumber": 576, "name": "Creative Commons Attribution 3.0 Unported", "licenseId": "CC-BY-3.0", "seeAlso": [ @@ -1461,7 +1499,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-AT.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-AT.json", - "referenceNumber": 130, + "referenceNumber": 107, "name": "Creative Commons Attribution 3.0 Austria", "licenseId": "CC-BY-3.0-AT", "seeAlso": [ @@ -1473,7 +1511,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-AU.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-AU.json", - "referenceNumber": 256, + "referenceNumber": 648, "name": "Creative Commons Attribution 3.0 Australia", "licenseId": "CC-BY-3.0-AU", "seeAlso": [ @@ -1485,7 +1523,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-DE.json", - "referenceNumber": 91, + "referenceNumber": 458, "name": "Creative Commons Attribution 3.0 Germany", "licenseId": "CC-BY-3.0-DE", "seeAlso": [ @@ -1497,7 +1535,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-IGO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-IGO.json", - "referenceNumber": 213, + "referenceNumber": 410, "name": "Creative Commons Attribution 3.0 IGO", "licenseId": "CC-BY-3.0-IGO", "seeAlso": [ @@ -1509,7 +1547,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-NL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-NL.json", - "referenceNumber": 402, + "referenceNumber": 436, "name": "Creative Commons Attribution 3.0 Netherlands", "licenseId": "CC-BY-3.0-NL", "seeAlso": [ @@ -1521,7 +1559,7 @@ "reference": "https://spdx.org/licenses/CC-BY-3.0-US.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-3.0-US.json", - "referenceNumber": 275, + "referenceNumber": 366, "name": "Creative Commons Attribution 3.0 United States", "licenseId": "CC-BY-3.0-US", "seeAlso": [ @@ -1533,7 +1571,7 @@ "reference": "https://spdx.org/licenses/CC-BY-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-4.0.json", - "referenceNumber": 494, + "referenceNumber": 66, "name": "Creative Commons Attribution 4.0 International", "licenseId": "CC-BY-4.0", "seeAlso": [ @@ -1546,7 +1584,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-1.0.json", - "referenceNumber": 414, + "referenceNumber": 428, "name": "Creative Commons Attribution Non Commercial 1.0 Generic", "licenseId": "CC-BY-NC-1.0", "seeAlso": [ @@ -1559,7 +1597,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-2.0.json", - "referenceNumber": 57, + "referenceNumber": 553, "name": "Creative Commons Attribution Non Commercial 2.0 Generic", "licenseId": "CC-BY-NC-2.0", "seeAlso": [ @@ -1572,7 +1610,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-2.5.json", - "referenceNumber": 332, + "referenceNumber": 49, "name": "Creative Commons Attribution Non Commercial 2.5 Generic", "licenseId": "CC-BY-NC-2.5", "seeAlso": [ @@ -1585,7 +1623,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-3.0.json", - "referenceNumber": 226, + "referenceNumber": 686, "name": "Creative Commons Attribution Non Commercial 3.0 Unported", "licenseId": "CC-BY-NC-3.0", "seeAlso": [ @@ -1598,7 +1636,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-3.0-DE.json", - "referenceNumber": 204, + "referenceNumber": 324, "name": "Creative Commons Attribution Non Commercial 3.0 Germany", "licenseId": "CC-BY-NC-3.0-DE", "seeAlso": [ @@ -1610,7 +1648,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-4.0.json", - "referenceNumber": 464, + "referenceNumber": 560, "name": "Creative Commons Attribution Non Commercial 4.0 International", "licenseId": "CC-BY-NC-4.0", "seeAlso": [ @@ -1623,7 +1661,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-1.0.json", - "referenceNumber": 190, + "referenceNumber": 442, "name": "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", "licenseId": "CC-BY-NC-ND-1.0", "seeAlso": [ @@ -1635,7 +1673,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-2.0.json", - "referenceNumber": 242, + "referenceNumber": 334, "name": "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", "licenseId": "CC-BY-NC-ND-2.0", "seeAlso": [ @@ -1647,7 +1685,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-2.5.json", - "referenceNumber": 358, + "referenceNumber": 215, "name": "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", "licenseId": "CC-BY-NC-ND-2.5", "seeAlso": [ @@ -1659,7 +1697,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0.json", - "referenceNumber": 51, + "referenceNumber": 94, "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", "licenseId": "CC-BY-NC-ND-3.0", "seeAlso": [ @@ -1671,7 +1709,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-DE.json", - "referenceNumber": 676, + "referenceNumber": 185, "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 Germany", "licenseId": "CC-BY-NC-ND-3.0-DE", "seeAlso": [ @@ -1683,7 +1721,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-IGO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-3.0-IGO.json", - "referenceNumber": 109, + "referenceNumber": 577, "name": "Creative Commons Attribution Non Commercial No Derivatives 3.0 IGO", "licenseId": "CC-BY-NC-ND-3.0-IGO", "seeAlso": [ @@ -1695,7 +1733,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-ND-4.0.json", - "referenceNumber": 184, + "referenceNumber": 53, "name": "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", "licenseId": "CC-BY-NC-ND-4.0", "seeAlso": [ @@ -1707,7 +1745,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-1.0.json", - "referenceNumber": 650, + "referenceNumber": 510, "name": "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", "licenseId": "CC-BY-NC-SA-1.0", "seeAlso": [ @@ -1719,7 +1757,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0.json", - "referenceNumber": 2, + "referenceNumber": 199, "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", "licenseId": "CC-BY-NC-SA-2.0", "seeAlso": [ @@ -1731,7 +1769,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-DE.json", - "referenceNumber": 310, + "referenceNumber": 356, "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 Germany", "licenseId": "CC-BY-NC-SA-2.0-DE", "seeAlso": [ @@ -1743,7 +1781,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-FR.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-FR.json", - "referenceNumber": 264, + "referenceNumber": 301, "name": "Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France", "licenseId": "CC-BY-NC-SA-2.0-FR", "seeAlso": [ @@ -1755,7 +1793,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-UK.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.0-UK.json", - "referenceNumber": 70, + "referenceNumber": 671, "name": "Creative Commons Attribution Non Commercial Share Alike 2.0 England and Wales", "licenseId": "CC-BY-NC-SA-2.0-UK", "seeAlso": [ @@ -1767,7 +1805,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-2.5.json", - "referenceNumber": 148, + "referenceNumber": 659, "name": "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", "licenseId": "CC-BY-NC-SA-2.5", "seeAlso": [ @@ -1779,7 +1817,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0.json", - "referenceNumber": 572, + "referenceNumber": 359, "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", "licenseId": "CC-BY-NC-SA-3.0", "seeAlso": [ @@ -1791,7 +1829,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-DE.json", - "referenceNumber": 625, + "referenceNumber": 279, "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 Germany", "licenseId": "CC-BY-NC-SA-3.0-DE", "seeAlso": [ @@ -1803,7 +1841,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-IGO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-3.0-IGO.json", - "referenceNumber": 239, + "referenceNumber": 636, "name": "Creative Commons Attribution Non Commercial Share Alike 3.0 IGO", "licenseId": "CC-BY-NC-SA-3.0-IGO", "seeAlso": [ @@ -1815,7 +1853,7 @@ "reference": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.json", - "referenceNumber": 437, + "referenceNumber": 89, "name": "Creative Commons Attribution Non Commercial Share Alike 4.0 International", "licenseId": "CC-BY-NC-SA-4.0", "seeAlso": [ @@ -1827,7 +1865,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-1.0.json", - "referenceNumber": 337, + "referenceNumber": 118, "name": "Creative Commons Attribution No Derivatives 1.0 Generic", "licenseId": "CC-BY-ND-1.0", "seeAlso": [ @@ -1840,7 +1878,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-2.0.json", - "referenceNumber": 293, + "referenceNumber": 587, "name": "Creative Commons Attribution No Derivatives 2.0 Generic", "licenseId": "CC-BY-ND-2.0", "seeAlso": [ @@ -1853,7 +1891,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-2.5.json", - "referenceNumber": 674, + "referenceNumber": 394, "name": "Creative Commons Attribution No Derivatives 2.5 Generic", "licenseId": "CC-BY-ND-2.5", "seeAlso": [ @@ -1866,7 +1904,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-3.0.json", - "referenceNumber": 616, + "referenceNumber": 457, "name": "Creative Commons Attribution No Derivatives 3.0 Unported", "licenseId": "CC-BY-ND-3.0", "seeAlso": [ @@ -1879,7 +1917,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-3.0-DE.json", - "referenceNumber": 386, + "referenceNumber": 610, "name": "Creative Commons Attribution No Derivatives 3.0 Germany", "licenseId": "CC-BY-ND-3.0-DE", "seeAlso": [ @@ -1891,7 +1929,7 @@ "reference": "https://spdx.org/licenses/CC-BY-ND-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-ND-4.0.json", - "referenceNumber": 95, + "referenceNumber": 11, "name": "Creative Commons Attribution No Derivatives 4.0 International", "licenseId": "CC-BY-ND-4.0", "seeAlso": [ @@ -1904,7 +1942,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-1.0.json", - "referenceNumber": 595, + "referenceNumber": 384, "name": "Creative Commons Attribution Share Alike 1.0 Generic", "licenseId": "CC-BY-SA-1.0", "seeAlso": [ @@ -1916,7 +1954,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.0.json", - "referenceNumber": 534, + "referenceNumber": 260, "name": "Creative Commons Attribution Share Alike 2.0 Generic", "licenseId": "CC-BY-SA-2.0", "seeAlso": [ @@ -1928,7 +1966,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-2.0-UK.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.0-UK.json", - "referenceNumber": 267, + "referenceNumber": 197, "name": "Creative Commons Attribution Share Alike 2.0 England and Wales", "licenseId": "CC-BY-SA-2.0-UK", "seeAlso": [ @@ -1940,7 +1978,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-2.1-JP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.1-JP.json", - "referenceNumber": 18, + "referenceNumber": 149, "name": "Creative Commons Attribution Share Alike 2.1 Japan", "licenseId": "CC-BY-SA-2.1-JP", "seeAlso": [ @@ -1952,7 +1990,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-2.5.json", - "referenceNumber": 617, + "referenceNumber": 631, "name": "Creative Commons Attribution Share Alike 2.5 Generic", "licenseId": "CC-BY-SA-2.5", "seeAlso": [ @@ -1964,7 +2002,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0.json", - "referenceNumber": 63, + "referenceNumber": 79, "name": "Creative Commons Attribution Share Alike 3.0 Unported", "licenseId": "CC-BY-SA-3.0", "seeAlso": [ @@ -1976,7 +2014,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-AT.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-AT.json", - "referenceNumber": 532, + "referenceNumber": 493, "name": "Creative Commons Attribution Share Alike 3.0 Austria", "licenseId": "CC-BY-SA-3.0-AT", "seeAlso": [ @@ -1988,7 +2026,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-DE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-DE.json", - "referenceNumber": 182, + "referenceNumber": 683, "name": "Creative Commons Attribution Share Alike 3.0 Germany", "licenseId": "CC-BY-SA-3.0-DE", "seeAlso": [ @@ -2000,7 +2038,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-3.0-IGO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-3.0-IGO.json", - "referenceNumber": 627, + "referenceNumber": 571, "name": "Creative Commons Attribution-ShareAlike 3.0 IGO", "licenseId": "CC-BY-SA-3.0-IGO", "seeAlso": [ @@ -2012,7 +2050,7 @@ "reference": "https://spdx.org/licenses/CC-BY-SA-4.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-BY-SA-4.0.json", - "referenceNumber": 44, + "referenceNumber": 256, "name": "Creative Commons Attribution Share Alike 4.0 International", "licenseId": "CC-BY-SA-4.0", "seeAlso": [ @@ -2025,7 +2063,7 @@ "reference": "https://spdx.org/licenses/CC-PDDC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-PDDC.json", - "referenceNumber": 602, + "referenceNumber": 273, "name": "Creative Commons Public Domain Dedication and Certification", "licenseId": "CC-PDDC", "seeAlso": [ @@ -2037,7 +2075,7 @@ "reference": "https://spdx.org/licenses/CC-PDM-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-PDM-1.0.json", - "referenceNumber": 565, + "referenceNumber": 547, "name": "Creative Commons Public Domain Mark 1.0 Universal", "licenseId": "CC-PDM-1.0", "seeAlso": [ @@ -2050,7 +2088,7 @@ "reference": "https://spdx.org/licenses/CC-SA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC-SA-1.0.json", - "referenceNumber": 321, + "referenceNumber": 85, "name": "Creative Commons Share Alike 1.0 Generic", "licenseId": "CC-SA-1.0", "seeAlso": [ @@ -2062,7 +2100,7 @@ "reference": "https://spdx.org/licenses/CC0-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CC0-1.0.json", - "referenceNumber": 111, + "referenceNumber": 369, "name": "Creative Commons Zero v1.0 Universal", "licenseId": "CC0-1.0", "seeAlso": [ @@ -2075,7 +2113,7 @@ "reference": "https://spdx.org/licenses/CDDL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDDL-1.0.json", - "referenceNumber": 284, + "referenceNumber": 407, "name": "Common Development and Distribution License 1.0", "licenseId": "CDDL-1.0", "seeAlso": [ @@ -2088,7 +2126,7 @@ "reference": "https://spdx.org/licenses/CDDL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDDL-1.1.json", - "referenceNumber": 198, + "referenceNumber": 124, "name": "Common Development and Distribution License 1.1", "licenseId": "CDDL-1.1", "seeAlso": [ @@ -2101,7 +2139,7 @@ "reference": "https://spdx.org/licenses/CDL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDL-1.0.json", - "referenceNumber": 539, + "referenceNumber": 385, "name": "Common Documentation License 1.0", "licenseId": "CDL-1.0", "seeAlso": [ @@ -2115,7 +2153,7 @@ "reference": "https://spdx.org/licenses/CDLA-Permissive-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDLA-Permissive-1.0.json", - "referenceNumber": 524, + "referenceNumber": 454, "name": "Community Data License Agreement Permissive 1.0", "licenseId": "CDLA-Permissive-1.0", "seeAlso": [ @@ -2127,7 +2165,7 @@ "reference": "https://spdx.org/licenses/CDLA-Permissive-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDLA-Permissive-2.0.json", - "referenceNumber": 636, + "referenceNumber": 520, "name": "Community Data License Agreement Permissive 2.0", "licenseId": "CDLA-Permissive-2.0", "seeAlso": [ @@ -2139,7 +2177,7 @@ "reference": "https://spdx.org/licenses/CDLA-Sharing-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CDLA-Sharing-1.0.json", - "referenceNumber": 161, + "referenceNumber": 548, "name": "Community Data License Agreement Sharing 1.0", "licenseId": "CDLA-Sharing-1.0", "seeAlso": [ @@ -2151,7 +2189,7 @@ "reference": "https://spdx.org/licenses/CECILL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-1.0.json", - "referenceNumber": 66, + "referenceNumber": 468, "name": "CeCILL Free Software License Agreement v1.0", "licenseId": "CECILL-1.0", "seeAlso": [ @@ -2163,7 +2201,7 @@ "reference": "https://spdx.org/licenses/CECILL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-1.1.json", - "referenceNumber": 343, + "referenceNumber": 100, "name": "CeCILL Free Software License Agreement v1.1", "licenseId": "CECILL-1.1", "seeAlso": [ @@ -2175,7 +2213,7 @@ "reference": "https://spdx.org/licenses/CECILL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-2.0.json", - "referenceNumber": 113, + "referenceNumber": 370, "name": "CeCILL Free Software License Agreement v2.0", "licenseId": "CECILL-2.0", "seeAlso": [ @@ -2188,7 +2226,7 @@ "reference": "https://spdx.org/licenses/CECILL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-2.1.json", - "referenceNumber": 154, + "referenceNumber": 95, "name": "CeCILL Free Software License Agreement v2.1", "licenseId": "CECILL-2.1", "seeAlso": [ @@ -2200,7 +2238,7 @@ "reference": "https://spdx.org/licenses/CECILL-B.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-B.json", - "referenceNumber": 657, + "referenceNumber": 425, "name": "CeCILL-B Free Software License Agreement", "licenseId": "CECILL-B", "seeAlso": [ @@ -2213,7 +2251,7 @@ "reference": "https://spdx.org/licenses/CECILL-C.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CECILL-C.json", - "referenceNumber": 276, + "referenceNumber": 45, "name": "CeCILL-C Free Software License Agreement", "licenseId": "CECILL-C", "seeAlso": [ @@ -2226,7 +2264,7 @@ "reference": "https://spdx.org/licenses/CERN-OHL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CERN-OHL-1.1.json", - "referenceNumber": 348, + "referenceNumber": 398, "name": "CERN Open Hardware Licence v1.1", "licenseId": "CERN-OHL-1.1", "seeAlso": [ @@ -2238,7 +2276,7 @@ "reference": "https://spdx.org/licenses/CERN-OHL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CERN-OHL-1.2.json", - "referenceNumber": 143, + "referenceNumber": 318, "name": "CERN Open Hardware Licence v1.2", "licenseId": "CERN-OHL-1.2", "seeAlso": [ @@ -2250,7 +2288,7 @@ "reference": "https://spdx.org/licenses/CERN-OHL-P-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CERN-OHL-P-2.0.json", - "referenceNumber": 422, + "referenceNumber": 200, "name": "CERN Open Hardware Licence Version 2 - Permissive", "licenseId": "CERN-OHL-P-2.0", "seeAlso": [ @@ -2262,7 +2300,7 @@ "reference": "https://spdx.org/licenses/CERN-OHL-S-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CERN-OHL-S-2.0.json", - "referenceNumber": 306, + "referenceNumber": 175, "name": "CERN Open Hardware Licence Version 2 - Strongly Reciprocal", "licenseId": "CERN-OHL-S-2.0", "seeAlso": [ @@ -2274,7 +2312,7 @@ "reference": "https://spdx.org/licenses/CERN-OHL-W-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CERN-OHL-W-2.0.json", - "referenceNumber": 268, + "referenceNumber": 219, "name": "CERN Open Hardware Licence Version 2 - Weakly Reciprocal", "licenseId": "CERN-OHL-W-2.0", "seeAlso": [ @@ -2286,7 +2324,7 @@ "reference": "https://spdx.org/licenses/CFITSIO.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CFITSIO.json", - "referenceNumber": 598, + "referenceNumber": 207, "name": "CFITSIO License", "licenseId": "CFITSIO", "seeAlso": [ @@ -2299,7 +2337,7 @@ "reference": "https://spdx.org/licenses/check-cvs.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/check-cvs.json", - "referenceNumber": 411, + "referenceNumber": 377, "name": "check-cvs License", "licenseId": "check-cvs", "seeAlso": [ @@ -2311,7 +2349,7 @@ "reference": "https://spdx.org/licenses/checkmk.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/checkmk.json", - "referenceNumber": 13, + "referenceNumber": 389, "name": "Checkmk License", "licenseId": "checkmk", "seeAlso": [ @@ -2323,7 +2361,7 @@ "reference": "https://spdx.org/licenses/ClArtistic.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ClArtistic.json", - "referenceNumber": 236, + "referenceNumber": 690, "name": "Clarified Artistic License", "licenseId": "ClArtistic", "seeAlso": [ @@ -2337,7 +2375,7 @@ "reference": "https://spdx.org/licenses/Clips.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Clips.json", - "referenceNumber": 392, + "referenceNumber": 65, "name": "Clips License", "licenseId": "Clips", "seeAlso": [ @@ -2349,7 +2387,7 @@ "reference": "https://spdx.org/licenses/CMU-Mach.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CMU-Mach.json", - "referenceNumber": 35, + "referenceNumber": 178, "name": "CMU Mach License", "licenseId": "CMU-Mach", "seeAlso": [ @@ -2361,7 +2399,7 @@ "reference": "https://spdx.org/licenses/CMU-Mach-nodoc.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CMU-Mach-nodoc.json", - "referenceNumber": 255, + "referenceNumber": 391, "name": "CMU Mach - no notices-in-documentation variant", "licenseId": "CMU-Mach-nodoc", "seeAlso": [ @@ -2374,7 +2412,7 @@ "reference": "https://spdx.org/licenses/CNRI-Jython.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CNRI-Jython.json", - "referenceNumber": 270, + "referenceNumber": 138, "name": "CNRI Jython License", "licenseId": "CNRI-Jython", "seeAlso": [ @@ -2386,7 +2424,7 @@ "reference": "https://spdx.org/licenses/CNRI-Python.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CNRI-Python.json", - "referenceNumber": 287, + "referenceNumber": 352, "name": "CNRI Python License", "licenseId": "CNRI-Python", "seeAlso": [ @@ -2398,7 +2436,7 @@ "reference": "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.json", - "referenceNumber": 646, + "referenceNumber": 673, "name": "CNRI Python Open Source GPL Compatible License Agreement", "licenseId": "CNRI-Python-GPL-Compatible", "seeAlso": [ @@ -2410,7 +2448,7 @@ "reference": "https://spdx.org/licenses/COIL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/COIL-1.0.json", - "referenceNumber": 193, + "referenceNumber": 526, "name": "Copyfree Open Innovation License", "licenseId": "COIL-1.0", "seeAlso": [ @@ -2422,7 +2460,7 @@ "reference": "https://spdx.org/licenses/Community-Spec-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Community-Spec-1.0.json", - "referenceNumber": 29, + "referenceNumber": 695, "name": "Community Specification License 1.0", "licenseId": "Community-Spec-1.0", "seeAlso": [ @@ -2434,7 +2472,7 @@ "reference": "https://spdx.org/licenses/Condor-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Condor-1.1.json", - "referenceNumber": 274, + "referenceNumber": 114, "name": "Condor Public License v1.1", "licenseId": "Condor-1.1", "seeAlso": [ @@ -2448,7 +2486,7 @@ "reference": "https://spdx.org/licenses/copyleft-next-0.3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/copyleft-next-0.3.0.json", - "referenceNumber": 308, + "referenceNumber": 122, "name": "copyleft-next 0.3.0", "licenseId": "copyleft-next-0.3.0", "seeAlso": [ @@ -2460,7 +2498,7 @@ "reference": "https://spdx.org/licenses/copyleft-next-0.3.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/copyleft-next-0.3.1.json", - "referenceNumber": 302, + "referenceNumber": 583, "name": "copyleft-next 0.3.1", "licenseId": "copyleft-next-0.3.1", "seeAlso": [ @@ -2472,7 +2510,7 @@ "reference": "https://spdx.org/licenses/Cornell-Lossless-JPEG.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Cornell-Lossless-JPEG.json", - "referenceNumber": 176, + "referenceNumber": 331, "name": "Cornell Lossless JPEG License", "licenseId": "Cornell-Lossless-JPEG", "seeAlso": [ @@ -2486,7 +2524,7 @@ "reference": "https://spdx.org/licenses/CPAL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CPAL-1.0.json", - "referenceNumber": 301, + "referenceNumber": 147, "name": "Common Public Attribution License 1.0", "licenseId": "CPAL-1.0", "seeAlso": [ @@ -2499,7 +2537,7 @@ "reference": "https://spdx.org/licenses/CPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CPL-1.0.json", - "referenceNumber": 41, + "referenceNumber": 367, "name": "Common Public License 1.0", "licenseId": "CPL-1.0", "seeAlso": [ @@ -2512,7 +2550,7 @@ "reference": "https://spdx.org/licenses/CPOL-1.02.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CPOL-1.02.json", - "referenceNumber": 420, + "referenceNumber": 250, "name": "Code Project Open License 1.02", "licenseId": "CPOL-1.02", "seeAlso": [ @@ -2525,7 +2563,7 @@ "reference": "https://spdx.org/licenses/Cronyx.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Cronyx.json", - "referenceNumber": 335, + "referenceNumber": 32, "name": "Cronyx License", "licenseId": "Cronyx", "seeAlso": [ @@ -2540,7 +2578,7 @@ "reference": "https://spdx.org/licenses/Crossword.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Crossword.json", - "referenceNumber": 344, + "referenceNumber": 347, "name": "Crossword License", "licenseId": "Crossword", "seeAlso": [ @@ -2548,11 +2586,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/CryptoSwift.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/CryptoSwift.json", + "referenceNumber": 323, + "name": "CryptoSwift License", + "licenseId": "CryptoSwift", + "seeAlso": [ + "https://github.com/krzyzanowskim/CryptoSwift/blob/main/LICENSE" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/CrystalStacker.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CrystalStacker.json", - "referenceNumber": 31, + "referenceNumber": 449, "name": "CrystalStacker License", "licenseId": "CrystalStacker", "seeAlso": [ @@ -2564,7 +2614,7 @@ "reference": "https://spdx.org/licenses/CUA-OPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/CUA-OPL-1.0.json", - "referenceNumber": 151, + "referenceNumber": 298, "name": "CUA Office Public License v1.0", "licenseId": "CUA-OPL-1.0", "seeAlso": [ @@ -2576,7 +2626,7 @@ "reference": "https://spdx.org/licenses/Cube.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Cube.json", - "referenceNumber": 103, + "referenceNumber": 140, "name": "Cube License", "licenseId": "Cube", "seeAlso": [ @@ -2588,7 +2638,7 @@ "reference": "https://spdx.org/licenses/curl.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/curl.json", - "referenceNumber": 587, + "referenceNumber": 160, "name": "curl License", "licenseId": "curl", "seeAlso": [ @@ -2600,7 +2650,7 @@ "reference": "https://spdx.org/licenses/cve-tou.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/cve-tou.json", - "referenceNumber": 15, + "referenceNumber": 216, "name": "Common Vulnerability Enumeration ToU License", "licenseId": "cve-tou", "seeAlso": [ @@ -2612,7 +2662,7 @@ "reference": "https://spdx.org/licenses/D-FSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/D-FSL-1.0.json", - "referenceNumber": 265, + "referenceNumber": 545, "name": "Deutsche Freie Software Lizenz", "licenseId": "D-FSL-1.0", "seeAlso": [ @@ -2631,7 +2681,7 @@ "reference": "https://spdx.org/licenses/DEC-3-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DEC-3-Clause.json", - "referenceNumber": 460, + "referenceNumber": 164, "name": "DEC 3-Clause License", "licenseId": "DEC-3-Clause", "seeAlso": [ @@ -2643,7 +2693,7 @@ "reference": "https://spdx.org/licenses/diffmark.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/diffmark.json", - "referenceNumber": 277, + "referenceNumber": 50, "name": "diffmark license", "licenseId": "diffmark", "seeAlso": [ @@ -2655,7 +2705,7 @@ "reference": "https://spdx.org/licenses/DL-DE-BY-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DL-DE-BY-2.0.json", - "referenceNumber": 141, + "referenceNumber": 530, "name": "Data licence Germany – attribution – version 2.0", "licenseId": "DL-DE-BY-2.0", "seeAlso": [ @@ -2667,7 +2717,7 @@ "reference": "https://spdx.org/licenses/DL-DE-ZERO-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DL-DE-ZERO-2.0.json", - "referenceNumber": 470, + "referenceNumber": 139, "name": "Data licence Germany – zero – version 2.0", "licenseId": "DL-DE-ZERO-2.0", "seeAlso": [ @@ -2679,7 +2729,7 @@ "reference": "https://spdx.org/licenses/DOC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DOC.json", - "referenceNumber": 177, + "referenceNumber": 31, "name": "DOC License", "licenseId": "DOC", "seeAlso": [ @@ -2688,11 +2738,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/DocBook-DTD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/DocBook-DTD.json", + "referenceNumber": 603, + "name": "DocBook DTD License", + "licenseId": "DocBook-DTD", + "seeAlso": [ + "http://www.docbook.org/xml/simple/1.1/docbook-simple-1.1.zip" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/DocBook-Schema.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DocBook-Schema.json", - "referenceNumber": 305, + "referenceNumber": 184, "name": "DocBook Schema License", "licenseId": "DocBook-Schema", "seeAlso": [ @@ -2704,7 +2766,7 @@ "reference": "https://spdx.org/licenses/DocBook-Stylesheet.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DocBook-Stylesheet.json", - "referenceNumber": 250, + "referenceNumber": 494, "name": "DocBook Stylesheet License", "licenseId": "DocBook-Stylesheet", "seeAlso": [ @@ -2716,7 +2778,7 @@ "reference": "https://spdx.org/licenses/DocBook-XML.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DocBook-XML.json", - "referenceNumber": 221, + "referenceNumber": 672, "name": "DocBook XML License", "licenseId": "DocBook-XML", "seeAlso": [ @@ -2728,7 +2790,7 @@ "reference": "https://spdx.org/licenses/Dotseqn.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Dotseqn.json", - "referenceNumber": 456, + "referenceNumber": 257, "name": "Dotseqn License", "licenseId": "Dotseqn", "seeAlso": [ @@ -2740,7 +2802,7 @@ "reference": "https://spdx.org/licenses/DRL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DRL-1.0.json", - "referenceNumber": 331, + "referenceNumber": 446, "name": "Detection Rule License 1.0", "licenseId": "DRL-1.0", "seeAlso": [ @@ -2752,7 +2814,7 @@ "reference": "https://spdx.org/licenses/DRL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DRL-1.1.json", - "referenceNumber": 632, + "referenceNumber": 135, "name": "Detection Rule License 1.1", "licenseId": "DRL-1.1", "seeAlso": [ @@ -2764,7 +2826,7 @@ "reference": "https://spdx.org/licenses/DSDP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/DSDP.json", - "referenceNumber": 0, + "referenceNumber": 336, "name": "DSDP License", "licenseId": "DSDP", "seeAlso": [ @@ -2776,7 +2838,7 @@ "reference": "https://spdx.org/licenses/dtoa.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/dtoa.json", - "referenceNumber": 124, + "referenceNumber": 578, "name": "David M. Gay dtoa License", "licenseId": "dtoa", "seeAlso": [ @@ -2789,7 +2851,7 @@ "reference": "https://spdx.org/licenses/dvipdfm.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/dvipdfm.json", - "referenceNumber": 299, + "referenceNumber": 319, "name": "dvipdfm License", "licenseId": "dvipdfm", "seeAlso": [ @@ -2801,7 +2863,7 @@ "reference": "https://spdx.org/licenses/ECL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ECL-1.0.json", - "referenceNumber": 38, + "referenceNumber": 641, "name": "Educational Community License v1.0", "licenseId": "ECL-1.0", "seeAlso": [ @@ -2813,7 +2875,7 @@ "reference": "https://spdx.org/licenses/ECL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ECL-2.0.json", - "referenceNumber": 174, + "referenceNumber": 338, "name": "Educational Community License v2.0", "licenseId": "ECL-2.0", "seeAlso": [ @@ -2826,7 +2888,7 @@ "reference": "https://spdx.org/licenses/eCos-2.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/eCos-2.0.json", - "referenceNumber": 8, + "referenceNumber": 647, "name": "eCos license version 2.0", "licenseId": "eCos-2.0", "seeAlso": [ @@ -2839,7 +2901,7 @@ "reference": "https://spdx.org/licenses/EFL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EFL-1.0.json", - "referenceNumber": 201, + "referenceNumber": 145, "name": "Eiffel Forum License v1.0", "licenseId": "EFL-1.0", "seeAlso": [ @@ -2852,7 +2914,7 @@ "reference": "https://spdx.org/licenses/EFL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EFL-2.0.json", - "referenceNumber": 525, + "referenceNumber": 604, "name": "Eiffel Forum License v2.0", "licenseId": "EFL-2.0", "seeAlso": [ @@ -2866,7 +2928,7 @@ "reference": "https://spdx.org/licenses/eGenix.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/eGenix.json", - "referenceNumber": 134, + "referenceNumber": 613, "name": "eGenix.com Public License 1.1.0", "licenseId": "eGenix", "seeAlso": [ @@ -2879,7 +2941,7 @@ "reference": "https://spdx.org/licenses/Elastic-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Elastic-2.0.json", - "referenceNumber": 40, + "referenceNumber": 396, "name": "Elastic License 2.0", "licenseId": "Elastic-2.0", "seeAlso": [ @@ -2892,7 +2954,7 @@ "reference": "https://spdx.org/licenses/Entessa.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Entessa.json", - "referenceNumber": 202, + "referenceNumber": 40, "name": "Entessa Public License v1.0", "licenseId": "Entessa", "seeAlso": [ @@ -2904,7 +2966,7 @@ "reference": "https://spdx.org/licenses/EPICS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EPICS.json", - "referenceNumber": 165, + "referenceNumber": 158, "name": "EPICS Open License", "licenseId": "EPICS", "seeAlso": [ @@ -2916,7 +2978,7 @@ "reference": "https://spdx.org/licenses/EPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EPL-1.0.json", - "referenceNumber": 89, + "referenceNumber": 558, "name": "Eclipse Public License 1.0", "licenseId": "EPL-1.0", "seeAlso": [ @@ -2930,12 +2992,14 @@ "reference": "https://spdx.org/licenses/EPL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EPL-2.0.json", - "referenceNumber": 378, + "referenceNumber": 326, "name": "Eclipse Public License 2.0", "licenseId": "EPL-2.0", "seeAlso": [ "https://www.eclipse.org/legal/epl-2.0", - "https://www.opensource.org/licenses/EPL-2.0" + "https://www.opensource.org/licenses/EPL-2.0", + "https://www.eclipse.org/legal/epl-v20.html", + "https://projects.eclipse.org/license/epl-2.0" ], "isOsiApproved": true, "isFsfLibre": true @@ -2944,7 +3008,7 @@ "reference": "https://spdx.org/licenses/ErlPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ErlPL-1.1.json", - "referenceNumber": 590, + "referenceNumber": 541, "name": "Erlang Public License v1.1", "licenseId": "ErlPL-1.1", "seeAlso": [ @@ -2956,7 +3020,7 @@ "reference": "https://spdx.org/licenses/etalab-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/etalab-2.0.json", - "referenceNumber": 596, + "referenceNumber": 363, "name": "Etalab Open License 2.0", "licenseId": "etalab-2.0", "seeAlso": [ @@ -2969,7 +3033,7 @@ "reference": "https://spdx.org/licenses/EUDatagrid.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EUDatagrid.json", - "referenceNumber": 119, + "referenceNumber": 262, "name": "EU DataGrid Software License", "licenseId": "EUDatagrid", "seeAlso": [ @@ -2983,7 +3047,7 @@ "reference": "https://spdx.org/licenses/EUPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EUPL-1.0.json", - "referenceNumber": 187, + "referenceNumber": 405, "name": "European Union Public License 1.0", "licenseId": "EUPL-1.0", "seeAlso": [ @@ -2996,7 +3060,7 @@ "reference": "https://spdx.org/licenses/EUPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EUPL-1.1.json", - "referenceNumber": 474, + "referenceNumber": 393, "name": "European Union Public License 1.1", "licenseId": "EUPL-1.1", "seeAlso": [ @@ -3011,7 +3075,7 @@ "reference": "https://spdx.org/licenses/EUPL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/EUPL-1.2.json", - "referenceNumber": 398, + "referenceNumber": 596, "name": "European Union Public License 1.2", "licenseId": "EUPL-1.2", "seeAlso": [ @@ -3029,7 +3093,7 @@ "reference": "https://spdx.org/licenses/Eurosym.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Eurosym.json", - "referenceNumber": 319, + "referenceNumber": 299, "name": "Eurosym License", "licenseId": "Eurosym", "seeAlso": [ @@ -3041,7 +3105,7 @@ "reference": "https://spdx.org/licenses/Fair.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Fair.json", - "referenceNumber": 245, + "referenceNumber": 190, "name": "Fair License", "licenseId": "Fair", "seeAlso": [ @@ -3054,7 +3118,7 @@ "reference": "https://spdx.org/licenses/FBM.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FBM.json", - "referenceNumber": 235, + "referenceNumber": 476, "name": "Fuzzy Bitmap License", "licenseId": "FBM", "seeAlso": [ @@ -3066,7 +3130,7 @@ "reference": "https://spdx.org/licenses/FDK-AAC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FDK-AAC.json", - "referenceNumber": 294, + "referenceNumber": 44, "name": "Fraunhofer FDK AAC Codec Library", "licenseId": "FDK-AAC", "seeAlso": [ @@ -3079,7 +3143,7 @@ "reference": "https://spdx.org/licenses/Ferguson-Twofish.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Ferguson-Twofish.json", - "referenceNumber": 338, + "referenceNumber": 662, "name": "Ferguson Twofish License", "licenseId": "Ferguson-Twofish", "seeAlso": [ @@ -3091,7 +3155,7 @@ "reference": "https://spdx.org/licenses/Frameworx-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Frameworx-1.0.json", - "referenceNumber": 229, + "referenceNumber": 376, "name": "Frameworx Open License 1.0", "licenseId": "Frameworx-1.0", "seeAlso": [ @@ -3103,7 +3167,7 @@ "reference": "https://spdx.org/licenses/FreeBSD-DOC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FreeBSD-DOC.json", - "referenceNumber": 254, + "referenceNumber": 645, "name": "FreeBSD Documentation License", "licenseId": "FreeBSD-DOC", "seeAlso": [ @@ -3115,7 +3179,7 @@ "reference": "https://spdx.org/licenses/FreeImage.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FreeImage.json", - "referenceNumber": 260, + "referenceNumber": 264, "name": "FreeImage Public License v1.0", "licenseId": "FreeImage", "seeAlso": [ @@ -3127,7 +3191,7 @@ "reference": "https://spdx.org/licenses/FSFAP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FSFAP.json", - "referenceNumber": 116, + "referenceNumber": 561, "name": "FSF All Permissive License", "licenseId": "FSFAP", "seeAlso": [ @@ -3140,7 +3204,7 @@ "reference": "https://spdx.org/licenses/FSFAP-no-warranty-disclaimer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FSFAP-no-warranty-disclaimer.json", - "referenceNumber": 579, + "referenceNumber": 629, "name": "FSF All Permissive License (without Warranty)", "licenseId": "FSFAP-no-warranty-disclaimer", "seeAlso": [ @@ -3152,7 +3216,7 @@ "reference": "https://spdx.org/licenses/FSFUL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FSFUL.json", - "referenceNumber": 578, + "referenceNumber": 59, "name": "FSF Unlimited License", "licenseId": "FSFUL", "seeAlso": [ @@ -3164,7 +3228,7 @@ "reference": "https://spdx.org/licenses/FSFULLR.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FSFULLR.json", - "referenceNumber": 52, + "referenceNumber": 322, "name": "FSF Unlimited License (with License Retention)", "licenseId": "FSFULLR", "seeAlso": [ @@ -3172,11 +3236,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/FSFULLRSD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSFULLRSD.json", + "referenceNumber": 300, + "name": "FSF Unlimited License (with License Retention and Short Disclaimer)", + "licenseId": "FSFULLRSD", + "seeAlso": [ + "https://git.savannah.gnu.org/cgit/gnulib.git/tree/modules/COPYING?id\u003d7b08932179d0d6b017f7df01a2ddf6e096b038e3" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/FSFULLRWD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FSFULLRWD.json", - "referenceNumber": 199, + "referenceNumber": 245, "name": "FSF Unlimited License (With License Retention and Warranty Disclaimer)", "licenseId": "FSFULLRWD", "seeAlso": [ @@ -3184,11 +3260,35 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/FSL-1.1-ALv2.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSL-1.1-ALv2.json", + "referenceNumber": 585, + "name": "Functional Source License, Version 1.1, ALv2 Future License", + "licenseId": "FSL-1.1-ALv2", + "seeAlso": [ + "https://fsl.software/FSL-1.1-ALv2.template.md" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/FSL-1.1-MIT.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/FSL-1.1-MIT.json", + "referenceNumber": 639, + "name": "Functional Source License, Version 1.1, MIT Future License", + "licenseId": "FSL-1.1-MIT", + "seeAlso": [ + "https://fsl.software/FSL-1.1-MIT.template.md" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/FTL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/FTL.json", - "referenceNumber": 304, + "referenceNumber": 417, "name": "Freetype Project License", "licenseId": "FTL", "seeAlso": [ @@ -3203,7 +3303,7 @@ "reference": "https://spdx.org/licenses/Furuseth.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Furuseth.json", - "referenceNumber": 563, + "referenceNumber": 72, "name": "Furuseth License", "licenseId": "Furuseth", "seeAlso": [ @@ -3215,7 +3315,7 @@ "reference": "https://spdx.org/licenses/fwlw.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/fwlw.json", - "referenceNumber": 81, + "referenceNumber": 529, "name": "fwlw License", "licenseId": "fwlw", "seeAlso": [ @@ -3223,11 +3323,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/Game-Programming-Gems.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Game-Programming-Gems.json", + "referenceNumber": 246, + "name": "Game Programming Gems License", + "licenseId": "Game-Programming-Gems", + "seeAlso": [ + "https://github.com/OGRECave/ogre/blob/master/OgreMain/include/OgreSingleton.h#L28C3-L35C46" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/GCR-docs.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GCR-docs.json", - "referenceNumber": 135, + "referenceNumber": 270, "name": "Gnome GCR Documentation License", "licenseId": "GCR-docs", "seeAlso": [ @@ -3239,7 +3351,7 @@ "reference": "https://spdx.org/licenses/GD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GD.json", - "referenceNumber": 333, + "referenceNumber": 549, "name": "GD License", "licenseId": "GD", "seeAlso": [ @@ -3251,7 +3363,7 @@ "reference": "https://spdx.org/licenses/generic-xts.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/generic-xts.json", - "referenceNumber": 476, + "referenceNumber": 132, "name": "Generic XTS License", "licenseId": "generic-xts", "seeAlso": [ @@ -3263,7 +3375,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1.json", - "referenceNumber": 279, + "referenceNumber": 533, "name": "GNU Free Documentation License v1.1", "licenseId": "GFDL-1.1", "seeAlso": [ @@ -3276,7 +3388,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-invariants-only.json", - "referenceNumber": 452, + "referenceNumber": 271, "name": "GNU Free Documentation License v1.1 only - invariants", "licenseId": "GFDL-1.1-invariants-only", "seeAlso": [ @@ -3288,7 +3400,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-invariants-or-later.json", - "referenceNumber": 153, + "referenceNumber": 538, "name": "GNU Free Documentation License v1.1 or later - invariants", "licenseId": "GFDL-1.1-invariants-or-later", "seeAlso": [ @@ -3300,7 +3412,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-no-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-no-invariants-only.json", - "referenceNumber": 215, + "referenceNumber": 609, "name": "GNU Free Documentation License v1.1 only - no invariants", "licenseId": "GFDL-1.1-no-invariants-only", "seeAlso": [ @@ -3312,7 +3424,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-no-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-no-invariants-or-later.json", - "referenceNumber": 626, + "referenceNumber": 689, "name": "GNU Free Documentation License v1.1 or later - no invariants", "licenseId": "GFDL-1.1-no-invariants-or-later", "seeAlso": [ @@ -3324,7 +3436,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-only.json", - "referenceNumber": 610, + "referenceNumber": 456, "name": "GNU Free Documentation License v1.1 only", "licenseId": "GFDL-1.1-only", "seeAlso": [ @@ -3337,7 +3449,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.1-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.1-or-later.json", - "referenceNumber": 162, + "referenceNumber": 67, "name": "GNU Free Documentation License v1.1 or later", "licenseId": "GFDL-1.1-or-later", "seeAlso": [ @@ -3350,7 +3462,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2.json", - "referenceNumber": 643, + "referenceNumber": 350, "name": "GNU Free Documentation License v1.2", "licenseId": "GFDL-1.2", "seeAlso": [ @@ -3363,7 +3475,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-invariants-only.json", - "referenceNumber": 200, + "referenceNumber": 192, "name": "GNU Free Documentation License v1.2 only - invariants", "licenseId": "GFDL-1.2-invariants-only", "seeAlso": [ @@ -3375,7 +3487,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-invariants-or-later.json", - "referenceNumber": 357, + "referenceNumber": 261, "name": "GNU Free Documentation License v1.2 or later - invariants", "licenseId": "GFDL-1.2-invariants-or-later", "seeAlso": [ @@ -3387,7 +3499,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-no-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-no-invariants-only.json", - "referenceNumber": 42, + "referenceNumber": 101, "name": "GNU Free Documentation License v1.2 only - no invariants", "licenseId": "GFDL-1.2-no-invariants-only", "seeAlso": [ @@ -3399,7 +3511,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-no-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-no-invariants-or-later.json", - "referenceNumber": 329, + "referenceNumber": 244, "name": "GNU Free Documentation License v1.2 or later - no invariants", "licenseId": "GFDL-1.2-no-invariants-or-later", "seeAlso": [ @@ -3411,7 +3523,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-only.json", - "referenceNumber": 663, + "referenceNumber": 595, "name": "GNU Free Documentation License v1.2 only", "licenseId": "GFDL-1.2-only", "seeAlso": [ @@ -3424,7 +3536,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.2-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.2-or-later.json", - "referenceNumber": 436, + "referenceNumber": 488, "name": "GNU Free Documentation License v1.2 or later", "licenseId": "GFDL-1.2-or-later", "seeAlso": [ @@ -3437,7 +3549,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3.json", - "referenceNumber": 379, + "referenceNumber": 652, "name": "GNU Free Documentation License v1.3", "licenseId": "GFDL-1.3", "seeAlso": [ @@ -3450,7 +3562,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-invariants-only.json", - "referenceNumber": 555, + "referenceNumber": 69, "name": "GNU Free Documentation License v1.3 only - invariants", "licenseId": "GFDL-1.3-invariants-only", "seeAlso": [ @@ -3462,7 +3574,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-invariants-or-later.json", - "referenceNumber": 504, + "referenceNumber": 550, "name": "GNU Free Documentation License v1.3 or later - invariants", "licenseId": "GFDL-1.3-invariants-or-later", "seeAlso": [ @@ -3474,7 +3586,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-no-invariants-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-no-invariants-only.json", - "referenceNumber": 5, + "referenceNumber": 516, "name": "GNU Free Documentation License v1.3 only - no invariants", "licenseId": "GFDL-1.3-no-invariants-only", "seeAlso": [ @@ -3486,7 +3598,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-no-invariants-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-no-invariants-or-later.json", - "referenceNumber": 528, + "referenceNumber": 73, "name": "GNU Free Documentation License v1.3 or later - no invariants", "licenseId": "GFDL-1.3-no-invariants-or-later", "seeAlso": [ @@ -3498,7 +3610,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-only.json", - "referenceNumber": 311, + "referenceNumber": 223, "name": "GNU Free Documentation License v1.3 only", "licenseId": "GFDL-1.3-only", "seeAlso": [ @@ -3511,7 +3623,7 @@ "reference": "https://spdx.org/licenses/GFDL-1.3-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GFDL-1.3-or-later.json", - "referenceNumber": 142, + "referenceNumber": 633, "name": "GNU Free Documentation License v1.3 or later", "licenseId": "GFDL-1.3-or-later", "seeAlso": [ @@ -3524,7 +3636,7 @@ "reference": "https://spdx.org/licenses/Giftware.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Giftware.json", - "referenceNumber": 656, + "referenceNumber": 519, "name": "Giftware License", "licenseId": "Giftware", "seeAlso": [ @@ -3536,7 +3648,7 @@ "reference": "https://spdx.org/licenses/GL2PS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GL2PS.json", - "referenceNumber": 639, + "referenceNumber": 360, "name": "GL2PS License", "licenseId": "GL2PS", "seeAlso": [ @@ -3548,7 +3660,7 @@ "reference": "https://spdx.org/licenses/Glide.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Glide.json", - "referenceNumber": 203, + "referenceNumber": 71, "name": "3dfx Glide License", "licenseId": "Glide", "seeAlso": [ @@ -3560,7 +3672,7 @@ "reference": "https://spdx.org/licenses/Glulxe.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Glulxe.json", - "referenceNumber": 483, + "referenceNumber": 635, "name": "Glulxe License", "licenseId": "Glulxe", "seeAlso": [ @@ -3572,7 +3684,7 @@ "reference": "https://spdx.org/licenses/GLWTPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GLWTPL.json", - "referenceNumber": 9, + "referenceNumber": 27, "name": "Good Luck With That Public License", "licenseId": "GLWTPL", "seeAlso": [ @@ -3584,7 +3696,7 @@ "reference": "https://spdx.org/licenses/gnuplot.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/gnuplot.json", - "referenceNumber": 389, + "referenceNumber": 247, "name": "gnuplot License", "licenseId": "gnuplot", "seeAlso": [ @@ -3597,7 +3709,7 @@ "reference": "https://spdx.org/licenses/GPL-1.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-1.0.json", - "referenceNumber": 227, + "referenceNumber": 10, "name": "GNU General Public License v1.0 only", "licenseId": "GPL-1.0", "seeAlso": [ @@ -3609,7 +3721,7 @@ "reference": "https://spdx.org/licenses/GPL-1.0+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-1.0+.json", - "referenceNumber": 297, + "referenceNumber": 177, "name": "GNU General Public License v1.0 or later", "licenseId": "GPL-1.0+", "seeAlso": [ @@ -3621,7 +3733,7 @@ "reference": "https://spdx.org/licenses/GPL-1.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-1.0-only.json", - "referenceNumber": 353, + "referenceNumber": 152, "name": "GNU General Public License v1.0 only", "licenseId": "GPL-1.0-only", "seeAlso": [ @@ -3633,7 +3745,7 @@ "reference": "https://spdx.org/licenses/GPL-1.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-1.0-or-later.json", - "referenceNumber": 376, + "referenceNumber": 68, "name": "GNU General Public License v1.0 or later", "licenseId": "GPL-1.0-or-later", "seeAlso": [ @@ -3645,7 +3757,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0.json", - "referenceNumber": 188, + "referenceNumber": 688, "name": "GNU General Public License v2.0 only", "licenseId": "GPL-2.0", "seeAlso": [ @@ -3659,7 +3771,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0+.json", - "referenceNumber": 600, + "referenceNumber": 144, "name": "GNU General Public License v2.0 or later", "licenseId": "GPL-2.0+", "seeAlso": [ @@ -3673,13 +3785,14 @@ "reference": "https://spdx.org/licenses/GPL-2.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-only.json", - "referenceNumber": 172, + "referenceNumber": 461, "name": "GNU General Public License v2.0 only", "licenseId": "GPL-2.0-only", "seeAlso": [ "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt", - "https://opensource.org/licenses/GPL-2.0" + "https://opensource.org/licenses/GPL-2.0", + "https://github.com/openjdk/jdk/blob/6162e2c5213c5dd7c1127fd9616b543efa898962/LICENSE" ], "isOsiApproved": true, "isFsfLibre": true @@ -3688,12 +3801,13 @@ "reference": "https://spdx.org/licenses/GPL-2.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-or-later.json", - "referenceNumber": 424, + "referenceNumber": 99, "name": "GNU General Public License v2.0 or later", "licenseId": "GPL-2.0-or-later", "seeAlso": [ "https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", - "https://opensource.org/licenses/GPL-2.0" + "https://opensource.org/licenses/GPL-2.0", + "https://github.com/openjdk/jdk/blob/6162e2c5213c5dd7c1127fd9616b543efa898962/LICENSE" ], "isOsiApproved": true, "isFsfLibre": true @@ -3702,7 +3816,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0-with-autoconf-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-autoconf-exception.json", - "referenceNumber": 629, + "referenceNumber": 618, "name": "GNU General Public License v2.0 w/Autoconf exception", "licenseId": "GPL-2.0-with-autoconf-exception", "seeAlso": [ @@ -3714,7 +3828,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0-with-bison-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-bison-exception.json", - "referenceNumber": 37, + "referenceNumber": 358, "name": "GNU General Public License v2.0 w/Bison exception", "licenseId": "GPL-2.0-with-bison-exception", "seeAlso": [ @@ -3726,7 +3840,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0-with-classpath-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-classpath-exception.json", - "referenceNumber": 410, + "referenceNumber": 171, "name": "GNU General Public License v2.0 w/Classpath exception", "licenseId": "GPL-2.0-with-classpath-exception", "seeAlso": [ @@ -3738,7 +3852,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0-with-font-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-font-exception.json", - "referenceNumber": 548, + "referenceNumber": 151, "name": "GNU General Public License v2.0 w/Font exception", "licenseId": "GPL-2.0-with-font-exception", "seeAlso": [ @@ -3750,7 +3864,7 @@ "reference": "https://spdx.org/licenses/GPL-2.0-with-GCC-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-2.0-with-GCC-exception.json", - "referenceNumber": 492, + "referenceNumber": 525, "name": "GNU General Public License v2.0 w/GCC Runtime Library exception", "licenseId": "GPL-2.0-with-GCC-exception", "seeAlso": [ @@ -3762,7 +3876,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-3.0.json", - "referenceNumber": 671, + "referenceNumber": 503, "name": "GNU General Public License v3.0 only", "licenseId": "GPL-3.0", "seeAlso": [ @@ -3776,7 +3890,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-3.0+.json", - "referenceNumber": 501, + "referenceNumber": 131, "name": "GNU General Public License v3.0 or later", "licenseId": "GPL-3.0+", "seeAlso": [ @@ -3790,7 +3904,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-only.json", - "referenceNumber": 584, + "referenceNumber": 632, "name": "GNU General Public License v3.0 only", "licenseId": "GPL-3.0-only", "seeAlso": [ @@ -3804,7 +3918,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-or-later.json", - "referenceNumber": 448, + "referenceNumber": 467, "name": "GNU General Public License v3.0 or later", "licenseId": "GPL-3.0-or-later", "seeAlso": [ @@ -3818,7 +3932,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-with-autoconf-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-with-autoconf-exception.json", - "referenceNumber": 659, + "referenceNumber": 650, "name": "GNU General Public License v3.0 w/Autoconf exception", "licenseId": "GPL-3.0-with-autoconf-exception", "seeAlso": [ @@ -3830,7 +3944,7 @@ "reference": "https://spdx.org/licenses/GPL-3.0-with-GCC-exception.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/GPL-3.0-with-GCC-exception.json", - "referenceNumber": 173, + "referenceNumber": 601, "name": "GNU General Public License v3.0 w/GCC Runtime Library exception", "licenseId": "GPL-3.0-with-GCC-exception", "seeAlso": [ @@ -3842,7 +3956,7 @@ "reference": "https://spdx.org/licenses/Graphics-Gems.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Graphics-Gems.json", - "referenceNumber": 55, + "referenceNumber": 255, "name": "Graphics Gems License", "licenseId": "Graphics-Gems", "seeAlso": [ @@ -3854,7 +3968,7 @@ "reference": "https://spdx.org/licenses/gSOAP-1.3b.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/gSOAP-1.3b.json", - "referenceNumber": 315, + "referenceNumber": 668, "name": "gSOAP Public License v1.3b", "licenseId": "gSOAP-1.3b", "seeAlso": [ @@ -3866,7 +3980,7 @@ "reference": "https://spdx.org/licenses/gtkbook.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/gtkbook.json", - "referenceNumber": 361, + "referenceNumber": 465, "name": "gtkbook License", "licenseId": "gtkbook", "seeAlso": [ @@ -3879,7 +3993,7 @@ "reference": "https://spdx.org/licenses/Gutmann.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Gutmann.json", - "referenceNumber": 146, + "referenceNumber": 524, "name": "Gutmann License", "licenseId": "Gutmann", "seeAlso": [ @@ -3891,7 +4005,7 @@ "reference": "https://spdx.org/licenses/HaskellReport.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HaskellReport.json", - "referenceNumber": 592, + "referenceNumber": 605, "name": "Haskell Language Report License", "licenseId": "HaskellReport", "seeAlso": [ @@ -3899,11 +4013,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/HDF5.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/HDF5.json", + "referenceNumber": 19, + "name": "HDF5 License", + "licenseId": "HDF5", + "seeAlso": [ + "https://github.com/HDFGroup/hdf5/?tab\u003dLicense-1-ov-file#readme" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/hdparm.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/hdparm.json", - "referenceNumber": 139, + "referenceNumber": 283, "name": "hdparm License", "licenseId": "hdparm", "seeAlso": [ @@ -3915,7 +4041,7 @@ "reference": "https://spdx.org/licenses/HIDAPI.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HIDAPI.json", - "referenceNumber": 637, + "referenceNumber": 310, "name": "HIDAPI License", "licenseId": "HIDAPI", "seeAlso": [ @@ -3927,7 +4053,7 @@ "reference": "https://spdx.org/licenses/Hippocratic-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Hippocratic-2.1.json", - "referenceNumber": 282, + "referenceNumber": 87, "name": "Hippocratic License 2.1", "licenseId": "Hippocratic-2.1", "seeAlso": [ @@ -3940,7 +4066,7 @@ "reference": "https://spdx.org/licenses/HP-1986.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HP-1986.json", - "referenceNumber": 156, + "referenceNumber": 282, "name": "Hewlett-Packard 1986 License", "licenseId": "HP-1986", "seeAlso": [ @@ -3952,7 +4078,7 @@ "reference": "https://spdx.org/licenses/HP-1989.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HP-1989.json", - "referenceNumber": 210, + "referenceNumber": 8, "name": "Hewlett-Packard 1989 License", "licenseId": "HP-1989", "seeAlso": [ @@ -3964,7 +4090,7 @@ "reference": "https://spdx.org/licenses/HPND.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND.json", - "referenceNumber": 382, + "referenceNumber": 209, "name": "Historical Permission Notice and Disclaimer", "licenseId": "HPND", "seeAlso": [ @@ -3978,7 +4104,7 @@ "reference": "https://spdx.org/licenses/HPND-DEC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-DEC.json", - "referenceNumber": 457, + "referenceNumber": 112, "name": "Historical Permission Notice and Disclaimer - DEC variant", "licenseId": "HPND-DEC", "seeAlso": [ @@ -3990,7 +4116,7 @@ "reference": "https://spdx.org/licenses/HPND-doc.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-doc.json", - "referenceNumber": 441, + "referenceNumber": 600, "name": "Historical Permission Notice and Disclaimer - documentation variant", "licenseId": "HPND-doc", "seeAlso": [ @@ -4003,7 +4129,7 @@ "reference": "https://spdx.org/licenses/HPND-doc-sell.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-doc-sell.json", - "referenceNumber": 679, + "referenceNumber": 306, "name": "Historical Permission Notice and Disclaimer - documentation sell variant", "licenseId": "HPND-doc-sell", "seeAlso": [ @@ -4016,7 +4142,7 @@ "reference": "https://spdx.org/licenses/HPND-export-US.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-export-US.json", - "referenceNumber": 157, + "referenceNumber": 459, "name": "HPND with US Government export control warning", "licenseId": "HPND-export-US", "seeAlso": [ @@ -4028,7 +4154,7 @@ "reference": "https://spdx.org/licenses/HPND-export-US-acknowledgement.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-export-US-acknowledgement.json", - "referenceNumber": 56, + "referenceNumber": 487, "name": "HPND with US Government export control warning and acknowledgment", "licenseId": "HPND-export-US-acknowledgement", "seeAlso": [ @@ -4041,7 +4167,7 @@ "reference": "https://spdx.org/licenses/HPND-export-US-modify.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-export-US-modify.json", - "referenceNumber": 475, + "referenceNumber": 172, "name": "HPND with US Government export control warning and modification rqmt", "licenseId": "HPND-export-US-modify", "seeAlso": [ @@ -4054,7 +4180,7 @@ "reference": "https://spdx.org/licenses/HPND-export2-US.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-export2-US.json", - "referenceNumber": 621, + "referenceNumber": 1, "name": "HPND with US Government export control and 2 disclaimers", "licenseId": "HPND-export2-US", "seeAlso": [ @@ -4067,7 +4193,7 @@ "reference": "https://spdx.org/licenses/HPND-Fenneberg-Livingston.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Fenneberg-Livingston.json", - "referenceNumber": 407, + "referenceNumber": 445, "name": "Historical Permission Notice and Disclaimer - Fenneberg-Livingston variant", "licenseId": "HPND-Fenneberg-Livingston", "seeAlso": [ @@ -4080,7 +4206,7 @@ "reference": "https://spdx.org/licenses/HPND-INRIA-IMAG.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-INRIA-IMAG.json", - "referenceNumber": 611, + "referenceNumber": 233, "name": "Historical Permission Notice and Disclaimer - INRIA-IMAG variant", "licenseId": "HPND-INRIA-IMAG", "seeAlso": [ @@ -4092,7 +4218,7 @@ "reference": "https://spdx.org/licenses/HPND-Intel.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Intel.json", - "referenceNumber": 86, + "referenceNumber": 228, "name": "Historical Permission Notice and Disclaimer - Intel variant", "licenseId": "HPND-Intel", "seeAlso": [ @@ -4104,7 +4230,7 @@ "reference": "https://spdx.org/licenses/HPND-Kevlin-Henney.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Kevlin-Henney.json", - "referenceNumber": 278, + "referenceNumber": 528, "name": "Historical Permission Notice and Disclaimer - Kevlin Henney variant", "licenseId": "HPND-Kevlin-Henney", "seeAlso": [ @@ -4116,7 +4242,7 @@ "reference": "https://spdx.org/licenses/HPND-Markus-Kuhn.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Markus-Kuhn.json", - "referenceNumber": 445, + "referenceNumber": 623, "name": "Historical Permission Notice and Disclaimer - Markus Kuhn variant", "licenseId": "HPND-Markus-Kuhn", "seeAlso": [ @@ -4129,7 +4255,7 @@ "reference": "https://spdx.org/licenses/HPND-merchantability-variant.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-merchantability-variant.json", - "referenceNumber": 207, + "referenceNumber": 157, "name": "Historical Permission Notice and Disclaimer - merchantability variant", "licenseId": "HPND-merchantability-variant", "seeAlso": [ @@ -4141,7 +4267,7 @@ "reference": "https://spdx.org/licenses/HPND-MIT-disclaimer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-MIT-disclaimer.json", - "referenceNumber": 455, + "referenceNumber": 313, "name": "Historical Permission Notice and Disclaimer with MIT disclaimer", "licenseId": "HPND-MIT-disclaimer", "seeAlso": [ @@ -4153,7 +4279,7 @@ "reference": "https://spdx.org/licenses/HPND-Netrek.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Netrek.json", - "referenceNumber": 608, + "referenceNumber": 387, "name": "Historical Permission Notice and Disclaimer - Netrek variant", "licenseId": "HPND-Netrek", "seeAlso": [], @@ -4163,7 +4289,7 @@ "reference": "https://spdx.org/licenses/HPND-Pbmplus.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-Pbmplus.json", - "referenceNumber": 675, + "referenceNumber": 339, "name": "Historical Permission Notice and Disclaimer - Pbmplus variant", "licenseId": "HPND-Pbmplus", "seeAlso": [ @@ -4175,7 +4301,7 @@ "reference": "https://spdx.org/licenses/HPND-sell-MIT-disclaimer-xserver.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-sell-MIT-disclaimer-xserver.json", - "referenceNumber": 649, + "referenceNumber": 341, "name": "Historical Permission Notice and Disclaimer - sell xserver variant with MIT disclaimer", "licenseId": "HPND-sell-MIT-disclaimer-xserver", "seeAlso": [ @@ -4187,7 +4313,7 @@ "reference": "https://spdx.org/licenses/HPND-sell-regexpr.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-sell-regexpr.json", - "referenceNumber": 527, + "referenceNumber": 681, "name": "Historical Permission Notice and Disclaimer - sell regexpr variant", "licenseId": "HPND-sell-regexpr", "seeAlso": [ @@ -4199,7 +4325,7 @@ "reference": "https://spdx.org/licenses/HPND-sell-variant.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant.json", - "referenceNumber": 231, + "referenceNumber": 13, "name": "Historical Permission Notice and Disclaimer - sell variant", "licenseId": "HPND-sell-variant", "seeAlso": [ @@ -4212,7 +4338,7 @@ "reference": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer.json", - "referenceNumber": 75, + "referenceNumber": 225, "name": "HPND sell variant with MIT disclaimer", "licenseId": "HPND-sell-variant-MIT-disclaimer", "seeAlso": [ @@ -4224,7 +4350,7 @@ "reference": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer-rev.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-sell-variant-MIT-disclaimer-rev.json", - "referenceNumber": 661, + "referenceNumber": 357, "name": "HPND sell variant with MIT disclaimer - reverse", "licenseId": "HPND-sell-variant-MIT-disclaimer-rev", "seeAlso": [ @@ -4236,7 +4362,7 @@ "reference": "https://spdx.org/licenses/HPND-UC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-UC.json", - "referenceNumber": 466, + "referenceNumber": 210, "name": "Historical Permission Notice and Disclaimer - University of California variant", "licenseId": "HPND-UC", "seeAlso": [ @@ -4248,7 +4374,7 @@ "reference": "https://spdx.org/licenses/HPND-UC-export-US.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HPND-UC-export-US.json", - "referenceNumber": 90, + "referenceNumber": 143, "name": "Historical Permission Notice and Disclaimer - University of California, US export warning", "licenseId": "HPND-UC-export-US", "seeAlso": [ @@ -4260,7 +4386,7 @@ "reference": "https://spdx.org/licenses/HTMLTIDY.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/HTMLTIDY.json", - "referenceNumber": 78, + "referenceNumber": 478, "name": "HTML Tidy License", "licenseId": "HTMLTIDY", "seeAlso": [ @@ -4272,7 +4398,7 @@ "reference": "https://spdx.org/licenses/IBM-pibs.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IBM-pibs.json", - "referenceNumber": 417, + "referenceNumber": 242, "name": "IBM PowerPC Initialization and Boot Software", "licenseId": "IBM-pibs", "seeAlso": [ @@ -4284,7 +4410,7 @@ "reference": "https://spdx.org/licenses/ICU.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ICU.json", - "referenceNumber": 520, + "referenceNumber": 289, "name": "ICU License", "licenseId": "ICU", "seeAlso": [ @@ -4296,7 +4422,7 @@ "reference": "https://spdx.org/licenses/IEC-Code-Components-EULA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IEC-Code-Components-EULA.json", - "referenceNumber": 211, + "referenceNumber": 399, "name": "IEC Code Components End-user licence agreement", "licenseId": "IEC-Code-Components-EULA", "seeAlso": [ @@ -4310,7 +4436,7 @@ "reference": "https://spdx.org/licenses/IJG.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IJG.json", - "referenceNumber": 672, + "referenceNumber": 512, "name": "Independent JPEG Group License", "licenseId": "IJG", "seeAlso": [ @@ -4323,7 +4449,7 @@ "reference": "https://spdx.org/licenses/IJG-short.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IJG-short.json", - "referenceNumber": 493, + "referenceNumber": 694, "name": "Independent JPEG Group License - short", "licenseId": "IJG-short", "seeAlso": [ @@ -4335,7 +4461,7 @@ "reference": "https://spdx.org/licenses/ImageMagick.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ImageMagick.json", - "referenceNumber": 581, + "referenceNumber": 472, "name": "ImageMagick License", "licenseId": "ImageMagick", "seeAlso": [ @@ -4347,7 +4473,7 @@ "reference": "https://spdx.org/licenses/iMatix.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/iMatix.json", - "referenceNumber": 129, + "referenceNumber": 482, "name": "iMatix Standard Function Library Agreement", "licenseId": "iMatix", "seeAlso": [ @@ -4360,7 +4486,7 @@ "reference": "https://spdx.org/licenses/Imlib2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Imlib2.json", - "referenceNumber": 365, + "referenceNumber": 552, "name": "Imlib2 License", "licenseId": "Imlib2", "seeAlso": [ @@ -4374,7 +4500,7 @@ "reference": "https://spdx.org/licenses/Info-ZIP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Info-ZIP.json", - "referenceNumber": 10, + "referenceNumber": 52, "name": "Info-ZIP License", "licenseId": "Info-ZIP", "seeAlso": [ @@ -4386,7 +4512,7 @@ "reference": "https://spdx.org/licenses/Inner-Net-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Inner-Net-2.0.json", - "referenceNumber": 352, + "referenceNumber": 328, "name": "Inner Net License v2.0", "licenseId": "Inner-Net-2.0", "seeAlso": [ @@ -4399,7 +4525,7 @@ "reference": "https://spdx.org/licenses/InnoSetup.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/InnoSetup.json", - "referenceNumber": 19, + "referenceNumber": 354, "name": "Inno Setup License", "licenseId": "InnoSetup", "seeAlso": [ @@ -4411,7 +4537,7 @@ "reference": "https://spdx.org/licenses/Intel.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Intel.json", - "referenceNumber": 462, + "referenceNumber": 419, "name": "Intel Open Source License", "licenseId": "Intel", "seeAlso": [ @@ -4424,7 +4550,7 @@ "reference": "https://spdx.org/licenses/Intel-ACPI.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Intel-ACPI.json", - "referenceNumber": 509, + "referenceNumber": 206, "name": "Intel ACPI Software License Agreement", "licenseId": "Intel-ACPI", "seeAlso": [ @@ -4436,7 +4562,7 @@ "reference": "https://spdx.org/licenses/Interbase-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Interbase-1.0.json", - "referenceNumber": 569, + "referenceNumber": 532, "name": "Interbase Public License v1.0", "licenseId": "Interbase-1.0", "seeAlso": [ @@ -4448,7 +4574,7 @@ "reference": "https://spdx.org/licenses/IPA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IPA.json", - "referenceNumber": 49, + "referenceNumber": 186, "name": "IPA Font License", "licenseId": "IPA", "seeAlso": [ @@ -4461,7 +4587,7 @@ "reference": "https://spdx.org/licenses/IPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/IPL-1.0.json", - "referenceNumber": 20, + "referenceNumber": 591, "name": "IBM Public License v1.0", "licenseId": "IPL-1.0", "seeAlso": [ @@ -4474,7 +4600,7 @@ "reference": "https://spdx.org/licenses/ISC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ISC.json", - "referenceNumber": 593, + "referenceNumber": 58, "name": "ISC License", "licenseId": "ISC", "seeAlso": [ @@ -4489,7 +4615,7 @@ "reference": "https://spdx.org/licenses/ISC-Veillard.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ISC-Veillard.json", - "referenceNumber": 401, + "referenceNumber": 317, "name": "ISC Veillard variant", "licenseId": "ISC-Veillard", "seeAlso": [ @@ -4503,7 +4629,7 @@ "reference": "https://spdx.org/licenses/Jam.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Jam.json", - "referenceNumber": 409, + "referenceNumber": 475, "name": "Jam License", "licenseId": "Jam", "seeAlso": [ @@ -4516,7 +4642,7 @@ "reference": "https://spdx.org/licenses/JasPer-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/JasPer-2.0.json", - "referenceNumber": 316, + "referenceNumber": 103, "name": "JasPer License", "licenseId": "JasPer-2.0", "seeAlso": [ @@ -4524,11 +4650,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/jove.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/jove.json", + "referenceNumber": 642, + "name": "Jove License", + "licenseId": "jove", + "seeAlso": [ + "https://github.com/jonmacs/jove/blob/4_17/LICENSE" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/JPL-image.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/JPL-image.json", - "referenceNumber": 195, + "referenceNumber": 321, "name": "JPL Image Use Policy", "licenseId": "JPL-image", "seeAlso": [ @@ -4540,7 +4678,7 @@ "reference": "https://spdx.org/licenses/JPNIC.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/JPNIC.json", - "referenceNumber": 22, + "referenceNumber": 655, "name": "Japan Network Information Center License", "licenseId": "JPNIC", "seeAlso": [ @@ -4552,7 +4690,7 @@ "reference": "https://spdx.org/licenses/JSON.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/JSON.json", - "referenceNumber": 662, + "referenceNumber": 54, "name": "JSON License", "licenseId": "JSON", "seeAlso": [ @@ -4565,7 +4703,7 @@ "reference": "https://spdx.org/licenses/Kastrup.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Kastrup.json", - "referenceNumber": 468, + "referenceNumber": 491, "name": "Kastrup License", "licenseId": "Kastrup", "seeAlso": [ @@ -4577,7 +4715,7 @@ "reference": "https://spdx.org/licenses/Kazlib.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Kazlib.json", - "referenceNumber": 71, + "referenceNumber": 312, "name": "Kazlib License", "licenseId": "Kazlib", "seeAlso": [ @@ -4589,7 +4727,7 @@ "reference": "https://spdx.org/licenses/Knuth-CTAN.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Knuth-CTAN.json", - "referenceNumber": 505, + "referenceNumber": 332, "name": "Knuth CTAN License", "licenseId": "Knuth-CTAN", "seeAlso": [ @@ -4601,7 +4739,7 @@ "reference": "https://spdx.org/licenses/LAL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LAL-1.2.json", - "referenceNumber": 484, + "referenceNumber": 134, "name": "Licence Art Libre 1.2", "licenseId": "LAL-1.2", "seeAlso": [ @@ -4613,7 +4751,7 @@ "reference": "https://spdx.org/licenses/LAL-1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LAL-1.3.json", - "referenceNumber": 363, + "referenceNumber": 521, "name": "Licence Art Libre 1.3", "licenseId": "LAL-1.3", "seeAlso": [ @@ -4625,7 +4763,7 @@ "reference": "https://spdx.org/licenses/Latex2e.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Latex2e.json", - "referenceNumber": 83, + "referenceNumber": 43, "name": "Latex2e License", "licenseId": "Latex2e", "seeAlso": [ @@ -4637,7 +4775,7 @@ "reference": "https://spdx.org/licenses/Latex2e-translated-notice.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Latex2e-translated-notice.json", - "referenceNumber": 48, + "referenceNumber": 523, "name": "Latex2e with translated notice permission", "licenseId": "Latex2e-translated-notice", "seeAlso": [ @@ -4649,7 +4787,7 @@ "reference": "https://spdx.org/licenses/Leptonica.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Leptonica.json", - "referenceNumber": 391, + "referenceNumber": 137, "name": "Leptonica License", "licenseId": "Leptonica", "seeAlso": [ @@ -4661,7 +4799,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-2.0.json", - "referenceNumber": 570, + "referenceNumber": 676, "name": "GNU Library General Public License v2 only", "licenseId": "LGPL-2.0", "seeAlso": [ @@ -4673,7 +4811,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.0+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-2.0+.json", - "referenceNumber": 412, + "referenceNumber": 409, "name": "GNU Library General Public License v2 or later", "licenseId": "LGPL-2.0+", "seeAlso": [ @@ -4685,7 +4823,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-2.0-only.json", - "referenceNumber": 458, + "referenceNumber": 329, "name": "GNU Library General Public License v2 only", "licenseId": "LGPL-2.0-only", "seeAlso": [ @@ -4697,7 +4835,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-2.0-or-later.json", - "referenceNumber": 168, + "referenceNumber": 75, "name": "GNU Library General Public License v2 or later", "licenseId": "LGPL-2.0-or-later", "seeAlso": [ @@ -4709,7 +4847,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.1.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-2.1.json", - "referenceNumber": 224, + "referenceNumber": 677, "name": "GNU Lesser General Public License v2.1 only", "licenseId": "LGPL-2.1", "seeAlso": [ @@ -4723,7 +4861,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.1+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-2.1+.json", - "referenceNumber": 566, + "referenceNumber": 448, "name": "GNU Lesser General Public License v2.1 or later", "licenseId": "LGPL-2.1+", "seeAlso": [ @@ -4737,7 +4875,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.1-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-2.1-only.json", - "referenceNumber": 59, + "referenceNumber": 297, "name": "GNU Lesser General Public License v2.1 only", "licenseId": "LGPL-2.1-only", "seeAlso": [ @@ -4751,7 +4889,7 @@ "reference": "https://spdx.org/licenses/LGPL-2.1-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-2.1-or-later.json", - "referenceNumber": 97, + "referenceNumber": 187, "name": "GNU Lesser General Public License v2.1 or later", "licenseId": "LGPL-2.1-or-later", "seeAlso": [ @@ -4765,7 +4903,7 @@ "reference": "https://spdx.org/licenses/LGPL-3.0.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-3.0.json", - "referenceNumber": 372, + "referenceNumber": 9, "name": "GNU Lesser General Public License v3.0 only", "licenseId": "LGPL-3.0", "seeAlso": [ @@ -4780,7 +4918,7 @@ "reference": "https://spdx.org/licenses/LGPL-3.0+.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/LGPL-3.0+.json", - "referenceNumber": 405, + "referenceNumber": 169, "name": "GNU Lesser General Public License v3.0 or later", "licenseId": "LGPL-3.0+", "seeAlso": [ @@ -4795,7 +4933,7 @@ "reference": "https://spdx.org/licenses/LGPL-3.0-only.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-3.0-only.json", - "referenceNumber": 571, + "referenceNumber": 634, "name": "GNU Lesser General Public License v3.0 only", "licenseId": "LGPL-3.0-only", "seeAlso": [ @@ -4810,7 +4948,7 @@ "reference": "https://spdx.org/licenses/LGPL-3.0-or-later.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPL-3.0-or-later.json", - "referenceNumber": 313, + "referenceNumber": 502, "name": "GNU Lesser General Public License v3.0 or later", "licenseId": "LGPL-3.0-or-later", "seeAlso": [ @@ -4825,7 +4963,7 @@ "reference": "https://spdx.org/licenses/LGPLLR.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LGPLLR.json", - "referenceNumber": 76, + "referenceNumber": 123, "name": "Lesser General Public License For Linguistic Resources", "licenseId": "LGPLLR", "seeAlso": [ @@ -4837,7 +4975,7 @@ "reference": "https://spdx.org/licenses/Libpng.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Libpng.json", - "referenceNumber": 648, + "referenceNumber": 62, "name": "libpng License", "licenseId": "Libpng", "seeAlso": [ @@ -4845,11 +4983,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/libpng-1.6.35.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/libpng-1.6.35.json", + "referenceNumber": 429, + "name": "PNG Reference Library License v1 (for libpng 0.5 through 1.6.35)", + "licenseId": "libpng-1.6.35", + "seeAlso": [ + "http://www.libpng.org/pub/png/src/libpng-LICENSE.txt" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/libpng-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/libpng-2.0.json", - "referenceNumber": 390, + "referenceNumber": 226, "name": "PNG Reference Library version 2", "licenseId": "libpng-2.0", "seeAlso": [ @@ -4861,7 +5011,7 @@ "reference": "https://spdx.org/licenses/libselinux-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/libselinux-1.0.json", - "referenceNumber": 406, + "referenceNumber": 263, "name": "libselinux public domain notice", "licenseId": "libselinux-1.0", "seeAlso": [ @@ -4873,7 +5023,7 @@ "reference": "https://spdx.org/licenses/libtiff.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/libtiff.json", - "referenceNumber": 589, + "referenceNumber": 35, "name": "libtiff License", "licenseId": "libtiff", "seeAlso": [ @@ -4885,7 +5035,7 @@ "reference": "https://spdx.org/licenses/libutil-David-Nugent.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/libutil-David-Nugent.json", - "referenceNumber": 218, + "referenceNumber": 402, "name": "libutil David Nugent License", "licenseId": "libutil-David-Nugent", "seeAlso": [ @@ -4898,7 +5048,7 @@ "reference": "https://spdx.org/licenses/LiLiQ-P-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LiLiQ-P-1.1.json", - "referenceNumber": 289, + "referenceNumber": 232, "name": "Licence Libre du Québec – Permissive version 1.1", "licenseId": "LiLiQ-P-1.1", "seeAlso": [ @@ -4911,7 +5061,7 @@ "reference": "https://spdx.org/licenses/LiLiQ-R-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LiLiQ-R-1.1.json", - "referenceNumber": 354, + "referenceNumber": 229, "name": "Licence Libre du Québec – Réciprocité version 1.1", "licenseId": "LiLiQ-R-1.1", "seeAlso": [ @@ -4924,7 +5074,7 @@ "reference": "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LiLiQ-Rplus-1.1.json", - "referenceNumber": 222, + "referenceNumber": 238, "name": "Licence Libre du Québec – Réciprocité forte version 1.1", "licenseId": "LiLiQ-Rplus-1.1", "seeAlso": [ @@ -4937,7 +5087,7 @@ "reference": "https://spdx.org/licenses/Linux-man-pages-1-para.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-1-para.json", - "referenceNumber": 419, + "referenceNumber": 78, "name": "Linux man-pages - 1 paragraph", "licenseId": "Linux-man-pages-1-para", "seeAlso": [ @@ -4949,7 +5099,7 @@ "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft.json", - "referenceNumber": 585, + "referenceNumber": 640, "name": "Linux man-pages Copyleft", "licenseId": "Linux-man-pages-copyleft", "seeAlso": [ @@ -4961,7 +5111,7 @@ "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft-2-para.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft-2-para.json", - "referenceNumber": 633, + "referenceNumber": 592, "name": "Linux man-pages Copyleft - 2 paragraphs", "licenseId": "Linux-man-pages-copyleft-2-para", "seeAlso": [ @@ -4974,7 +5124,7 @@ "reference": "https://spdx.org/licenses/Linux-man-pages-copyleft-var.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-man-pages-copyleft-var.json", - "referenceNumber": 480, + "referenceNumber": 202, "name": "Linux man-pages Copyleft Variant", "licenseId": "Linux-man-pages-copyleft-var", "seeAlso": [ @@ -4986,7 +5136,7 @@ "reference": "https://spdx.org/licenses/Linux-OpenIB.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Linux-OpenIB.json", - "referenceNumber": 383, + "referenceNumber": 513, "name": "Linux Kernel Variant of OpenIB.org license", "licenseId": "Linux-OpenIB", "seeAlso": [ @@ -4998,7 +5148,7 @@ "reference": "https://spdx.org/licenses/LOOP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LOOP.json", - "referenceNumber": 132, + "referenceNumber": 237, "name": "Common Lisp LOOP License", "licenseId": "LOOP", "seeAlso": [ @@ -5015,7 +5165,7 @@ "reference": "https://spdx.org/licenses/LPD-document.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPD-document.json", - "referenceNumber": 341, + "referenceNumber": 5, "name": "LPD Documentation License", "licenseId": "LPD-document", "seeAlso": [ @@ -5028,7 +5178,7 @@ "reference": "https://spdx.org/licenses/LPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPL-1.0.json", - "referenceNumber": 537, + "referenceNumber": 136, "name": "Lucent Public License Version 1.0", "licenseId": "LPL-1.0", "seeAlso": [ @@ -5040,7 +5190,7 @@ "reference": "https://spdx.org/licenses/LPL-1.02.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPL-1.02.json", - "referenceNumber": 269, + "referenceNumber": 656, "name": "Lucent Public License v1.02", "licenseId": "LPL-1.02", "seeAlso": [ @@ -5054,7 +5204,7 @@ "reference": "https://spdx.org/licenses/LPPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPPL-1.0.json", - "referenceNumber": 653, + "referenceNumber": 63, "name": "LaTeX Project Public License v1.0", "licenseId": "LPPL-1.0", "seeAlso": [ @@ -5066,7 +5216,7 @@ "reference": "https://spdx.org/licenses/LPPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPPL-1.1.json", - "referenceNumber": 538, + "referenceNumber": 542, "name": "LaTeX Project Public License v1.1", "licenseId": "LPPL-1.1", "seeAlso": [ @@ -5078,7 +5228,7 @@ "reference": "https://spdx.org/licenses/LPPL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPPL-1.2.json", - "referenceNumber": 104, + "referenceNumber": 486, "name": "LaTeX Project Public License v1.2", "licenseId": "LPPL-1.2", "seeAlso": [ @@ -5091,7 +5241,7 @@ "reference": "https://spdx.org/licenses/LPPL-1.3a.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPPL-1.3a.json", - "referenceNumber": 523, + "referenceNumber": 280, "name": "LaTeX Project Public License v1.3a", "licenseId": "LPPL-1.3a", "seeAlso": [ @@ -5104,7 +5254,7 @@ "reference": "https://spdx.org/licenses/LPPL-1.3c.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LPPL-1.3c.json", - "referenceNumber": 11, + "referenceNumber": 33, "name": "LaTeX Project Public License v1.3c", "licenseId": "LPPL-1.3c", "seeAlso": [ @@ -5117,7 +5267,7 @@ "reference": "https://spdx.org/licenses/lsof.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/lsof.json", - "referenceNumber": 259, + "referenceNumber": 563, "name": "lsof License", "licenseId": "lsof", "seeAlso": [ @@ -5129,7 +5279,7 @@ "reference": "https://spdx.org/licenses/Lucida-Bitmap-Fonts.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Lucida-Bitmap-Fonts.json", - "referenceNumber": 330, + "referenceNumber": 661, "name": "Lucida Bitmap Fonts License", "licenseId": "Lucida-Bitmap-Fonts", "seeAlso": [ @@ -5141,7 +5291,7 @@ "reference": "https://spdx.org/licenses/LZMA-SDK-9.11-to-9.20.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LZMA-SDK-9.11-to-9.20.json", - "referenceNumber": 273, + "referenceNumber": 349, "name": "LZMA SDK License (versions 9.11 to 9.20)", "licenseId": "LZMA-SDK-9.11-to-9.20", "seeAlso": [ @@ -5154,7 +5304,7 @@ "reference": "https://spdx.org/licenses/LZMA-SDK-9.22.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/LZMA-SDK-9.22.json", - "referenceNumber": 446, + "referenceNumber": 504, "name": "LZMA SDK License (versions 9.22 and beyond)", "licenseId": "LZMA-SDK-9.22", "seeAlso": [ @@ -5167,7 +5317,7 @@ "reference": "https://spdx.org/licenses/Mackerras-3-Clause.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Mackerras-3-Clause.json", - "referenceNumber": 503, + "referenceNumber": 539, "name": "Mackerras 3-Clause License", "licenseId": "Mackerras-3-Clause", "seeAlso": [ @@ -5179,7 +5329,7 @@ "reference": "https://spdx.org/licenses/Mackerras-3-Clause-acknowledgment.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Mackerras-3-Clause-acknowledgment.json", - "referenceNumber": 564, + "referenceNumber": 433, "name": "Mackerras 3-Clause - acknowledgment variant", "licenseId": "Mackerras-3-Clause-acknowledgment", "seeAlso": [ @@ -5191,11 +5341,12 @@ "reference": "https://spdx.org/licenses/magaz.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/magaz.json", - "referenceNumber": 217, + "referenceNumber": 373, "name": "magaz License", "licenseId": "magaz", "seeAlso": [ - "https://mirrors.nic.cz/tex-archive/macros/latex/contrib/magaz/magaz.tex" + "https://mirrors.nic.cz/tex-archive/macros/latex/contrib/magaz/magaz.tex", + "https://mirrors.ctan.org/macros/latex/contrib/version/version.sty" ], "isOsiApproved": false }, @@ -5203,7 +5354,7 @@ "reference": "https://spdx.org/licenses/mailprio.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mailprio.json", - "referenceNumber": 62, + "referenceNumber": 381, "name": "mailprio License", "licenseId": "mailprio", "seeAlso": [ @@ -5215,7 +5366,7 @@ "reference": "https://spdx.org/licenses/MakeIndex.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MakeIndex.json", - "referenceNumber": 291, + "referenceNumber": 165, "name": "MakeIndex License", "licenseId": "MakeIndex", "seeAlso": [ @@ -5223,11 +5374,25 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/man2html.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/man2html.json", + "referenceNumber": 120, + "name": "man2html License", + "licenseId": "man2html", + "seeAlso": [ + "http://primates.ximian.com/~flucifredi/man/man-1.6g.tar.gz", + "https://github.com/hamano/man2html/blob/master/man2html.c", + "https://docs.oracle.com/cd/E81115_01/html/E81116/licenses.html" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/Martin-Birgmeier.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Martin-Birgmeier.json", - "referenceNumber": 186, + "referenceNumber": 361, "name": "Martin Birgmeier License", "licenseId": "Martin-Birgmeier", "seeAlso": [ @@ -5239,7 +5404,7 @@ "reference": "https://spdx.org/licenses/McPhee-slideshow.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/McPhee-slideshow.json", - "referenceNumber": 189, + "referenceNumber": 489, "name": "McPhee Slideshow License", "licenseId": "McPhee-slideshow", "seeAlso": [ @@ -5251,7 +5416,7 @@ "reference": "https://spdx.org/licenses/metamail.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/metamail.json", - "referenceNumber": 512, + "referenceNumber": 455, "name": "metamail License", "licenseId": "metamail", "seeAlso": [ @@ -5263,7 +5428,7 @@ "reference": "https://spdx.org/licenses/Minpack.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Minpack.json", - "referenceNumber": 609, + "referenceNumber": 28, "name": "Minpack License", "licenseId": "Minpack", "seeAlso": [ @@ -5276,7 +5441,7 @@ "reference": "https://spdx.org/licenses/MIPS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIPS.json", - "referenceNumber": 550, + "referenceNumber": 351, "name": "MIPS License", "licenseId": "MIPS", "seeAlso": [ @@ -5288,7 +5453,7 @@ "reference": "https://spdx.org/licenses/MirOS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MirOS.json", - "referenceNumber": 16, + "referenceNumber": 692, "name": "The MirOS Licence", "licenseId": "MirOS", "seeAlso": [ @@ -5300,11 +5465,12 @@ "reference": "https://spdx.org/licenses/MIT.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT.json", - "referenceNumber": 144, + "referenceNumber": 515, "name": "MIT License", "licenseId": "MIT", "seeAlso": [ - "https://opensource.org/license/mit/" + "https://opensource.org/license/mit/", + "http://opensource.org/licenses/MIT" ], "isOsiApproved": true, "isFsfLibre": true @@ -5313,7 +5479,7 @@ "reference": "https://spdx.org/licenses/MIT-0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-0.json", - "referenceNumber": 127, + "referenceNumber": 173, "name": "MIT No Attribution", "licenseId": "MIT-0", "seeAlso": [ @@ -5327,7 +5493,7 @@ "reference": "https://spdx.org/licenses/MIT-advertising.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-advertising.json", - "referenceNumber": 246, + "referenceNumber": 440, "name": "Enlightenment License (e16)", "licenseId": "MIT-advertising", "seeAlso": [ @@ -5339,7 +5505,7 @@ "reference": "https://spdx.org/licenses/MIT-Click.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-Click.json", - "referenceNumber": 374, + "referenceNumber": 438, "name": "MIT Click License", "licenseId": "MIT-Click", "seeAlso": [ @@ -5351,7 +5517,7 @@ "reference": "https://spdx.org/licenses/MIT-CMU.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-CMU.json", - "referenceNumber": 469, + "referenceNumber": 287, "name": "CMU License", "licenseId": "MIT-CMU", "seeAlso": [ @@ -5364,7 +5530,7 @@ "reference": "https://spdx.org/licenses/MIT-enna.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-enna.json", - "referenceNumber": 196, + "referenceNumber": 580, "name": "enna License", "licenseId": "MIT-enna", "seeAlso": [ @@ -5376,7 +5542,7 @@ "reference": "https://spdx.org/licenses/MIT-feh.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-feh.json", - "referenceNumber": 223, + "referenceNumber": 408, "name": "feh License", "licenseId": "MIT-feh", "seeAlso": [ @@ -5388,7 +5554,7 @@ "reference": "https://spdx.org/licenses/MIT-Festival.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-Festival.json", - "referenceNumber": 167, + "referenceNumber": 18, "name": "MIT Festival Variant", "licenseId": "MIT-Festival", "seeAlso": [ @@ -5401,7 +5567,7 @@ "reference": "https://spdx.org/licenses/MIT-Khronos-old.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-Khronos-old.json", - "referenceNumber": 340, + "referenceNumber": 508, "name": "MIT Khronos - old variant", "licenseId": "MIT-Khronos-old", "seeAlso": [ @@ -5413,7 +5579,7 @@ "reference": "https://spdx.org/licenses/MIT-Modern-Variant.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-Modern-Variant.json", - "referenceNumber": 573, + "referenceNumber": 304, "name": "MIT License Modern Variant", "licenseId": "MIT-Modern-Variant", "seeAlso": [ @@ -5427,12 +5593,11 @@ "reference": "https://spdx.org/licenses/MIT-open-group.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-open-group.json", - "referenceNumber": 552, + "referenceNumber": 404, "name": "MIT Open Group variant", "licenseId": "MIT-open-group", "seeAlso": [ "https://gitlab.freedesktop.org/xorg/app/iceauth/-/blob/master/COPYING", - "https://gitlab.freedesktop.org/xorg/app/xvinfo/-/blob/master/COPYING", "https://gitlab.freedesktop.org/xorg/app/xsetroot/-/blob/master/COPYING", "https://gitlab.freedesktop.org/xorg/app/xauth/-/blob/master/COPYING" ], @@ -5442,7 +5607,7 @@ "reference": "https://spdx.org/licenses/MIT-testregex.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-testregex.json", - "referenceNumber": 133, + "referenceNumber": 496, "name": "MIT testregex Variant", "licenseId": "MIT-testregex", "seeAlso": [ @@ -5454,7 +5619,7 @@ "reference": "https://spdx.org/licenses/MIT-Wu.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MIT-Wu.json", - "referenceNumber": 467, + "referenceNumber": 355, "name": "MIT Tom Wu Variant", "licenseId": "MIT-Wu", "seeAlso": [ @@ -5466,7 +5631,7 @@ "reference": "https://spdx.org/licenses/MITNFA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MITNFA.json", - "referenceNumber": 588, + "referenceNumber": 473, "name": "MIT +no-false-attribs license", "licenseId": "MITNFA", "seeAlso": [ @@ -5478,7 +5643,7 @@ "reference": "https://spdx.org/licenses/MMIXware.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MMIXware.json", - "referenceNumber": 54, + "referenceNumber": 663, "name": "MMIXware License", "licenseId": "MMIXware", "seeAlso": [ @@ -5490,7 +5655,7 @@ "reference": "https://spdx.org/licenses/Motosoto.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Motosoto.json", - "referenceNumber": 208, + "referenceNumber": 507, "name": "Motosoto License", "licenseId": "Motosoto", "seeAlso": [ @@ -5502,7 +5667,7 @@ "reference": "https://spdx.org/licenses/MPEG-SSG.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MPEG-SSG.json", - "referenceNumber": 597, + "referenceNumber": 303, "name": "MPEG Software Simulation", "licenseId": "MPEG-SSG", "seeAlso": [ @@ -5514,7 +5679,7 @@ "reference": "https://spdx.org/licenses/mpi-permissive.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mpi-permissive.json", - "referenceNumber": 482, + "referenceNumber": 213, "name": "mpi Permissive License", "licenseId": "mpi-permissive", "seeAlso": [ @@ -5526,7 +5691,7 @@ "reference": "https://spdx.org/licenses/mpich2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mpich2.json", - "referenceNumber": 118, + "referenceNumber": 102, "name": "mpich2 License", "licenseId": "mpich2", "seeAlso": [ @@ -5538,7 +5703,7 @@ "reference": "https://spdx.org/licenses/MPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MPL-1.0.json", - "referenceNumber": 32, + "referenceNumber": 665, "name": "Mozilla Public License 1.0", "licenseId": "MPL-1.0", "seeAlso": [ @@ -5551,7 +5716,7 @@ "reference": "https://spdx.org/licenses/MPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MPL-1.1.json", - "referenceNumber": 25, + "referenceNumber": 679, "name": "Mozilla Public License 1.1", "licenseId": "MPL-1.1", "seeAlso": [ @@ -5565,7 +5730,7 @@ "reference": "https://spdx.org/licenses/MPL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MPL-2.0.json", - "referenceNumber": 249, + "referenceNumber": 599, "name": "Mozilla Public License 2.0", "licenseId": "MPL-2.0", "seeAlso": [ @@ -5579,7 +5744,7 @@ "reference": "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.json", - "referenceNumber": 350, + "referenceNumber": 174, "name": "Mozilla Public License 2.0 (no copyleft exception)", "licenseId": "MPL-2.0-no-copyleft-exception", "seeAlso": [ @@ -5592,7 +5757,7 @@ "reference": "https://spdx.org/licenses/mplus.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/mplus.json", - "referenceNumber": 85, + "referenceNumber": 17, "name": "mplus Font License", "licenseId": "mplus", "seeAlso": [ @@ -5604,7 +5769,7 @@ "reference": "https://spdx.org/licenses/MS-LPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MS-LPL.json", - "referenceNumber": 370, + "referenceNumber": 674, "name": "Microsoft Limited Public License", "licenseId": "MS-LPL", "seeAlso": [ @@ -5618,7 +5783,7 @@ "reference": "https://spdx.org/licenses/MS-PL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MS-PL.json", - "referenceNumber": 430, + "referenceNumber": 698, "name": "Microsoft Public License", "licenseId": "MS-PL", "seeAlso": [ @@ -5632,7 +5797,7 @@ "reference": "https://spdx.org/licenses/MS-RL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MS-RL.json", - "referenceNumber": 285, + "referenceNumber": 276, "name": "Microsoft Reciprocal License", "licenseId": "MS-RL", "seeAlso": [ @@ -5646,7 +5811,7 @@ "reference": "https://spdx.org/licenses/MTLL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MTLL.json", - "referenceNumber": 620, + "referenceNumber": 588, "name": "Matrix Template Library License", "licenseId": "MTLL", "seeAlso": [ @@ -5658,7 +5823,7 @@ "reference": "https://spdx.org/licenses/MulanPSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MulanPSL-1.0.json", - "referenceNumber": 599, + "referenceNumber": 320, "name": "Mulan Permissive Software License, Version 1", "licenseId": "MulanPSL-1.0", "seeAlso": [ @@ -5671,7 +5836,7 @@ "reference": "https://spdx.org/licenses/MulanPSL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/MulanPSL-2.0.json", - "referenceNumber": 327, + "referenceNumber": 182, "name": "Mulan Permissive Software License, Version 2", "licenseId": "MulanPSL-2.0", "seeAlso": [ @@ -5683,7 +5848,7 @@ "reference": "https://spdx.org/licenses/Multics.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Multics.json", - "referenceNumber": 427, + "referenceNumber": 60, "name": "Multics License", "licenseId": "Multics", "seeAlso": [ @@ -5695,7 +5860,7 @@ "reference": "https://spdx.org/licenses/Mup.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Mup.json", - "referenceNumber": 371, + "referenceNumber": 288, "name": "Mup License", "licenseId": "Mup", "seeAlso": [ @@ -5707,7 +5872,7 @@ "reference": "https://spdx.org/licenses/NAIST-2003.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NAIST-2003.json", - "referenceNumber": 220, + "referenceNumber": 462, "name": "Nara Institute of Science and Technology License (2003)", "licenseId": "NAIST-2003", "seeAlso": [ @@ -5720,7 +5885,7 @@ "reference": "https://spdx.org/licenses/NASA-1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NASA-1.3.json", - "referenceNumber": 486, + "referenceNumber": 432, "name": "NASA Open Source Agreement 1.3", "licenseId": "NASA-1.3", "seeAlso": [ @@ -5734,7 +5899,7 @@ "reference": "https://spdx.org/licenses/Naumen.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Naumen.json", - "referenceNumber": 594, + "referenceNumber": 307, "name": "Naumen Public License", "licenseId": "Naumen", "seeAlso": [ @@ -5746,7 +5911,7 @@ "reference": "https://spdx.org/licenses/NBPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NBPL-1.0.json", - "referenceNumber": 240, + "referenceNumber": 460, "name": "Net Boolean Public License v1", "licenseId": "NBPL-1.0", "seeAlso": [ @@ -5758,7 +5923,7 @@ "reference": "https://spdx.org/licenses/NCBI-PD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NCBI-PD.json", - "referenceNumber": 395, + "referenceNumber": 696, "name": "NCBI Public Domain Notice", "licenseId": "NCBI-PD", "seeAlso": [ @@ -5774,7 +5939,7 @@ "reference": "https://spdx.org/licenses/NCGL-UK-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NCGL-UK-2.0.json", - "referenceNumber": 212, + "referenceNumber": 392, "name": "Non-Commercial Government Licence", "licenseId": "NCGL-UK-2.0", "seeAlso": [ @@ -5786,7 +5951,7 @@ "reference": "https://spdx.org/licenses/NCL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NCL.json", - "referenceNumber": 152, + "referenceNumber": 154, "name": "NCL Source Code License", "licenseId": "NCL", "seeAlso": [ @@ -5798,7 +5963,7 @@ "reference": "https://spdx.org/licenses/NCSA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NCSA.json", - "referenceNumber": 478, + "referenceNumber": 148, "name": "University of Illinois/NCSA Open Source License", "licenseId": "NCSA", "seeAlso": [ @@ -5812,7 +5977,7 @@ "reference": "https://spdx.org/licenses/Net-SNMP.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/Net-SNMP.json", - "referenceNumber": 440, + "referenceNumber": 638, "name": "Net-SNMP License", "licenseId": "Net-SNMP", "seeAlso": [ @@ -5824,7 +5989,7 @@ "reference": "https://spdx.org/licenses/NetCDF.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NetCDF.json", - "referenceNumber": 303, + "referenceNumber": 626, "name": "NetCDF license", "licenseId": "NetCDF", "seeAlso": [ @@ -5836,7 +6001,7 @@ "reference": "https://spdx.org/licenses/Newsletr.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Newsletr.json", - "referenceNumber": 163, + "referenceNumber": 607, "name": "Newsletr License", "licenseId": "Newsletr", "seeAlso": [ @@ -5848,7 +6013,7 @@ "reference": "https://spdx.org/licenses/NGPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NGPL.json", - "referenceNumber": 115, + "referenceNumber": 64, "name": "Nethack General Public License", "licenseId": "NGPL", "seeAlso": [ @@ -5856,11 +6021,23 @@ ], "isOsiApproved": true }, + { + "reference": "https://spdx.org/licenses/ngrep.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/ngrep.json", + "referenceNumber": 16, + "name": "ngrep License", + "licenseId": "ngrep", + "seeAlso": [ + "https://github.com/jpr5/ngrep/blob/master/LICENSE" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/NICTA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NICTA-1.0.json", - "referenceNumber": 536, + "referenceNumber": 406, "name": "NICTA Public Software License, Version 1.0", "licenseId": "NICTA-1.0", "seeAlso": [ @@ -5872,7 +6049,7 @@ "reference": "https://spdx.org/licenses/NIST-PD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NIST-PD.json", - "referenceNumber": 1, + "referenceNumber": 98, "name": "NIST Public Domain Notice", "licenseId": "NIST-PD", "seeAlso": [ @@ -5885,7 +6062,7 @@ "reference": "https://spdx.org/licenses/NIST-PD-fallback.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NIST-PD-fallback.json", - "referenceNumber": 463, + "referenceNumber": 616, "name": "NIST Public Domain Notice with license fallback", "licenseId": "NIST-PD-fallback", "seeAlso": [ @@ -5898,7 +6075,7 @@ "reference": "https://spdx.org/licenses/NIST-Software.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NIST-Software.json", - "referenceNumber": 471, + "referenceNumber": 447, "name": "NIST Software License", "licenseId": "NIST-Software", "seeAlso": [ @@ -5910,7 +6087,7 @@ "reference": "https://spdx.org/licenses/NLOD-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NLOD-1.0.json", - "referenceNumber": 3, + "referenceNumber": 249, "name": "Norwegian Licence for Open Government Data (NLOD) 1.0", "licenseId": "NLOD-1.0", "seeAlso": [ @@ -5922,7 +6099,7 @@ "reference": "https://spdx.org/licenses/NLOD-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NLOD-2.0.json", - "referenceNumber": 60, + "referenceNumber": 687, "name": "Norwegian Licence for Open Government Data (NLOD) 2.0", "licenseId": "NLOD-2.0", "seeAlso": [ @@ -5934,7 +6111,7 @@ "reference": "https://spdx.org/licenses/NLPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NLPL.json", - "referenceNumber": 477, + "referenceNumber": 161, "name": "No Limit Public License", "licenseId": "NLPL", "seeAlso": [ @@ -5946,7 +6123,7 @@ "reference": "https://spdx.org/licenses/Nokia.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Nokia.json", - "referenceNumber": 678, + "referenceNumber": 464, "name": "Nokia Open Source License", "licenseId": "Nokia", "seeAlso": [ @@ -5959,7 +6136,7 @@ "reference": "https://spdx.org/licenses/NOSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NOSL.json", - "referenceNumber": 80, + "referenceNumber": 471, "name": "Netizen Open Source License", "licenseId": "NOSL", "seeAlso": [ @@ -5972,7 +6149,7 @@ "reference": "https://spdx.org/licenses/Noweb.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Noweb.json", - "referenceNumber": 64, + "referenceNumber": 77, "name": "Noweb License", "licenseId": "Noweb", "seeAlso": [ @@ -5984,7 +6161,7 @@ "reference": "https://spdx.org/licenses/NPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NPL-1.0.json", - "referenceNumber": 112, + "referenceNumber": 372, "name": "Netscape Public License v1.0", "licenseId": "NPL-1.0", "seeAlso": [ @@ -5997,7 +6174,7 @@ "reference": "https://spdx.org/licenses/NPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NPL-1.1.json", - "referenceNumber": 491, + "referenceNumber": 518, "name": "Netscape Public License v1.1", "licenseId": "NPL-1.1", "seeAlso": [ @@ -6010,7 +6187,7 @@ "reference": "https://spdx.org/licenses/NPOSL-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NPOSL-3.0.json", - "referenceNumber": 507, + "referenceNumber": 195, "name": "Non-Profit Open Software License 3.0", "licenseId": "NPOSL-3.0", "seeAlso": [ @@ -6022,7 +6199,7 @@ "reference": "https://spdx.org/licenses/NRL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NRL.json", - "referenceNumber": 442, + "referenceNumber": 146, "name": "NRL License", "licenseId": "NRL", "seeAlso": [ @@ -6030,11 +6207,24 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/NTIA-PD.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/NTIA-PD.json", + "referenceNumber": 426, + "name": "NTIA Public Domain Notice", + "licenseId": "NTIA-PD", + "seeAlso": [ + "https://raw.githubusercontent.com/NTIA/itm/refs/heads/master/LICENSE.md", + "https://raw.githubusercontent.com/NTIA/scos-sensor/refs/heads/master/LICENSE.md" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/NTP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NTP.json", - "referenceNumber": 228, + "referenceNumber": 621, "name": "NTP License", "licenseId": "NTP", "seeAlso": [ @@ -6046,7 +6236,7 @@ "reference": "https://spdx.org/licenses/NTP-0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/NTP-0.json", - "referenceNumber": 586, + "referenceNumber": 566, "name": "NTP No Attribution", "licenseId": "NTP-0", "seeAlso": [ @@ -6058,7 +6248,7 @@ "reference": "https://spdx.org/licenses/Nunit.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/Nunit.json", - "referenceNumber": 605, + "referenceNumber": 203, "name": "Nunit License", "licenseId": "Nunit", "seeAlso": [ @@ -6071,7 +6261,7 @@ "reference": "https://spdx.org/licenses/O-UDA-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/O-UDA-1.0.json", - "referenceNumber": 84, + "referenceNumber": 485, "name": "Open Use of Data Agreement v1.0", "licenseId": "O-UDA-1.0", "seeAlso": [ @@ -6084,7 +6274,7 @@ "reference": "https://spdx.org/licenses/OAR.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OAR.json", - "referenceNumber": 77, + "referenceNumber": 251, "name": "OAR License", "licenseId": "OAR", "seeAlso": [ @@ -6096,7 +6286,7 @@ "reference": "https://spdx.org/licenses/OCCT-PL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OCCT-PL.json", - "referenceNumber": 547, + "referenceNumber": 371, "name": "Open CASCADE Technology Public License", "licenseId": "OCCT-PL", "seeAlso": [ @@ -6108,7 +6298,7 @@ "reference": "https://spdx.org/licenses/OCLC-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OCLC-2.0.json", - "referenceNumber": 179, + "referenceNumber": 274, "name": "OCLC Research Public License 2.0", "licenseId": "OCLC-2.0", "seeAlso": [ @@ -6121,7 +6311,7 @@ "reference": "https://spdx.org/licenses/ODbL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ODbL-1.0.json", - "referenceNumber": 615, + "referenceNumber": 397, "name": "Open Data Commons Open Database License v1.0", "licenseId": "ODbL-1.0", "seeAlso": [ @@ -6135,7 +6325,7 @@ "reference": "https://spdx.org/licenses/ODC-By-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ODC-By-1.0.json", - "referenceNumber": 192, + "referenceNumber": 46, "name": "Open Data Commons Attribution License v1.0", "licenseId": "ODC-By-1.0", "seeAlso": [ @@ -6147,7 +6337,7 @@ "reference": "https://spdx.org/licenses/OFFIS.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFFIS.json", - "referenceNumber": 423, + "referenceNumber": 368, "name": "OFFIS License", "licenseId": "OFFIS", "seeAlso": [ @@ -6159,7 +6349,7 @@ "reference": "https://spdx.org/licenses/OFL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.0.json", - "referenceNumber": 98, + "referenceNumber": 589, "name": "SIL Open Font License 1.0", "licenseId": "OFL-1.0", "seeAlso": [ @@ -6172,7 +6362,7 @@ "reference": "https://spdx.org/licenses/OFL-1.0-no-RFN.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.0-no-RFN.json", - "referenceNumber": 362, + "referenceNumber": 653, "name": "SIL Open Font License 1.0 with no Reserved Font Name", "licenseId": "OFL-1.0-no-RFN", "seeAlso": [ @@ -6184,7 +6374,7 @@ "reference": "https://spdx.org/licenses/OFL-1.0-RFN.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.0-RFN.json", - "referenceNumber": 622, + "referenceNumber": 201, "name": "SIL Open Font License 1.0 with Reserved Font Name", "licenseId": "OFL-1.0-RFN", "seeAlso": [ @@ -6196,7 +6386,7 @@ "reference": "https://spdx.org/licenses/OFL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.1.json", - "referenceNumber": 433, + "referenceNumber": 608, "name": "SIL Open Font License 1.1", "licenseId": "OFL-1.1", "seeAlso": [ @@ -6210,7 +6400,7 @@ "reference": "https://spdx.org/licenses/OFL-1.1-no-RFN.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.1-no-RFN.json", - "referenceNumber": 562, + "referenceNumber": 204, "name": "SIL Open Font License 1.1 with no Reserved Font Name", "licenseId": "OFL-1.1-no-RFN", "seeAlso": [ @@ -6223,7 +6413,7 @@ "reference": "https://spdx.org/licenses/OFL-1.1-RFN.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OFL-1.1-RFN.json", - "referenceNumber": 88, + "referenceNumber": 82, "name": "SIL Open Font License 1.1 with Reserved Font Name", "licenseId": "OFL-1.1-RFN", "seeAlso": [ @@ -6236,7 +6426,7 @@ "reference": "https://spdx.org/licenses/OGC-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGC-1.0.json", - "referenceNumber": 533, + "referenceNumber": 612, "name": "OGC Software License, Version 1.0", "licenseId": "OGC-1.0", "seeAlso": [ @@ -6248,7 +6438,7 @@ "reference": "https://spdx.org/licenses/OGDL-Taiwan-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGDL-Taiwan-1.0.json", - "referenceNumber": 247, + "referenceNumber": 129, "name": "Taiwan Open Government Data License, version 1.0", "licenseId": "OGDL-Taiwan-1.0", "seeAlso": [ @@ -6260,7 +6450,7 @@ "reference": "https://spdx.org/licenses/OGL-Canada-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGL-Canada-2.0.json", - "referenceNumber": 673, + "referenceNumber": 544, "name": "Open Government Licence - Canada", "licenseId": "OGL-Canada-2.0", "seeAlso": [ @@ -6272,7 +6462,7 @@ "reference": "https://spdx.org/licenses/OGL-UK-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGL-UK-1.0.json", - "referenceNumber": 171, + "referenceNumber": 168, "name": "Open Government Licence v1.0", "licenseId": "OGL-UK-1.0", "seeAlso": [ @@ -6296,7 +6486,7 @@ "reference": "https://spdx.org/licenses/OGL-UK-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGL-UK-3.0.json", - "referenceNumber": 385, + "referenceNumber": 570, "name": "Open Government Licence v3.0", "licenseId": "OGL-UK-3.0", "seeAlso": [ @@ -6308,7 +6498,7 @@ "reference": "https://spdx.org/licenses/OGTSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OGTSL.json", - "referenceNumber": 614, + "referenceNumber": 534, "name": "Open Group Test Suite License", "licenseId": "OGTSL", "seeAlso": [ @@ -6321,7 +6511,7 @@ "reference": "https://spdx.org/licenses/OLDAP-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-1.1.json", - "referenceNumber": 209, + "referenceNumber": 333, "name": "Open LDAP Public License v1.1", "licenseId": "OLDAP-1.1", "seeAlso": [ @@ -6333,7 +6523,7 @@ "reference": "https://spdx.org/licenses/OLDAP-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-1.2.json", - "referenceNumber": 33, + "referenceNumber": 281, "name": "Open LDAP Public License v1.2", "licenseId": "OLDAP-1.2", "seeAlso": [ @@ -6345,7 +6535,7 @@ "reference": "https://spdx.org/licenses/OLDAP-1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-1.3.json", - "referenceNumber": 58, + "referenceNumber": 386, "name": "Open LDAP Public License v1.3", "licenseId": "OLDAP-1.3", "seeAlso": [ @@ -6357,7 +6547,7 @@ "reference": "https://spdx.org/licenses/OLDAP-1.4.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-1.4.json", - "referenceNumber": 508, + "referenceNumber": 105, "name": "Open LDAP Public License v1.4", "licenseId": "OLDAP-1.4", "seeAlso": [ @@ -6369,7 +6559,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.0.json", - "referenceNumber": 261, + "referenceNumber": 657, "name": "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", "licenseId": "OLDAP-2.0", "seeAlso": [ @@ -6381,7 +6571,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.0.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.0.1.json", - "referenceNumber": 634, + "referenceNumber": 654, "name": "Open LDAP Public License v2.0.1", "licenseId": "OLDAP-2.0.1", "seeAlso": [ @@ -6393,7 +6583,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.1.json", - "referenceNumber": 94, + "referenceNumber": 170, "name": "Open LDAP Public License v2.1", "licenseId": "OLDAP-2.1", "seeAlso": [ @@ -6405,7 +6595,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.json", - "referenceNumber": 369, + "referenceNumber": 667, "name": "Open LDAP Public License v2.2", "licenseId": "OLDAP-2.2", "seeAlso": [ @@ -6417,7 +6607,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.1.json", - "referenceNumber": 542, + "referenceNumber": 378, "name": "Open LDAP Public License v2.2.1", "licenseId": "OLDAP-2.2.1", "seeAlso": [ @@ -6429,7 +6619,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.2.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.2.2.json", - "referenceNumber": 105, + "referenceNumber": 314, "name": "Open LDAP Public License 2.2.2", "licenseId": "OLDAP-2.2.2", "seeAlso": [ @@ -6441,7 +6631,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.3.json", - "referenceNumber": 288, + "referenceNumber": 411, "name": "Open LDAP Public License v2.3", "licenseId": "OLDAP-2.3", "seeAlso": [ @@ -6454,7 +6644,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.4.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.4.json", - "referenceNumber": 359, + "referenceNumber": 382, "name": "Open LDAP Public License v2.4", "licenseId": "OLDAP-2.4", "seeAlso": [ @@ -6466,7 +6656,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.5.json", - "referenceNumber": 181, + "referenceNumber": 443, "name": "Open LDAP Public License v2.5", "licenseId": "OLDAP-2.5", "seeAlso": [ @@ -6478,7 +6668,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.6.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.6.json", - "referenceNumber": 544, + "referenceNumber": 344, "name": "Open LDAP Public License v2.6", "licenseId": "OLDAP-2.6", "seeAlso": [ @@ -6490,7 +6680,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.7.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.7.json", - "referenceNumber": 618, + "referenceNumber": 574, "name": "Open LDAP Public License v2.7", "licenseId": "OLDAP-2.7", "seeAlso": [ @@ -6503,7 +6693,7 @@ "reference": "https://spdx.org/licenses/OLDAP-2.8.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLDAP-2.8.json", - "referenceNumber": 14, + "referenceNumber": 364, "name": "Open LDAP Public License v2.8", "licenseId": "OLDAP-2.8", "seeAlso": [ @@ -6515,7 +6705,7 @@ "reference": "https://spdx.org/licenses/OLFL-1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OLFL-1.3.json", - "referenceNumber": 351, + "referenceNumber": 121, "name": "Open Logistics Foundation License Version 1.3", "licenseId": "OLFL-1.3", "seeAlso": [ @@ -6528,7 +6718,7 @@ "reference": "https://spdx.org/licenses/OML.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OML.json", - "referenceNumber": 453, + "referenceNumber": 116, "name": "Open Market License", "licenseId": "OML", "seeAlso": [ @@ -6540,7 +6730,7 @@ "reference": "https://spdx.org/licenses/OpenPBS-2.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OpenPBS-2.3.json", - "referenceNumber": 140, + "referenceNumber": 2, "name": "OpenPBS v2.3 Software License", "licenseId": "OpenPBS-2.3", "seeAlso": [ @@ -6553,7 +6743,7 @@ "reference": "https://spdx.org/licenses/OpenSSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OpenSSL.json", - "referenceNumber": 393, + "referenceNumber": 275, "name": "OpenSSL License", "licenseId": "OpenSSL", "seeAlso": [ @@ -6566,7 +6756,7 @@ "reference": "https://spdx.org/licenses/OpenSSL-standalone.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OpenSSL-standalone.json", - "referenceNumber": 449, + "referenceNumber": 128, "name": "OpenSSL License - standalone", "licenseId": "OpenSSL-standalone", "seeAlso": [ @@ -6579,7 +6769,7 @@ "reference": "https://spdx.org/licenses/OpenVision.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OpenVision.json", - "referenceNumber": 23, + "referenceNumber": 36, "name": "OpenVision License", "licenseId": "OpenVision", "seeAlso": [ @@ -6593,7 +6783,7 @@ "reference": "https://spdx.org/licenses/OPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OPL-1.0.json", - "referenceNumber": 43, + "referenceNumber": 614, "name": "Open Public License v1.0", "licenseId": "OPL-1.0", "seeAlso": [ @@ -6607,7 +6797,7 @@ "reference": "https://spdx.org/licenses/OPL-UK-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OPL-UK-3.0.json", - "referenceNumber": 248, + "referenceNumber": 285, "name": "United Kingdom Open Parliament Licence v3.0", "licenseId": "OPL-UK-3.0", "seeAlso": [ @@ -6619,7 +6809,7 @@ "reference": "https://spdx.org/licenses/OPUBL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OPUBL-1.0.json", - "referenceNumber": 241, + "referenceNumber": 414, "name": "Open Publication License v1.0", "licenseId": "OPUBL-1.0", "seeAlso": [ @@ -6633,7 +6823,7 @@ "reference": "https://spdx.org/licenses/OSET-PL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSET-PL-2.1.json", - "referenceNumber": 658, + "referenceNumber": 183, "name": "OSET Public License version 2.1", "licenseId": "OSET-PL-2.1", "seeAlso": [ @@ -6646,7 +6836,7 @@ "reference": "https://spdx.org/licenses/OSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSL-1.0.json", - "referenceNumber": 554, + "referenceNumber": 651, "name": "Open Software License 1.0", "licenseId": "OSL-1.0", "seeAlso": [ @@ -6659,7 +6849,7 @@ "reference": "https://spdx.org/licenses/OSL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSL-1.1.json", - "referenceNumber": 481, + "referenceNumber": 453, "name": "Open Software License 1.1", "licenseId": "OSL-1.1", "seeAlso": [ @@ -6672,7 +6862,7 @@ "reference": "https://spdx.org/licenses/OSL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSL-2.0.json", - "referenceNumber": 377, + "referenceNumber": 179, "name": "Open Software License 2.0", "licenseId": "OSL-2.0", "seeAlso": [ @@ -6685,7 +6875,7 @@ "reference": "https://spdx.org/licenses/OSL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSL-2.1.json", - "referenceNumber": 368, + "referenceNumber": 29, "name": "Open Software License 2.1", "licenseId": "OSL-2.1", "seeAlso": [ @@ -6699,7 +6889,7 @@ "reference": "https://spdx.org/licenses/OSL-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/OSL-3.0.json", - "referenceNumber": 30, + "referenceNumber": 3, "name": "Open Software License 3.0", "licenseId": "OSL-3.0", "seeAlso": [ @@ -6713,7 +6903,7 @@ "reference": "https://spdx.org/licenses/PADL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PADL.json", - "referenceNumber": 535, + "referenceNumber": 284, "name": "PADL License", "licenseId": "PADL", "seeAlso": [ @@ -6725,7 +6915,7 @@ "reference": "https://spdx.org/licenses/Parity-6.0.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Parity-6.0.0.json", - "referenceNumber": 17, + "referenceNumber": 241, "name": "The Parity Public License 6.0.0", "licenseId": "Parity-6.0.0", "seeAlso": [ @@ -6737,7 +6927,7 @@ "reference": "https://spdx.org/licenses/Parity-7.0.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Parity-7.0.0.json", - "referenceNumber": 324, + "referenceNumber": 235, "name": "The Parity Public License 7.0.0", "licenseId": "Parity-7.0.0", "seeAlso": [ @@ -6749,7 +6939,7 @@ "reference": "https://spdx.org/licenses/PDDL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PDDL-1.0.json", - "referenceNumber": 149, + "referenceNumber": 684, "name": "Open Data Commons Public Domain Dedication \u0026 License 1.0", "licenseId": "PDDL-1.0", "seeAlso": [ @@ -6762,7 +6952,7 @@ "reference": "https://spdx.org/licenses/PHP-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PHP-3.0.json", - "referenceNumber": 138, + "referenceNumber": 133, "name": "PHP License v3.0", "licenseId": "PHP-3.0", "seeAlso": [ @@ -6775,7 +6965,7 @@ "reference": "https://spdx.org/licenses/PHP-3.01.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PHP-3.01.json", - "referenceNumber": 666, + "referenceNumber": 221, "name": "PHP License v3.01", "licenseId": "PHP-3.01", "seeAlso": [ @@ -6788,7 +6978,7 @@ "reference": "https://spdx.org/licenses/Pixar.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Pixar.json", - "referenceNumber": 607, + "referenceNumber": 435, "name": "Pixar License", "licenseId": "Pixar", "seeAlso": [ @@ -6802,7 +6992,7 @@ "reference": "https://spdx.org/licenses/pkgconf.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/pkgconf.json", - "referenceNumber": 664, + "referenceNumber": 670, "name": "pkgconf License", "licenseId": "pkgconf", "seeAlso": [ @@ -6814,7 +7004,7 @@ "reference": "https://spdx.org/licenses/Plexus.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Plexus.json", - "referenceNumber": 39, + "referenceNumber": 181, "name": "Plexus Classworlds License", "licenseId": "Plexus", "seeAlso": [ @@ -6826,7 +7016,7 @@ "reference": "https://spdx.org/licenses/pnmstitch.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/pnmstitch.json", - "referenceNumber": 266, + "referenceNumber": 691, "name": "pnmstitch License", "licenseId": "pnmstitch", "seeAlso": [ @@ -6838,7 +7028,7 @@ "reference": "https://spdx.org/licenses/PolyForm-Noncommercial-1.0.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PolyForm-Noncommercial-1.0.0.json", - "referenceNumber": 561, + "referenceNumber": 119, "name": "PolyForm Noncommercial License 1.0.0", "licenseId": "PolyForm-Noncommercial-1.0.0", "seeAlso": [ @@ -6850,7 +7040,7 @@ "reference": "https://spdx.org/licenses/PolyForm-Small-Business-1.0.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PolyForm-Small-Business-1.0.0.json", - "referenceNumber": 155, + "referenceNumber": 30, "name": "PolyForm Small Business License 1.0.0", "licenseId": "PolyForm-Small-Business-1.0.0", "seeAlso": [ @@ -6862,7 +7052,7 @@ "reference": "https://spdx.org/licenses/PostgreSQL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PostgreSQL.json", - "referenceNumber": 645, + "referenceNumber": 697, "name": "PostgreSQL License", "licenseId": "PostgreSQL", "seeAlso": [ @@ -6875,7 +7065,7 @@ "reference": "https://spdx.org/licenses/PPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PPL.json", - "referenceNumber": 87, + "referenceNumber": 150, "name": "Peer Production License", "licenseId": "PPL", "seeAlso": [ @@ -6889,7 +7079,7 @@ "reference": "https://spdx.org/licenses/PSF-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/PSF-2.0.json", - "referenceNumber": 479, + "referenceNumber": 211, "name": "Python Software Foundation License 2.0", "licenseId": "PSF-2.0", "seeAlso": [ @@ -6902,7 +7092,7 @@ "reference": "https://spdx.org/licenses/psfrag.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/psfrag.json", - "referenceNumber": 100, + "referenceNumber": 423, "name": "psfrag License", "licenseId": "psfrag", "seeAlso": [ @@ -6914,7 +7104,7 @@ "reference": "https://spdx.org/licenses/psutils.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/psutils.json", - "referenceNumber": 50, + "referenceNumber": 500, "name": "psutils License", "licenseId": "psutils", "seeAlso": [ @@ -6926,7 +7116,7 @@ "reference": "https://spdx.org/licenses/Python-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Python-2.0.json", - "referenceNumber": 651, + "referenceNumber": 628, "name": "Python License 2.0", "licenseId": "Python-2.0", "seeAlso": [ @@ -6939,7 +7129,7 @@ "reference": "https://spdx.org/licenses/Python-2.0.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Python-2.0.1.json", - "referenceNumber": 290, + "referenceNumber": 586, "name": "Python License 2.0.1", "licenseId": "Python-2.0.1", "seeAlso": [ @@ -6953,7 +7143,7 @@ "reference": "https://spdx.org/licenses/python-ldap.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/python-ldap.json", - "referenceNumber": 531, + "referenceNumber": 630, "name": "Python ldap License", "licenseId": "python-ldap", "seeAlso": [ @@ -6965,7 +7155,7 @@ "reference": "https://spdx.org/licenses/Qhull.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Qhull.json", - "referenceNumber": 435, + "referenceNumber": 590, "name": "Qhull License", "licenseId": "Qhull", "seeAlso": [ @@ -6977,7 +7167,7 @@ "reference": "https://spdx.org/licenses/QPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/QPL-1.0.json", - "referenceNumber": 169, + "referenceNumber": 693, "name": "Q Public License 1.0", "licenseId": "QPL-1.0", "seeAlso": [ @@ -6992,7 +7182,7 @@ "reference": "https://spdx.org/licenses/QPL-1.0-INRIA-2004.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/QPL-1.0-INRIA-2004.json", - "referenceNumber": 461, + "referenceNumber": 117, "name": "Q Public License 1.0 - INRIA 2004 variant", "licenseId": "QPL-1.0-INRIA-2004", "seeAlso": [ @@ -7004,7 +7194,7 @@ "reference": "https://spdx.org/licenses/radvd.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/radvd.json", - "referenceNumber": 425, + "referenceNumber": 678, "name": "radvd License", "licenseId": "radvd", "seeAlso": [ @@ -7016,7 +7206,7 @@ "reference": "https://spdx.org/licenses/Rdisc.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Rdisc.json", - "referenceNumber": 74, + "referenceNumber": 4, "name": "Rdisc License", "licenseId": "Rdisc", "seeAlso": [ @@ -7028,7 +7218,7 @@ "reference": "https://spdx.org/licenses/RHeCos-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RHeCos-1.1.json", - "referenceNumber": 4, + "referenceNumber": 258, "name": "Red Hat eCos Public License v1.1", "licenseId": "RHeCos-1.1", "seeAlso": [ @@ -7041,7 +7231,7 @@ "reference": "https://spdx.org/licenses/RPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RPL-1.1.json", - "referenceNumber": 281, + "referenceNumber": 57, "name": "Reciprocal Public License 1.1", "licenseId": "RPL-1.1", "seeAlso": [ @@ -7053,7 +7243,7 @@ "reference": "https://spdx.org/licenses/RPL-1.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RPL-1.5.json", - "referenceNumber": 677, + "referenceNumber": 413, "name": "Reciprocal Public License 1.5", "licenseId": "RPL-1.5", "seeAlso": [ @@ -7065,7 +7255,7 @@ "reference": "https://spdx.org/licenses/RPSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RPSL-1.0.json", - "referenceNumber": 668, + "referenceNumber": 104, "name": "RealNetworks Public Source License v1.0", "licenseId": "RPSL-1.0", "seeAlso": [ @@ -7079,7 +7269,7 @@ "reference": "https://spdx.org/licenses/RSA-MD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RSA-MD.json", - "referenceNumber": 178, + "referenceNumber": 12, "name": "RSA Message-Digest License", "licenseId": "RSA-MD", "seeAlso": [ @@ -7091,7 +7281,7 @@ "reference": "https://spdx.org/licenses/RSCPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/RSCPL.json", - "referenceNumber": 6, + "referenceNumber": 166, "name": "Ricoh Source Code Public License", "licenseId": "RSCPL", "seeAlso": [ @@ -7104,7 +7294,7 @@ "reference": "https://spdx.org/licenses/Ruby.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Ruby.json", - "referenceNumber": 244, + "referenceNumber": 490, "name": "Ruby License", "licenseId": "Ruby", "seeAlso": [ @@ -7117,7 +7307,7 @@ "reference": "https://spdx.org/licenses/Ruby-pty.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Ruby-pty.json", - "referenceNumber": 558, + "referenceNumber": 509, "name": "Ruby pty extension license", "licenseId": "Ruby-pty", "seeAlso": [ @@ -7131,7 +7321,7 @@ "reference": "https://spdx.org/licenses/SAX-PD.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SAX-PD.json", - "referenceNumber": 166, + "referenceNumber": 22, "name": "Sax Public Domain Notice", "licenseId": "SAX-PD", "seeAlso": [ @@ -7143,7 +7333,7 @@ "reference": "https://spdx.org/licenses/SAX-PD-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SAX-PD-2.0.json", - "referenceNumber": 497, + "referenceNumber": 346, "name": "Sax Public Domain Notice 2.0", "licenseId": "SAX-PD-2.0", "seeAlso": [ @@ -7155,7 +7345,7 @@ "reference": "https://spdx.org/licenses/Saxpath.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Saxpath.json", - "referenceNumber": 298, + "referenceNumber": 390, "name": "Saxpath License", "licenseId": "Saxpath", "seeAlso": [ @@ -7167,7 +7357,7 @@ "reference": "https://spdx.org/licenses/SCEA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SCEA.json", - "referenceNumber": 518, + "referenceNumber": 484, "name": "SCEA Shared Source License", "licenseId": "SCEA", "seeAlso": [ @@ -7179,7 +7369,7 @@ "reference": "https://spdx.org/licenses/SchemeReport.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SchemeReport.json", - "referenceNumber": 339, + "referenceNumber": 91, "name": "Scheme Language Report License", "licenseId": "SchemeReport", "seeAlso": [], @@ -7189,7 +7379,7 @@ "reference": "https://spdx.org/licenses/Sendmail.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sendmail.json", - "referenceNumber": 394, + "referenceNumber": 266, "name": "Sendmail License", "licenseId": "Sendmail", "seeAlso": [ @@ -7202,7 +7392,7 @@ "reference": "https://spdx.org/licenses/Sendmail-8.23.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sendmail-8.23.json", - "referenceNumber": 34, + "referenceNumber": 55, "name": "Sendmail License 8.23", "licenseId": "Sendmail-8.23", "seeAlso": [ @@ -7215,7 +7405,7 @@ "reference": "https://spdx.org/licenses/Sendmail-Open-Source-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sendmail-Open-Source-1.1.json", - "referenceNumber": 317, + "referenceNumber": 620, "name": "Sendmail Open Source License v1.1", "licenseId": "Sendmail-Open-Source-1.1", "seeAlso": [ @@ -7227,7 +7417,7 @@ "reference": "https://spdx.org/licenses/SGI-B-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SGI-B-1.0.json", - "referenceNumber": 515, + "referenceNumber": 56, "name": "SGI Free Software License B v1.0", "licenseId": "SGI-B-1.0", "seeAlso": [ @@ -7239,7 +7429,7 @@ "reference": "https://spdx.org/licenses/SGI-B-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SGI-B-1.1.json", - "referenceNumber": 46, + "referenceNumber": 296, "name": "SGI Free Software License B v1.1", "licenseId": "SGI-B-1.1", "seeAlso": [ @@ -7251,7 +7441,7 @@ "reference": "https://spdx.org/licenses/SGI-B-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SGI-B-2.0.json", - "referenceNumber": 551, + "referenceNumber": 617, "name": "SGI Free Software License B v2.0", "licenseId": "SGI-B-2.0", "seeAlso": [ @@ -7264,7 +7454,7 @@ "reference": "https://spdx.org/licenses/SGI-OpenGL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SGI-OpenGL.json", - "referenceNumber": 73, + "referenceNumber": 34, "name": "SGI OpenGL License", "licenseId": "SGI-OpenGL", "seeAlso": [ @@ -7276,7 +7466,7 @@ "reference": "https://spdx.org/licenses/SGP4.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SGP4.json", - "referenceNumber": 24, + "referenceNumber": 572, "name": "SGP4 Permission Notice", "licenseId": "SGP4", "seeAlso": [ @@ -7288,7 +7478,7 @@ "reference": "https://spdx.org/licenses/SHL-0.5.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SHL-0.5.json", - "referenceNumber": 159, + "referenceNumber": 267, "name": "Solderpad Hardware License v0.5", "licenseId": "SHL-0.5", "seeAlso": [ @@ -7300,7 +7490,7 @@ "reference": "https://spdx.org/licenses/SHL-0.51.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SHL-0.51.json", - "referenceNumber": 522, + "referenceNumber": 582, "name": "Solderpad Hardware License, Version 0.51", "licenseId": "SHL-0.51", "seeAlso": [ @@ -7312,7 +7502,7 @@ "reference": "https://spdx.org/licenses/SimPL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SimPL-2.0.json", - "referenceNumber": 560, + "referenceNumber": 452, "name": "Simple Public License 2.0", "licenseId": "SimPL-2.0", "seeAlso": [ @@ -7324,7 +7514,7 @@ "reference": "https://spdx.org/licenses/SISSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SISSL.json", - "referenceNumber": 349, + "referenceNumber": 110, "name": "Sun Industry Standards Source License v1.1", "licenseId": "SISSL", "seeAlso": [ @@ -7338,7 +7528,7 @@ "reference": "https://spdx.org/licenses/SISSL-1.2.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SISSL-1.2.json", - "referenceNumber": 670, + "referenceNumber": 253, "name": "Sun Industry Standards Source License v1.2", "licenseId": "SISSL-1.2", "seeAlso": [ @@ -7350,7 +7540,7 @@ "reference": "https://spdx.org/licenses/SL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SL.json", - "referenceNumber": 295, + "referenceNumber": 83, "name": "SL License", "licenseId": "SL", "seeAlso": [ @@ -7362,7 +7552,7 @@ "reference": "https://spdx.org/licenses/Sleepycat.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sleepycat.json", - "referenceNumber": 120, + "referenceNumber": 42, "name": "Sleepycat License", "licenseId": "Sleepycat", "seeAlso": [ @@ -7375,7 +7565,7 @@ "reference": "https://spdx.org/licenses/SMAIL-GPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SMAIL-GPL.json", - "referenceNumber": 485, + "referenceNumber": 546, "name": "SMAIL General Public License", "licenseId": "SMAIL-GPL", "seeAlso": [ @@ -7387,7 +7577,7 @@ "reference": "https://spdx.org/licenses/SMLNJ.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SMLNJ.json", - "referenceNumber": 506, + "referenceNumber": 81, "name": "Standard ML of New Jersey License", "licenseId": "SMLNJ", "seeAlso": [ @@ -7400,7 +7590,7 @@ "reference": "https://spdx.org/licenses/SMPPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SMPPL.json", - "referenceNumber": 325, + "referenceNumber": 579, "name": "Secure Messaging Protocol Public License", "licenseId": "SMPPL", "seeAlso": [ @@ -7412,7 +7602,7 @@ "reference": "https://spdx.org/licenses/SNIA.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SNIA.json", - "referenceNumber": 92, + "referenceNumber": 224, "name": "SNIA Public License 1.1", "licenseId": "SNIA", "seeAlso": [ @@ -7424,7 +7614,7 @@ "reference": "https://spdx.org/licenses/snprintf.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/snprintf.json", - "referenceNumber": 604, + "referenceNumber": 594, "name": "snprintf License", "licenseId": "snprintf", "seeAlso": [ @@ -7432,11 +7622,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/SOFA.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SOFA.json", + "referenceNumber": 375, + "name": "SOFA Software License", + "licenseId": "SOFA", + "seeAlso": [ + "http://www.iausofa.org/tandc.html" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/softSurfer.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/softSurfer.json", - "referenceNumber": 96, + "referenceNumber": 593, "name": "softSurfer License", "licenseId": "softSurfer", "seeAlso": [ @@ -7449,7 +7651,7 @@ "reference": "https://spdx.org/licenses/Soundex.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Soundex.json", - "referenceNumber": 65, + "referenceNumber": 374, "name": "Soundex License", "licenseId": "Soundex", "seeAlso": [ @@ -7461,7 +7663,7 @@ "reference": "https://spdx.org/licenses/Spencer-86.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Spencer-86.json", - "referenceNumber": 21, + "referenceNumber": 193, "name": "Spencer License 86", "licenseId": "Spencer-86", "seeAlso": [ @@ -7473,7 +7675,7 @@ "reference": "https://spdx.org/licenses/Spencer-94.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Spencer-94.json", - "referenceNumber": 472, + "referenceNumber": 451, "name": "Spencer License 94", "licenseId": "Spencer-94", "seeAlso": [ @@ -7486,7 +7688,7 @@ "reference": "https://spdx.org/licenses/Spencer-99.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Spencer-99.json", - "referenceNumber": 432, + "referenceNumber": 220, "name": "Spencer License 99", "licenseId": "Spencer-99", "seeAlso": [ @@ -7498,7 +7700,7 @@ "reference": "https://spdx.org/licenses/SPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SPL-1.0.json", - "referenceNumber": 487, + "referenceNumber": 342, "name": "Sun Public License v1.0", "licenseId": "SPL-1.0", "seeAlso": [ @@ -7511,7 +7713,7 @@ "reference": "https://spdx.org/licenses/ssh-keyscan.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ssh-keyscan.json", - "referenceNumber": 431, + "referenceNumber": 537, "name": "ssh-keyscan License", "licenseId": "ssh-keyscan", "seeAlso": [ @@ -7523,7 +7725,7 @@ "reference": "https://spdx.org/licenses/SSH-OpenSSH.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SSH-OpenSSH.json", - "referenceNumber": 68, + "referenceNumber": 463, "name": "SSH OpenSSH license", "licenseId": "SSH-OpenSSH", "seeAlso": [ @@ -7535,7 +7737,7 @@ "reference": "https://spdx.org/licenses/SSH-short.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SSH-short.json", - "referenceNumber": 170, + "referenceNumber": 573, "name": "SSH short notice", "licenseId": "SSH-short", "seeAlso": [ @@ -7549,7 +7751,7 @@ "reference": "https://spdx.org/licenses/SSLeay-standalone.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SSLeay-standalone.json", - "referenceNumber": 53, + "referenceNumber": 96, "name": "SSLeay License - standalone", "licenseId": "SSLeay-standalone", "seeAlso": [ @@ -7561,7 +7763,7 @@ "reference": "https://spdx.org/licenses/SSPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SSPL-1.0.json", - "referenceNumber": 631, + "referenceNumber": 664, "name": "Server Side Public License, v 1", "licenseId": "SSPL-1.0", "seeAlso": [ @@ -7573,7 +7775,7 @@ "reference": "https://spdx.org/licenses/StandardML-NJ.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/StandardML-NJ.json", - "referenceNumber": 280, + "referenceNumber": 501, "name": "Standard ML of New Jersey License", "licenseId": "StandardML-NJ", "seeAlso": [ @@ -7586,7 +7788,7 @@ "reference": "https://spdx.org/licenses/SugarCRM-1.1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SugarCRM-1.1.3.json", - "referenceNumber": 128, + "referenceNumber": 222, "name": "SugarCRM Public License v1.1.3", "licenseId": "SugarCRM-1.1.3", "seeAlso": [ @@ -7594,11 +7796,23 @@ ], "isOsiApproved": false }, + { + "reference": "https://spdx.org/licenses/SUL-1.0.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/SUL-1.0.json", + "referenceNumber": 557, + "name": "Sustainable Use License v1.0", + "licenseId": "SUL-1.0", + "seeAlso": [ + "https://github.com/n8n-io/n8n/blob/master/LICENSE.md" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/Sun-PPP.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sun-PPP.json", - "referenceNumber": 541, + "referenceNumber": 39, "name": "Sun PPP License", "licenseId": "Sun-PPP", "seeAlso": [ @@ -7610,7 +7824,7 @@ "reference": "https://spdx.org/licenses/Sun-PPP-2000.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Sun-PPP-2000.json", - "referenceNumber": 514, + "referenceNumber": 70, "name": "Sun PPP License (2000)", "licenseId": "Sun-PPP-2000", "seeAlso": [ @@ -7622,7 +7836,7 @@ "reference": "https://spdx.org/licenses/SunPro.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SunPro.json", - "referenceNumber": 237, + "referenceNumber": 395, "name": "SunPro License", "licenseId": "SunPro", "seeAlso": [ @@ -7635,7 +7849,7 @@ "reference": "https://spdx.org/licenses/SWL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/SWL.json", - "referenceNumber": 655, + "referenceNumber": 196, "name": "Scheme Widget Library (SWL) Software License Agreement", "licenseId": "SWL", "seeAlso": [ @@ -7647,7 +7861,7 @@ "reference": "https://spdx.org/licenses/swrule.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/swrule.json", - "referenceNumber": 283, + "referenceNumber": 348, "name": "swrule License", "licenseId": "swrule", "seeAlso": [ @@ -7659,7 +7873,7 @@ "reference": "https://spdx.org/licenses/Symlinks.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Symlinks.json", - "referenceNumber": 557, + "referenceNumber": 517, "name": "Symlinks License", "licenseId": "Symlinks", "seeAlso": [ @@ -7671,7 +7885,7 @@ "reference": "https://spdx.org/licenses/TAPR-OHL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TAPR-OHL-1.0.json", - "referenceNumber": 252, + "referenceNumber": 80, "name": "TAPR Open Hardware License v1.0", "licenseId": "TAPR-OHL-1.0", "seeAlso": [ @@ -7683,7 +7897,7 @@ "reference": "https://spdx.org/licenses/TCL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TCL.json", - "referenceNumber": 576, + "referenceNumber": 625, "name": "TCL/TK License", "licenseId": "TCL", "seeAlso": [ @@ -7696,7 +7910,7 @@ "reference": "https://spdx.org/licenses/TCP-wrappers.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TCP-wrappers.json", - "referenceNumber": 126, + "referenceNumber": 278, "name": "TCP Wrappers License", "licenseId": "TCP-wrappers", "seeAlso": [ @@ -7708,7 +7922,7 @@ "reference": "https://spdx.org/licenses/TermReadKey.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TermReadKey.json", - "referenceNumber": 642, + "referenceNumber": 619, "name": "TermReadKey License", "licenseId": "TermReadKey", "seeAlso": [ @@ -7720,7 +7934,7 @@ "reference": "https://spdx.org/licenses/TGPPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TGPPL-1.0.json", - "referenceNumber": 603, + "referenceNumber": 142, "name": "Transitive Grace Period Public Licence 1.0", "licenseId": "TGPPL-1.0", "seeAlso": [ @@ -7733,7 +7947,7 @@ "reference": "https://spdx.org/licenses/ThirdEye.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ThirdEye.json", - "referenceNumber": 320, + "referenceNumber": 403, "name": "ThirdEye License", "licenseId": "ThirdEye", "seeAlso": [ @@ -7745,7 +7959,7 @@ "reference": "https://spdx.org/licenses/threeparttable.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/threeparttable.json", - "referenceNumber": 364, + "referenceNumber": 14, "name": "threeparttable License", "licenseId": "threeparttable", "seeAlso": [ @@ -7757,7 +7971,7 @@ "reference": "https://spdx.org/licenses/TMate.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TMate.json", - "referenceNumber": 164, + "referenceNumber": 176, "name": "TMate Open Source License", "licenseId": "TMate", "seeAlso": [ @@ -7769,7 +7983,7 @@ "reference": "https://spdx.org/licenses/TORQUE-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TORQUE-1.1.json", - "referenceNumber": 498, + "referenceNumber": 214, "name": "TORQUE v2.5+ Software License v1.1", "licenseId": "TORQUE-1.1", "seeAlso": [ @@ -7781,7 +7995,7 @@ "reference": "https://spdx.org/licenses/TOSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TOSL.json", - "referenceNumber": 640, + "referenceNumber": 416, "name": "Trusster Open Source License", "licenseId": "TOSL", "seeAlso": [ @@ -7793,7 +8007,7 @@ "reference": "https://spdx.org/licenses/TPDL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TPDL.json", - "referenceNumber": 443, + "referenceNumber": 666, "name": "Time::ParseDate License", "licenseId": "TPDL", "seeAlso": [ @@ -7805,7 +8019,7 @@ "reference": "https://spdx.org/licenses/TPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TPL-1.0.json", - "referenceNumber": 251, + "referenceNumber": 540, "name": "THOR Public License 1.0", "licenseId": "TPL-1.0", "seeAlso": [ @@ -7817,7 +8031,7 @@ "reference": "https://spdx.org/licenses/TrustedQSL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TrustedQSL.json", - "referenceNumber": 396, + "referenceNumber": 37, "name": "TrustedQSL License", "licenseId": "TrustedQSL", "seeAlso": [ @@ -7829,7 +8043,7 @@ "reference": "https://spdx.org/licenses/TTWL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TTWL.json", - "referenceNumber": 106, + "referenceNumber": 598, "name": "Text-Tabs+Wrap License", "licenseId": "TTWL", "seeAlso": [ @@ -7842,7 +8056,7 @@ "reference": "https://spdx.org/licenses/TTYP0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TTYP0.json", - "referenceNumber": 336, + "referenceNumber": 236, "name": "TTYP0 License", "licenseId": "TTYP0", "seeAlso": [ @@ -7854,7 +8068,7 @@ "reference": "https://spdx.org/licenses/TU-Berlin-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TU-Berlin-1.0.json", - "referenceNumber": 296, + "referenceNumber": 106, "name": "Technische Universitaet Berlin License 1.0", "licenseId": "TU-Berlin-1.0", "seeAlso": [ @@ -7866,7 +8080,7 @@ "reference": "https://spdx.org/licenses/TU-Berlin-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/TU-Berlin-2.0.json", - "referenceNumber": 499, + "referenceNumber": 669, "name": "Technische Universitaet Berlin License 2.0", "licenseId": "TU-Berlin-2.0", "seeAlso": [ @@ -7878,7 +8092,7 @@ "reference": "https://spdx.org/licenses/Ubuntu-font-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Ubuntu-font-1.0.json", - "referenceNumber": 72, + "referenceNumber": 268, "name": "Ubuntu Font Licence v1.0", "licenseId": "Ubuntu-font-1.0", "seeAlso": [ @@ -7891,7 +8105,7 @@ "reference": "https://spdx.org/licenses/UCAR.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UCAR.json", - "referenceNumber": 559, + "referenceNumber": 353, "name": "UCAR License", "licenseId": "UCAR", "seeAlso": [ @@ -7903,7 +8117,7 @@ "reference": "https://spdx.org/licenses/UCL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UCL-1.0.json", - "referenceNumber": 619, + "referenceNumber": 611, "name": "Upstream Compatibility License v1.0", "licenseId": "UCL-1.0", "seeAlso": [ @@ -7915,7 +8129,7 @@ "reference": "https://spdx.org/licenses/ulem.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ulem.json", - "referenceNumber": 495, + "referenceNumber": 514, "name": "ulem License", "licenseId": "ulem", "seeAlso": [ @@ -7927,7 +8141,7 @@ "reference": "https://spdx.org/licenses/UMich-Merit.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UMich-Merit.json", - "referenceNumber": 225, + "referenceNumber": 48, "name": "Michigan/Merit Networks License", "licenseId": "UMich-Merit", "seeAlso": [ @@ -7939,7 +8153,7 @@ "reference": "https://spdx.org/licenses/Unicode-3.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Unicode-3.0.json", - "referenceNumber": 447, + "referenceNumber": 308, "name": "Unicode License v3", "licenseId": "Unicode-3.0", "seeAlso": [ @@ -7951,7 +8165,7 @@ "reference": "https://spdx.org/licenses/Unicode-DFS-2015.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Unicode-DFS-2015.json", - "referenceNumber": 125, + "referenceNumber": 254, "name": "Unicode License Agreement - Data Files and Software (2015)", "licenseId": "Unicode-DFS-2015", "seeAlso": [ @@ -7963,7 +8177,7 @@ "reference": "https://spdx.org/licenses/Unicode-DFS-2016.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Unicode-DFS-2016.json", - "referenceNumber": 665, + "referenceNumber": 309, "name": "Unicode License Agreement - Data Files and Software (2016)", "licenseId": "Unicode-DFS-2016", "seeAlso": [ @@ -7977,7 +8191,7 @@ "reference": "https://spdx.org/licenses/Unicode-TOU.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Unicode-TOU.json", - "referenceNumber": 574, + "referenceNumber": 115, "name": "Unicode Terms of Use", "licenseId": "Unicode-TOU", "seeAlso": [ @@ -7990,7 +8204,7 @@ "reference": "https://spdx.org/licenses/UnixCrypt.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UnixCrypt.json", - "referenceNumber": 253, + "referenceNumber": 180, "name": "UnixCrypt License", "licenseId": "UnixCrypt", "seeAlso": [ @@ -8004,7 +8218,7 @@ "reference": "https://spdx.org/licenses/Unlicense.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Unlicense.json", - "referenceNumber": 150, + "referenceNumber": 337, "name": "The Unlicense", "licenseId": "Unlicense", "seeAlso": [ @@ -8013,11 +8227,35 @@ "isOsiApproved": true, "isFsfLibre": true }, + { + "reference": "https://spdx.org/licenses/Unlicense-libtelnet.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unlicense-libtelnet.json", + "referenceNumber": 113, + "name": "Unlicense - libtelnet variant", + "licenseId": "Unlicense-libtelnet", + "seeAlso": [ + "https://github.com/seanmiddleditch/libtelnet/blob/develop/COPYING" + ], + "isOsiApproved": false + }, + { + "reference": "https://spdx.org/licenses/Unlicense-libwhirlpool.html", + "isDeprecatedLicenseId": false, + "detailsUrl": "https://spdx.org/licenses/Unlicense-libwhirlpool.json", + "referenceNumber": 565, + "name": "Unlicense - libwhirlpool variant", + "licenseId": "Unlicense-libwhirlpool", + "seeAlso": [ + "https://github.com/dfateyev/libwhirlpool/blob/master/README#L27" + ], + "isOsiApproved": false + }, { "reference": "https://spdx.org/licenses/UPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/UPL-1.0.json", - "referenceNumber": 342, + "referenceNumber": 88, "name": "Universal Permissive License v1.0", "licenseId": "UPL-1.0", "seeAlso": [ @@ -8030,7 +8268,7 @@ "reference": "https://spdx.org/licenses/URT-RLE.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/URT-RLE.json", - "referenceNumber": 526, + "referenceNumber": 380, "name": "Utah Raster Toolkit Run Length Encoded License", "licenseId": "URT-RLE", "seeAlso": [ @@ -8043,7 +8281,7 @@ "reference": "https://spdx.org/licenses/Vim.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Vim.json", - "referenceNumber": 28, + "referenceNumber": 327, "name": "Vim License", "licenseId": "Vim", "seeAlso": [ @@ -8056,7 +8294,7 @@ "reference": "https://spdx.org/licenses/VOSTROM.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/VOSTROM.json", - "referenceNumber": 439, + "referenceNumber": 575, "name": "VOSTROM Public License for Open Source", "licenseId": "VOSTROM", "seeAlso": [ @@ -8068,7 +8306,7 @@ "reference": "https://spdx.org/licenses/VSL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/VSL-1.0.json", - "referenceNumber": 238, + "referenceNumber": 562, "name": "Vovida Software License v1.0", "licenseId": "VSL-1.0", "seeAlso": [ @@ -8080,7 +8318,7 @@ "reference": "https://spdx.org/licenses/W3C.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/W3C.json", - "referenceNumber": 216, + "referenceNumber": 479, "name": "W3C Software Notice and License (2002-12-31)", "licenseId": "W3C", "seeAlso": [ @@ -8094,7 +8332,7 @@ "reference": "https://spdx.org/licenses/W3C-19980720.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/W3C-19980720.json", - "referenceNumber": 206, + "referenceNumber": 365, "name": "W3C Software Notice and License (1998-07-20)", "licenseId": "W3C-19980720", "seeAlso": [ @@ -8106,7 +8344,7 @@ "reference": "https://spdx.org/licenses/W3C-20150513.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/W3C-20150513.json", - "referenceNumber": 375, + "referenceNumber": 295, "name": "W3C Software Notice and Document License (2015-05-13)", "licenseId": "W3C-20150513", "seeAlso": [ @@ -8120,7 +8358,7 @@ "reference": "https://spdx.org/licenses/w3m.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/w3m.json", - "referenceNumber": 82, + "referenceNumber": 141, "name": "w3m License", "licenseId": "w3m", "seeAlso": [ @@ -8132,7 +8370,7 @@ "reference": "https://spdx.org/licenses/Watcom-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Watcom-1.0.json", - "referenceNumber": 322, + "referenceNumber": 527, "name": "Sybase Open Watcom Public License 1.0", "licenseId": "Watcom-1.0", "seeAlso": [ @@ -8145,7 +8383,7 @@ "reference": "https://spdx.org/licenses/Widget-Workshop.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Widget-Workshop.json", - "referenceNumber": 647, + "referenceNumber": 522, "name": "Widget Workshop License", "licenseId": "Widget-Workshop", "seeAlso": [ @@ -8157,7 +8395,7 @@ "reference": "https://spdx.org/licenses/Wsuipa.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Wsuipa.json", - "referenceNumber": 399, + "referenceNumber": 564, "name": "Wsuipa License", "licenseId": "Wsuipa", "seeAlso": [ @@ -8169,7 +8407,7 @@ "reference": "https://spdx.org/licenses/WTFPL.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/WTFPL.json", - "referenceNumber": 234, + "referenceNumber": 418, "name": "Do What The F*ck You Want To Public License", "licenseId": "WTFPL", "seeAlso": [ @@ -8183,7 +8421,7 @@ "reference": "https://spdx.org/licenses/wwl.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/wwl.json", - "referenceNumber": 114, + "referenceNumber": 627, "name": "WWL License", "licenseId": "wwl", "seeAlso": [ @@ -8195,7 +8433,7 @@ "reference": "https://spdx.org/licenses/wxWindows.html", "isDeprecatedLicenseId": true, "detailsUrl": "https://spdx.org/licenses/wxWindows.json", - "referenceNumber": 147, + "referenceNumber": 431, "name": "wxWindows Library License", "licenseId": "wxWindows", "seeAlso": [ @@ -8207,7 +8445,7 @@ "reference": "https://spdx.org/licenses/X11.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/X11.json", - "referenceNumber": 309, + "referenceNumber": 0, "name": "X11 License", "licenseId": "X11", "seeAlso": [ @@ -8220,7 +8458,7 @@ "reference": "https://spdx.org/licenses/X11-distribute-modifications-variant.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/X11-distribute-modifications-variant.json", - "referenceNumber": 307, + "referenceNumber": 302, "name": "X11 License Distribution Modification Variant", "licenseId": "X11-distribute-modifications-variant", "seeAlso": [ @@ -8232,7 +8470,7 @@ "reference": "https://spdx.org/licenses/X11-swapped.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/X11-swapped.json", - "referenceNumber": 158, + "referenceNumber": 248, "name": "X11 swapped final paragraphs", "licenseId": "X11-swapped", "seeAlso": [ @@ -8244,7 +8482,7 @@ "reference": "https://spdx.org/licenses/Xdebug-1.03.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Xdebug-1.03.json", - "referenceNumber": 408, + "referenceNumber": 109, "name": "Xdebug License v 1.03", "licenseId": "Xdebug-1.03", "seeAlso": [ @@ -8256,7 +8494,7 @@ "reference": "https://spdx.org/licenses/Xerox.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Xerox.json", - "referenceNumber": 577, + "referenceNumber": 615, "name": "Xerox License", "licenseId": "Xerox", "seeAlso": [ @@ -8268,7 +8506,7 @@ "reference": "https://spdx.org/licenses/Xfig.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Xfig.json", - "referenceNumber": 426, + "referenceNumber": 125, "name": "Xfig License", "licenseId": "Xfig", "seeAlso": [ @@ -8282,7 +8520,7 @@ "reference": "https://spdx.org/licenses/XFree86-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/XFree86-1.1.json", - "referenceNumber": 47, + "referenceNumber": 646, "name": "XFree86 License 1.1", "licenseId": "XFree86-1.1", "seeAlso": [ @@ -8295,7 +8533,7 @@ "reference": "https://spdx.org/licenses/xinetd.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/xinetd.json", - "referenceNumber": 415, + "referenceNumber": 93, "name": "xinetd License", "licenseId": "xinetd", "seeAlso": [ @@ -8308,7 +8546,7 @@ "reference": "https://spdx.org/licenses/xkeyboard-config-Zinoviev.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/xkeyboard-config-Zinoviev.json", - "referenceNumber": 451, + "referenceNumber": 212, "name": "xkeyboard-config Zinoviev License", "licenseId": "xkeyboard-config-Zinoviev", "seeAlso": [ @@ -8320,7 +8558,7 @@ "reference": "https://spdx.org/licenses/xlock.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/xlock.json", - "referenceNumber": 516, + "referenceNumber": 362, "name": "xlock License", "licenseId": "xlock", "seeAlso": [ @@ -8332,7 +8570,7 @@ "reference": "https://spdx.org/licenses/Xnet.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Xnet.json", - "referenceNumber": 367, + "referenceNumber": 470, "name": "X.Net License", "licenseId": "Xnet", "seeAlso": [ @@ -8344,7 +8582,7 @@ "reference": "https://spdx.org/licenses/xpp.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/xpp.json", - "referenceNumber": 36, + "referenceNumber": 290, "name": "XPP License", "licenseId": "xpp", "seeAlso": [ @@ -8356,7 +8594,7 @@ "reference": "https://spdx.org/licenses/XSkat.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/XSkat.json", - "referenceNumber": 145, + "referenceNumber": 293, "name": "XSkat License", "licenseId": "XSkat", "seeAlso": [ @@ -8368,7 +8606,7 @@ "reference": "https://spdx.org/licenses/xzoom.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/xzoom.json", - "referenceNumber": 644, + "referenceNumber": 90, "name": "xzoom License", "licenseId": "xzoom", "seeAlso": [ @@ -8380,7 +8618,7 @@ "reference": "https://spdx.org/licenses/YPL-1.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/YPL-1.0.json", - "referenceNumber": 549, + "referenceNumber": 294, "name": "Yahoo! Public License v1.0", "licenseId": "YPL-1.0", "seeAlso": [ @@ -8392,7 +8630,7 @@ "reference": "https://spdx.org/licenses/YPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/YPL-1.1.json", - "referenceNumber": 654, + "referenceNumber": 481, "name": "Yahoo! Public License v1.1", "licenseId": "YPL-1.1", "seeAlso": [ @@ -8405,7 +8643,7 @@ "reference": "https://spdx.org/licenses/Zed.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zed.json", - "referenceNumber": 513, + "referenceNumber": 189, "name": "Zed License", "licenseId": "Zed", "seeAlso": [ @@ -8417,7 +8655,7 @@ "reference": "https://spdx.org/licenses/Zeeff.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zeeff.json", - "referenceNumber": 384, + "referenceNumber": 551, "name": "Zeeff License", "licenseId": "Zeeff", "seeAlso": [ @@ -8429,7 +8667,7 @@ "reference": "https://spdx.org/licenses/Zend-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zend-2.0.json", - "referenceNumber": 334, + "referenceNumber": 444, "name": "Zend License v2.0", "licenseId": "Zend-2.0", "seeAlso": [ @@ -8442,7 +8680,7 @@ "reference": "https://spdx.org/licenses/Zimbra-1.3.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zimbra-1.3.json", - "referenceNumber": 450, + "referenceNumber": 26, "name": "Zimbra Public License v1.3", "licenseId": "Zimbra-1.3", "seeAlso": [ @@ -8455,7 +8693,7 @@ "reference": "https://spdx.org/licenses/Zimbra-1.4.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zimbra-1.4.json", - "referenceNumber": 257, + "referenceNumber": 330, "name": "Zimbra Public License v1.4", "licenseId": "Zimbra-1.4", "seeAlso": [ @@ -8467,7 +8705,7 @@ "reference": "https://spdx.org/licenses/Zlib.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/Zlib.json", - "referenceNumber": 567, + "referenceNumber": 421, "name": "zlib License", "licenseId": "Zlib", "seeAlso": [ @@ -8481,7 +8719,7 @@ "reference": "https://spdx.org/licenses/zlib-acknowledgement.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/zlib-acknowledgement.json", - "referenceNumber": 12, + "referenceNumber": 188, "name": "zlib/libpng License with Acknowledgement", "licenseId": "zlib-acknowledgement", "seeAlso": [ @@ -8493,7 +8731,7 @@ "reference": "https://spdx.org/licenses/ZPL-1.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ZPL-1.1.json", - "referenceNumber": 314, + "referenceNumber": 597, "name": "Zope Public License 1.1", "licenseId": "ZPL-1.1", "seeAlso": [ @@ -8505,7 +8743,7 @@ "reference": "https://spdx.org/licenses/ZPL-2.0.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ZPL-2.0.json", - "referenceNumber": 623, + "referenceNumber": 555, "name": "Zope Public License 2.0", "licenseId": "ZPL-2.0", "seeAlso": [ @@ -8519,7 +8757,7 @@ "reference": "https://spdx.org/licenses/ZPL-2.1.html", "isDeprecatedLicenseId": false, "detailsUrl": "https://spdx.org/licenses/ZPL-2.1.json", - "referenceNumber": 110, + "referenceNumber": 272, "name": "Zope Public License 2.1", "licenseId": "ZPL-2.1", "seeAlso": [ @@ -8529,5 +8767,5 @@ "isFsfLibre": true } ], - "releaseDate": "2024-12-30T00:00:00Z" + "releaseDate": "2025-07-01T00:00:00Z" } \ No newline at end of file diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb index a18f892225..6f2ed6c8ed 100644 --- a/Library/Homebrew/debrew/irb.rb +++ b/Library/Homebrew/debrew/irb.rb @@ -1,13 +1,15 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "irb" module IRB + sig { params(binding: Binding).void } def self.start_within(binding) old_stdout_sync = $stdout.sync $stdout.sync = true + @setup_done ||= T.let(false, T.nilable(T::Boolean)) unless @setup_done setup(nil, argv: []) @setup_done = true diff --git a/Library/Homebrew/dependencies.rbi b/Library/Homebrew/dependencies.rbi index 29a8508c06..5cdc3fcad4 100644 --- a/Library/Homebrew/dependencies.rbi +++ b/Library/Homebrew/dependencies.rbi @@ -13,8 +13,8 @@ class Dependencies < SimpleDelegator sig { returns(T::Enumerator[Dependency]) } def each(&blk); end - sig { params(blk: T.proc.params(arg0: Dependency).returns(T::Boolean)).returns(T::Array[Dependency]) } - sig { returns(T::Enumerator[Dependency]) } + sig { override.params(blk: T.proc.params(arg0: Dependency).returns(T.anything)).returns(T::Array[Dependency]) } + sig { override.returns(T::Enumerator[Dependency]) } def select(&blk); end end @@ -26,7 +26,7 @@ class Requirements < SimpleDelegator sig { returns(T::Enumerator[Requirement]) } def each(&blk); end - sig { params(blk: T.proc.params(arg0: Requirement).returns(T::Boolean)).returns(T::Array[Requirement]) } - sig { returns(T::Enumerator[Requirement]) } + sig { override.params(blk: T.proc.params(arg0: Requirement).returns(T.anything)).returns(T::Array[Requirement]) } + sig { override.returns(T::Enumerator[Requirement]) } def select(&blk); end end diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 6420504515..cddae5fcdc 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -5,7 +5,7 @@ require "dependency" require "dependencies" require "requirement" require "requirements" -require "extend/cachable" +require "cachable" # A dependency is a formula that another formula needs to install. # A requirement is something other than a formula that another formula diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 24e69cb463..1563b1b953 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -42,8 +42,8 @@ module Homebrew switch "--installed", description: "Only check formulae and casks that are currently installed." switch "--eval-all", - description: "Evaluate all available formulae and casks, whether installed or not, to audit them. " \ - "Implied if `HOMEBREW_EVAL_ALL` is set." + description: "Evaluate all available formulae and casks, whether installed or not, to audit them.", + env: :eval_all switch "--new", description: "Run various additional style checks to determine if a new formula or cask is eligible " \ "for Homebrew. This should be used when creating new formulae or casks and implies " \ @@ -58,8 +58,10 @@ module Homebrew hidden: true switch "--[no-]signing", description: "Audit for app signatures, which are required by macOS on ARM." + # should be odeprecated in future switch "--token-conflicts", - description: "Audit for token conflicts." + description: "Audit for token conflicts.", + hidden: true flag "--tap=", description: "Check formulae and casks within the given tap, specified as `/`." switch "--fix", @@ -135,15 +137,17 @@ module Homebrew no_named_args = true [Formula.installed, Cask::Caskroom.casks] elsif args.no_named? - if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + eval_all = args.eval_all? + + unless eval_all # This odisabled should probably stick around indefinitely. odisabled "brew audit", "brew audit --eval-all or HOMEBREW_EVAL_ALL" end no_named_args = true [ - Formula.all(eval_all: args.eval_all?), - Cask::Cask.all(eval_all: args.eval_all?), + Formula.all(eval_all:), + Cask::Cask.all(eval_all:), ] else if args.named.any? { |named_arg| named_arg.end_with?(".rb") } @@ -251,18 +255,17 @@ module Homebrew # For switches, we add `|| nil` so that `nil` will be passed # instead of `false` if they aren't set. # This way, we can distinguish between "not set" and "set to false". - audit_online: args.online? || nil, - audit_strict: args.strict? || nil, + audit_online: args.online? || nil, + audit_strict: args.strict? || nil, # No need for `|| nil` for `--[no-]signing` # because boolean switches are already `nil` if not passed - audit_signing: args.signing?, - audit_new_cask: args.new? || nil, - audit_token_conflicts: args.token_conflicts? || nil, - quarantine: true, - any_named_args: !no_named_args, - only: args.only || [], - except: args.except || [], + audit_signing: args.signing?, + audit_new_cask: args.new? || nil, + quarantine: true, + any_named_args: !no_named_args, + only: args.only || [], + except: args.except || [], ).to_a end end.uniq diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 04307077bc..cb24586918 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -227,7 +227,7 @@ module Homebrew private sig { - params(string: String, keg: Keg, ignores: T::Array[String], + params(string: String, keg: Keg, ignores: T::Array[Regexp], formula_and_runtime_deps_names: T.nilable(T::Array[String])).returns(T::Boolean) } def keg_contain?(string, keg, ignores, formula_and_runtime_deps_names = nil) @@ -373,35 +373,17 @@ module Homebrew [gnu_tar(gnu_tar_formula), reproducible_gnutar_args(mtime)].freeze end - sig { params(formula: T.untyped).returns(T::Array[T.untyped]) } + sig { params(formula: Formula).returns(T::Array[Regexp]) } def formula_ignores(formula) - ignores = [] - cellar_regex = Regexp.escape(HOMEBREW_CELLAR) - prefix_regex = Regexp.escape(HOMEBREW_PREFIX) - # Ignore matches to go keg, because all go binaries are statically linked. any_go_deps = formula.deps.any? do |dep| Version.formula_optionally_versioned_regex(:go).match?(dep.name) end - if any_go_deps - go_regex = Version.formula_optionally_versioned_regex(:go, full: false) - ignores << %r{#{cellar_regex}/#{go_regex}/[\d.]+/libexec} - end + return [] unless any_go_deps - # TODO: Refactor and move to extend/os - # rubocop:disable Homebrew/MoveToExtendOS - ignores << case formula.name - # On Linux, GCC installation can be moved so long as the whole directory tree is moved together: - # https://gcc-help.gcc.gnu.narkive.com/GnwuCA7l/moving-gcc-from-the-installation-path-is-it-allowed. - when Version.formula_optionally_versioned_regex(:gcc) - Regexp.union(%r{#{cellar_regex}/gcc}, %r{#{prefix_regex}/opt/gcc}) if OS.linux? - # binutils is relocatable for the same reason: https://github.com/Homebrew/brew/pull/11899#issuecomment-906804451. - when Version.formula_optionally_versioned_regex(:binutils) - %r{#{cellar_regex}/binutils} if OS.linux? - end - # rubocop:enable Homebrew/MoveToExtendOS - - ignores.compact + cellar_regex = Regexp.escape(HOMEBREW_CELLAR) + go_regex = Version.formula_optionally_versioned_regex(:go, full: false) + Array(%r{#{cellar_regex}/#{go_regex}/[\d.]+/libexec}) end sig { params(formula: Formula).void } @@ -693,7 +675,7 @@ module Homebrew "filename" => filename.url_encode, "local_filename" => filename.to_s, "sha256" => sha256, - "tab" => tab.to_bottle_hash, + "tab" => T.must(tab).to_bottle_hash, "path_exec_files" => path_exec_files, "all_files" => all_files, "installed_size" => installed_size, @@ -741,7 +723,7 @@ module Homebrew all_bottle = !args.no_all_checks? && (!old_bottle_spec_matches || bottle.rebuild != old_bottle_spec.rebuild) && tag_hashes.count > 1 && - tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.count == 1 + tag_hashes.uniq { |tag_hash| "#{tag_hash["cellar"]}-#{tag_hash["sha256"]}" }.one? old_all_bottle = old_bottle_spec.tag?(Utils::Bottles.tag(:all)) if !all_bottle && old_all_bottle && !args.no_all_checks? diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index bcf3cb866a..e7ce29cc99 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -49,7 +49,6 @@ module Homebrew description: "Use the specified GitHub organization for forking." conflicts "--dry-run", "--write" - conflicts "--no-audit", "--online" conflicts "--version=", "--version-arm=" conflicts "--version=", "--version-intel=" @@ -85,7 +84,9 @@ module Homebrew method or 'livecheck' block with 'skip'.) EOS - odie "You have too many PRs open: close or merge some first!" if GitHub.too_many_open_prs?(cask.tap) + if !args.write_only? && GitHub.too_many_open_prs?(cask.tap) + odie "You have too many PRs open: close or merge some first!" + end new_version = BumpVersionParser.new( general: args.version, @@ -113,7 +114,7 @@ module Homebrew raise UsageError, "No `--version`, `--url` or `--sha256` argument specified!" end - check_pull_requests(cask, new_version:) + check_pull_requests(cask, new_version:) unless args.write_only? replacement_pairs ||= [] branch_name = "bump-#{cask.token}" @@ -136,7 +137,7 @@ module Homebrew end if new_version.present? - # For simplicity, our naming defers to the arm version if we multiple architectures are specified + # For simplicity, our naming defers to the arm version if multiple architectures are specified branch_version = new_version.arm || new_version.general if branch_version.is_a?(Cask::DSL::Version) commit_version = shortened_version(branch_version, cask:) @@ -171,7 +172,7 @@ module Homebrew pr_title: commit_message, } - GitHub.create_bump_pr(pr_info, args:) + GitHub.create_bump_pr(pr_info, args:) unless args.write_only? end private @@ -189,7 +190,7 @@ module Homebrew def generate_system_options(cask) current_os = Homebrew::SimulateSystem.current_os current_os_is_macos = MacOSVersion::SYMBOLS.include?(current_os) - newest_macos = MacOSVersion::SYMBOLS.keys.first + newest_macos = MacOSVersion.new(HOMEBREW_MACOS_NEWEST_SUPPORTED).to_sym depends_on_archs = cask.depends_on.arch&.filter_map { |arch| arch[:type] }&.uniq diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 3d7b867ee4..25a0e3c5eb 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -121,7 +121,9 @@ module Homebrew method or 'livecheck' block with 'skip'.) EOS - odie "You have too many PRs open: close or merge some first!" if GitHub.too_many_open_prs?(tap) + if !args.write_only? && GitHub.too_many_open_prs?(tap) + odie "You have too many PRs open: close or merge some first!" + end formula_spec = formula.stable odie "#{formula}: no stable specification found!" if formula_spec.blank? @@ -135,7 +137,7 @@ module Homebrew remote_branch = tap.git_repository.origin_branch_name previous_branch = "-" - check_pull_requests(formula, tap_remote_repo, state: "open") + check_pull_requests(formula, tap_remote_repo, state: "open") unless args.write_only? all_formulae = [] if args.bump_synced.present? @@ -397,12 +399,19 @@ module Homebrew nil end - if github_release_data.present? + if github_release_data.present? && github_release_data["body"].present? pre = "pre" if github_release_data["prerelease"].present? + # maximum length of PR body is 65,536 characters so let's truncate release notes to half of that. + body = Formatter.truncate(github_release_data["body"], max: 32_768) + + # Ensure the URL is properly HTML encoded to handle any quotes or other special characters + html_url = CGI.escapeHTML(github_release_data["html_url"]) + formula_pr_message += <<~XML
#{pre}release notes -
#{github_release_data["body"]}
+
#{body}
+

View the full release notes at #{html_url}.

XML end @@ -430,7 +439,7 @@ module Homebrew # If `brew audit` fails, revert the changes made to any formula. commits.each do |revert| revert_formula = Formula[revert[:formula_name]] - revert_formula.path.atomic_write(revert[:old_contents]) unless args.dry_run? + revert_formula.path.atomic_write(revert[:old_contents]) if !args.dry_run? && !args.write_only? revert_alias_rename = revert[:additional_files] if revert_alias_rename && (source = revert_alias_rename.first) && (destination = revert_alias_rename.last) FileUtils.mv source, destination @@ -467,7 +476,7 @@ module Homebrew tap_remote_repo:, pr_message:, } - GitHub.create_bump_pr(pr_info, args:) + GitHub.create_bump_pr(pr_info, args:) unless args.write_only? end private @@ -580,7 +589,7 @@ module Homebrew #{leading_spaces}resource "#{resource.name}" do #{leading_spaces} url "#{new_url}"#{new_mirrors.map { |m| "\n#{leading_spaces} mirror \"#{m}\"" }.join} #{leading_spaces} sha256 "#{new_hash}" - #{forced_version ? "#{leading_spaces} version \"#{version}\"\n" : ""} + #{"#{leading_spaces} version \"#{version}\"\n" if forced_version} #{leading_spaces} livecheck do #{leading_spaces} formula :parent #{leading_spaces} end diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index e9422d9e56..0da3372b6a 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -40,7 +40,8 @@ module Homebrew switch "--cask", "--casks", description: "Check only casks." switch "--eval-all", - description: "Evaluate all formulae and casks." + description: "Evaluate all formulae and casks.", + env: :eval_all switch "--repology", description: "Use Repology to check for outdated packages." flag "--tap=", @@ -71,14 +72,12 @@ module Homebrew Homebrew.install_bundler_gems!(groups: ["livecheck"]) Homebrew.with_no_api_env do - eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all? + eval_all = args.eval_all? excluded_autobump = [] - if args.no_autobump? - excluded_autobump.concat(autobumped_formulae_or_casks(CoreTap.instance)) if eval_all || args.formula? - if eval_all || args.cask? - excluded_autobump.concat(autobumped_formulae_or_casks(CoreCaskTap.instance, casks: true)) - end + if args.no_autobump? && eval_all + excluded_autobump.concat(autobumped_formulae_or_casks(CoreTap.instance)) if args.formula? + excluded_autobump.concat(autobumped_formulae_or_casks(CoreCaskTap.instance, casks: true)) if args.cask? end formulae_and_casks = if args.auto? @@ -118,7 +117,7 @@ module Homebrew else raise UsageError, "`brew bump` without named arguments needs `--installed` or `--eval-all` passed or " \ - "`HOMEBREW_EVAL_ALL` set!" + "`$HOMEBREW_EVAL_ALL` set!" end if args.start_with @@ -181,7 +180,7 @@ module Homebrew formulae_and_casks.each_with_index do |formula_or_cask, i| puts if i.positive? - next if skip_ineligible_formulae(formula_or_cask) + next if skip_ineligible_formulae!(formula_or_cask) use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask) name = Livecheck.package_or_resource_name(formula_or_cask, full_name: use_full_name) @@ -205,7 +204,7 @@ module Homebrew sig { params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T::Boolean) } - def skip_ineligible_formulae(formula_or_cask) + def skip_ineligible_formulae!(formula_or_cask) if formula_or_cask.is_a?(Formula) skip = formula_or_cask.disabled? || formula_or_cask.head_only? name = formula_or_cask.name diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index 2be6135a48..57a5fe79a3 100644 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -88,16 +88,21 @@ module Homebrew contributions << "#{Utils.pluralize("time", grand_totals[username].values.sum, include_count: true)} (total)" - puts [ + contributions_string = [ "#{username} contributed", *contributions.to_sentence, "#{time_period(from:, to: args.to)}.", ].join(" ") + if args.csv? + $stderr.puts contributions_string + else + puts contributions_string + end end return unless args.csv? - puts + $stderr.puts puts generate_csv(grand_totals) end diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index f89b3287a1..1823ee59d9 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -20,6 +20,8 @@ module Homebrew EOS switch "--autotools", description: "Create a basic template for an Autotools-style build." + switch "--cabal", + description: "Create a basic template for a Cabal build." switch "--cask", description: "Create a basic template for a cask." switch "--cmake", @@ -59,7 +61,7 @@ module Homebrew switch "-f", "--force", description: "Ignore errors for disallowed formula names and names that shadow aliases." - conflicts "--autotools", "--cmake", "--crystal", "--go", "--meson", "--node", + conflicts "--autotools", "--cabal", "--cmake", "--crystal", "--go", "--meson", "--node", "--perl", "--python", "--ruby", "--rust", "--zig", "--cask" conflicts "--cask", "--HEAD" conflicts "--cask", "--set-license" @@ -163,6 +165,8 @@ module Homebrew :crystal elsif args.go? :go + elsif args.cabal? + :cabal elsif args.meson? :meson elsif args.node? @@ -179,41 +183,42 @@ module Homebrew :zig end - fc = FormulaCreator.new( - args.set_name, - args.set_version, - tap: args.tap, + formula_creator = FormulaCreator.new( url: args.named.fetch(0), + name: args.set_name, + version: args.set_version, + tap: args.tap, mode:, license: args.set_license, fetch: !args.no_fetch?, head: args.HEAD?, ) - fc.parse_url + # ask for confirmation if name wasn't passed explicitly if args.set_name.blank? - print "Formula name [#{fc.name}]: " - fc.name = __gets || fc.name + print "Formula name [#{formula_creator.name}]: " + confirmed_name = __gets + formula_creator.name = confirmed_name if confirmed_name.present? end - fc.verify + formula_creator.verify_tap_available! # Check for disallowed formula, or names that shadow aliases, # unless --force is specified. unless args.force? - if (reason = MissingFormula.disallowed_reason(fc.name)) + if (reason = MissingFormula.disallowed_reason(formula_creator.name)) odie <<~EOS - The formula '#{fc.name}' is not allowed to be created. + The formula '#{formula_creator.name}' is not allowed to be created. #{reason} If you really want to create this formula use `--force`. EOS end Homebrew.with_no_api_env do - if Formula.aliases.include? fc.name - realname = Formulary.canonical_name(fc.name) + if Formula.aliases.include?(formula_creator.name) + realname = Formulary.canonical_name(formula_creator.name) odie <<~EOS - The formula '#{realname}' is already aliased to '#{fc.name}'. + The formula '#{realname}' is already aliased to '#{formula_creator.name}'. Please check that you are not creating a duplicate. To force creation use `--force`. EOS @@ -221,19 +226,19 @@ module Homebrew end end - path = fc.write_formula! + path = formula_creator.write_formula! formula = Homebrew.with_no_api_env do CoreTap.instance.clear_cache - Formula[fc.name] + Formula[formula_creator.name] end PyPI.update_python_resources! formula, ignore_non_pypi_packages: true if args.python? puts <<~EOS Please audit and test formula before submitting: - HOMEBREW_NO_INSTALL_FROM_API=1 brew audit --new #{fc.name} - HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source --verbose --debug #{fc.name} - HOMEBREW_NO_INSTALL_FROM_API=1 brew test #{fc.name} + HOMEBREW_NO_INSTALL_FROM_API=1 brew audit --new #{formula_creator.name} + HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source --verbose --debug #{formula_creator.name} + HOMEBREW_NO_INSTALL_FROM_API=1 brew test #{formula_creator.name} EOS path end diff --git a/Library/Homebrew/dev-cmd/determine-test-runners.rb b/Library/Homebrew/dev-cmd/determine-test-runners.rb index 39449ea83f..52757b3f8d 100644 --- a/Library/Homebrew/dev-cmd/determine-test-runners.rb +++ b/Library/Homebrew/dev-cmd/determine-test-runners.rb @@ -21,7 +21,8 @@ module Homebrew "dependents.", env: :eval_all switch "--dependents", - description: "Determine runners for testing dependents. Requires `--eval-all` or `HOMEBREW_EVAL_ALL`.", + description: "Determine runners for testing dependents. " \ + "Requires `--eval-all` or `$HOMEBREW_EVAL_ALL` to be set.", depends_on: "--eval-all" named_args max: 2 diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb index d88d603735..bee0caf795 100644 --- a/Library/Homebrew/dev-cmd/edit.rb +++ b/Library/Homebrew/dev-cmd/edit.rb @@ -9,10 +9,9 @@ module Homebrew class Edit < AbstractCommand cmd_args do description <<~EOS - Open a , or in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, + Open a , or in the editor set by `$EDITOR` or `$HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided. EOS - switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index 6063f9314f..bef3247be9 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:disable Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "abstract_command" @@ -172,7 +172,8 @@ module Homebrew with_monkey_patch { Formulary.from_contents(name, file, contents, ignore_errors: true) } end - def with_monkey_patch + sig { params(_block: T.proc.void).returns(T.untyped) } + def with_monkey_patch(&_block) # Since `method_defined?` is not a supported type guard, the use of `alias_method` below is not typesafe: BottleSpecification.class_eval do T.unsafe(self).alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) @@ -210,28 +211,28 @@ module Homebrew BottleSpecification.class_eval do if method_defined?(:old_method_missing) T.unsafe(self).alias_method :method_missing, :old_method_missing - undef :old_method_missing + T.unsafe(self).undef :old_method_missing end end Module.class_eval do if method_defined?(:old_method_missing) T.unsafe(self).alias_method :method_missing, :old_method_missing - undef :old_method_missing + T.unsafe(self).undef :old_method_missing end end Resource.class_eval do if method_defined?(:old_method_missing) T.unsafe(self).alias_method :method_missing, :old_method_missing - undef :old_method_missing + T.unsafe(self).undef :old_method_missing end end DependencyCollector.class_eval do if method_defined?(:old_parse_symbol_spec) T.unsafe(self).alias_method :parse_symbol_spec, :old_parse_symbol_spec - undef :old_parse_symbol_spec + T.unsafe(self).undef :old_parse_symbol_spec end end end diff --git a/Library/Homebrew/dev-cmd/generate-analytics-api.rb b/Library/Homebrew/dev-cmd/generate-analytics-api.rb index 3d3fe20ede..a07abe2694 100755 --- a/Library/Homebrew/dev-cmd/generate-analytics-api.rb +++ b/Library/Homebrew/dev-cmd/generate-analytics-api.rb @@ -77,7 +77,7 @@ module Homebrew analytics_data_dir = root_dir/"_data/analytics" analytics_api_dir = root_dir/"api/analytics" - threads = [] + analytics_output_queue = Queue.new CATEGORIES.each do |category| formula_analytics_args = [] @@ -124,15 +124,40 @@ module Homebrew DAYS.each do |days| next if days != "30" && category_name == "build-error" && !data_source.nil? - threads << Thread.new do - args = %W[--days-ago=#{days}] - (analytics_data_path/"#{days}d.json").write run_formula_analytics(*formula_analytics_args, *args) - (analytics_api_path/"#{days}d.json").write analytics_json_template(category_name, data_source:) - end + analytics_output_queue << { + formula_analytics_args: formula_analytics_args.dup, + days: days, + analytics_data_path: analytics_data_path, + analytics_api_path: analytics_api_path, + category_name: category_name, + data_source: data_source, + } end end - threads.each(&:join) + workers = [] + 4.times do + workers << Thread.new do + until analytics_output_queue.empty? + analytics_output_type = begin + analytics_output_queue.pop(true) + rescue ThreadError + break + end + + days = analytics_output_type[:days] + args = ["--days-ago=#{days}"] + + (analytics_output_type[:analytics_data_path]/"#{days}d.json").write \ + run_formula_analytics(*analytics_output_type[:formula_analytics_args], *args) + + data_source = analytics_output_type[:data_source] + (analytics_output_type[:analytics_api_path]/"#{days}d.json").write \ + analytics_json_template(analytics_output_type[:category_name], data_source:) + end + end + end + workers.each(&:join) end end end diff --git a/Library/Homebrew/dev-cmd/generate-cask-api.rb b/Library/Homebrew/dev-cmd/generate-cask-api.rb index 40b3a1c7da..11922c7212 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-api.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-api.rb @@ -33,7 +33,7 @@ module Homebrew raise TapUnavailableError, tap.name unless tap.installed? unless args.dry_run? - directories = ["_data/cask", "api/cask", "api/cask-source", "cask", "api/internal/v3"].freeze + directories = ["_data/cask", "api/cask", "api/cask-source", "cask", "api/internal"].freeze FileUtils.rm_rf directories FileUtils.mkdir_p directories end @@ -44,12 +44,14 @@ module Homebrew Cask::Cask.generating_hash! - latest_macos = MacOSVersion.new((HOMEBREW_MACOS_NEWEST_UNSUPPORTED.to_i - 1).to_s).to_sym + all_casks = {} + latest_macos = MacOSVersion.new(HOMEBREW_MACOS_NEWEST_SUPPORTED).to_sym Homebrew::SimulateSystem.with(os: latest_macos, arch: :arm) do tap.cask_files.each do |path| cask = Cask::CaskLoader.load(path) name = cask.token - json = JSON.pretty_generate(cask.to_hash_with_variations) + all_casks[name] = cask.to_hash_with_variations + json = JSON.pretty_generate(all_casks[name]) cask_source = path.read html_template_name = html_template(name) @@ -67,6 +69,14 @@ module Homebrew canonical_json = JSON.pretty_generate(tap.cask_renames) File.write("_data/cask_canonical.json", "#{canonical_json}\n") unless args.dry_run? + + OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag| + variation_casks = all_casks.map do |_, cask| + Homebrew::API.merge_variations(cask, bottle_tag:) + end + + File.write("api/internal/cask.#{bottle_tag}.json", JSON.generate(variation_casks)) unless args.dry_run? + end end end diff --git a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb index dfaa9a050e..53cc53d6b7 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb @@ -67,8 +67,8 @@ module Homebrew end raise UsageError, "Only one url can be specified" if pr_url&.count&.> 1 - labels = if pr_url - pr = GitHub::API.open_rest(pr_url.first) + labels = if pr_url && (first_pr_url = pr_url.first) + pr = GitHub::API.open_rest(first_pr_url) pr.fetch("labels").map { |l| l.fetch("name") } else [] @@ -263,11 +263,10 @@ module Homebrew audit_exceptions << %w[homepage_https_availability] if labels.include?("ci-skip-homepage") if labels.include?("ci-skip-livecheck") - audit_exceptions << %w[hosting_with_livecheck livecheck_https_availability - livecheck_min_os livecheck_version] + audit_exceptions << %w[hosting_with_livecheck livecheck_https_availability livecheck_version min_os] end - audit_exceptions << "livecheck_min_os" if labels.include?("ci-skip-livecheck-min-os") + audit_exceptions << "min_os" if labels.include?("ci-skip-livecheck-min-os") if labels.include?("ci-skip-repository") audit_exceptions << %w[github_repository github_prerelease_version @@ -275,10 +274,7 @@ module Homebrew bitbucket_repository] end - if labels.include?("ci-skip-token") - audit_exceptions << %w[token_conflicts token_valid - token_bad_words] - end + audit_exceptions << %w[token_valid token_bad_words] if labels.include?("ci-skip-token") audit_args << "--except" << audit_exceptions.join(",") if audit_exceptions.any? diff --git a/Library/Homebrew/dev-cmd/generate-formula-api.rb b/Library/Homebrew/dev-cmd/generate-formula-api.rb index ac8d5dd63b..5741ce6872 100644 --- a/Library/Homebrew/dev-cmd/generate-formula-api.rb +++ b/Library/Homebrew/dev-cmd/generate-formula-api.rb @@ -32,7 +32,7 @@ module Homebrew raise TapUnavailableError, tap.name unless tap.installed? unless args.dry_run? - directories = ["_data/formula", "api/formula", "formula", "api/internal/v3"] + directories = ["_data/formula", "api/formula", "formula", "api/internal"] FileUtils.rm_rf directories + ["_data/formula_canonical.json"] FileUtils.mkdir_p directories end @@ -44,12 +44,14 @@ module Homebrew Formulary.enable_factory_cache! Formula.generating_hash! + all_formulae = {} latest_macos = MacOSVersion.new((HOMEBREW_MACOS_NEWEST_UNSUPPORTED.to_i - 1).to_s).to_sym Homebrew::SimulateSystem.with(os: latest_macos, arch: :arm) do tap.formula_names.each do |name| formula = Formulary.factory(name) name = formula.name - json = JSON.pretty_generate(formula.to_hash_with_variations) + all_formulae[name] = formula.to_hash_with_variations + json = JSON.pretty_generate(all_formulae[name]) html_template_name = html_template(name) unless args.dry_run? @@ -65,6 +67,30 @@ module Homebrew canonical_json = JSON.pretty_generate(tap.formula_renames.merge(tap.alias_table)) File.write("_data/formula_canonical.json", "#{canonical_json}\n") unless args.dry_run? + + OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag| + variation_formulae = all_formulae.to_h do |name, formula| + formula = Homebrew::API.merge_variations(formula, bottle_tag:) + + version = Version.new(formula.dig("versions", "stable")) + pkg_version = PkgVersion.new(version, formula["revision"]) + rebuild = formula.dig("bottle", "stable", "rebuild") || 0 + + bottle_collector = Utils::Bottles::Collector.new + formula.dig("bottle", "stable", "files")&.each do |tag, data| + tag = Utils::Bottles::Tag.from_symbol(tag) + bottle_collector.add tag, checksum: Checksum.new(data["sha256"]), cellar: :any + end + + sha256 = bottle_collector.specification_for(bottle_tag)&.checksum&.to_s + + [name, [pkg_version.to_s, rebuild, sha256]] + end + + unless args.dry_run? + File.write("api/internal/formula.#{bottle_tag}.json", JSON.generate(variation_formulae)) + end + end end end diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb index 31cf968bcc..55107b78c1 100644 --- a/Library/Homebrew/dev-cmd/irb.rb +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -44,8 +44,8 @@ module Homebrew switch "--examples", description: "Show several examples." switch "--pry", - env: :pry, - description: "Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set." + description: "Use Pry instead of IRB.", + env: :pry end # work around IRB modifying ARGV. diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 23462cc98a..73ce789aed 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -23,7 +23,7 @@ module Homebrew description: "For every library that a keg references, print its dylib path followed by the " \ "binaries that link to it." switch "--cached", - description: "Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous " \ + description: "Print the cached linkage values stored in `$HOMEBREW_CACHE`, set by a previous " \ "`brew linkage` run." named_args :installed_formula diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index dee478de47..816bbb1468 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -13,7 +13,7 @@ module Homebrew description <<~EOS Check for newer versions of formulae and/or casks from upstream. If no formula or cask argument is passed, the list of formulae and - casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or + casks to check is taken from `$HOMEBREW_LIVECHECK_WATCHLIST` or `~/.homebrew/livecheck_watchlist.txt`. EOS switch "--full-name", @@ -53,7 +53,7 @@ module Homebrew def run Homebrew.install_bundler_gems!(groups: ["livecheck"]) - all = args.eval_all? + eval_all = args.eval_all? if args.debug? && args.verbose? puts args @@ -70,12 +70,12 @@ module Homebrew formulae = args.cask? ? [] : Formula.installed casks = args.formula? ? [] : Cask::Caskroom.casks formulae + casks - elsif all - formulae = args.cask? ? [] : Formula.all(eval_all: args.eval_all?) - casks = args.formula? ? [] : Cask::Cask.all(eval_all: args.eval_all?) - formulae + casks elsif args.named.present? args.named.to_formulae_and_casks_with_taps + elsif eval_all + formulae = args.cask? ? [] : Formula.all(eval_all:) + casks = args.formula? ? [] : Cask::Cask.all(eval_all:) + formulae + casks elsif File.exist?(watchlist_path) begin names = Pathname.new(watchlist_path).read.lines @@ -88,7 +88,8 @@ module Homebrew onoe e end else - raise UsageError, "A watchlist file is required when no arguments are given." + raise UsageError, + "`brew livecheck` with no arguments needs a watchlist file to be present or `--eval-all` passed!" end end diff --git a/Library/Homebrew/dev-cmd/sh.rb b/Library/Homebrew/dev-cmd/sh.rb index c6161dd1ad..df034059fe 100644 --- a/Library/Homebrew/dev-cmd/sh.rb +++ b/Library/Homebrew/dev-cmd/sh.rb @@ -13,13 +13,13 @@ module Homebrew Enter an interactive shell for Homebrew's build environment. Use years-battle-hardened build logic to help your `./configure && make && make install` and even your `gem install` succeed. Especially handy if you run Homebrew - in an Xcode-only configuration since it adds tools like `make` to your `PATH` + in an Xcode-only configuration since it adds tools like `make` to your `$PATH` which build systems would not find otherwise. EOS - flag "--env=", - description: "Use the standard `PATH` instead of superenv's when `std` is passed." - flag "-c=", "--cmd=", - description: "Execute commands in a non-interactive shell." + flag "--env=", + description: "Use the standard `$PATH` instead of superenv's when `std` is passed." + flag "-c=", "--cmd=", + description: "Execute commands in a non-interactive shell." named_args :file, max: 1 end @@ -29,7 +29,9 @@ module Homebrew ENV.activate_extensions!(env: args.env) if superenv?(args.env) - T.cast(ENV, Superenv).deps = Formula.installed.select { |f| f.keg_only? && f.opt_prefix.directory? } + ENV.deps = Formula.installed.select do |f| + f.keg_only? && f.opt_prefix.directory? + end end ENV.setup_build_environment if superenv?(args.env) diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 5d04a15c6c..2b9ed6137b 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -44,12 +44,11 @@ module Homebrew titleized_repository = tap.repository.dup titleized_user[0] = titleized_user[0].upcase titleized_repository[0] = titleized_repository[0].upcase - root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repository}") if args.github_packages? + # Duplicate assignment to silence `assigned but unused variable` warning + root_url = root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repository}") if args.github_packages? (tap.path/"Formula").mkpath - # FIXME: https://github.com/errata-ai/vale/issues/818 - # readme = <<~MARKDOWN # #{titleized_user} #{titleized_repository} @@ -70,7 +69,6 @@ module Homebrew `brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh). MARKDOWN - # write_path(tap, "README.md", readme) tests_yml = <<~ERB @@ -99,9 +97,9 @@ module Homebrew steps: - name: Set up Homebrew id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: - token: ${{ github.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Cache Homebrew Bundler RubyGems uses: actions/cache@v4 @@ -120,13 +118,13 @@ module Homebrew id: base64-encode if: github.event_name == 'pull_request' env: - TOKEN: ${{ github.token }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | base64_token=$(echo -n "${TOKEN}" | base64 | tr -d "\\n") echo "::add-mask::${base64_token}" echo "token=${base64_token}" >> "${GITHUB_OUTPUT}" <% end -%> - - run: brew test-bot --only-formulae<% if root_url %> --root-url='<%= root_url %>'<% end %> + - run: brew test-bot --only-formulae#{" --root-url=#{root_url}" if root_url} if: github.event_name == 'pull_request' <% if args.github_packages? -%> env: @@ -164,25 +162,25 @@ module Homebrew pull-requests: write steps: - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main with: - token: ${{ github.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up git - uses: Homebrew/actions/git-user-config@master + uses: Homebrew/actions/git-user-config@main - name: Pull bottles env: - HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }} + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} <% if args.github_packages? -%> - HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }} + HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.repository_owner }} <% end -%> PULL_REQUEST: ${{ github.event.pull_request.number }} run: brew pr-pull --debug --tap="$GITHUB_REPOSITORY" "$PULL_REQUEST" - name: Push commits - uses: Homebrew/actions/git-try-push@master + uses: Homebrew/actions/git-try-push@main with: branch: <%= branch %> diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 4df8acd792..70f2679c00 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -25,9 +25,11 @@ module Homebrew switch "--debug", description: "Enable debugging using `ruby/debug`, or surface the standard `odebug` output." switch "--changed", - description: "Only runs tests on files that were changed from the master branch." + description: "Only runs tests on files that were changed from the `main` branch." switch "--fail-fast", description: "Exit early on the first failing test." + switch "--no-parallel", + description: "Run tests serially." flag "--only=", description: "Run only `_spec.rb`. Appending `:` will start at a " \ "specific line." @@ -49,7 +51,12 @@ module Homebrew HOMEBREW_LIBRARY_PATH.cd do setup_environment! - parallel = true + # Needs required here, after `setup_environment!`, so that + # `HOMEBREW_TEST_GENERIC_OS` is set and `OS.linux?` and `OS.mac?` both + # `return false`. + require "extend/os/dev-cmd/tests" + + parallel = !args.no_parallel? only = args.only files = if only @@ -120,29 +127,13 @@ module Homebrew ] bundle_args << "--fail-fast" if args.fail_fast? bundle_args << "--profile" << args.profile if args.profile - - # TODO: Refactor and move to extend/os - # rubocop:disable Homebrew/MoveToExtendOS - unless OS.mac? - bundle_args << "--tag" << "~needs_macos" << "--tag" << "~cask" - files = files.grep_v(%r{^test/(os/mac|cask)(/.*|_spec\.rb)$}) - end - - unless OS.linux? - bundle_args << "--tag" << "~needs_linux" - files = files.grep_v(%r{^test/os/linux(/.*|_spec\.rb)$}) - end - # rubocop:enable Homebrew/MoveToExtendOS - bundle_args << "--tag" << "~needs_arm" unless Hardware::CPU.arm? - bundle_args << "--tag" << "~needs_intel" unless Hardware::CPU.intel? - bundle_args << "--tag" << "~needs_network" unless args.online? - unless ENV["CI"] - bundle_args << "--tag" << "~needs_ci" \ - << "--tag" << "~needs_svn" - end + bundle_args << "--tag" << "~needs_ci" unless ENV["CI"] + + bundle_args = os_bundle_args(bundle_args) + files = os_files(files) puts "Randomized with seed #{seed}" @@ -170,11 +161,46 @@ module Homebrew private + sig { params(bundle_args: T::Array[String]).returns(T::Array[String]) } + def os_bundle_args(bundle_args) + # for generic tests, remove macOS or Linux specific tests + non_linux_bundle_args(non_macos_bundle_args(bundle_args)) + end + + sig { params(bundle_args: T::Array[String]).returns(T::Array[String]) } + def non_macos_bundle_args(bundle_args) + bundle_args << "--tag" << "~needs_homebrew_core" if ENV["CI"] + bundle_args << "--tag" << "~needs_svn" unless args.online? + + bundle_args << "--tag" << "~needs_macos" << "--tag" << "~cask" + end + + sig { params(bundle_args: T::Array[String]).returns(T::Array[String]) } + def non_linux_bundle_args(bundle_args) + bundle_args << "--tag" << "~needs_linux" << "--tag" << "~needs_systemd" + end + + sig { params(files: T::Array[String]).returns(T::Array[String]) } + def os_files(files) + # for generic tests, remove macOS or Linux specific files + non_linux_files(non_macos_files(files)) + end + + sig { params(files: T::Array[String]).returns(T::Array[String]) } + def non_macos_files(files) + files.grep_v(%r{^test/(os/mac|cask)(/.*|_spec\.rb)$}) + end + + sig { params(files: T::Array[String]).returns(T::Array[String]) } + def non_linux_files(files) + files.grep_v(%r{^test/os/linux(/.*|_spec\.rb)$}) + end + sig { returns(T::Array[String]) } def changed_test_files - changed_files = Utils.popen_read("git", "diff", "--name-only", "master") + changed_files = Utils.popen_read("git", "diff", "--name-only", "main") - raise UsageError, "No files have been changed from the master branch!" if changed_files.blank? + raise UsageError, "No files have been changed from the `main` branch!" if changed_files.blank? filestub_regex = %r{Library/Homebrew/([\w/-]+).rb} changed_files.scan(filestub_regex).map(&:last).filter_map do |filestub| @@ -221,9 +247,6 @@ module Homebrew ENV["HOMEBREW_SORBET_RUNTIME"] = "1" ENV["HOMEBREW_NO_FORCE_BREW_WRAPPER"] = "1" - # TODO: remove this and fix tests when possible. - ENV["HOMEBREW_NO_INSTALL_FROM_API"] = "1" - ENV["USER"] ||= system_command!("id", args: ["-nu"]).stdout.chomp # Avoid local configuration messing with tests, e.g. git being configured diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 3f16dae317..fc3d5d614b 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -60,6 +60,7 @@ module Homebrew HOMEBREW_LIBRARY_PATH.cd do if update workers = args.debug? ? ["--workers=1"] : [] + safe_system "bundle", "exec", "tapioca", "annotations" safe_system "bundle", "exec", "tapioca", "dsl", *workers # Prefer adding args here: Library/Homebrew/sorbet/tapioca/config.yml tapioca_args = args.update_all? ? ["--all"] : [] @@ -67,6 +68,9 @@ module Homebrew ohai "Updating Tapioca RBI files..." safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args + ohai "Trimming RuboCop RBI because by default it's massive..." + trim_rubocop_rbi + if args.suggest_typed? ohai "Checking if we can bump Sorbet `typed` sigils..." # --sorbet needed because of https://github.com/Shopify/spoom/issues/488 @@ -115,6 +119,157 @@ module Homebrew Homebrew.failed = true end end + + sig { params(path: T.any(String, Pathname)).void } + def trim_rubocop_rbi(path: HOMEBREW_LIBRARY_PATH/"sorbet/rbi/gems/rubocop@*.rbi") + rbi_file = Dir.glob(path).first + return unless rbi_file.present? + return unless (rbi_path = Pathname.new(rbi_file)).exist? + + require "prism" + original_content = rbi_path.read + parsed = Prism.parse(original_content) + return unless parsed.success? + + allowlist = %w[ + Parser::Source + RuboCop::AST::Node + RuboCop::AST::NodePattern + RuboCop::AST::ProcessedSource + RuboCop::CLI + RuboCop::Config + RuboCop::Cop::AllowedPattern + RuboCop::Cop::AllowedMethods + RuboCop::Cop::AutoCorrector + RuboCop::Cop::AutocorrectLogic + RuboCop::Cop::Base + RuboCop::Cop::CommentsHelp + RuboCop::Cop::ConfigurableFormatting + RuboCop::Cop::ConfigurableNaming + RuboCop::Cop::Corrector + RuboCop::Cop::IgnoredMethods + RuboCop::Cop::IgnoredNode + RuboCop::Cop::IgnoredPattern + RuboCop::Cop::MethodPreference + RuboCop::Cop::Offense + RuboCop::Cop::RangeHelp + RuboCop::Cop::Registry + RuboCop::Cop::Util + RuboCop::DirectiveComment + RuboCop::Error + RuboCop::ExcludeLimit + RuboCop::Ext::Comment + RuboCop::Ext::ProcessedSource + RuboCop::Ext::Range + RuboCop::FileFinder + RuboCop::Formatter::TextUtil + RuboCop::Formatter::PathUtil + RuboCop::Options + RuboCop::ResultCache + RuboCop::Runner + RuboCop::TargetFinder + RuboCop::Version + ].freeze + + nodes_to_keep = Set.new + + parsed.value.statements.body.each do |node| + case node + when Prism::ModuleNode, Prism::ClassNode + # Keep if it's in our allowlist or is a top-level essential node. + full_name = extract_full_name(node) + nodes_to_keep << node if full_name.blank? || allowlist.any? { |name| full_name.start_with?(name) } + when Prism::ConstantWriteNode # Keep essential constants. + nodes_to_keep << node if node.name.to_s.match?(/^[[:digit:][:upper:]_]+$/) + else # Keep other top-level nodes (comments, etc.) + nodes_to_keep << node + end + end + + new_content = generate_trimmed_rbi(original_content, nodes_to_keep, parsed) + rbi_path.write(new_content) + end + + private + + sig { params(node: Prism::Node).returns(String) } + def extract_full_name(node) + case node + when Prism::ModuleNode, Prism::ClassNode + parts = [] + + constant_path = node.constant_path + if constant_path.is_a?(Prism::ConstantReadNode) + parts << constant_path.name.to_s + elsif constant_path.is_a?(Prism::ConstantPathNode) + parts.concat(extract_constant_path_parts(constant_path)) + end + + parts.join("::") + else + "" + end + end + + sig { params(constant_path: T.any(Prism::ConstantPathNode, Prism::Node)).returns(T::Array[String]) } + def extract_constant_path_parts(constant_path) + parts = [] + current = T.let(constant_path, T.nilable(Prism::Node)) + + while current + case current + when Prism::ConstantPathNode + parts.unshift(current.name.to_s) + current = current.parent + when Prism::ConstantReadNode + parts.unshift(current.name.to_s) + break + else + break + end + end + + parts + end + + sig { + params( + original_content: String, + nodes_to_keep: T::Set[Prism::Node], + parsed: Prism::ParseResult, + ).returns(String) + } + def generate_trimmed_rbi(original_content, nodes_to_keep, parsed) + lines = original_content.lines + output_lines = [] + + first_node = parsed.value.statements.body.first + if first_node + first_line = first_node.location.start_line - 1 + (0...first_line).each { |i| output_lines << lines[i] if lines[i] } + end + + parsed.value.statements.body.each do |node| + next unless nodes_to_keep.include?(node) + + start_line = node.location.start_line - 1 + end_line = node.location.end_line - 1 + + (start_line..end_line).each { |i| output_lines << lines[i] if lines[i] } + output_lines << "\n" + end + + header = <<~EOS.chomp + # typed: true + + # This file is autogenerated. Do not edit it by hand. + # To regenerate, run `brew typecheck --update rubocop`. + EOS + + return header if output_lines.empty? + + output_lines.join + end end end end diff --git a/Library/Homebrew/dev-cmd/unbottled.rb b/Library/Homebrew/dev-cmd/unbottled.rb index 3fb1880093..0eeff65f8f 100644 --- a/Library/Homebrew/dev-cmd/unbottled.rb +++ b/Library/Homebrew/dev-cmd/unbottled.rb @@ -22,8 +22,8 @@ module Homebrew switch "--lost", description: "Print the `homebrew/core` commits where bottles were lost in the last week." switch "--eval-all", - description: "Evaluate all available formulae and casks, whether installed or not, to check them. " \ - "Implied if `HOMEBREW_EVAL_ALL` is set." + description: "Evaluate all available formulae and casks, whether installed or not, to check them.", + env: :eval_all conflicts "--dependents", "--total", "--lost" @@ -65,22 +65,19 @@ module Homebrew end Homebrew::SimulateSystem.with(os:, arch:) do - all = args.eval_all? - if args.total? - if !all && !Homebrew::EnvConfig.eval_all? - raise UsageError, "`brew unbottled --total` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" - end + eval_all = args.eval_all? - all = true + if args.total? && !eval_all + raise UsageError, "`brew unbottled --total` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end if args.named.blank? ohai "Getting formulae..." - elsif all + elsif eval_all raise UsageError, "Cannot specify formulae when using `--eval-all`/`--total`." end - formulae, all_formulae, formula_installs = formulae_all_installs_from_args(all) + formulae, all_formulae, formula_installs = formulae_all_installs_from_args(eval_all) deps_hash, uses_hash = deps_uses_from_formulae(all_formulae) if args.dependents? @@ -89,7 +86,7 @@ module Homebrew dependents = uses_hash[f.name]&.length || 0 formula_dependents[f.name] ||= dependents end.reverse - elsif all + elsif eval_all output_total(formulae) return end @@ -111,22 +108,22 @@ module Homebrew private sig { - params(all: T::Boolean).returns([T::Array[Formula], T::Array[Formula], T.nilable(T::Hash[Symbol, Integer])]) + params(eval_all: T::Boolean).returns([T::Array[Formula], T::Array[Formula], + T.nilable(T::Hash[Symbol, Integer])]) } - def formulae_all_installs_from_args(all) + def formulae_all_installs_from_args(eval_all) if args.named.present? formulae = all_formulae = args.named.to_formulae elsif args.dependents? - if !args.eval_all? && !Homebrew::EnvConfig.eval_all? - raise UsageError, - "`brew unbottled --dependents` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" + unless eval_all + raise UsageError, "`brew unbottled --dependents` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!" end - formulae = all_formulae = Formula.all(eval_all: args.eval_all?) + formulae = all_formulae = Formula.all(eval_all:) @sort = T.let(" (sorted by number of dependents)", T.nilable(String)) - elsif all - formulae = all_formulae = Formula.all(eval_all: args.eval_all?) + elsif eval_all + formulae = all_formulae = Formula.all(eval_all:) else formula_installs = {} @@ -136,7 +133,7 @@ module Homebrew if analytics.blank? raise UsageError, "default sort by analytics data requires " \ - "`HOMEBREW_NO_GITHUB_API` and `HOMEBREW_NO_ANALYTICS` to be unset" + "`$HOMEBREW_NO_GITHUB_API` and `$HOMEBREW_NO_ANALYTICS` to be unset." end formulae = analytics["items"].filter_map do |i| @@ -153,7 +150,7 @@ module Homebrew end @sort = T.let(" (sorted by installs in the last 90 days; top 10,000 only)", T.nilable(String)) - all_formulae = Formula.all(eval_all: args.eval_all?) + all_formulae = Formula.all(eval_all:) end # Remove deprecated and disabled formulae as we do not care if they are unbottled diff --git a/Library/Homebrew/dev-cmd/update-maintainers.rb b/Library/Homebrew/dev-cmd/update-maintainers.rb index 0b5dd62980..e1ca6a550f 100644 --- a/Library/Homebrew/dev-cmd/update-maintainers.rb +++ b/Library/Homebrew/dev-cmd/update-maintainers.rb @@ -21,12 +21,22 @@ module Homebrew sig { override.void } def run + # Needed for Manpages.regenerate_man_pages below + Homebrew.install_bundler_gems!(groups: ["man"]) + # We assume that only public members wish to be included in the README public_members = GitHub.public_member_usernames("Homebrew") maintainers = GitHub.members_by_team("Homebrew", "maintainers") + # Not all PLC members are Homebrew GitHub organisation members any more + non_maintainer_plc_members = { + colindean: "Colin Dean", + mozzadrella: "Vanessa Gennarelli", + }.transform_keys(&:to_s) + public_members += non_maintainer_plc_members.keys + members = { - plc: GitHub.members_by_team("Homebrew", "plc"), + plc: GitHub.members_by_team("Homebrew", "plc").merge(non_maintainer_plc_members), tsc: GitHub.members_by_team("Homebrew", "tsc"), maintainers:, } diff --git a/Library/Homebrew/dev-cmd/update-perl-resources.rb b/Library/Homebrew/dev-cmd/update-perl-resources.rb new file mode 100644 index 0000000000..266674f728 --- /dev/null +++ b/Library/Homebrew/dev-cmd/update-perl-resources.rb @@ -0,0 +1,36 @@ +# typed: strict +# frozen_string_literal: true + +require "abstract_command" +require "utils/cpan" + +module Homebrew + module DevCmd + class UpdatePerlResources < AbstractCommand + cmd_args do + description <<~EOS + Update versions for CPAN resource blocks in . + EOS + switch "-p", "--print-only", + description: "Print the updated resource blocks instead of changing ." + switch "-s", "--silent", + description: "Suppress any output." + switch "--ignore-errors", + description: "Continue processing even if some resources can't be resolved." + + named_args :formula, min: 1, without_api: true + end + + sig { override.void } + def run + args.named.to_formulae.each do |formula| + CPAN.update_perl_resources! formula, + print_only: args.print_only?, + silent: args.silent?, + verbose: args.verbose?, + ignore_errors: args.ignore_errors? + end + end + end + end +end diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index eb975b73fd..e6b495dba2 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -12,10 +12,10 @@ module Homebrew cmd_args do description <<~EOS Run a test of `brew update` with a new repository clone. - If no options are passed, use `origin/master` as the start commit. + If no options are passed, use `origin/main` as the start commit. EOS switch "--to-tag", - description: "Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags." + description: "Set `$HOMEBREW_UPDATE_TO_TAG` to test updating between tags." switch "--keep-tmp", description: "Retain the temporary directory containing the new repository clone." flag "--commit=", @@ -47,7 +47,7 @@ module Homebrew "stable" else ENV["HOMEBREW_DEV_CMD_RUN"] = "1" - "master" + "main" end # Utils.popen_read returns a String without a block argument, but that isn't easily typed. We thus label this @@ -58,7 +58,7 @@ module Homebrew start_commit = if (commit = args.commit) commit elsif (date = args.before) - Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp + Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/main").chomp elsif args.to_tag? tags = git_tags current_tag, previous_tag, = tags.lines @@ -72,7 +72,7 @@ module Homebrew # ^0 ensures this points to the commit rather than the tag object. "#{previous_tag}^0" else - Utils.popen_read("git", "merge-base", "origin/master", end_commit).chomp + Utils.popen_read("git", "merge-base", "origin/main", end_commit).chomp end odie "Could not find start commit!" if start_commit.empty? @@ -82,8 +82,8 @@ module Homebrew end_commit = T.cast(Utils.popen_read("git", "rev-parse", end_commit).chomp, String) odie "Could not find end commit!" if end_commit.empty? - if Utils.popen_read("git", "branch", "--list", "master").blank? - safe_system "git", "branch", "master", "origin/master" + if Utils.popen_read("git", "branch", "--list", "main").blank? + safe_system "git", "branch", "main", "origin/HEAD" end end @@ -99,17 +99,17 @@ module Homebrew oh1 "Preparing test environment..." # copy Homebrew installation safe_system "git", "clone", "#{HOMEBREW_REPOSITORY}/.git", ".", - "--branch", "master", "--single-branch" + "--branch", "main", "--single-branch" # set git origin to another copy safe_system "git", "clone", "#{HOMEBREW_REPOSITORY}/.git", "remote.git", - "--bare", "--branch", "master", "--single-branch" + "--bare", "--branch", "main", "--single-branch" safe_system "git", "config", "remote.origin.url", "#{curdir}/remote.git" ENV["HOMEBREW_BREW_GIT_REMOTE"] = "#{curdir}/remote.git" # force push origin to end_commit - safe_system "git", "checkout", "-B", "master", end_commit - safe_system "git", "push", "--force", "origin", "master" + safe_system "git", "checkout", "-B", "main", end_commit + safe_system "git", "push", "--force", "origin", "main" # set test copy to start_commit safe_system "git", "reset", "--hard", start_commit @@ -142,6 +142,7 @@ module Homebrew private + sig { returns(String) } def git_tags tags = Utils.popen_read("git", "tag", "--list", "--sort=-version:refname") if tags.blank? diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 6d0408f51b..dc67b2cef8 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -57,6 +57,11 @@ class DevelopmentTools :clang end + sig { returns(Version) } + def ld64_version + Version::NULL + end + # Get the Clang version. # # @api public diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 80921c4cc6..323ddb553e 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -115,16 +115,16 @@ module Homebrew def support_tier_message(tier:) return if tier.to_s == "1" - tier_title, tier_slug = if tier.to_s == "unsupported" - ["Unsupported", "unsupported"] + tier_title, tier_slug, tier_issues = if tier.to_s == "unsupported" + ["Unsupported", "unsupported", "Do not report any"] else - ["Tier #{tier}", "tier-#{tier.to_s.downcase}"] + ["Tier #{tier}", "tier-#{tier.to_s.downcase}", "You can report Tier #{tier} unrelated"] end <<~EOS This is a #{tier_title} configuration: #{Formatter.url("https://docs.brew.sh/Support-Tiers##{tier_slug}")} - #{Formatter.bold("Do not report any issues to Homebrew/* repositories!")} + #{Formatter.bold("#{tier_issues} issues to Homebrew/* repositories!")} Read the above document instead before opening any issues or PRs. EOS end @@ -350,7 +350,6 @@ module Homebrew sudo chmod +t #{HOMEBREW_TEMP} EOS end - alias generic_check_tmpdir_sticky_bit check_tmpdir_sticky_bit def check_exist_directories return if HOMEBREW_PREFIX.writable? @@ -588,7 +587,7 @@ module Homebrew EOS end - def __check_linked_brew(formula) + def __check_linked_brew!(formula) formula.installed_prefixes.each do |prefix| prefix.find do |src| next if src == prefix @@ -909,24 +908,21 @@ module Homebrew EOS end + def check_deprecated_cask_taps + tapped_caskroom_taps = ::Tap.select { |t| t.user == "caskroom" || t.name == "phinze/cask" } + .map(&:name) + return if tapped_caskroom_taps.empty? + + <<~EOS + You have the following deprecated Cask taps installed: + #{tapped_caskroom_taps.join("\n ")} + Please remove them with: + brew untap #{tapped_caskroom_taps.join(" ")} + EOS + end + def check_cask_software_versions add_info "Homebrew Version", HOMEBREW_VERSION - add_info "macOS", MacOS.full_version - add_info "SIP", begin - csrutil = "/usr/bin/csrutil" - if File.executable?(csrutil) - Open3.capture2(csrutil, "status") - .first - .gsub("This is an unsupported configuration, likely to break in " \ - "the future and leave your machine in an unknown state.", "") - .gsub("System Integrity Protection status: ", "") - .delete("\t.") - .capitalize - .strip - else - "N/A" - end - end nil end @@ -1013,6 +1009,10 @@ module Homebrew end def check_cask_xattr + # If quarantine is not available, a warning is already shown by check_cask_quarantine_support so just return + return unless Cask::Quarantine.available? + return "Unable to find `xattr`." unless File.exist?("/usr/bin/xattr") + result = system_command "/usr/bin/xattr", args: ["-h"] return if result.status.success? @@ -1048,6 +1048,8 @@ module Homebrew "No Cask quarantine support available: there's no working version of `xattr` on this system." when :no_swift "No Cask quarantine support available: there's no available version of `swift` on this system." + when :linux + "No Cask quarantine support available: not available on Linux." else "No Cask quarantine support available: unknown reason." end diff --git a/Library/Homebrew/download_queue.rb b/Library/Homebrew/download_queue.rb index c77b5c1d67..0de8add528 100644 --- a/Library/Homebrew/download_queue.rb +++ b/Library/Homebrew/download_queue.rb @@ -1,39 +1,138 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "downloadable" require "concurrent/promises" require "concurrent/executors" +require "retryable_download" module Homebrew class DownloadQueue - sig { returns(Concurrent::FixedThreadPool) } - attr_reader :pool - private :pool - - sig { params(size: Integer).void } - def initialize(size = 1) - @pool = Concurrent::FixedThreadPool.new(size) + sig { params(concurrency: Integer, retries: Integer, force: T::Boolean).void } + def initialize(concurrency:, retries:, force:) + @concurrency = concurrency + @quiet = T.let(concurrency > 1, T::Boolean) + @tries = T.let(retries + 1, Integer) + @force = force + @pool = T.let(Concurrent::FixedThreadPool.new(concurrency), Concurrent::FixedThreadPool) end - sig { params(downloadable: Downloadable, force: T::Boolean).returns(Concurrent::Promises::Future) } - def enqueue(downloadable, force: false) - quiet = pool.max_length > 1 - # Passing in arguments from outside into the future is a common `concurrent-ruby` pattern. - # rubocop:disable Lint/ShadowingOuterLocalVariable - Concurrent::Promises.future_on(pool, downloadable, force, quiet) do |downloadable, force, quiet| - downloadable.clear_cache if force - downloadable.fetch(quiet:) + sig { params(downloadable: T.any(Resource, Bottle, Cask::Download)).void } + def enqueue(downloadable) + downloads[downloadable] ||= Concurrent::Promises.future_on( + pool, RetryableDownload.new(downloadable, tries:), force, quiet + ) do |download, force, quiet| + download.clear_cache if force + download.fetch(quiet:) end - # rubocop:enable Lint/ShadowingOuterLocalVariable end sig { void } - def cancel - # FIXME: Implement graceful cancellaction of running downloads based on - # https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Cancellation.html - # instead of killing the whole thread pool. - pool.kill + def start + if concurrency == 1 + downloads.each do |downloadable, promise| + promise.wait! + rescue ChecksumMismatchError => e + opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" + Homebrew.failed = true if downloadable.is_a?(Resource::Patch) + end + else + spinner = Spinner.new + remaining_downloads = downloads.dup.to_a + previous_pending_line_count = 0 + + begin + $stdout.print Tty.hide_cursor + $stdout.flush + + output_message = lambda do |downloadable, future, last| + status = case future.state + when :fulfilled + "#{Tty.green}✔︎#{Tty.reset}" + when :rejected + "#{Tty.red}✘#{Tty.reset}" + when :pending, :processing + "#{Tty.blue}#{spinner}#{Tty.reset}" + else + raise future.state.to_s + end + + message = "#{downloadable.download_type.capitalize} #{downloadable.name}" + $stdout.print "#{status} #{message}#{"\n" unless last}" + $stdout.flush + + if future.rejected? + if (e = future.reason).is_a?(ChecksumMismatchError) + opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" + Homebrew.failed = true if downloadable.is_a?(Resource::Patch) + next 2 + else + message = future.reason.to_s + onoe message + Homebrew.failed = true + next message.count("\n") + end + end + + 1 + end + + until remaining_downloads.empty? + begin + finished_states = [:fulfilled, :rejected] + + finished_downloads, remaining_downloads = remaining_downloads.partition do |_, future| + finished_states.include?(future.state) + end + + finished_downloads.each do |downloadable, future| + previous_pending_line_count -= 1 + $stdout.print Tty.clear_to_end + $stdout.flush + output_message.call(downloadable, future, false) + end + + previous_pending_line_count = 0 + max_lines = [concurrency, Tty.height].min + remaining_downloads.each_with_index do |(downloadable, future), i| + break if previous_pending_line_count >= max_lines + + $stdout.print Tty.clear_to_end + $stdout.flush + last = i == max_lines - 1 || i == remaining_downloads.count - 1 + previous_pending_line_count += output_message.call(downloadable, future, last) + end + + if previous_pending_line_count.positive? + if (previous_pending_line_count - 1).zero? + $stdout.print Tty.move_cursor_beginning + else + $stdout.print Tty.move_cursor_up_beginning(previous_pending_line_count - 1) + end + $stdout.flush + end + + sleep 0.05 + rescue Interrupt + remaining_downloads.each do |_, future| + # FIXME: Implement cancellation of running downloads. + end + + cancel + + if previous_pending_line_count.positive? + $stdout.print Tty.move_cursor_down(previous_pending_line_count - 1) + $stdout.flush + end + + raise + end + end + ensure + $stdout.print Tty.show_cursor + $stdout.flush + end + end end sig { void } @@ -41,5 +140,68 @@ module Homebrew pool.shutdown pool.wait_for_termination end + + private + + sig { void } + def cancel + # FIXME: Implement graceful cancellation of running downloads based on + # https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Cancellation.html + # instead of killing the whole thread pool. + pool.kill + end + + sig { returns(Concurrent::FixedThreadPool) } + attr_reader :pool + + sig { returns(Integer) } + attr_reader :concurrency + + sig { returns(Integer) } + attr_reader :tries + + sig { returns(T::Boolean) } + attr_reader :force + + sig { returns(T::Boolean) } + attr_reader :quiet + + sig { returns(T::Hash[T.any(Resource, Bottle, Cask::Download), Concurrent::Promises::Future]) } + def downloads + @downloads ||= T.let({}, T.nilable(T::Hash[T.any(Resource, Bottle, Cask::Download), + Concurrent::Promises::Future])) + end + + class Spinner + FRAMES = [ + "⠋", + "⠙", + "⠚", + "⠞", + "⠖", + "⠦", + "⠴", + "⠲", + "⠳", + "⠓", + ].freeze + + sig { void } + def initialize + @start = T.let(Time.now, Time) + @i = T.let(0, Integer) + end + + sig { returns(String) } + def to_s + now = Time.now + if @start + 0.1 < now + @start = now + @i = (@i + 1) % FRAMES.count + end + + FRAMES.fetch(@i) + end + end end end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index d9a6e86290..e744d4d6ce 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -341,7 +341,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy .reject { |path| path.extname.end_with?(".incomplete") } @cached_location = T.let( - if downloads.count == 1 + if downloads.one? downloads.fetch(0) else HOMEBREW_CACHE/"downloads/#{url_sha256}--#{Utils.safe_filename(resolved_basename)}" @@ -425,8 +425,8 @@ end class CurlDownloadStrategy < AbstractFileDownloadStrategy include Utils::Curl - # url, basename, time, file_size, is_redirection - URLMetadata = T.type_alias { [String, String, T.nilable(Time), T.nilable(Integer), T::Boolean] } + # url, basename, time, file_size, content_type, is_redirection + URLMetadata = T.type_alias { [String, String, T.nilable(Time), T.nilable(Integer), T.nilable(String), T::Boolean] } sig { returns(T::Array[String]) } attr_reader :mirrors @@ -469,10 +469,8 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy ohai "Downloading #{url}" cached_location_valid = cached_location.exist? - v = version - cached_location_valid = false if v.is_a?(Cask::DSL::Version) && v.latest? - resolved_url, _, last_modified, file_size, is_redirection = begin + resolved_url, _, last_modified, file_size, content_type, is_redirection = begin resolve_url_basename_time_file_size(url, timeout: Utils::Timer.remaining!(end_time)) rescue ErrorDuringExecution raise unless cached_location_valid @@ -484,10 +482,19 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy # The cached location is no longer fresh if either: # - Last-Modified value is newer than the file's timestamp # - Content-Length value is different than the file's size - if cached_location_valid && !is_redirection - newer_last_modified = last_modified && last_modified > cached_location.mtime - different_file_size = file_size&.nonzero? && file_size != cached_location.size - cached_location_valid = !(newer_last_modified || different_file_size) + if cached_location_valid && (content_type.nil? || !content_type.start_with?("text/")) + if last_modified && last_modified > cached_location.mtime + ohai "Ignoring #{cached_location}", + "Cached modified time #{cached_location.mtime.iso8601} is before" \ + "Last-Modified header: #{last_modified.iso8601}" + cached_location_valid = false + end + if file_size&.nonzero? && file_size != cached_location.size + ohai "Ignoring #{cached_location}", + "Cached size #{cached_location.size} differs from " \ + "Content-Length header: #{file_size}" + cached_location_valid = false + end end if cached_location_valid @@ -525,7 +532,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy sig { params(timeout: T.any(Float, Integer, NilClass)).returns([T.nilable(Time), Integer]) } def resolved_time_file_size(timeout: nil) - _, _, time, file_size = resolve_url_basename_time_file_size(url, timeout:) + _, _, time, file_size, = resolve_url_basename_time_file_size(url, timeout:) [time, T.must(file_size)] end @@ -545,7 +552,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy begin parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout:) rescue ErrorDuringExecution - return [url, parse_basename(url), nil, nil, false] + return [url, parse_basename(url), nil, nil, nil, false] end parsed_headers = parsed_output.fetch(:responses).map { |r| r.fetch(:headers) } @@ -597,10 +604,14 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy .flat_map { |headers| [*headers["content-length"]&.to_i] } .last + content_type = parsed_headers + .flat_map { |headers| [*headers["content-type"]] } + .last + is_redirection = url != final_url basename = filenames.last || parse_basename(final_url, search_query: !is_redirection) - @resolved_info_cache[url] = [final_url, basename, time.last, file_size, is_redirection] + @resolved_info_cache[url] = [final_url, basename, time.last, file_size, content_type, is_redirection] end sig { @@ -718,7 +729,7 @@ class CurlGitHubPackagesDownloadStrategy < CurlDownloadStrategy def resolve_url_basename_time_file_size(url, timeout: nil) return super if @resolved_basename.blank? - [url, @resolved_basename, nil, nil, false] + [url, @resolved_basename, nil, nil, nil, false] end end @@ -1352,7 +1363,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy end command! "cvs", - args: [*quiet_flag, "-d", @url, "checkout", "-d", cached_location.basename, @module], + args: [*quiet_flag, "-d", @url, "checkout", "-d", basename.to_s, @module], chdir: cached_location.dirname, timeout: Utils::Timer.remaining(timeout) end @@ -1544,7 +1555,7 @@ class FossilDownloadStrategy < VCSDownloadStrategy sig { override.returns(Time) } def source_modified_time out = silent_command("fossil", args: ["info", "tip", "-R", cached_location]).stdout - Time.parse(T.must(out[/^uuid: +\h+ (.+)$/, 1])) + Time.parse(T.must(out[/^(hash|uuid): +\h+ (.+)$/, 1])) end # Return last commit's unique identifier for the repository. @@ -1553,7 +1564,7 @@ class FossilDownloadStrategy < VCSDownloadStrategy sig { override.returns(String) } def last_commit out = silent_command("fossil", args: ["info", "tip", "-R", cached_location]).stdout - T.must(out[/^uuid: +(\h+) .+$/, 1]) + T.must(out[/^(hash|uuid): +(\h+) .+$/, 1]) end sig { override.returns(T::Boolean) } diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 7fc446340d..1af588add6 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -463,7 +463,7 @@ module Homebrew default_text: "`~/.ssh/config`", }, HOMEBREW_SUDO_THROUGH_SUDO_USER: { - description: "If set, Homebrew will use the `SUDO_USER` environment variable to define the user to " \ + description: "If set, Homebrew will use the `$SUDO_USER` environment variable to define the user to " \ "`sudo`(8) through when running `sudo`(8).", boolean: true, }, diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index b7a9afb644..4a449993f7 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -7,16 +7,6 @@ require "extend/ENV/shared" require "extend/ENV/std" require "extend/ENV/super" -module Kernel - sig { params(env: T.nilable(String)).returns(T::Boolean) } - def superenv?(env) - return false if env == "std" - - !Superenv.bin.nil? - end - private :superenv? -end - # # @!parse # # `ENV` is not actually a class, but this makes YARD happy diff --git a/Library/Homebrew/extend/ENV.rbi b/Library/Homebrew/extend/ENV.rbi index 24711f725f..b7727c58c9 100644 --- a/Library/Homebrew/extend/ENV.rbi +++ b/Library/Homebrew/extend/ENV.rbi @@ -10,6 +10,10 @@ class Sorbet module Static class ENVClass include EnvActivation + # NOTE: This is a bit misleading, as at most only one of these can be true + # See: EnvActivation#activate_extensions! + include Stdenv + include Superenv end end end diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index d80724a8fa..38b7c16f4e 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -54,8 +54,6 @@ module SharedEnvExtension @debug_symbols = debug_symbols reset end - alias generic_shared_setup_build_environment setup_build_environment - private :generic_shared_setup_build_environment sig { void } def reset diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index b0c312c24a..22f5cb4056 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -68,7 +68,6 @@ module Stdenv gcc_formula = gcc_version_formula(cc) append_path "PATH", gcc_formula.opt_bin.to_s end - alias generic_setup_build_environment setup_build_environment sig { returns(T.nilable(PATH)) } def determine_pkg_config_libdir diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 5dceddbac1..b419561736 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -93,6 +93,8 @@ module Superenv # Prevent Go from automatically downloading a newer toolchain than the one that we have. # https://tip.golang.org/doc/toolchain self["GOTOOLCHAIN"] = "local" + # Prevent maturin from automatically downloading its own rust + self["MATURIN_NO_INSTALL_RUST"] = "1" # Prevent Python packages from using bundled libraries by default. # Currently for hidapi, pyzmq and pynacl self["HIDAPI_SYSTEM_HIDAPI"] = "1" @@ -125,7 +127,6 @@ module Superenv # These flags will also be present: # a - apply fix for apr-1-config path end - alias generic_setup_build_environment setup_build_environment private @@ -152,7 +153,6 @@ module Superenv .reverse .map { |d| d.opt_libexec/"bin" } end - alias generic_homebrew_extra_paths homebrew_extra_paths sig { returns(T.nilable(PATH)) } def determine_path @@ -372,8 +372,8 @@ module Superenv append_to_cccfg "O" end + # This is an exception where we want to use this method name format. # rubocop: disable Naming/MethodName - # Fixes style error `Naming/MethodName: Use snake_case for method names.` sig { params(block: T.nilable(T.proc.void)).void } def O0(&block) if block diff --git a/Library/Homebrew/extend/file/atomic.rb b/Library/Homebrew/extend/file/atomic.rb index b57c9cc850..d0ae305a3c 100644 --- a/Library/Homebrew/extend/file/atomic.rb +++ b/Library/Homebrew/extend/file/atomic.rb @@ -20,11 +20,11 @@ class File # file.write('hello') # end sig { - type_parameters(:out).params( + type_parameters(:Out).params( file_name: T.any(Pathname, String), temp_dir: String, - _block: T.proc.params(arg0: Tempfile).returns(T.type_parameter(:out)), - ).returns(T.type_parameter(:out)) + _block: T.proc.params(arg0: Tempfile).returns(T.type_parameter(:Out)), + ).returns(T.type_parameter(:Out)) } def self.atomic_write(file_name, temp_dir = dirname(file_name), &_block) require "tempfile" unless defined?(Tempfile) diff --git a/Library/Homebrew/extend/hash/deep_merge.rbi b/Library/Homebrew/extend/hash/deep_merge.rbi index a2a316e1b5..8d8413f7e8 100644 --- a/Library/Homebrew/extend/hash/deep_merge.rbi +++ b/Library/Homebrew/extend/hash/deep_merge.rbi @@ -3,18 +3,18 @@ class Hash sig { - type_parameters(:k2).params( - other_hash: T::Hash[T.type_parameter(:k2), T.untyped], + type_parameters(:K2).params( + other_hash: T::Hash[T.type_parameter(:K2), T.untyped], block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)), - ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped]) + ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:K2)), T.untyped]) } def deep_merge(other_hash, &block); end sig { - type_parameters(:k2).params( - other_hash: T::Hash[T.type_parameter(:k2), T.untyped], + type_parameters(:K2).params( + other_hash: T::Hash[T.type_parameter(:K2), T.untyped], block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)), - ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped]) + ).returns(T::Hash[T.any(Hash::K, T.type_parameter(:K2)), T.untyped]) } def deep_merge!(other_hash, &block); end end diff --git a/Library/Homebrew/extend/hash/deep_transform_values.rbi b/Library/Homebrew/extend/hash/deep_transform_values.rbi index 8eece3e2dc..f2edfb2c81 100644 --- a/Library/Homebrew/extend/hash/deep_transform_values.rbi +++ b/Library/Homebrew/extend/hash/deep_transform_values.rbi @@ -2,16 +2,16 @@ class Hash sig { - type_parameters(:out).params( - block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)), - ).returns(T::Hash[Hash::K, T.type_parameter(:out)]) + type_parameters(:Out).params( + block: T.proc.params(o: Hash::V).returns(T.type_parameter(:Out)), + ).returns(T::Hash[Hash::K, T.type_parameter(:Out)]) } def deep_transform_values(&block); end sig { - type_parameters(:out).params( - block: T.proc.params(o: Hash::V).returns(T.type_parameter(:out)), - ).returns(T::Hash[Hash::K, T.type_parameter(:out)]) + type_parameters(:Out).params( + block: T.proc.params(o: Hash::V).returns(T.type_parameter(:Out)), + ).returns(T::Hash[Hash::K, T.type_parameter(:Out)]) } def deep_transform_values!(&block); end end diff --git a/Library/Homebrew/extend/hash/keys.rbi b/Library/Homebrew/extend/hash/keys.rbi index ed4e6a6eb8..3cafb20b6a 100644 --- a/Library/Homebrew/extend/hash/keys.rbi +++ b/Library/Homebrew/extend/hash/keys.rbi @@ -3,16 +3,16 @@ class Hash sig { - type_parameters(:out).params( - block: T.proc.params(o: K).returns(T.type_parameter(:out)), - ).returns(T::Hash[T.type_parameter(:out), V]) + type_parameters(:Out).params( + block: T.proc.params(o: K).returns(T.type_parameter(:Out)), + ).returns(T::Hash[T.type_parameter(:Out), V]) } def deep_transform_keys(&block); end sig { - type_parameters(:out).params( - block: T.proc.params(o: K).returns(T.type_parameter(:out)), - ).returns(T::Hash[T.type_parameter(:out), V]) + type_parameters(:Out).params( + block: T.proc.params(o: K).returns(T.type_parameter(:Out)), + ).returns(T::Hash[T.type_parameter(:Out), V]) } def deep_transform_keys!(&block); end diff --git a/Library/Homebrew/extend/kernel.rb b/Library/Homebrew/extend/kernel.rb index 56eb04b97d..01eeef4e3d 100644 --- a/Library/Homebrew/extend/kernel.rb +++ b/Library/Homebrew/extend/kernel.rb @@ -5,6 +5,14 @@ # TODO: move these out of `Kernel`. module Kernel + sig { params(env: T.nilable(String)).returns(T::Boolean) } + def superenv?(env) + return false if env == "std" + + !Superenv.bin.nil? + end + private :superenv? + def require?(path) return false if path.nil? @@ -18,9 +26,8 @@ module Kernel require path end true - rescue LoadError => e - # we should raise on syntax errors but not if the file doesn't exist. - raise unless e.message.include?(path) + rescue LoadError + false end def ohai_title(title) @@ -73,7 +80,7 @@ module Kernel sig { params(message: T.any(String, Exception)).void } def opoo(message) require "utils/github/actions" - return if GitHub::Actions.puts_annotation_if_env_set(:warning, message.to_s) + return if GitHub::Actions.puts_annotation_if_env_set!(:warning, message.to_s) require "utils/formatter" @@ -82,13 +89,24 @@ module Kernel end end + # Print a warning message only if not running in GitHub Actions. + # + # @api public + sig { params(message: T.any(String, Exception)).void } + def opoo_outside_github_actions(message) + require "utils/github/actions" + return if GitHub::Actions.env_set? + + opoo(message) + end + # Print an error message. # # @api public sig { params(message: T.any(String, Exception)).void } def onoe(message) require "utils/github/actions" - return if GitHub::Actions.puts_annotation_if_env_set(:error, message.to_s) + return if GitHub::Actions.puts_annotation_if_env_set!(:error, message.to_s) require "utils/formatter" @@ -186,7 +204,7 @@ module Kernel disable = true if disable_for_developers && Homebrew::EnvConfig.developer? if disable || Homebrew.raise_deprecation_exceptions? require "utils/github/actions" - GitHub::Actions.puts_annotation_if_env_set(:error, message, file:, line:) + GitHub::Actions.puts_annotation_if_env_set!(:error, message, file:, line:) exception = MethodDeprecatedError.new(message) exception.set_backtrace(backtrace) raise exception diff --git a/Library/Homebrew/extend/os/dev-cmd/tests.rb b/Library/Homebrew/extend/os/dev-cmd/tests.rb new file mode 100644 index 0000000000..556052a63f --- /dev/null +++ b/Library/Homebrew/extend/os/dev-cmd/tests.rb @@ -0,0 +1,5 @@ +# typed: strict +# frozen_string_literal: true + +require "extend/os/linux/dev-cmd/tests" if OS.linux? +require "extend/os/mac/dev-cmd/tests" if OS.mac? diff --git a/Library/Homebrew/extend/os/linux/bundle/bundle.rb b/Library/Homebrew/extend/os/linux/bundle/bundle.rb index 71c2e41625..1acbb70541 100644 --- a/Library/Homebrew/extend/os/linux/bundle/bundle.rb +++ b/Library/Homebrew/extend/os/linux/bundle/bundle.rb @@ -9,6 +9,16 @@ module OS def mas_installed? false end + + # Setup pkg-config, if present, to help locate packages + # Only need this on Linux as Homebrew provides a shim on macOS + sig { void } + def prepend_pkgconf_path_if_needed! + pkgconf = Formulary.factory("pkgconf") + return unless pkgconf.any_version_installed? + + ENV.prepend_path "PATH", pkgconf.opt_bin.to_s + end end end end diff --git a/Library/Homebrew/extend/os/linux/cask/quarantine.rb b/Library/Homebrew/extend/os/linux/cask/quarantine.rb index 62d981ee3d..5adcbd2eec 100644 --- a/Library/Homebrew/extend/os/linux/cask/quarantine.rb +++ b/Library/Homebrew/extend/os/linux/cask/quarantine.rb @@ -5,18 +5,20 @@ module OS module Linux module Cask module Quarantine - extend T::Helpers + module ClassMethods + extend T::Helpers - requires_ancestor { ::Cask::Quarantine } + requires_ancestor { ::Cask::Quarantine } - sig { returns(Symbol) } - def self.check_quarantine_support = :linux + sig { returns(Symbol) } + def check_quarantine_support = :linux - sig { returns(T::Boolean) } - def self.available? = false + sig { returns(T::Boolean) } + def available? = false + end end end end end -Cask::Quarantine.prepend(OS::Linux::Cask::Quarantine) +Cask::Quarantine.singleton_class.prepend(OS::Linux::Cask::Quarantine::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/compilers.rb b/Library/Homebrew/extend/os/linux/compilers.rb index 8965b15100..db3e1cd00e 100644 --- a/Library/Homebrew/extend/os/linux/compilers.rb +++ b/Library/Homebrew/extend/os/linux/compilers.rb @@ -1,9 +1,21 @@ # typed: strict # frozen_string_literal: true -class CompilerSelector - sig { returns(String) } - def self.preferred_gcc - OS::LINUX_PREFERRED_GCC_COMPILER_FORMULA +module OS + module Linux + module CompilerSelector + module ClassMethods + extend T::Helpers + + requires_ancestor { T.class_of(::CompilerSelector) } + + sig { returns(String) } + def preferred_gcc + OS::LINUX_PREFERRED_GCC_COMPILER_FORMULA + end + end + end end end + +CompilerSelector.singleton_class.prepend(OS::Linux::CompilerSelector::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/dev-cmd/tests.rb b/Library/Homebrew/extend/os/linux/dev-cmd/tests.rb new file mode 100644 index 0000000000..60bc593254 --- /dev/null +++ b/Library/Homebrew/extend/os/linux/dev-cmd/tests.rb @@ -0,0 +1,28 @@ +# typed: strict +# frozen_string_literal: true + +module OS + module Linux + module DevCmd + module Tests + extend T::Helpers + + requires_ancestor { Homebrew::DevCmd::Tests } + + private + + sig { params(bundle_args: T::Array[String]).returns(T::Array[String]) } + def os_bundle_args(bundle_args) + non_macos_bundle_args(bundle_args) + end + + sig { params(files: T::Array[String]).returns(T::Array[String]) } + def os_files(files) + non_macos_files(files) + end + end + end + end +end + +Homebrew::DevCmd::Tests.prepend(OS::Linux::DevCmd::Tests) diff --git a/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb b/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb index 836a80c702..346fc1aa2a 100644 --- a/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb +++ b/Library/Homebrew/extend/os/linux/dev-cmd/update-test.rb @@ -1,19 +1,19 @@ # typed: strict # frozen_string_literal: true -module Homebrew - module DevCmd - class UpdateTest < AbstractCommand - alias generic_git_tags git_tags +module OS + module Linux + module DevCmd + module UpdateTest + private - private - - sig { returns(String) } - def git_tags - tags = generic_git_tags - tags = Utils.popen_read("git tag --list | sort -rV") if tags.blank? - tags + sig { returns(String) } + def git_tags + super.presence || Utils.popen_read("git tag --list | sort -rV") + end end end end end + +Homebrew::DevCmd::UpdateTest.prepend(OS::Linux::DevCmd::UpdateTest) diff --git a/Library/Homebrew/extend/os/linux/development_tools.rb b/Library/Homebrew/extend/os/linux/development_tools.rb index e65e5f8043..1036d79d5e 100644 --- a/Library/Homebrew/extend/os/linux/development_tools.rb +++ b/Library/Homebrew/extend/os/linux/development_tools.rb @@ -4,69 +4,71 @@ module OS module Linux module DevelopmentTools - extend T::Helpers + module ClassMethods + extend T::Helpers - requires_ancestor { ::DevelopmentTools } + requires_ancestor { ::DevelopmentTools } - sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } - def locate(tool) - @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), Pathname])) - @locate.fetch(tool) do |key| - @locate[key] = if ::DevelopmentTools.needs_build_formulae? && - (binutils_path = HOMEBREW_PREFIX/"opt/binutils/bin/#{tool}").executable? - binutils_path - elsif ::DevelopmentTools.needs_build_formulae? && - (glibc_path = HOMEBREW_PREFIX/"opt/glibc/bin/#{tool}").executable? - glibc_path - elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable? - homebrew_path - elsif File.executable?(system_path = "/usr/bin/#{tool}") - Pathname.new system_path + sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } + def locate(tool) + @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), Pathname])) + @locate.fetch(tool) do |key| + @locate[key] = if ::DevelopmentTools.needs_build_formulae? && + (binutils_path = HOMEBREW_PREFIX/"opt/binutils/bin/#{tool}").executable? + binutils_path + elsif ::DevelopmentTools.needs_build_formulae? && + (glibc_path = HOMEBREW_PREFIX/"opt/glibc/bin/#{tool}").executable? + glibc_path + elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable? + homebrew_path + elsif File.executable?(system_path = "/usr/bin/#{tool}") + Pathname.new system_path + end end end - end - sig { returns(Symbol) } - def default_compiler = :gcc + sig { returns(Symbol) } + def default_compiler = :gcc - sig { returns(T::Boolean) } - def needs_libc_formula? - return @needs_libc_formula unless @needs_libc_formula.nil? + sig { returns(T::Boolean) } + def needs_libc_formula? + return @needs_libc_formula unless @needs_libc_formula.nil? - @needs_libc_formula = T.let(OS::Linux::Glibc.below_ci_version?, T.nilable(T::Boolean)) - @needs_libc_formula = !!@needs_libc_formula - end - - # Keep this method around for now to make it easier to add this functionality later. - # rubocop:disable Lint/UselessMethodDefinition - sig { returns(Pathname) } - def host_gcc_path - # TODO: override this if/when we to pick the GCC based on e.g. the Ubuntu version. - super - end - # rubocop:enable Lint/UselessMethodDefinition - - sig { returns(T::Boolean) } - def needs_compiler_formula? - return @needs_compiler_formula unless @needs_compiler_formula.nil? - - @needs_compiler_formula = T.let(nil, T.nilable(T::Boolean)) - @needs_compiler_formula = if host_gcc_path.exist? - ::DevelopmentTools.gcc_version(host_gcc_path.to_s) < OS::LINUX_GCC_CI_VERSION - else - true + @needs_libc_formula = T.let(OS::Linux::Glibc.below_ci_version?, T.nilable(T::Boolean)) + @needs_libc_formula = !!@needs_libc_formula end - end - sig { returns(T::Hash[String, T.nilable(String)]) } - def build_system_info - super.merge({ - "glibc_version" => OS::Linux::Glibc.version.to_s.presence, - "oldest_cpu_family" => Hardware.oldest_cpu.to_s, - }) + # Keep this method around for now to make it easier to add this functionality later. + # rubocop:disable Lint/UselessMethodDefinition + sig { returns(Pathname) } + def host_gcc_path + # TODO: override this if/when we to pick the GCC based on e.g. the Ubuntu version. + super + end + # rubocop:enable Lint/UselessMethodDefinition + + sig { returns(T::Boolean) } + def needs_compiler_formula? + return @needs_compiler_formula unless @needs_compiler_formula.nil? + + @needs_compiler_formula = T.let(nil, T.nilable(T::Boolean)) + @needs_compiler_formula = if host_gcc_path.exist? + ::DevelopmentTools.gcc_version(host_gcc_path.to_s) < OS::LINUX_GCC_CI_VERSION + else + true + end + end + + sig { returns(T::Hash[String, T.nilable(String)]) } + def build_system_info + super.merge({ + "glibc_version" => OS::Linux::Glibc.version.to_s.presence, + "oldest_cpu_family" => ::Hardware.oldest_cpu.to_s, + }) + end end end end end -DevelopmentTools.singleton_class.prepend(OS::Linux::DevelopmentTools) +DevelopmentTools.singleton_class.prepend(OS::Linux::DevelopmentTools::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/diagnostic.rb b/Library/Homebrew/extend/os/linux/diagnostic.rb index 034d047961..d03421e498 100644 --- a/Library/Homebrew/extend/os/linux/diagnostic.rb +++ b/Library/Homebrew/extend/os/linux/diagnostic.rb @@ -32,7 +32,7 @@ module OS end def check_tmpdir_sticky_bit - message = generic_check_tmpdir_sticky_bit + message = super return if message.nil? message + <<~EOS @@ -74,11 +74,11 @@ module OS end def check_supported_architecture - return if Hardware::CPU.intel? - return if Homebrew::EnvConfig.developer? && ENV["HOMEBREW_ARM64_TESTING"].present? && Hardware::CPU.arm? + return if ::Hardware::CPU.intel? + return if Homebrew::EnvConfig.developer? && ENV["HOMEBREW_ARM64_TESTING"].present? && ::Hardware::CPU.arm? <<~EOS - Your CPU architecture (#{Hardware::CPU.arch}) is not supported. We only support + Your CPU architecture (#{::Hardware::CPU.arch}) is not supported. We only support x86_64 CPU architectures. You will be unable to use binary packages (bottles). #{support_tier_message(tier: 2)} @@ -189,6 +189,13 @@ module OS are prone to breaking when GCC is updated. You should `brew reinstall` these formulae: EOS end + + def check_cask_software_versions + super + add_info "Linux", OS::Linux.os_version + + nil + end end end end diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index fe4410d22e..284f62aa6b 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -1,16 +1,22 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module SharedEnvExtension - def effective_arch - if @build_bottle && @bottle_arch - @bottle_arch.to_sym - elsif @build_bottle - Hardware.oldest_cpu - elsif Hardware::CPU.intel? || Hardware::CPU.arm? - :native - else - :dunno +module OS + module Linux + module SharedEnvExtension + def effective_arch + if @build_bottle && @bottle_arch + @bottle_arch.to_sym + elsif @build_bottle + ::Hardware.oldest_cpu + elsif ::Hardware::CPU.intel? || ::Hardware::CPU.arm? + :native + else + :dunno + end + end end end end + +SharedEnvExtension.prepend(OS::Linux::SharedEnvExtension) diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb index ba2fa12309..67f2620405 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb @@ -1,36 +1,45 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module Stdenv - sig { - params( - formula: T.nilable(Formula), - cc: T.nilable(String), - build_bottle: T.nilable(T::Boolean), - bottle_arch: T.nilable(String), - testing_formula: T::Boolean, - debug_symbols: T.nilable(T::Boolean), - ).void - } - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, - debug_symbols: false) - generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, - testing_formula:, debug_symbols:) +module OS + module Linux + module Stdenv + extend T::Helpers - prepend_path "CPATH", HOMEBREW_PREFIX/"include" - prepend_path "LIBRARY_PATH", HOMEBREW_PREFIX/"lib" - prepend_path "LD_RUN_PATH", HOMEBREW_PREFIX/"lib" + requires_ancestor { ::SharedEnvExtension } - return unless @formula + sig { + params( + formula: T.nilable(::Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } + def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, + testing_formula: false, debug_symbols: false) + super - prepend_path "CPATH", @formula.include - prepend_path "LIBRARY_PATH", @formula.lib - prepend_path "LD_RUN_PATH", @formula.lib - end + prepend_path "CPATH", HOMEBREW_PREFIX/"include" + prepend_path "LIBRARY_PATH", HOMEBREW_PREFIX/"lib" + prepend_path "LD_RUN_PATH", HOMEBREW_PREFIX/"lib" - def libxml2 - append "CPPFLAGS", "-I#{Formula["libxml2"].include/"libxml2"}" - rescue FormulaUnavailableError - nil + return unless @formula + + prepend_path "CPATH", @formula.include + prepend_path "LIBRARY_PATH", @formula.lib + prepend_path "LD_RUN_PATH", @formula.lib + end + + def libxml2 + append "CPPFLAGS", "-I#{::Formula["libxml2"].include/"libxml2"}" + rescue FormulaUnavailableError + nil + end + end end end + +Stdenv.prepend(OS::Linux::Stdenv) diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index 6c5fb6ff4c..7c6d518fce 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -1,79 +1,93 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module Superenv - sig { returns(Pathname) } - def self.shims_path - HOMEBREW_SHIMS_PATH/"linux/super" - end +module OS + module Linux + module Superenv + extend T::Helpers - sig { returns(T.nilable(Pathname)) } - def self.bin - shims_path.realpath - end + requires_ancestor { SharedEnvExtension } + requires_ancestor { ::Superenv } - sig { - params( - formula: T.nilable(Formula), - cc: T.nilable(String), - build_bottle: T.nilable(T::Boolean), - bottle_arch: T.nilable(String), - testing_formula: T::Boolean, - debug_symbols: T.nilable(T::Boolean), - ).void - } - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, - debug_symbols: false) - generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, - testing_formula:, debug_symbols:) - self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" - self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path - self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula) - m4_path_deps = ["libtool", "bison"] - self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { m4_path_deps.include?(_1.name) } + module ClassMethods + sig { returns(Pathname) } + def shims_path + HOMEBREW_SHIMS_PATH/"linux/super" + end - # Pointer authentication and BTI are hardening techniques most distros - # use by default on their packages. arm64 Linux we're packaging - # everything from scratch so the entire dependency tree can have it. - append_to_cccfg "b" if Hardware::CPU.arch == :arm64 && DevelopmentTools.gcc_version("gcc") >= 9 - end + sig { returns(T.nilable(Pathname)) } + def bin + shims_path.realpath + end + end - def homebrew_extra_paths - paths = generic_homebrew_extra_paths - paths += %w[binutils make].filter_map do |f| - bin = Formulary.factory(f).opt_bin - bin if bin.directory? - rescue FormulaUnavailableError - nil + sig { + params( + formula: T.nilable(Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } + def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, + testing_formula: false, debug_symbols: false) + super + + self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" + self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path + self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula) + m4_path_deps = ["libtool", "bison"] + self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { m4_path_deps.include?(_1.name) } + + # Pointer authentication and BTI are hardening techniques most distros + # use by default on their packages. arm64 Linux we're packaging + # everything from scratch so the entire dependency tree can have it. + append_to_cccfg "b" if ::Hardware::CPU.arch == :arm64 && ::DevelopmentTools.gcc_version("gcc") >= 9 + end + + def homebrew_extra_paths + paths = super + paths += %w[binutils make].filter_map do |f| + bin = Formulary.factory(f).opt_bin + bin if bin.directory? + rescue FormulaUnavailableError + nil + end + paths + end + + def homebrew_extra_isystem_paths + paths = [] + # Add paths for GCC headers when building against versioned glibc because we have to use -nostdinc. + if deps.any? { |d| d.name.match?(/^glibc@.+$/) } + gcc_include_dir = Utils.safe_popen_read(cc, "--print-file-name=include").chomp + gcc_include_fixed_dir = Utils.safe_popen_read(cc, "--print-file-name=include-fixed").chomp + paths << gcc_include_dir << gcc_include_fixed_dir + end + paths + end + + def determine_rpath_paths(formula) + PATH.new( + *formula&.lib, + "#{HOMEBREW_PREFIX}/opt/gcc/lib/gcc/current", + PATH.new(run_time_deps.map { |dep| dep.opt_lib.to_s }).existing, + "#{HOMEBREW_PREFIX}/lib", + ) + end + + sig { returns(T.nilable(String)) } + def determine_dynamic_linker_path + path = "#{HOMEBREW_PREFIX}/lib/ld.so" + return unless File.readable? path + + path + end end - paths - end - - def homebrew_extra_isystem_paths - paths = [] - # Add paths for GCC headers when building against versioned glibc because we have to use -nostdinc. - if deps.any? { |d| d.name.match?(/^glibc@.+$/) } - gcc_include_dir = Utils.safe_popen_read(cc, "--print-file-name=include").chomp - gcc_include_fixed_dir = Utils.safe_popen_read(cc, "--print-file-name=include-fixed").chomp - paths << gcc_include_dir << gcc_include_fixed_dir - end - paths - end - - def determine_rpath_paths(formula) - PATH.new( - *formula&.lib, - "#{HOMEBREW_PREFIX}/opt/gcc/lib/gcc/current", - PATH.new(run_time_deps.map { |dep| dep.opt_lib.to_s }).existing, - "#{HOMEBREW_PREFIX}/lib", - ) - end - - sig { returns(T.nilable(String)) } - def determine_dynamic_linker_path - path = "#{HOMEBREW_PREFIX}/lib/ld.so" - return unless File.readable? path - - path end end + +Superenv.singleton_class.prepend(OS::Linux::Superenv::ClassMethods) +Superenv.prepend(OS::Linux::Superenv) diff --git a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb index b08411fb1b..a56c0c5582 100644 --- a/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/linux/formula_cellar_checks.rb @@ -1,9 +1,15 @@ # typed: strict # frozen_string_literal: true -module FormulaCellarChecks - sig { params(filename: Pathname).returns(T::Boolean) } - def valid_library_extension?(filename) - generic_valid_library_extension?(filename) || filename.basename.to_s.include?(".so.") +module OS + module Linux + module FormulaCellarChecks + sig { params(filename: Pathname).returns(T::Boolean) } + def valid_library_extension?(filename) + super || filename.basename.to_s.include?(".so.") + end + end end end + +FormulaCellarChecks.prepend(OS::Linux::FormulaCellarChecks) diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index b5c81ee078..2597af4eae 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -1,161 +1,171 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module Hardware - class CPU - class << self - def optimization_flags - @optimization_flags ||= begin - flags = generic_optimization_flags.dup - flags[:native] = arch_flag(Homebrew::EnvConfig.arch) - flags - end - end +module OS + module Linux + module Hardware + module CPU + module ClassMethods + extend T::Helpers - def family - return :arm if arm? - return :ppc if ppc? - return :dunno unless intel? + requires_ancestor { T.class_of(::Hardware::CPU) } - # See https://software.intel.com/en-us/articles/intel-architecture-and-processor-identification-with-cpuid-model-and-family-numbers - # and https://github.com/llvm/llvm-project/blob/main/llvm/lib/TargetParser/Host.cpp - # and https://en.wikipedia.org/wiki/List_of_Intel_CPU_microarchitectures#Roadmap - vendor_id = cpuinfo[/^vendor_id\s*: (.*)/, 1] - cpu_family = cpuinfo[/^cpu family\s*: ([0-9]+)/, 1].to_i - cpu_model = cpuinfo[/^model\s*: ([0-9]+)/, 1].to_i - unknown = :"unknown_0x#{cpu_family.to_s(16)}_0x#{cpu_model.to_s(16)}" - case vendor_id - when "GenuineIntel" - intel_family(cpu_family, cpu_model) - when "AuthenticAMD" - amd_family(cpu_family, cpu_model) - end || unknown - end - - def intel_family(family, cpu_model) - case family - when 0x06 - case cpu_model - when 0x3a, 0x3e - :ivybridge - when 0x2a, 0x2d - :sandybridge - when 0x25, 0x2c, 0x2f - :westmere - when 0x1a, 0x1e, 0x1f, 0x2e - :nehalem - when 0x17, 0x1d - :penryn - when 0x0f, 0x16 - :merom - when 0x0d - :dothan - when 0x1c, 0x26, 0x27, 0x35, 0x36 - :atom - when 0x3c, 0x3f, 0x45, 0x46 - :haswell - when 0x3d, 0x47, 0x4f, 0x56 - :broadwell - when 0x4e, 0x5e, 0x8e, 0x9e, 0xa5, 0xa6 - :skylake - when 0x66 - :cannonlake - when 0x6a, 0x6c, 0x7d, 0x7e - :icelake - when 0xa7 - :rocketlake - when 0x8c, 0x8d - :tigerlake - when 0x97, 0x9a, 0xbe, 0xb7, 0xba, 0xbf, 0xaa, 0xac - :alderlake - when 0xc5, 0xb5, 0xc6, 0xbd - :arrowlake - when 0xcc - :pantherlake - when 0xad, 0xae - :graniterapids - when 0xcf, 0x8f - :sapphirerapids + def optimization_flags + @optimization_flags ||= begin + flags = super.dup + flags[:native] = arch_flag(Homebrew::EnvConfig.arch) + flags + end end - when 0x0f - case cpu_model - when 0x06 - :presler - when 0x03, 0x04 - :prescott + + def family + return :arm if arm? + return :ppc if ppc? + return :dunno unless intel? + + # See https://software.intel.com/en-us/articles/intel-architecture-and-processor-identification-with-cpuid-model-and-family-numbers + # and https://github.com/llvm/llvm-project/blob/main/llvm/lib/TargetParser/Host.cpp + # and https://en.wikipedia.org/wiki/List_of_Intel_CPU_microarchitectures#Roadmap + vendor_id = cpuinfo[/^vendor_id\s*: (.*)/, 1] + cpu_family = cpuinfo[/^cpu family\s*: ([0-9]+)/, 1].to_i + cpu_model = cpuinfo[/^model\s*: ([0-9]+)/, 1].to_i + unknown = :"unknown_0x#{cpu_family.to_s(16)}_0x#{cpu_model.to_s(16)}" + case vendor_id + when "GenuineIntel" + intel_family(cpu_family, cpu_model) + when "AuthenticAMD" + amd_family(cpu_family, cpu_model) + end || unknown + end + + def intel_family(family, cpu_model) + case family + when 0x06 + case cpu_model + when 0x3a, 0x3e + :ivybridge + when 0x2a, 0x2d + :sandybridge + when 0x25, 0x2c, 0x2f + :westmere + when 0x1a, 0x1e, 0x1f, 0x2e + :nehalem + when 0x17, 0x1d + :penryn + when 0x0f, 0x16 + :merom + when 0x0d + :dothan + when 0x1c, 0x26, 0x27, 0x35, 0x36 + :atom + when 0x3c, 0x3f, 0x45, 0x46 + :haswell + when 0x3d, 0x47, 0x4f, 0x56 + :broadwell + when 0x4e, 0x5e, 0x8e, 0x9e, 0xa5, 0xa6 + :skylake + when 0x66 + :cannonlake + when 0x6a, 0x6c, 0x7d, 0x7e + :icelake + when 0xa7 + :rocketlake + when 0x8c, 0x8d + :tigerlake + when 0x97, 0x9a, 0xbe, 0xb7, 0xba, 0xbf, 0xaa, 0xac + :alderlake + when 0xc5, 0xb5, 0xc6, 0xbd + :arrowlake + when 0xcc + :pantherlake + when 0xad, 0xae + :graniterapids + when 0xcf, 0x8f + :sapphirerapids + end + when 0x0f + case cpu_model + when 0x06 + :presler + when 0x03, 0x04 + :prescott + end + end + end + + def amd_family(family, cpu_model) + case family + when 0x06 + :amd_k7 + when 0x0f + :amd_k8 + when 0x10 + :amd_k10 + when 0x11 + :amd_k8_k10_hybrid + when 0x12 + :amd_k10_llano + when 0x14 + :bobcat + when 0x15 + :bulldozer + when 0x16 + :jaguar + when 0x17 + case cpu_model + when 0x10..0x2f + :zen + when 0x30..0x3f, 0x47, 0x60..0x7f, 0x84..0x87, 0x90..0xaf + :zen2 + end + when 0x19 + case cpu_model + when ..0x0f, 0x20..0x5f + :zen3 + when 0x10..0x1f, 0x60..0x7f, 0xa0..0xaf + :zen4 + end + when 0x1a + :zen5 + end + end + + # Supported CPU instructions + def flags + @flags ||= cpuinfo[/^(?:flags|Features)\s*: (.*)/, 1]&.split + @flags ||= [] + end + + # Compatibility with Mac method, which returns lowercase symbols + # instead of strings. + def features + @features ||= flags[1..].map(&:intern) + end + + %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| + define_method(:"#{flag}?") do + T.bind(self, OS::Linux::Hardware::CPU::ClassMethods) + flags.include? flag + end + end + + def sse3? + flags.include?("pni") || flags.include?("sse3") + end + + def sse4? + flags.include? "sse4_1" + end + + private + + def cpuinfo + @cpuinfo ||= File.read("/proc/cpuinfo") end end end - - def amd_family(family, cpu_model) - case family - when 0x06 - :amd_k7 - when 0x0f - :amd_k8 - when 0x10 - :amd_k10 - when 0x11 - :amd_k8_k10_hybrid - when 0x12 - :amd_k10_llano - when 0x14 - :bobcat - when 0x15 - :bulldozer - when 0x16 - :jaguar - when 0x17 - case cpu_model - when 0x10..0x2f - :zen - when 0x30..0x3f, 0x47, 0x60..0x7f, 0x84..0x87, 0x90..0xaf - :zen2 - end - when 0x19 - case cpu_model - when ..0x0f, 0x20..0x5f - :zen3 - when 0x10..0x1f, 0x60..0x7f, 0xa0..0xaf - :zen4 - end - when 0x1a - :zen5 - end - end - - # Supported CPU instructions - def flags - @flags ||= cpuinfo[/^(?:flags|Features)\s*: (.*)/, 1]&.split - @flags ||= [] - end - - # Compatibility with Mac method, which returns lowercase symbols - # instead of strings. - def features - @features ||= flags[1..].map(&:intern) - end - - %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| - define_method(:"#{flag}?") do - T.bind(self, T.class_of(Hardware::CPU)) - flags.include? flag - end - end - - def sse3? - flags.include?("pni") || flags.include?("sse3") - end - - def sse4? - flags.include? "sse4_1" - end - - private - - def cpuinfo - @cpuinfo ||= File.read("/proc/cpuinfo") - end end end end + +Hardware::CPU.singleton_class.prepend(OS::Linux::Hardware::CPU::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/install.rb b/Library/Homebrew/extend/os/linux/install.rb index 0fc3cd16dc..d035a2f547 100644 --- a/Library/Homebrew/extend/os/linux/install.rb +++ b/Library/Homebrew/extend/os/linux/install.rb @@ -1,132 +1,132 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module Homebrew - module Install - # This is a list of known paths to the host dynamic linker on Linux if - # the host glibc is new enough. The symlink_ld_so method will fail if - # the host linker cannot be found in this list. - DYNAMIC_LINKERS = %w[ - /lib64/ld-linux-x86-64.so.2 - /lib64/ld64.so.2 - /lib/ld-linux.so.3 - /lib/ld-linux.so.2 - /lib/ld-linux-aarch64.so.1 - /lib/ld-linux-armhf.so.3 - /system/bin/linker64 - /system/bin/linker - ].freeze - private_constant :DYNAMIC_LINKERS +module OS + module Linux + module Install + module ClassMethods + # This is a list of known paths to the host dynamic linker on Linux if + # the host glibc is new enough. The symlink_ld_so method will fail if + # the host linker cannot be found in this list. + DYNAMIC_LINKERS = %w[ + /lib64/ld-linux-x86-64.so.2 + /lib64/ld64.so.2 + /lib/ld-linux.so.3 + /lib/ld-linux.so.2 + /lib/ld-linux-aarch64.so.1 + /lib/ld-linux-armhf.so.3 + /system/bin/linker64 + /system/bin/linker + ].freeze - # We link GCC runtime libraries that are not specifically used for Fortran, - # which are linked by the GCC formula. We only use the versioned shared libraries - # as the other shared and static libraries are only used at build time where - # GCC can find its own libraries. - GCC_RUNTIME_LIBS = %w[ - libatomic.so.1 - libgcc_s.so.1 - libgomp.so.1 - libstdc++.so.6 - ].freeze - private_constant :GCC_RUNTIME_LIBS + # We link GCC runtime libraries that are not specifically used for Fortran, + # which are linked by the GCC formula. We only use the versioned shared libraries + # as the other shared and static libraries are only used at build time where + # GCC can find its own libraries. + GCC_RUNTIME_LIBS = %w[ + libatomic.so.1 + libgcc_s.so.1 + libgomp.so.1 + libstdc++.so.6 + ].freeze - def self.perform_preinstall_checks(all_fatal: false) - generic_perform_preinstall_checks(all_fatal:) - symlink_ld_so - setup_preferred_gcc_libs - end - private_class_method :perform_preinstall_checks - - def self.global_post_install - generic_global_post_install - symlink_ld_so - setup_preferred_gcc_libs - end - - def self.check_cpu - return if Hardware::CPU.intel? && Hardware::CPU.is_64_bit? - return if Hardware::CPU.arm? - - message = "Sorry, Homebrew does not support your computer's CPU architecture!" - if Hardware::CPU.ppc64le? - message += <<~EOS - For OpenPOWER Linux (PPC64LE) support, see: - #{Formatter.url("https://github.com/homebrew-ppc64le/brew")} - EOS - end - abort message - end - private_class_method :check_cpu - - def self.symlink_ld_so - brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so" - - ld_so = HOMEBREW_PREFIX/"opt/glibc/bin/ld.so" - unless ld_so.readable? - ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s } - if ld_so.blank? - raise "Unable to locate the system's dynamic linker" unless brew_ld_so.readable? - - return - end - end - - return if brew_ld_so.readable? && (brew_ld_so.readlink == ld_so) - - FileUtils.mkdir_p HOMEBREW_PREFIX/"lib" - FileUtils.ln_sf ld_so, brew_ld_so - end - private_class_method :symlink_ld_so - - def self.setup_preferred_gcc_libs - gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA}" - glibc_installed = (HOMEBREW_PREFIX/"opt/glibc/bin/ld.so").readable? - - return unless gcc_opt_prefix.readable? - - if glibc_installed - ld_so_conf_d = HOMEBREW_PREFIX/"etc/ld.so.conf.d" - unless ld_so_conf_d.exist? - ld_so_conf_d.mkpath - FileUtils.chmod "go-w", ld_so_conf_d + def perform_preinstall_checks(all_fatal: false) + super + symlink_ld_so + setup_preferred_gcc_libs end - # Add gcc to ld search paths - ld_gcc_conf = ld_so_conf_d/"50-homebrew-preferred-gcc.conf" - ld_gcc_conf_content = <<~EOS - # This file is generated by Homebrew. Do not modify. - #{gcc_opt_prefix}/lib/gcc/current - EOS - - if !ld_gcc_conf.exist? || (ld_gcc_conf.read != ld_gcc_conf_content) - ld_gcc_conf.atomic_write ld_gcc_conf_content - FileUtils.chmod "u=rw,go-wx", ld_gcc_conf - - FileUtils.rm_f HOMEBREW_PREFIX/"etc/ld.so.cache" - system HOMEBREW_PREFIX/"opt/glibc/sbin/ldconfig" + def global_post_install + super + symlink_ld_so + setup_preferred_gcc_libs end - else - odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable? - end - GCC_RUNTIME_LIBS.each do |library| - gcc_library_symlink = HOMEBREW_PREFIX/"lib/#{library}" + def check_cpu + return if ::Hardware::CPU.intel? && ::Hardware::CPU.is_64_bit? + return if ::Hardware::CPU.arm? - if glibc_installed - # Remove legacy symlinks - FileUtils.rm gcc_library_symlink if gcc_library_symlink.symlink? - else - gcc_library = gcc_opt_prefix/"lib/gcc/current/#{library}" - # Skip if the link target doesn't exist. - next unless gcc_library.readable? + message = "Sorry, Homebrew does not support your computer's CPU architecture!" + if ::Hardware::CPU.ppc64le? + message += <<~EOS + For OpenPOWER Linux (PPC64LE) support, see: + #{Formatter.url("https://github.com/homebrew-ppc64le/brew")} + EOS + end + ::Kernel.abort message + end - # Also skip if the symlink already exists. - next if gcc_library_symlink.readable? && (gcc_library_symlink.readlink == gcc_library) + def symlink_ld_so + brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so" - FileUtils.ln_sf gcc_library, gcc_library_symlink + ld_so = HOMEBREW_PREFIX/"opt/glibc/bin/ld.so" + unless ld_so.readable? + ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s } + if ld_so.blank? + ::Kernel.raise "Unable to locate the system's dynamic linker" unless brew_ld_so.readable? + + return + end + end + + return if brew_ld_so.readable? && (brew_ld_so.readlink == ld_so) + + FileUtils.mkdir_p HOMEBREW_PREFIX/"lib" + FileUtils.ln_sf ld_so, brew_ld_so + end + + def setup_preferred_gcc_libs + gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA}" + glibc_installed = (HOMEBREW_PREFIX/"opt/glibc/bin/ld.so").readable? + + return unless gcc_opt_prefix.readable? + + if glibc_installed + ld_so_conf_d = HOMEBREW_PREFIX/"etc/ld.so.conf.d" + unless ld_so_conf_d.exist? + ld_so_conf_d.mkpath + FileUtils.chmod "go-w", ld_so_conf_d + end + + # Add gcc to ld search paths + ld_gcc_conf = ld_so_conf_d/"50-homebrew-preferred-gcc.conf" + ld_gcc_conf_content = <<~EOS + # This file is generated by Homebrew. Do not modify. + #{gcc_opt_prefix}/lib/gcc/current + EOS + + if !ld_gcc_conf.exist? || (ld_gcc_conf.read != ld_gcc_conf_content) + ld_gcc_conf.atomic_write ld_gcc_conf_content + FileUtils.chmod "u=rw,go-wx", ld_gcc_conf + + FileUtils.rm_f HOMEBREW_PREFIX/"etc/ld.so.cache" + ::Kernel.system HOMEBREW_PREFIX/"opt/glibc/sbin/ldconfig" + end + else + ::Kernel.odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable? + end + + GCC_RUNTIME_LIBS.each do |library| + gcc_library_symlink = HOMEBREW_PREFIX/"lib/#{library}" + + if glibc_installed + # Remove legacy symlinks + FileUtils.rm gcc_library_symlink if gcc_library_symlink.symlink? + else + gcc_library = gcc_opt_prefix/"lib/gcc/current/#{library}" + # Skip if the link target doesn't exist. + next unless gcc_library.readable? + + # Also skip if the symlink already exists. + next if gcc_library_symlink.readable? && (gcc_library_symlink.readlink == gcc_library) + + FileUtils.ln_sf gcc_library, gcc_library_symlink + end + end end end end - private_class_method :setup_preferred_gcc_libs end end + +Homebrew::Install.singleton_class.prepend(OS::Linux::Install::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/keg_relocate.rb b/Library/Homebrew/extend/os/linux/keg_relocate.rb index 6b53cd5e15..42e32dbf65 100644 --- a/Library/Homebrew/extend/os/linux/keg_relocate.rb +++ b/Library/Homebrew/extend/os/linux/keg_relocate.rb @@ -12,12 +12,12 @@ class Keg elf_files.each do |file| file.ensure_writable do - change_rpath(file, old_prefix, new_prefix) + change_rpath!(file, old_prefix, new_prefix) end end end - def change_rpath(file, old_prefix, new_prefix) + def change_rpath!(file, old_prefix, new_prefix) return false if !file.elf? || !file.dynamic_elf? updated = {} diff --git a/Library/Homebrew/extend/os/linux/linkage_checker.rb b/Library/Homebrew/extend/os/linux/linkage_checker.rb index c2392f7d7b..634bd5b71f 100644 --- a/Library/Homebrew/extend/os/linux/linkage_checker.rb +++ b/Library/Homebrew/extend/os/linux/linkage_checker.rb @@ -3,48 +3,55 @@ require "compilers" -class LinkageChecker - # Libraries provided by glibc and gcc. - SYSTEM_LIBRARY_ALLOWLIST = %w[ - ld-linux-x86-64.so.2 - ld-linux-aarch64.so.1 - libanl.so.1 - libatomic.so.1 - libc.so.6 - libdl.so.2 - libm.so.6 - libmvec.so.1 - libnss_files.so.2 - libpthread.so.0 - libresolv.so.2 - librt.so.1 - libthread_db.so.1 - libutil.so.1 - libgcc_s.so.1 - libgomp.so.1 - libstdc++.so.6 - libquadmath.so.0 - ].freeze +module OS + module Linux + module LinkageChecker + # Libraries provided by glibc and gcc. + SYSTEM_LIBRARY_ALLOWLIST = %w[ + ld-linux-x86-64.so.2 + ld-linux-aarch64.so.1 + libanl.so.1 + libatomic.so.1 + libc.so.6 + libdl.so.2 + libm.so.6 + libmvec.so.1 + libnss_files.so.2 + libpthread.so.0 + libresolv.so.2 + librt.so.1 + libthread_db.so.1 + libutil.so.1 + libgcc_s.so.1 + libgomp.so.1 + libstdc++.so.6 + libquadmath.so.0 + ].freeze - private + private - def check_dylibs(rebuild_cache:) - generic_check_dylibs(rebuild_cache:) + def check_dylibs(rebuild_cache:) + super - # glibc and gcc are implicit dependencies. - # No other linkage to system libraries is expected or desired. - @unwanted_system_dylibs = @system_dylibs.reject do |s| - SYSTEM_LIBRARY_ALLOWLIST.include? File.basename(s) + # glibc and gcc are implicit dependencies. + # No other linkage to system libraries is expected or desired. + @unwanted_system_dylibs = @system_dylibs.reject do |s| + SYSTEM_LIBRARY_ALLOWLIST.include? File.basename(s) + end + + # We build all formulae with an RPATH that includes the gcc formula's runtime lib directory. + # See: https://github.com/Homebrew/brew/blob/e689cc07/Library/Homebrew/extend/os/linux/extend/ENV/super.rb#L53 + # This results in formulae showing linkage with gcc whenever it is installed, even if no dependency is + # declared. + # See discussions at: + # https://github.com/Homebrew/brew/pull/13659 + # https://github.com/Homebrew/brew/pull/13796 + # TODO: Find a nicer way to handle this. (e.g. examining the ELF file to determine the required libstdc++.) + @undeclared_deps.delete("gcc") + @indirect_deps.delete("gcc") + end end - - # We build all formulae with an RPATH that includes the gcc formula's runtime lib directory. - # See: https://github.com/Homebrew/brew/blob/e689cc07/Library/Homebrew/extend/os/linux/extend/ENV/super.rb#L53 - # This results in formulae showing linkage with gcc whenever it is installed, even if no dependency is declared. - # See discussions at: - # https://github.com/Homebrew/brew/pull/13659 - # https://github.com/Homebrew/brew/pull/13796 - # TODO: Find a nicer way to handle this. (e.g. examining the ELF file to determine the required libstdc++.) - @undeclared_deps.delete("gcc") - @indirect_deps.delete("gcc") end end + +LinkageChecker.prepend(OS::Linux::LinkageChecker) diff --git a/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb b/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb index 296663fbca..2f730ef3c1 100644 --- a/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb +++ b/Library/Homebrew/extend/os/linux/requirements/xcode_requirement.rb @@ -5,7 +5,7 @@ require "requirement" class XcodeRequirement < Requirement sig { returns(T::Boolean) } - def xcode_installed_version + def xcode_installed_version! true end end diff --git a/Library/Homebrew/extend/os/linux/simulate_system.rb b/Library/Homebrew/extend/os/linux/simulate_system.rb index 248ee7e2a5..4e79bf7a2c 100644 --- a/Library/Homebrew/extend/os/linux/simulate_system.rb +++ b/Library/Homebrew/extend/os/linux/simulate_system.rb @@ -4,25 +4,27 @@ module OS module Linux module SimulateSystem - sig { returns(T.nilable(Symbol)) } - def os - @os ||= T.let(nil, T.nilable(Symbol)) - return :macos if @os.blank? && Homebrew::EnvConfig.simulate_macos_on_linux? + module ClassMethods + sig { returns(T.nilable(Symbol)) } + def os + @os ||= T.let(nil, T.nilable(Symbol)) + return :macos if @os.blank? && Homebrew::EnvConfig.simulate_macos_on_linux? - @os - end + @os + end - sig { returns(T::Boolean) } - def simulating_or_running_on_linux? - os.blank? || os == :linux - end + sig { returns(T::Boolean) } + def simulating_or_running_on_linux? + os.blank? || os == :linux + end - sig { returns(Symbol) } - def current_os - os || :linux + sig { returns(Symbol) } + def current_os + os || :linux + end end end end end -Homebrew::SimulateSystem.singleton_class.prepend(OS::Linux::SimulateSystem) +Homebrew::SimulateSystem.singleton_class.prepend(OS::Linux::SimulateSystem::ClassMethods) diff --git a/Library/Homebrew/extend/os/linux/system_config.rb b/Library/Homebrew/extend/os/linux/system_config.rb index 13ded66558..a9aa5213d4 100644 --- a/Library/Homebrew/extend/os/linux/system_config.rb +++ b/Library/Homebrew/extend/os/linux/system_config.rb @@ -5,53 +5,59 @@ require "compilers" require "os/linux/glibc" require "system_command" -module SystemConfig - include SystemCommand::Mixin +module OS + module Linux + module SystemConfig + module ClassMethods + include SystemCommand::Mixin - HOST_RUBY_PATH = "/usr/bin/ruby" + HOST_RUBY_PATH = "/usr/bin/ruby" - class << self - def host_glibc_version - version = OS::Linux::Glibc.system_version - return "N/A" if version.null? + def host_glibc_version + version = OS::Linux::Glibc.system_version + return "N/A" if version.null? - version - end + version + end - def host_gcc_version - gcc = DevelopmentTools.host_gcc_path - return "N/A" unless gcc.executable? + def host_gcc_version + gcc = ::DevelopmentTools.host_gcc_path + return "N/A" unless gcc.executable? - `#{gcc} --version 2>/dev/null`[/ (\d+\.\d+\.\d+)/, 1] - end + Utils.popen_read(gcc, "--version")[/ (\d+\.\d+\.\d+)/, 1] + end - def formula_linked_version(formula) - return "N/A" if Homebrew::EnvConfig.no_install_from_api? && !CoreTap.instance.installed? + def formula_linked_version(formula) + return "N/A" if Homebrew::EnvConfig.no_install_from_api? && !CoreTap.instance.installed? - Formulary.factory(formula).any_installed_version || "N/A" - rescue FormulaUnavailableError - "N/A" - end + Formulary.factory(formula).any_installed_version || "N/A" + rescue FormulaUnavailableError + "N/A" + end - def host_ruby_version - out, _, status = system_command(HOST_RUBY_PATH, args: ["-e", "puts RUBY_VERSION"], print_stderr: false) - return "N/A" unless status.success? + def host_ruby_version + out, _, status = system_command(HOST_RUBY_PATH, args: ["-e", "puts RUBY_VERSION"], print_stderr: false) + return "N/A" unless status.success? - out - end + out + end - def dump_verbose_config(out = $stdout) - kernel = Utils.safe_popen_read("uname", "-mors").chomp - dump_generic_verbose_config(out) - out.puts "Kernel: #{kernel}" - out.puts "OS: #{OS::Linux.os_version}" - out.puts "WSL: #{OS::Linux.wsl_version}" if OS::Linux.wsl? - out.puts "Host glibc: #{host_glibc_version}" - out.puts "#{DevelopmentTools.host_gcc_path}: #{host_gcc_version}" - out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH - ["glibc", CompilerSelector.preferred_gcc, OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA, "xorg"].each do |f| - out.puts "#{f}: #{formula_linked_version(f)}" + def dump_verbose_config(out = $stdout) + kernel = Utils.safe_popen_read("uname", "-mors").chomp + super + out.puts "Kernel: #{kernel}" + out.puts "OS: #{OS::Linux.os_version}" + out.puts "WSL: #{OS::Linux.wsl_version}" if OS::Linux.wsl? + out.puts "Host glibc: #{host_glibc_version}" + out.puts "#{::DevelopmentTools.host_gcc_path}: #{host_gcc_version}" + out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH + ["glibc", ::CompilerSelector.preferred_gcc, OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA, "xorg"].each do |f| + out.puts "#{f}: #{formula_linked_version(f)}" + end + end end end end end + +SystemConfig.singleton_class.prepend(OS::Linux::SystemConfig::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/dev-cmd/bottle.rb b/Library/Homebrew/extend/os/mac/dev-cmd/bottle.rb index 9d07b43695..e75eeab739 100644 --- a/Library/Homebrew/extend/os/mac/dev-cmd/bottle.rb +++ b/Library/Homebrew/extend/os/mac/dev-cmd/bottle.rb @@ -18,6 +18,26 @@ module OS def gnu_tar(gnu_tar_formula) "#{gnu_tar_formula.opt_bin}/gtar" end + + sig { params(formula: Formula).returns(T::Array[Regexp]) } + def formula_ignores(formula) + ignores = super + + cellar_regex = Regexp.escape(HOMEBREW_CELLAR) + prefix_regex = Regexp.escape(HOMEBREW_PREFIX) + + ignores << case formula.name + # On Linux, GCC installation can be moved so long as the whole directory tree is moved together: + # https://gcc-help.gcc.gnu.narkive.com/GnwuCA7l/moving-gcc-from-the-installation-path-is-it-allowed. + when Version.formula_optionally_versioned_regex(:gcc) + Regexp.union(%r{#{cellar_regex}/gcc}, %r{#{prefix_regex}/opt/gcc}) if OS.linux? + # binutils is relocatable for the same reason: https://github.com/Homebrew/brew/pull/11899#issuecomment-906804451. + when Version.formula_optionally_versioned_regex(:binutils) + %r{#{cellar_regex}/binutils} if OS.linux? + end + + ignores.compact + end end end end diff --git a/Library/Homebrew/extend/os/mac/dev-cmd/tests.rb b/Library/Homebrew/extend/os/mac/dev-cmd/tests.rb new file mode 100644 index 0000000000..6b03ba3ccf --- /dev/null +++ b/Library/Homebrew/extend/os/mac/dev-cmd/tests.rb @@ -0,0 +1,28 @@ +# typed: strict +# frozen_string_literal: true + +module OS + module Mac + module DevCmd + module Tests + extend T::Helpers + + requires_ancestor { Homebrew::DevCmd::Tests } + + private + + sig { params(bundle_args: T::Array[String]).returns(T::Array[String]) } + def os_bundle_args(bundle_args) + non_linux_bundle_args(bundle_args) + end + + sig { params(files: T::Array[String]).returns(T::Array[String]) } + def os_files(files) + non_linux_files(files) + end + end + end + end +end + +Homebrew::DevCmd::Tests.prepend(OS::Mac::DevCmd::Tests) diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index 0ee2c31c95..3a87930135 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -6,86 +6,88 @@ require "os/mac/xcode" module OS module Mac module DevelopmentTools - extend T::Helpers + module ClassMethods + extend T::Helpers - requires_ancestor { ::DevelopmentTools } + requires_ancestor { ::DevelopmentTools } - sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } - def locate(tool) - @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), Pathname])) - @locate.fetch(tool) do |key| - @locate[key] = if (located_tool = super(tool)) - located_tool - else - path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool, err: :close).chomp - Pathname.new(path) if File.executable?(path) + sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } + def locate(tool) + @locate ||= T.let({}, T.nilable(T::Hash[T.any(String, Symbol), Pathname])) + @locate.fetch(tool) do |key| + @locate[key] = if (located_tool = super(tool)) + located_tool + else + path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool, err: :close).chomp + Pathname.new(path) if File.executable?(path) + end end end - end - # Checks if the user has any developer tools installed, either via Xcode - # or the CLT. Convenient for guarding against formula builds when building - # is impossible. - sig { returns(T::Boolean) } - def installed? - MacOS::Xcode.installed? || MacOS::CLT.installed? - end + # Checks if the user has any developer tools installed, either via Xcode + # or the CLT. Convenient for guarding against formula builds when building + # is impossible. + sig { returns(T::Boolean) } + def installed? + MacOS::Xcode.installed? || MacOS::CLT.installed? + end - sig { returns(Symbol) } - def default_compiler - :clang - end + sig { returns(Symbol) } + def default_compiler + :clang + end - sig { returns(Version) } - def self.ld64_version - @ld64_version ||= T.let(begin - json = Utils.popen_read("/usr/bin/ld", "-version_details") - if $CHILD_STATUS.success? - Version.parse(JSON.parse(json)["version"]) - else - Version::NULL - end - end, T.nilable(Version)) - end + sig { returns(Version) } + def ld64_version + @ld64_version ||= T.let(begin + json = Utils.popen_read("/usr/bin/ld", "-version_details") + if $CHILD_STATUS.success? + Version.parse(JSON.parse(json)["version"]) + else + Version::NULL + end + end, T.nilable(Version)) + end - sig { returns(T::Boolean) } - def curl_handles_most_https_certificates? - # The system Curl is too old for some modern HTTPS certificates on - # older macOS versions. - ENV["HOMEBREW_SYSTEM_CURL_TOO_OLD"].nil? - end + sig { returns(T::Boolean) } + def curl_handles_most_https_certificates? + # The system Curl is too old for some modern HTTPS certificates on + # older macOS versions. + ENV["HOMEBREW_SYSTEM_CURL_TOO_OLD"].nil? + end - sig { returns(T::Boolean) } - def subversion_handles_most_https_certificates? - # The system Subversion is too old for some HTTPS certificates on - # older macOS versions. - MacOS.version >= :sierra - end + sig { returns(T::Boolean) } + def subversion_handles_most_https_certificates? + # The system Subversion is too old for some HTTPS certificates on + # older macOS versions. + MacOS.version >= :sierra + end - sig { returns(String) } - def installation_instructions - MacOS::CLT.installation_instructions - end + sig { returns(String) } + def installation_instructions + MacOS::CLT.installation_instructions + end - sig { returns(String) } - def custom_installation_instructions - <<~EOS - Install GNU's GCC: - brew install gcc - EOS - end + sig { returns(String) } + def custom_installation_instructions + <<~EOS + Install GNU's GCC: + brew install gcc + EOS + end - sig { returns(T::Hash[String, T.nilable(String)]) } - def build_system_info - build_info = { - "xcode" => MacOS::Xcode.version.to_s.presence, - "clt" => MacOS::CLT.version.to_s.presence, - "preferred_perl" => MacOS.preferred_perl_version, - } - super.merge build_info + sig { returns(T::Hash[String, T.nilable(String)]) } + def build_system_info + build_info = { + "xcode" => MacOS::Xcode.version.to_s.presence, + "clt" => MacOS::CLT.version.to_s.presence, + "preferred_perl" => MacOS.preferred_perl_version, + } + super.merge build_info + end end end end end -DevelopmentTools.singleton_class.prepend(OS::Mac::DevelopmentTools) +DevelopmentTools.singleton_class.prepend(OS::Mac::DevelopmentTools::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 311b68167e..f6f70440a8 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -145,7 +145,7 @@ module OS return end - oclp_support_tier = Hardware::CPU.features.include?(:pclmulqdq) ? 2 : 3 + oclp_support_tier = ::Hardware::CPU.features.include?(:pclmulqdq) ? 2 : 3 <<~EOS You have booted macOS using OpenCore Legacy Patcher. @@ -415,7 +415,7 @@ module OS <<~EOS Your Cellar and TEMP directories are on different volumes. macOS won't move relative symlinks across volumes unless the target file already - exists. Brews known to be affected by this are Git and Narwhal. + exists. Formulae known to be affected by this are Git and Narwhal. You should set the "HOMEBREW_TEMP" environment variable to a suitable directory on the same volume as your Cellar. @@ -424,18 +424,6 @@ module OS EOS end - def check_deprecated_caskroom_taps - tapped_caskroom_taps = Tap.select { |t| t.user == "caskroom" || t.name == "phinze/cask" } - .map(&:name) - return if tapped_caskroom_taps.empty? - - <<~EOS - You have the following deprecated, cask taps tapped: - #{tapped_caskroom_taps.join("\n ")} - Untap them with `brew untap`. - EOS - end - def check_if_supported_sdk_available return unless ::DevelopmentTools.installed? return unless MacOS.sdk_root_needed? @@ -496,6 +484,28 @@ module OS #{installation_instructions} EOS end + + def check_cask_software_versions + super + add_info "macOS", MacOS.full_version + add_info "SIP", begin + csrutil = "/usr/bin/csrutil" + if File.executable?(csrutil) + Open3.capture2(csrutil, "status") + .first + .gsub("This is an unsupported configuration, likely to break in " \ + "the future and leave your machine in an unknown state.", "") + .gsub("System Integrity Protection status: ", "") + .delete("\t.") + .capitalize + .strip + else + "N/A" + end + end + + nil + end end end end diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb index 42a2cea1c7..e56f917762 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/shared.rb @@ -1,42 +1,50 @@ # typed: strict # frozen_string_literal: true -module SharedEnvExtension - sig { - params( - formula: T.nilable(Formula), - cc: T.nilable(String), - build_bottle: T.nilable(T::Boolean), - bottle_arch: T.nilable(String), - testing_formula: T::Boolean, - debug_symbols: T.nilable(T::Boolean), - ).void - } - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, - debug_symbols: false) - generic_shared_setup_build_environment(formula:, cc:, build_bottle:, - bottle_arch:, testing_formula:, - debug_symbols:) +module OS + module Mac + module SharedEnvExtension + extend T::Helpers - # Normalise the system Perl version used, where multiple may be available - self["VERSIONER_PERL_VERSION"] = MacOS.preferred_perl_version - end + requires_ancestor { ::SharedEnvExtension } - sig { returns(T::Boolean) } - def no_weak_imports_support? - return false if compiler != :clang + sig { + params( + formula: T.nilable(::Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } + def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, + testing_formula: false, debug_symbols: false) + super - return false if !MacOS::Xcode.version.null? && MacOS::Xcode.version < "8.0" - return false if !MacOS::CLT.version.null? && MacOS::CLT.version < "8.0" + # Normalise the system Perl version used, where multiple may be available + self["VERSIONER_PERL_VERSION"] = MacOS.preferred_perl_version + end - true - end + sig { returns(T::Boolean) } + def no_weak_imports_support? + return false if compiler != :clang - sig { returns(T::Boolean) } - def no_fixup_chains_support? - # This is supported starting Xcode 13, which ships ld64-711. - # https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes - # https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2 - OS::Mac::DevelopmentTools.ld64_version >= 711 + return false if !MacOS::Xcode.version.null? && MacOS::Xcode.version < "8.0" + return false if !MacOS::CLT.version.null? && MacOS::CLT.version < "8.0" + + true + end + + sig { returns(T::Boolean) } + def no_fixup_chains_support? + # This is supported starting Xcode 13, which ships ld64-711. + # https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes + # https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2 + ::DevelopmentTools.ld64_version >= 711 + end + end end end + +SharedEnvExtension.prepend(OS::Mac::SharedEnvExtension) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index c312eb1125..28298fedac 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -1,117 +1,125 @@ # typed: true # rubocop:disable Sorbet/StrictSigil # frozen_string_literal: true -module Stdenv - undef homebrew_extra_pkg_config_paths +module OS + module Mac + module Stdenv + extend T::Helpers - sig { returns(T::Array[Pathname]) } - def homebrew_extra_pkg_config_paths - [Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] - end - private :homebrew_extra_pkg_config_paths + requires_ancestor { SharedEnvExtension } + requires_ancestor { ::Stdenv } - sig { - params( - formula: T.nilable(Formula), - cc: T.nilable(String), - build_bottle: T.nilable(T::Boolean), - bottle_arch: T.nilable(String), - testing_formula: T::Boolean, - debug_symbols: T.nilable(T::Boolean), - ).void - } - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, - debug_symbols: false) - generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, - testing_formula:, debug_symbols:) + sig { returns(T::Array[Pathname]) } + def homebrew_extra_pkg_config_paths + [Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] + end + private :homebrew_extra_pkg_config_paths - append "LDFLAGS", "-Wl,-headerpad_max_install_names" + sig { + params( + formula: T.nilable(Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } + def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, + testing_formula: false, debug_symbols: false) + super - # `sed` is strict and errors out when it encounters files with mixed character sets. - delete("LC_ALL") - self["LC_CTYPE"] = "C" + append "LDFLAGS", "-Wl,-headerpad_max_install_names" - # Add `lib` and `include` etc. from the current `macosxsdk` to compiler flags: - macosxsdk(formula: @formula, testing_formula:) + # `sed` is strict and errors out when it encounters files with mixed character sets. + delete("LC_ALL") + self["LC_CTYPE"] = "C" - return unless MacOS::Xcode.without_clt? + # Add `lib` and `include` etc. from the current `macosxsdk` to compiler flags: + macosxsdk(formula: @formula, testing_formula:) - append_path "PATH", "#{MacOS::Xcode.prefix}/usr/bin" - append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin" - end + return unless MacOS::Xcode.without_clt? - def remove_macosxsdk(version = nil) - # Clear all `lib` and `include` dirs from `CFLAGS`, `CPPFLAGS`, `LDFLAGS` that were - # previously added by `macosxsdk`. - remove_from_cflags(/ ?-mmacosx-version-min=\d+\.\d+/) - delete("CPATH") - remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" + append_path "PATH", "#{MacOS::Xcode.prefix}/usr/bin" + append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin" + end - sdk = self["SDKROOT"] || MacOS.sdk_path_if_needed(version) - return unless sdk + def remove_macosxsdk(version = nil) + # Clear all `lib` and `include` dirs from `CFLAGS`, `CPPFLAGS`, `LDFLAGS` that were + # previously added by `macosxsdk`. + remove_from_cflags(/ ?-mmacosx-version-min=\d+\.\d+/) + delete("CPATH") + remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" - delete("SDKROOT") - remove_from_cflags "-isysroot#{sdk}" - remove "CPPFLAGS", "-isysroot#{sdk}" - remove "LDFLAGS", "-isysroot#{sdk}" - if HOMEBREW_PREFIX.to_s == "/usr/local" - delete("CMAKE_PREFIX_PATH") - else - # It was set in `setup_build_environment`, so we have to restore it here. - self["CMAKE_PREFIX_PATH"] = HOMEBREW_PREFIX.to_s + sdk = self["SDKROOT"] || MacOS.sdk_path_if_needed(version) + return unless sdk + + delete("SDKROOT") + remove_from_cflags "-isysroot#{sdk}" + remove "CPPFLAGS", "-isysroot#{sdk}" + remove "LDFLAGS", "-isysroot#{sdk}" + if HOMEBREW_PREFIX.to_s == "/usr/local" + delete("CMAKE_PREFIX_PATH") + else + # It was set in `setup_build_environment`, so we have to restore it here. + self["CMAKE_PREFIX_PATH"] = HOMEBREW_PREFIX.to_s + end + remove "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks" + end + + def macosxsdk(version = nil, formula: nil, testing_formula: false) + # Sets all needed `lib` and `include` dirs to `CFLAGS`, `CPPFLAGS`, `LDFLAGS`. + remove_macosxsdk + min_version = version || MacOS.version + append_to_cflags("-mmacosx-version-min=#{min_version}") + self["CPATH"] = "#{HOMEBREW_PREFIX}/include" + prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" + + sdk = if formula + MacOS.sdk_for_formula(formula, version, check_only_runtime_requirements: testing_formula) + else + MacOS.sdk(version) + end + return if !MacOS.sdk_root_needed? && sdk&.source != :xcode + + Homebrew::Diagnostic.checks(:fatal_setup_build_environment_checks) + sdk = sdk.path + + # Extra setup to support Xcode 4.3+ without CLT. + self["SDKROOT"] = sdk + # Tell clang/gcc where system include's are: + append_path "CPATH", "#{sdk}/usr/include" + # The -isysroot is needed, too, because of the Frameworks + append_to_cflags "-isysroot#{sdk}" + append "CPPFLAGS", "-isysroot#{sdk}" + # And the linker needs to find sdk/usr/lib + append "LDFLAGS", "-isysroot#{sdk}" + # Needed to build cmake itself and perhaps some cmake projects: + append_path "CMAKE_PREFIX_PATH", "#{sdk}/usr" + append_path "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks" + end + + # Some configure scripts won't find libxml2 without help. + # This is a no-op with macOS SDK 10.15.4 and later. + def libxml2 + sdk = self["SDKROOT"] || MacOS.sdk_path_if_needed + if !sdk + append "CPPFLAGS", "-I/usr/include/libxml2" + elsif !Pathname("#{sdk}/usr/include/libxml").directory? + # Use the includes form the sdk + append "CPPFLAGS", "-I#{sdk}/usr/include/libxml2" + end + end + + def no_weak_imports + append "LDFLAGS", "-Wl,-no_weak_imports" if no_weak_imports_support? + end + + def no_fixup_chains + append "LDFLAGS", "-Wl,-no_fixup_chains" if no_fixup_chains_support? + end end - remove "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks" - end - - def macosxsdk(version = nil, formula: nil, testing_formula: false) - # Sets all needed `lib` and `include` dirs to `CFLAGS`, `CPPFLAGS`, `LDFLAGS`. - remove_macosxsdk - min_version = version || MacOS.version - append_to_cflags("-mmacosx-version-min=#{min_version}") - self["CPATH"] = "#{HOMEBREW_PREFIX}/include" - prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" - - sdk = if formula - MacOS.sdk_for_formula(formula, version, check_only_runtime_requirements: testing_formula) - else - MacOS.sdk(version) - end - return if !MacOS.sdk_root_needed? && sdk&.source != :xcode - - Homebrew::Diagnostic.checks(:fatal_setup_build_environment_checks) - sdk = sdk.path - - # Extra setup to support Xcode 4.3+ without CLT. - self["SDKROOT"] = sdk - # Tell clang/gcc where system include's are: - append_path "CPATH", "#{sdk}/usr/include" - # The -isysroot is needed, too, because of the Frameworks - append_to_cflags "-isysroot#{sdk}" - append "CPPFLAGS", "-isysroot#{sdk}" - # And the linker needs to find sdk/usr/lib - append "LDFLAGS", "-isysroot#{sdk}" - # Needed to build cmake itself and perhaps some cmake projects: - append_path "CMAKE_PREFIX_PATH", "#{sdk}/usr" - append_path "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks" - end - - # Some configure scripts won't find libxml2 without help. - # This is a no-op with macOS SDK 10.15.4 and later. - def libxml2 - sdk = self["SDKROOT"] || MacOS.sdk_path_if_needed - if !sdk - append "CPPFLAGS", "-I/usr/include/libxml2" - elsif !Pathname("#{sdk}/usr/include/libxml").directory? - # Use the includes form the sdk - append "CPPFLAGS", "-I#{sdk}/usr/include/libxml2" - end - end - - def no_weak_imports - append "LDFLAGS", "-Wl,-no_weak_imports" if no_weak_imports_support? - end - - def no_fixup_chains - append "LDFLAGS", "-Wl,-no_fixup_chains" if no_fixup_chains_support? end end + +Stdenv.prepend(OS::Mac::Stdenv) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index 8ed7ef263f..930c55396c 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -1,171 +1,173 @@ # typed: true # rubocop:disable Sorbet/StrictSigil # frozen_string_literal: true -module Superenv - class << self - # The location of Homebrew's shims on macOS. - def shims_path - HOMEBREW_SHIMS_PATH/"mac/super" - end +module OS + module Mac + module Superenv + extend T::Helpers - undef bin + requires_ancestor { SharedEnvExtension } + requires_ancestor { ::Superenv } - def bin - return unless DevelopmentTools.installed? + module ClassMethods + sig { returns(Pathname) } + def shims_path + HOMEBREW_SHIMS_PATH/"mac/super" + end - shims_path.realpath - end - end + sig { returns(T.nilable(Pathname)) } + def bin + return unless ::DevelopmentTools.installed? - undef homebrew_extra_pkg_config_paths, - homebrew_extra_isystem_paths, homebrew_extra_library_paths, - homebrew_extra_cmake_include_paths, - homebrew_extra_cmake_library_paths, - homebrew_extra_cmake_frameworks_paths, - determine_cccfg - - sig { returns(T::Array[Pathname]) } - def homebrew_extra_pkg_config_paths - [Pathname("/usr/lib/pkgconfig"), Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] - end - private :homebrew_extra_pkg_config_paths - - sig { returns(T::Boolean) } - def libxml2_include_needed? - return false if deps.any? { |d| d.name == "libxml2" } - return false if Pathname("#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml").directory? - - true - end - private :libxml2_include_needed? - - def homebrew_extra_isystem_paths - paths = [] - paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? - paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? - paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" - paths - end - - def homebrew_extra_library_paths - paths = [] - if compiler == :llvm_clang - paths << "#{self["HOMEBREW_SDKROOT"]}/usr/lib" - paths << Formula["llvm"].opt_lib.to_s - end - paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" - paths - end - - def homebrew_extra_cmake_include_paths - paths = [] - paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? - paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? - paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" - paths - end - - def homebrew_extra_cmake_library_paths - [Pathname("#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries")] - end - - def homebrew_extra_cmake_frameworks_paths - paths = [] - paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks" if MacOS::Xcode.without_clt? - paths - end - - def determine_cccfg - s = +"" - # Fix issue with >= Mountain Lion apr-1-config having broken paths - s << "a" - s.freeze - end - - # @private - def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, - debug_symbols: false) - sdk = formula ? MacOS.sdk_for_formula(formula) : MacOS.sdk - is_xcode_sdk = sdk&.source == :xcode - - if is_xcode_sdk || MacOS.sdk_root_needed? - Homebrew::Diagnostic.checks(:fatal_setup_build_environment_checks) - self["HOMEBREW_SDKROOT"] = sdk.path if sdk - end - - self["HOMEBREW_DEVELOPER_DIR"] = if is_xcode_sdk - MacOS::Xcode.prefix.to_s - else - MacOS::CLT::PKG_PATH - end - - # This is a workaround for the missing `m4` in Xcode CLT 15.3, which was - # reported in FB13679972. Apple has fixed this in Xcode CLT 16.0. - # See https://github.com/Homebrew/homebrew-core/issues/165388 - if deps.none? { |d| d.name == "m4" } && - MacOS.active_developer_dir == MacOS::CLT::PKG_PATH && - !File.exist?("#{MacOS::CLT::PKG_PATH}/usr/bin/m4") && - (gm4 = DevelopmentTools.locate("gm4").to_s).present? - self["M4"] = gm4 - end - - generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, - testing_formula:, debug_symbols:) - - # Filter out symbols known not to be defined since GNU Autotools can't - # reliably figure this out with Xcode 8 and above. - if MacOS.version == "10.12" && MacOS::Xcode.version >= "9.0" - %w[fmemopen futimens open_memstream utimensat].each do |s| - ENV["ac_cv_func_#{s}"] = "no" - end - elsif MacOS.version == "10.11" && MacOS::Xcode.version >= "8.0" - %w[basename_r clock_getres clock_gettime clock_settime dirname_r - getentropy mkostemp mkostemps timingsafe_bcmp].each do |s| - ENV["ac_cv_func_#{s}"] = "no" + shims_path.realpath + end end - ENV["ac_cv_search_clock_gettime"] = "no" + sig { returns(T::Array[Pathname]) } + def homebrew_extra_pkg_config_paths + [Pathname("/usr/lib/pkgconfig"), Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] + end - # works around libev.m4 unsetting ac_cv_func_clock_gettime - ENV["ac_have_clock_syscall"] = "no" + sig { returns(T::Boolean) } + def libxml2_include_needed? + return false if deps.any? { |d| d.name == "libxml2" } + return false if Pathname("#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml").directory? + + true + end + + def homebrew_extra_isystem_paths + paths = [] + paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? + paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? + paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" + paths + end + + def homebrew_extra_library_paths + paths = [] + if compiler == :llvm_clang + paths << "#{self["HOMEBREW_SDKROOT"]}/usr/lib" + paths << ::Formula["llvm"].opt_lib.to_s + end + paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" + paths + end + + def homebrew_extra_cmake_include_paths + paths = [] + paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed? + paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt? + paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers" + paths + end + + def homebrew_extra_cmake_library_paths + brew_sdkroot = self["HOMEBREW_SDKROOT"] + [Pathname("#{brew_sdkroot}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries")] + end + + def homebrew_extra_cmake_frameworks_paths + paths = [] + paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks" if MacOS::Xcode.without_clt? + paths + end + + def determine_cccfg + s = +"" + # Fix issue with >= Mountain Lion apr-1-config having broken paths + s << "a" + s.freeze + end + + # @private + def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, + testing_formula: false, debug_symbols: false) + sdk = formula ? MacOS.sdk_for_formula(formula) : MacOS.sdk + is_xcode_sdk = sdk&.source == :xcode + + if is_xcode_sdk || MacOS.sdk_root_needed? + Homebrew::Diagnostic.checks(:fatal_setup_build_environment_checks) + self["HOMEBREW_SDKROOT"] = sdk.path if sdk + end + + self["HOMEBREW_DEVELOPER_DIR"] = if is_xcode_sdk + MacOS::Xcode.prefix.to_s + else + MacOS::CLT::PKG_PATH + end + + # This is a workaround for the missing `m4` in Xcode CLT 15.3, which was + # reported in FB13679972. Apple has fixed this in Xcode CLT 16.0. + # See https://github.com/Homebrew/homebrew-core/issues/165388 + if deps.none? { |d| d.name == "m4" } && + MacOS.active_developer_dir == MacOS::CLT::PKG_PATH && + !File.exist?("#{MacOS::CLT::PKG_PATH}/usr/bin/m4") && + (gm4 = ::DevelopmentTools.locate("gm4").to_s).present? + self["M4"] = gm4 + end + + super + + # Filter out symbols known not to be defined since GNU Autotools can't + # reliably figure this out with Xcode 8 and above. + if MacOS.version == "10.12" && MacOS::Xcode.version >= "9.0" + %w[fmemopen futimens open_memstream utimensat].each do |s| + ENV["ac_cv_func_#{s}"] = "no" + end + elsif MacOS.version == "10.11" && MacOS::Xcode.version >= "8.0" + %w[basename_r clock_getres clock_gettime clock_settime dirname_r + getentropy mkostemp mkostemps timingsafe_bcmp].each do |s| + ENV["ac_cv_func_#{s}"] = "no" + end + + ENV["ac_cv_search_clock_gettime"] = "no" + + # works around libev.m4 unsetting ac_cv_func_clock_gettime + ENV["ac_have_clock_syscall"] = "no" + end + + # On macOS Sonoma (at least release candidate), iconv() is generally + # present and working, but has a minor regression that defeats the + # test implemented in gettext's configure script (and used by many + # gettext dependents). + ENV["am_cv_func_iconv_works"] = "yes" if MacOS.version == "14" + + # The tools in /usr/bin proxy to the active developer directory. + # This means we can use them for any combination of CLT and Xcode. + self["HOMEBREW_PREFER_CLT_PROXIES"] = "1" + + # Deterministic timestamping. + # This can work on older Xcode versions, but they contain some bugs. + # Notably, Xcode 10.2 fixes issues where ZERO_AR_DATE affected file mtimes. + # Xcode 11.0 contains fixes for lldb reading things built with ZERO_AR_DATE. + self["ZERO_AR_DATE"] = "1" if MacOS::Xcode.version >= "11.0" || MacOS::CLT.version >= "11.0" + + # Pass `-no_fixup_chains` whenever the linker is invoked with `-undefined dynamic_lookup`. + # See: https://github.com/python/cpython/issues/97524 + # https://github.com/pybind/pybind11/pull/4301 + no_fixup_chains + + # Strip build prefixes from linker where supported, for deterministic builds. + append_to_cccfg "o" if ::DevelopmentTools.ld64_version >= 512 + + # Pass `-ld_classic` whenever the linker is invoked with `-dead_strip_dylibs` + # on `ld` versions that don't properly handle that option. + return unless ::DevelopmentTools.ld64_version.between?("1015.7", "1022.1") + + append_to_cccfg "c" + end + + def no_weak_imports + append_to_cccfg "w" if no_weak_imports_support? + end + + def no_fixup_chains + append_to_cccfg "f" if no_fixup_chains_support? + end end - - # On macOS Sonoma (at least release candidate), iconv() is generally - # present and working, but has a minor regression that defeats the - # test implemented in gettext's configure script (and used by many - # gettext dependents). - ENV["am_cv_func_iconv_works"] = "yes" if MacOS.version == "14" - - # The tools in /usr/bin proxy to the active developer directory. - # This means we can use them for any combination of CLT and Xcode. - self["HOMEBREW_PREFER_CLT_PROXIES"] = "1" - - # Deterministic timestamping. - # This can work on older Xcode versions, but they contain some bugs. - # Notably, Xcode 10.2 fixes issues where ZERO_AR_DATE affected file mtimes. - # Xcode 11.0 contains fixes for lldb reading things built with ZERO_AR_DATE. - self["ZERO_AR_DATE"] = "1" if MacOS::Xcode.version >= "11.0" || MacOS::CLT.version >= "11.0" - - # Pass `-no_fixup_chains` whenever the linker is invoked with `-undefined dynamic_lookup`. - # See: https://github.com/python/cpython/issues/97524 - # https://github.com/pybind/pybind11/pull/4301 - no_fixup_chains - - # Strip build prefixes from linker where supported, for deterministic builds. - append_to_cccfg "o" if OS::Mac::DevelopmentTools.ld64_version >= 512 - - # Pass `-ld_classic` whenever the linker is invoked with `-dead_strip_dylibs` - # on `ld` versions that don't properly handle that option. - return unless OS::Mac::DevelopmentTools.ld64_version.between?("1015.7", "1022.1") - - append_to_cccfg "c" - end - - def no_weak_imports - append_to_cccfg "w" if no_weak_imports_support? - end - - def no_fixup_chains - append_to_cccfg "f" if no_fixup_chains_support? end end + +Superenv.singleton_class.prepend(OS::Mac::Superenv::ClassMethods) +Superenv.prepend(OS::Mac::Superenv) diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb index 324748d4d9..4aa06cc1eb 100644 --- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb +++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb @@ -4,133 +4,145 @@ require "cache_store" require "linkage_checker" -module FormulaCellarChecks - sig { returns(T.nilable(String)) } - def check_shadowed_headers - return if ["libtool", "subversion", "berkeley-db"].any? do |formula_name| - formula.name.start_with?(formula_name) - end +module OS + module Mac + module FormulaCellarChecks + extend T::Helpers - return if formula.name.match?(Version.formula_optionally_versioned_regex(:php)) - return if formula.keg_only? || !formula.include.directory? + requires_ancestor { Homebrew::FormulaAuditor } + requires_ancestor { ::FormulaCellarChecks } - files = relative_glob(formula.include, "**/*.h") - files &= relative_glob("#{MacOS.sdk_path}/usr/include", "**/*.h") - files.map! { |p| File.join(formula.include, p) } + sig { returns(T.nilable(String)) } + def check_shadowed_headers + return if ["libtool", "subversion", "berkeley-db"].any? do |formula_name| + formula.name.start_with?(formula_name) + end - return if files.empty? + return if formula.name.match?(Version.formula_optionally_versioned_regex(:php)) + return if formula.keg_only? || !formula.include.directory? - <<~EOS - Header files that shadow system header files were installed to "#{formula.include}" - The offending files are: - #{files * "\n "} - EOS - end + files = relative_glob(formula.include, "**/*.h") + files &= relative_glob("#{MacOS.sdk_path}/usr/include", "**/*.h") + files.map! { |p| File.join(formula.include, p) } - sig { returns(T.nilable(String)) } - def check_openssl_links - return unless formula.prefix.directory? + return if files.empty? - keg = Keg.new(formula.prefix) - system_openssl = keg.mach_o_files.select do |obj| - dlls = obj.dynamically_linked_libraries - dlls.any? { |dll| %r{/usr/lib/lib(crypto|ssl|tls)\..*dylib}.match? dll } - end - return if system_openssl.empty? - - <<~EOS - object files were linked against system openssl - These object files were linked against the deprecated system OpenSSL or - the system's private LibreSSL. - Adding `depends_on "openssl"` to the formula may help. - #{system_openssl * "\n "} - EOS - end - - sig { params(lib: Pathname).returns(T.nilable(String)) } - def check_python_framework_links(lib) - python_modules = Pathname.glob lib/"python*/site-packages/**/*.so" - framework_links = python_modules.select do |obj| - dlls = obj.dynamically_linked_libraries - dlls.any? { |dll| dll.include?("Python.framework") } - end - return if framework_links.empty? - - <<~EOS - python modules have explicit framework links - These python extension modules were linked directly to a Python - framework binary. They should be linked with -undefined dynamic_lookup - instead of -lpython or -framework Python. - #{framework_links * "\n "} - EOS - end - - sig { void } - def check_linkage - return unless formula.prefix.directory? - - keg = Keg.new(formula.prefix) - - CacheStoreDatabase.use(:linkage) do |db| - checker = LinkageChecker.new(keg, formula, cache_db: db) - next unless checker.broken_library_linkage? - - output = <<~EOS - #{formula} has broken dynamic library links: - #{checker.display_test_output} - EOS - - tab = keg.tab - if tab.poured_from_bottle - output += <<~EOS - Rebuild this from source with: - brew reinstall --build-from-source #{formula} - If that's successful, file an issue#{formula.tap ? " here:\n #{T.must(formula.tap).issues_url}" : "."} + <<~EOS + Header files that shadow system header files were installed to "#{formula.include}" + The offending files are: + #{files * "\n "} EOS end - problem_if_output output - end - end - sig { params(formula: Formula).returns(T.nilable(String)) } - def check_flat_namespace(formula) - return unless formula.prefix.directory? - return if formula.tap&.audit_exception(:flat_namespace_allowlist, formula.name) + sig { returns(T.nilable(String)) } + def check_openssl_links + return unless formula.prefix.directory? - keg = ::Keg.new(formula.prefix) - flat_namespace_files = keg.mach_o_files.reject do |file| - next true unless file.dylib? + keg = ::Keg.new(formula.prefix) + system_openssl = keg.mach_o_files.select do |obj| + dlls = obj.dynamically_linked_libraries + dlls.any? { |dll| %r{/usr/lib/lib(crypto|ssl|tls)\..*dylib}.match? dll } + end + return if system_openssl.empty? - macho = MachO.open(file) - if MachO::Utils.fat_magic?(macho.magic) - macho.machos.map(&:header).all? { |h| h.flag? :MH_TWOLEVEL } - else - macho.header.flag? :MH_TWOLEVEL + <<~EOS + object files were linked against system openssl + These object files were linked against the deprecated system OpenSSL or + the system's private LibreSSL. + Adding `depends_on "openssl"` to the formula may help. + #{system_openssl * "\n "} + EOS + end + + sig { params(lib: Pathname).returns(T.nilable(String)) } + def check_python_framework_links(lib) + python_modules = Pathname.glob lib/"python*/site-packages/**/*.so" + framework_links = python_modules.select do |obj| + dlls = obj.dynamically_linked_libraries + dlls.any? { |dll| dll.include?("Python.framework") } + end + return if framework_links.empty? + + <<~EOS + python modules have explicit framework links + These python extension modules were linked directly to a Python + framework binary. They should be linked with -undefined dynamic_lookup + instead of -lpython or -framework Python. + #{framework_links * "\n "} + EOS + end + + sig { void } + def check_linkage + return unless formula.prefix.directory? + + keg = ::Keg.new(formula.prefix) + + CacheStoreDatabase.use(:linkage) do |db| + checker = ::LinkageChecker.new(keg, formula, cache_db: db) + next unless checker.broken_library_linkage? + + output = <<~EOS + #{formula} has broken dynamic library links: + #{checker.display_test_output} + EOS + + tab = keg.tab + if tab.poured_from_bottle + output += <<~EOS + Rebuild this from source with: + brew reinstall --build-from-source #{formula} + If that's successful, file an issue#{formula.tap ? " here:\n #{formula.tap.issues_url}" : "."} + EOS + end + problem_if_output output + end + end + + sig { params(formula: ::Formula).returns(T.nilable(String)) } + def check_flat_namespace(formula) + return unless formula.prefix.directory? + return if formula.tap&.audit_exception(:flat_namespace_allowlist, formula.name) + + keg = ::Keg.new(formula.prefix) + flat_namespace_files = keg.mach_o_files.reject do |file| + next true unless file.dylib? + + macho = MachO.open(file) + if MachO::Utils.fat_magic?(macho.magic) + macho.machos.map(&:header).all? { |h| h.flag? :MH_TWOLEVEL } + else + macho.header.flag? :MH_TWOLEVEL + end + end + return if flat_namespace_files.empty? + + <<~EOS + Libraries were compiled with a flat namespace. + This can cause linker errors due to name collisions and + is often due to a bug in detecting the macOS version. + #{flat_namespace_files * "\n "} + EOS + end + + sig { void } + def audit_installed + super + problem_if_output(check_shadowed_headers) + problem_if_output(check_openssl_links) + problem_if_output(check_python_framework_links(formula.lib)) + check_linkage + problem_if_output(check_flat_namespace(formula)) + end + + MACOS_LIB_EXTENSIONS = %w[.dylib .framework].freeze + + sig { params(filename: Pathname).returns(T::Boolean) } + def valid_library_extension?(filename) + super || MACOS_LIB_EXTENSIONS.include?(filename.extname) end end - return if flat_namespace_files.empty? - - <<~EOS - Libraries were compiled with a flat namespace. - This can cause linker errors due to name collisions and - is often due to a bug in detecting the macOS version. - #{flat_namespace_files * "\n "} - EOS - end - - sig { void } - def audit_installed - generic_audit_installed - problem_if_output(check_shadowed_headers) - problem_if_output(check_openssl_links) - problem_if_output(check_python_framework_links(formula.lib)) - check_linkage - problem_if_output(check_flat_namespace(formula)) - end - - sig { params(filename: Pathname).returns(T::Boolean) } - def valid_library_extension?(filename) - macos_lib_extensions = %w[.dylib .framework] - generic_valid_library_extension?(filename) || macos_lib_extensions.include?(filename.extname) end end + +FormulaCellarChecks.prepend(OS::Mac::FormulaCellarChecks) diff --git a/Library/Homebrew/extend/os/mac/hardware.rb b/Library/Homebrew/extend/os/mac/hardware.rb index d984567c69..38a12686ce 100644 --- a/Library/Homebrew/extend/os/mac/hardware.rb +++ b/Library/Homebrew/extend/os/mac/hardware.rb @@ -1,25 +1,33 @@ # typed: strict # frozen_string_literal: true -module Hardware - sig { params(version: T.nilable(Version)).returns(Symbol) } - def self.oldest_cpu(version = nil) - version = if version - MacOSVersion.new(version.to_s) - else - MacOS.version - end - if CPU.arch == :arm64 - :arm_vortex_tempest - # This cannot use a newer CPU e.g. haswell because Rosetta 2 does not - # support AVX instructions in bottles: - # https://github.com/Homebrew/homebrew-core/issues/67713 - elsif version >= :ventura - :westmere - elsif version >= :mojave - :nehalem - else - generic_oldest_cpu +module OS + module Mac + module Hardware + module ClassMethods + sig { params(version: T.nilable(MacOSVersion)).returns(Symbol) } + def oldest_cpu(version = nil) + version = if version + MacOSVersion.new(version.to_s) + else + MacOS.version + end + if ::Hardware::CPU.arch == :arm64 + :arm_vortex_tempest + # This cannot use a newer CPU e.g. haswell because Rosetta 2 does not + # support AVX instructions in bottles: + # https://github.com/Homebrew/homebrew-core/issues/67713 + elsif version >= :ventura + :westmere + elsif version >= :mojave + :nehalem + else + super + end + end + end end end end + +Hardware.singleton_class.prepend(OS::Mac::Hardware::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index 43973e4db0..1c64dd1971 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -7,56 +7,58 @@ module OS module Mac module Hardware module CPU - extend T::Helpers + module ClassMethods + extend T::Helpers - # These methods use info spewed out by sysctl. - # Look in for decoding info. - def type - case ::Hardware::CPU.sysctl_int("hw.cputype") - when MachO::Headers::CPU_TYPE_I386 - :intel - when MachO::Headers::CPU_TYPE_ARM64 - :arm - else - :dunno + # These methods use info spewed out by sysctl. + # Look in for decoding info. + def type + case ::Hardware::CPU.sysctl_int("hw.cputype") + when MachO::Headers::CPU_TYPE_I386 + :intel + when MachO::Headers::CPU_TYPE_ARM64 + :arm + else + :dunno + end end - end - def family - if ::Hardware::CPU.arm? - ::Hardware::CPU.arm_family - elsif ::Hardware::CPU.intel? - ::Hardware::CPU.intel_family - else - :dunno + def family + if ::Hardware::CPU.arm? + ::Hardware::CPU.arm_family + elsif ::Hardware::CPU.intel? + ::Hardware::CPU.intel_family + else + :dunno + end end - end - # True when running under an Intel-based shell via Rosetta 2 on an - # Apple Silicon Mac. This can be detected via seeing if there's a - # conflict between what `uname` reports and the underlying `sysctl` flags, - # since the `sysctl` flags don't change behaviour under Rosetta 2. - def in_rosetta2? - ::Hardware::CPU.sysctl_bool("sysctl.proc_translated") - end + # True when running under an Intel-based shell via Rosetta 2 on an + # Apple Silicon Mac. This can be detected via seeing if there's a + # conflict between what `uname` reports and the underlying `sysctl` flags, + # since the `sysctl` flags don't change behaviour under Rosetta 2. + def in_rosetta2? + ::Hardware::CPU.sysctl_bool!("sysctl.proc_translated") + end - def self.features - @features ||= ::Hardware::CPU.sysctl_n( - "machdep.cpu.features", - "machdep.cpu.extfeatures", - "machdep.cpu.leaf7_features", - ).split.map { |s| s.downcase.to_sym } - end + def features + @features ||= ::Hardware::CPU.sysctl_n( + "machdep.cpu.features", + "machdep.cpu.extfeatures", + "machdep.cpu.leaf7_features", + ).split.map { |s| s.downcase.to_sym } + end - def sse4? - ::Hardware::CPU.sysctl_bool("hw.optional.sse4_1") + def sse4? + ::Hardware::CPU.sysctl_bool!("hw.optional.sse4_1") + end end end end end end -Hardware::CPU.singleton_class.prepend(OS::Mac::Hardware::CPU) +Hardware::CPU.singleton_class.prepend(OS::Mac::Hardware::CPU::ClassMethods) module Hardware class CPU @@ -66,41 +68,41 @@ module Hardware end def aes? - sysctl_bool("hw.optional.aes") + sysctl_bool!("hw.optional.aes") end def altivec? - sysctl_bool("hw.optional.altivec") + sysctl_bool!("hw.optional.altivec") end def avx? - sysctl_bool("hw.optional.avx1_0") + sysctl_bool!("hw.optional.avx1_0") end def avx2? - sysctl_bool("hw.optional.avx2_0") + sysctl_bool!("hw.optional.avx2_0") end def sse3? - sysctl_bool("hw.optional.sse3") + sysctl_bool!("hw.optional.sse3") end def ssse3? - sysctl_bool("hw.optional.supplementalsse3") + sysctl_bool!("hw.optional.supplementalsse3") end def sse4_2? - sysctl_bool("hw.optional.sse4_2") + sysctl_bool!("hw.optional.sse4_2") end # NOTE: This is more reliable than checking `uname`. `sysctl` returns # the right answer even when running in Rosetta 2. def physical_cpu_arm64? - sysctl_bool("hw.optional.arm64") + sysctl_bool!("hw.optional.arm64") end def virtualized? - sysctl_bool("kern.hv_vmm_present") + sysctl_bool!("kern.hv_vmm_present") end def arm_family @@ -171,7 +173,7 @@ module Hardware end end - def sysctl_bool(key) + def sysctl_bool!(key) sysctl_int(key) == 1 end diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 5b56011faf..3c0a5d34ae 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -95,7 +95,7 @@ module OS end end - generic_fix_dynamic_linkage + super end def loader_name_for(file, target) @@ -199,7 +199,7 @@ module OS end def prepare_relocation_to_locations - relocation = generic_prepare_relocation_to_locations + relocation = super brewed_perl = runtime_dependencies&.any? { |dep| dep["full_name"] == "perl" && dep["declared_directly"] } perl_path = if brewed_perl || name == "perl" diff --git a/Library/Homebrew/extend/os/mac/language/java.rb b/Library/Homebrew/extend/os/mac/language/java.rb index 3e8192c470..d052dc9ad4 100644 --- a/Library/Homebrew/extend/os/mac/language/java.rb +++ b/Library/Homebrew/extend/os/mac/language/java.rb @@ -1,13 +1,26 @@ # typed: strict # frozen_string_literal: true -module Language - module Java - def self.java_home(version = nil) - openjdk = find_openjdk_formula(version) - return unless openjdk +module OS + module Mac + module Language + module Java + module ClassMethods + extend T::Helpers - openjdk.opt_libexec/"openjdk.jdk/Contents/Home" + requires_ancestor { T.class_of(::Language::Java) } + + sig { params(version: T.nilable(String)).returns(T.nilable(Pathname)) } + def java_home(version = nil) + openjdk = find_openjdk_formula(version) + return unless openjdk + + openjdk.opt_libexec/"openjdk.jdk/Contents/Home" + end + end + end end end end + +Language::Java.singleton_class.prepend(OS::Mac::Language::Java::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/missing_formula.rb b/Library/Homebrew/extend/os/mac/missing_formula.rb index 8721980e76..6933c305d6 100644 --- a/Library/Homebrew/extend/os/mac/missing_formula.rb +++ b/Library/Homebrew/extend/os/mac/missing_formula.rb @@ -5,55 +5,59 @@ require "cask/info" require "cask/cask_loader" require "cask/caskroom" -module Homebrew - module MissingFormula - class << self - sig { params(name: String).returns(T.nilable(String)) } - def disallowed_reason(name) - case name.downcase - when "xcode" - <<~EOS - Xcode can be installed from the App Store. - EOS - else - generic_disallowed_reason(name) +module OS + module Mac + module MissingFormula + module ClassMethods + sig { params(name: String).returns(T.nilable(String)) } + def disallowed_reason(name) + case name.downcase + when "xcode" + <<~EOS + Xcode can be installed from the App Store. + EOS + else + super + end end - end - sig { params(name: String, silent: T::Boolean, show_info: T::Boolean).returns(T.nilable(String)) } - def cask_reason(name, silent: false, show_info: false) - return if silent + sig { params(name: String, silent: T::Boolean, show_info: T::Boolean).returns(T.nilable(String)) } + def cask_reason(name, silent: false, show_info: false) + return if silent - suggest_command(name, show_info ? "info" : "install") - end + suggest_command(name, show_info ? "info" : "install") + end - sig { params(name: String, command: String).returns(T.nilable(String)) } - def suggest_command(name, command) - suggestion = <<~EOS - Found a cask named "#{name}" instead. Try - brew #{command} --cask #{name} - - EOS - case command - when "install" - Cask::CaskLoader.load(name) - when "uninstall" - cask = Cask::Caskroom.casks.find { |installed_cask| installed_cask.to_s == name } - raise Cask::CaskUnavailableError, name if cask.nil? - when "info" - cask = Cask::CaskLoader.load(name) + sig { params(name: String, command: String).returns(T.nilable(String)) } + def suggest_command(name, command) suggestion = <<~EOS - Found a cask named "#{name}" instead. + Found a cask named "#{name}" instead. Try + brew #{command} --cask #{name} - #{Cask::Info.get_info(cask)} EOS - else - return + case command + when "install" + ::Cask::CaskLoader.load(name) + when "uninstall" + cask = ::Cask::Caskroom.casks.find { |installed_cask| installed_cask.to_s == name } + Kernel.raise ::Cask::CaskUnavailableError, name if cask.nil? + when "info" + cask = ::Cask::CaskLoader.load(name) + suggestion = <<~EOS + Found a cask named "#{name}" instead. + + #{::Cask::Info.get_info(cask)} + EOS + else + return + end + suggestion + rescue ::Cask::CaskUnavailableError + nil end - suggestion - rescue Cask::CaskUnavailableError - nil end end end end + +Homebrew::MissingFormula.singleton_class.prepend(OS::Mac::MissingFormula::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/readall.rb b/Library/Homebrew/extend/os/mac/readall.rb index 23f71e403c..6d926a87f3 100644 --- a/Library/Homebrew/extend/os/mac/readall.rb +++ b/Library/Homebrew/extend/os/mac/readall.rb @@ -4,44 +4,46 @@ module OS module Mac module Readall - extend T::Helpers + module ClassMethods + extend T::Helpers - requires_ancestor { Kernel } + requires_ancestor { Kernel } - sig { params(tap: Tap, os_name: T.nilable(Symbol), arch: T.nilable(Symbol)).returns(T::Boolean) } - def valid_casks?(tap, os_name: nil, arch: ::Hardware::CPU.type) - return true if os_name == :linux + sig { params(tap: ::Tap, os_name: T.nilable(Symbol), arch: T.nilable(Symbol)).returns(T::Boolean) } + def valid_casks?(tap, os_name: nil, arch: ::Hardware::CPU.type) + return true if os_name == :linux - current_macos_version = if os_name.is_a?(Symbol) - MacOSVersion.from_symbol(os_name) - else - MacOS.version - end - - success = T.let(true, T::Boolean) - tap.cask_files.each do |file| - cask = ::Cask::CaskLoader.load(file) - - # Fine to have missing URLs for unsupported macOS - macos_req = cask.depends_on.macos - next if macos_req&.version && Array(macos_req.version).none? do |macos_version| - current_macos_version.compare(macos_req.comparator, macos_version) + current_macos_version = if os_name.is_a?(Symbol) + MacOSVersion.from_symbol(os_name) + else + MacOS.version end - raise "Missing URL" if cask.url.nil? - rescue Interrupt - raise - # Handle all possible exceptions reading Casks. - rescue Exception => e # rubocop:disable Lint/RescueException - os_and_arch = "macOS #{current_macos_version} on #{arch}" - onoe "Invalid cask (#{os_and_arch}): #{file}" - $stderr.puts e - success = false + success = T.let(true, T::Boolean) + tap.cask_files.each do |file| + cask = ::Cask::CaskLoader.load(file) + + # Fine to have missing URLs for unsupported macOS + macos_req = cask.depends_on.macos + next if macos_req&.version && Array(macos_req.version).none? do |macos_version| + current_macos_version.compare(macos_req.comparator, macos_version) + end + + raise "Missing URL" if cask.url.nil? + rescue Interrupt + raise + # Handle all possible exceptions reading Casks. + rescue Exception => e # rubocop:disable Lint/RescueException + os_and_arch = "macOS #{current_macos_version} on #{arch}" + onoe "Invalid cask (#{os_and_arch}): #{file}" + $stderr.puts e + success = false + end + success end - success end end end end -Readall.singleton_class.prepend(OS::Mac::Readall) +Readall.singleton_class.prepend(OS::Mac::Readall::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/sandbox.rb b/Library/Homebrew/extend/os/mac/sandbox.rb index 976ede4716..a352f44fa2 100644 --- a/Library/Homebrew/extend/os/mac/sandbox.rb +++ b/Library/Homebrew/extend/os/mac/sandbox.rb @@ -1,9 +1,21 @@ # typed: strict # frozen_string_literal: true -class Sandbox - sig { returns(T::Boolean) } - def self.available? - File.executable?(SANDBOX_EXEC) +module OS + module Mac + module Sandbox + module ClassMethods + extend T::Helpers + + requires_ancestor { T.class_of(::Sandbox) } + + sig { returns(T::Boolean) } + def available? + File.executable?(::Sandbox::SANDBOX_EXEC) + end + end + end end end + +Sandbox.singleton_class.prepend(OS::Mac::Sandbox::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/simulate_system.rb b/Library/Homebrew/extend/os/mac/simulate_system.rb index a8e3329e19..3786d8f413 100644 --- a/Library/Homebrew/extend/os/mac/simulate_system.rb +++ b/Library/Homebrew/extend/os/mac/simulate_system.rb @@ -4,19 +4,21 @@ module OS module Mac module SimulateSystem - sig { returns(T::Boolean) } - def simulating_or_running_on_macos? - return true if Homebrew::SimulateSystem.os.blank? + module ClassMethods + sig { returns(T::Boolean) } + def simulating_or_running_on_macos? + return true if Homebrew::SimulateSystem.os.blank? - [:macos, *MacOSVersion::SYMBOLS.keys].include?(Homebrew::SimulateSystem.os) - end + [:macos, *MacOSVersion::SYMBOLS.keys].include?(Homebrew::SimulateSystem.os) + end - sig { returns(Symbol) } - def current_os - ::Homebrew::SimulateSystem.os || MacOS.version.to_sym + sig { returns(Symbol) } + def current_os + ::Homebrew::SimulateSystem.os || MacOS.version.to_sym + end end end end end -Homebrew::SimulateSystem.singleton_class.prepend(OS::Mac::SimulateSystem) +Homebrew::SimulateSystem.singleton_class.prepend(OS::Mac::SimulateSystem::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/system_config.rb b/Library/Homebrew/extend/os/mac/system_config.rb index 0f84aca104..e7d33e4b56 100644 --- a/Library/Homebrew/extend/os/mac/system_config.rb +++ b/Library/Homebrew/extend/os/mac/system_config.rb @@ -6,46 +6,45 @@ require "system_command" module OS module Mac module SystemConfig - sig { returns(String) } - def describe_clang - return "N/A" if ::SystemConfig.clang.null? + module ClassMethods + extend T::Helpers - clang_build_info = ::SystemConfig.clang_build.null? ? "(parse error)" : ::SystemConfig.clang_build - "#{::SystemConfig.clang} build #{clang_build_info}" + requires_ancestor { T.class_of(::SystemConfig) } + + sig { returns(String) } + def describe_clang + return "N/A" if ::SystemConfig.clang.null? + + clang_build_info = ::SystemConfig.clang_build.null? ? "(parse error)" : ::SystemConfig.clang_build + "#{::SystemConfig.clang} build #{clang_build_info}" + end + + def xcode + @xcode ||= if MacOS::Xcode.installed? + xcode = MacOS::Xcode.version.to_s + xcode += " => #{MacOS::Xcode.prefix}" unless MacOS::Xcode.default_prefix? + xcode + end + end + + def clt + @clt ||= MacOS::CLT.version if MacOS::CLT.installed? + end + + def core_tap_config(out = $stdout) + dump_tap_config(CoreTap.instance, out) + dump_tap_config(CoreCaskTap.instance, out) + end + + def dump_verbose_config(out = $stdout) + super + out.puts "macOS: #{MacOS.full_version}-#{kernel}" + out.puts "CLT: #{clt || "N/A"}" + out.puts "Xcode: #{xcode || "N/A"}" + out.puts "Rosetta 2: #{::Hardware::CPU.in_rosetta2?}" if ::Hardware::CPU.physical_cpu_arm64? + end end end end end - -SystemConfig.prepend(OS::Mac::SystemConfig) - -module SystemConfig - class << self - include SystemCommand::Mixin - - def xcode - @xcode ||= if MacOS::Xcode.installed? - xcode = MacOS::Xcode.version.to_s - xcode += " => #{MacOS::Xcode.prefix}" unless MacOS::Xcode.default_prefix? - xcode - end - end - - def clt - @clt ||= MacOS::CLT.version if MacOS::CLT.installed? - end - - def core_tap_config(out = $stdout) - dump_tap_config(CoreTap.instance, out) - dump_tap_config(CoreCaskTap.instance, out) - end - - def dump_verbose_config(out = $stdout) - dump_generic_verbose_config(out) - out.puts "macOS: #{MacOS.full_version}-#{kernel}" - out.puts "CLT: #{clt || "N/A"}" - out.puts "Xcode: #{xcode || "N/A"}" - out.puts "Rosetta 2: #{Hardware::CPU.in_rosetta2?}" if Hardware::CPU.physical_cpu_arm64? - end - end -end +SystemConfig.singleton_class.prepend(OS::Mac::SystemConfig::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/tap.rb b/Library/Homebrew/extend/os/mac/tap.rb new file mode 100644 index 0000000000..2213a4f757 --- /dev/null +++ b/Library/Homebrew/extend/os/mac/tap.rb @@ -0,0 +1,17 @@ +# typed: strict +# frozen_string_literal: true + +module OS + module Mac + module Tap + module ClassMethods + sig { returns(T::Array[::Tap]) } + def core_taps + [CoreTap.instance, CoreCaskTap.instance].freeze + end + end + end + end +end + +Tap.singleton_class.prepend(OS::Mac::Tap::ClassMethods) diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb index 754aeaec64..f982a4dca3 100644 --- a/Library/Homebrew/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb @@ -1,59 +1,66 @@ # typed: strict # frozen_string_literal: true -module Utils - module Bottles - class << self - module MacOSOverride - sig { params(tag: T.nilable(T.any(Symbol, Tag))).returns(Tag) } +module OS + module Mac + module Bottles + module ClassMethods + sig { params(tag: T.nilable(T.any(Symbol, Utils::Bottles::Tag))).returns(Utils::Bottles::Tag) } def tag(tag = nil) - return Tag.new(system: MacOS.version.to_sym, arch: Hardware::CPU.arch) if tag.nil? - - super + if tag.nil? + Utils::Bottles::Tag.new(system: MacOS.version.to_sym, arch: ::Hardware::CPU.arch) + else + super + end end end - prepend MacOSOverride - end + module Collector + extend T::Helpers - class Collector - private + requires_ancestor { Utils::Bottles::Collector } - alias generic_find_matching_tag find_matching_tag + private - sig { params(tag: Utils::Bottles::Tag, no_older_versions: T::Boolean).returns(T.nilable(Utils::Bottles::Tag)) } - def find_matching_tag(tag, no_older_versions: false) - # Used primarily by developers testing beta macOS releases. - if no_older_versions || - (OS::Mac.version.prerelease? && - Homebrew::EnvConfig.developer? && - Homebrew::EnvConfig.skip_or_later_bottles?) - generic_find_matching_tag(tag) - else - generic_find_matching_tag(tag) || - find_older_compatible_tag(tag) - end - end - - # Find a bottle built for a previous version of macOS. - sig { params(tag: Utils::Bottles::Tag).returns(T.nilable(Utils::Bottles::Tag)) } - def find_older_compatible_tag(tag) - tag_version = begin - tag.to_macos_version - rescue MacOSVersion::Error - nil + sig { + params(tag: Utils::Bottles::Tag, + no_older_versions: T::Boolean).returns(T.nilable(Utils::Bottles::Tag)) + } + def find_matching_tag(tag, no_older_versions: false) + # Used primarily by developers testing beta macOS releases. + if no_older_versions || + (OS::Mac.version.prerelease? && + Homebrew::EnvConfig.developer? && + Homebrew::EnvConfig.skip_or_later_bottles?) + super(tag) + else + super(tag) || find_older_compatible_tag(tag) + end end - return if tag_version.blank? + # Find a bottle built for a previous version of macOS. + sig { params(tag: Utils::Bottles::Tag).returns(T.nilable(Utils::Bottles::Tag)) } + def find_older_compatible_tag(tag) + tag_version = begin + tag.to_macos_version + rescue MacOSVersion::Error + nil + end - tags.find do |candidate| - next if candidate.arch != tag.arch + return if tag_version.blank? - candidate.to_macos_version <= tag_version - rescue MacOSVersion::Error - false + tags.find do |candidate| + next if candidate.standardized_arch != tag.standardized_arch + + candidate.to_macos_version <= tag_version + rescue MacOSVersion::Error + false + end end end end end end + +Utils::Bottles.singleton_class.prepend(OS::Mac::Bottles::ClassMethods) +Utils::Bottles::Collector.prepend(OS::Mac::Bottles::Collector) diff --git a/Library/Homebrew/extend/os/mac/utils/socket.rb b/Library/Homebrew/extend/os/mac/utils/socket.rb index 563a9b86d4..b9bb4265d2 100644 --- a/Library/Homebrew/extend/os/mac/utils/socket.rb +++ b/Library/Homebrew/extend/os/mac/utils/socket.rb @@ -7,24 +7,26 @@ module OS module Mac # Wrapper around UNIXSocket to allow > 104 characters on macOS. module UNIXSocketExt - extend T::Helpers + module ClassMethods + extend T::Helpers - requires_ancestor { Kernel } + requires_ancestor { Kernel } - sig { params(path: String).returns(String) } - def sockaddr_un(path) - if path.bytesize > 252 # largest size that can fit into a single-byte length - raise ArgumentError, "too long unix socket path (#{path.bytesize} bytes given but 252 bytes max)" + sig { params(path: String).returns(String) } + def sockaddr_un(path) + if path.bytesize > 252 # largest size that can fit into a single-byte length + raise ArgumentError, "too long unix socket path (#{path.bytesize} bytes given but 252 bytes max)" + end + + [ + path.bytesize + 3, # = length (1 byte) + family (1 byte) + path (variable) + null terminator (1 byte) + 1, # AF_UNIX + path, + ].pack("CCZ*") end - - [ - path.bytesize + 3, # = length (1 byte) + family (1 byte) + path (variable) + null terminator (1 byte) - 1, # AF_UNIX - path, - ].pack("CCZ*") end end end end -Utils::UNIXSocketExt.singleton_class.prepend(OS::Mac::UNIXSocketExt) +Utils::UNIXSocketExt.singleton_class.prepend(OS::Mac::UNIXSocketExt::ClassMethods) diff --git a/Library/Homebrew/extend/os/tap.rb b/Library/Homebrew/extend/os/tap.rb new file mode 100644 index 0000000000..e6662ff704 --- /dev/null +++ b/Library/Homebrew/extend/os/tap.rb @@ -0,0 +1,4 @@ +# typed: strict +# frozen_string_literal: true + +require "extend/os/mac/tap" if OS.mac? diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 91337f81d1..111a464804 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -1,79 +1,9 @@ # typed: true # rubocop:todo Sorbet/StrictSigil # frozen_string_literal: true -module DiskUsageExtension - extend T::Helpers - - requires_ancestor { Pathname } - - sig { returns(Integer) } - def disk_usage - return @disk_usage if defined?(@disk_usage) - - compute_disk_usage - @disk_usage - end - - sig { returns(Integer) } - def file_count - return @file_count if defined?(@file_count) - - compute_disk_usage - @file_count - end - - sig { returns(String) } - def abv - out = +"" - compute_disk_usage - out << "#{number_readable(@file_count)} files, " if @file_count > 1 - out << disk_usage_readable(@disk_usage).to_s - out.freeze - end - - private - - sig { void } - def compute_disk_usage - if symlink? && !exist? - @file_count = 1 - @disk_usage = 0 - return - end - - path = if symlink? - resolved_path - else - self - end - - if path.directory? - scanned_files = Set.new - @file_count = 0 - @disk_usage = 0 - path.find do |f| - if f.directory? - @disk_usage += f.lstat.size - else - @file_count += 1 if f.basename.to_s != ".DS_Store" - # use Pathname#lstat instead of Pathname#stat to get info of symlink itself. - stat = f.lstat - file_id = [stat.dev, stat.ino] - # count hardlinks only once. - unless scanned_files.include?(file_id) - @disk_usage += stat.size - scanned_files.add(file_id) - end - end - end - else - @file_count = 1 - @disk_usage = path.lstat.size - end - end -end - require "system_command" +require "extend/pathname/disk_usage_extension" +require "extend/pathname/observer_pathname_extension" # Homebrew extends Ruby's `Pathname` to make our code more readable. # @see https://ruby-doc.org/stdlib-2.6.3/libdoc/pathname/rdoc/Pathname.html Ruby's Pathname API @@ -519,97 +449,8 @@ class Pathname # This is why monkeypatching is non-ideal (but right solution to get # Ruby 3.3 over the line). odisabled "rmtree", "FileUtils#rm_r" - FileUtils.rm_r(@path, noop:, verbose:, secure:) + FileUtils.rm_r(T.must(@path), noop:, verbose:, secure:) nil end end require "extend/os/pathname" - -require "context" - -module ObserverPathnameExtension - extend T::Helpers - - requires_ancestor { Pathname } - - class << self - include Context - - sig { returns(Integer) } - attr_accessor :n, :d - - sig { void } - def reset_counts! - @n = @d = 0 - @put_verbose_trimmed_warning = false - end - - sig { returns(Integer) } - def total - n + d - end - - sig { returns([Integer, Integer]) } - def counts - [n, d] - end - - MAXIMUM_VERBOSE_OUTPUT = 100 - private_constant :MAXIMUM_VERBOSE_OUTPUT - - sig { returns(T::Boolean) } - def verbose? - return super unless ENV["CI"] - return false unless super - - if total < MAXIMUM_VERBOSE_OUTPUT - true - else - unless @put_verbose_trimmed_warning - puts "Only the first #{MAXIMUM_VERBOSE_OUTPUT} operations were output." - @put_verbose_trimmed_warning = true - end - false - end - end - end - - sig { void } - def unlink - super - puts "rm #{self}" if ObserverPathnameExtension.verbose? - ObserverPathnameExtension.n += 1 - end - - sig { void } - def mkpath - super - puts "mkdir -p #{self}" if ObserverPathnameExtension.verbose? - end - - sig { void } - def rmdir - super - puts "rmdir #{self}" if ObserverPathnameExtension.verbose? - ObserverPathnameExtension.d += 1 - end - - sig { params(src: Pathname).void } - def make_relative_symlink(src) - super - puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ObserverPathnameExtension.verbose? - ObserverPathnameExtension.n += 1 - end - - sig { void } - def install_info - super - puts "info #{self}" if ObserverPathnameExtension.verbose? - end - - sig { void } - def uninstall_info - super - puts "uninfo #{self}" if ObserverPathnameExtension.verbose? - end -end diff --git a/Library/Homebrew/extend/pathname/disk_usage_extension.rb b/Library/Homebrew/extend/pathname/disk_usage_extension.rb new file mode 100644 index 0000000000..4781ebfeb5 --- /dev/null +++ b/Library/Homebrew/extend/pathname/disk_usage_extension.rb @@ -0,0 +1,74 @@ +# typed: true # rubocop:todo Sorbet/StrictSigil +# frozen_string_literal: true + +module DiskUsageExtension + extend T::Helpers + + requires_ancestor { Pathname } + + sig { returns(Integer) } + def disk_usage + return @disk_usage if defined?(@disk_usage) + + compute_disk_usage + @disk_usage + end + + sig { returns(Integer) } + def file_count + return @file_count if defined?(@file_count) + + compute_disk_usage + @file_count + end + + sig { returns(String) } + def abv + out = +"" + compute_disk_usage + out << "#{number_readable(@file_count)} files, " if @file_count > 1 + out << disk_usage_readable(@disk_usage).to_s + out.freeze + end + + private + + sig { void } + def compute_disk_usage + if symlink? && !exist? + @file_count = 1 + @disk_usage = 0 + return + end + + path = if symlink? + resolved_path + else + self + end + + if path.directory? + scanned_files = Set.new + @file_count = 0 + @disk_usage = 0 + path.find do |f| + if f.directory? + @disk_usage += f.lstat.size + else + @file_count += 1 if f.basename.to_s != ".DS_Store" + # use Pathname#lstat instead of Pathname#stat to get info of symlink itself. + stat = f.lstat + file_id = [stat.dev, stat.ino] + # count hardlinks only once. + unless scanned_files.include?(file_id) + @disk_usage += stat.size + scanned_files.add(file_id) + end + end + end + else + @file_count = 1 + @disk_usage = path.lstat.size + end + end +end diff --git a/Library/Homebrew/extend/pathname/observer_pathname_extension.rb b/Library/Homebrew/extend/pathname/observer_pathname_extension.rb new file mode 100644 index 0000000000..2ef2035cb7 --- /dev/null +++ b/Library/Homebrew/extend/pathname/observer_pathname_extension.rb @@ -0,0 +1,91 @@ +# typed: true # rubocop:todo Sorbet/StrictSigil +# frozen_string_literal: true + +require "context" + +module ObserverPathnameExtension + extend T::Helpers + + requires_ancestor { Pathname } + + class << self + include Context + + sig { returns(Integer) } + attr_accessor :n, :d + + sig { void } + def reset_counts! + @n = @d = 0 + @put_verbose_trimmed_warning = false + end + + sig { returns(Integer) } + def total + n + d + end + + sig { returns([Integer, Integer]) } + def counts + [n, d] + end + + MAXIMUM_VERBOSE_OUTPUT = 100 + private_constant :MAXIMUM_VERBOSE_OUTPUT + + sig { returns(T::Boolean) } + def verbose? + return super unless ENV["CI"] + return false unless super + + if total < MAXIMUM_VERBOSE_OUTPUT + true + else + unless @put_verbose_trimmed_warning + puts "Only the first #{MAXIMUM_VERBOSE_OUTPUT} operations were output." + @put_verbose_trimmed_warning = true + end + false + end + end + end + + sig { void } + def unlink + super + puts "rm #{self}" if ObserverPathnameExtension.verbose? + ObserverPathnameExtension.n += 1 + end + + sig { void } + def mkpath + super + puts "mkdir -p #{self}" if ObserverPathnameExtension.verbose? + end + + sig { void } + def rmdir + super + puts "rmdir #{self}" if ObserverPathnameExtension.verbose? + ObserverPathnameExtension.d += 1 + end + + sig { params(src: Pathname).void } + def make_relative_symlink(src) + super + puts "ln -s #{src.relative_path_from(dirname)} #{basename}" if ObserverPathnameExtension.verbose? + ObserverPathnameExtension.n += 1 + end + + sig { void } + def install_info + super + puts "info #{self}" if ObserverPathnameExtension.verbose? + end + + sig { void } + def uninstall_info + super + puts "uninfo #{self}" if ObserverPathnameExtension.verbose? + end +end diff --git a/Library/Homebrew/extend/time.rb b/Library/Homebrew/extend/time.rb index 75a79b864b..2d266db5ff 100644 --- a/Library/Homebrew/extend/time.rb +++ b/Library/Homebrew/extend/time.rb @@ -5,5 +5,9 @@ require "time" class Time # Backwards compatibility for formulae that used this ActiveSupport extension - alias rfc3339 xmlschema + sig { returns(String) } + def rfc3339 + odeprecated "Time#rfc3339", "Time#xmlschema" + xmlschema + end end diff --git a/Library/Homebrew/formula-analytics/requirements.txt b/Library/Homebrew/formula-analytics/requirements.txt index ea19e51c7e..ae502f889f 100644 --- a/Library/Homebrew/formula-analytics/requirements.txt +++ b/Library/Homebrew/formula-analytics/requirements.txt @@ -4,13 +4,13 @@ # # pip-compile --allow-unsafe --generate-hashes --strip-extras requirements.in # -certifi==2025.4.26 \ - --hash=sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6 \ - --hash=sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3 +certifi==2025.6.15 \ + --hash=sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057 \ + --hash=sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b # via influxdb3-python -influxdb3-python==0.13.0 \ - --hash=sha256:616ee767286a81b6f575ea3de097bc095db724262586231ca8d7567dd2377a30 \ - --hash=sha256:c039638fcb44dd7c9433ab19e8f05bb782fa13989cb8c74d90e1291ebcc67b3b +influxdb3-python==0.14.0 \ + --hash=sha256:63318c1eb53e026d1d793ef00fef51510acd40dd80bd69b528bf05332757dc67 \ + --hash=sha256:f3c676112bf8a6230278a3e0940dd4cc2b57a868906a9de8e20cc9efd708a339 # via -r requirements.in pyarrow==20.0.0 \ --hash=sha256:00138f79ee1b5aca81e2bdedb91e3739b987245e11fa3c826f9e57c5d102fb75 \ @@ -81,17 +81,11 @@ six==1.17.0 \ --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \ --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81 # via python-dateutil -typing-extensions==4.13.2 \ - --hash=sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c \ - --hash=sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef +typing-extensions==4.14.1 \ + --hash=sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36 \ + --hash=sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76 # via reactivex -urllib3==2.4.0 \ - --hash=sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466 \ - --hash=sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813 - # via influxdb3-python - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.8.0 \ - --hash=sha256:49f7af965996f26d43c8ae34539c8d99c5042fbff34302ea151eaa9c207cd257 \ - --hash=sha256:95a60484590d24103af13b686121328cc2736bee85de8936383111e421b9edc0 +urllib3==2.5.0 \ + --hash=sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760 \ + --hash=sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc # via influxdb3-python diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f1fc47661e..ac85783f92 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -38,9 +38,9 @@ require "tab" require "mktemp" require "find" require "utils/spdx" -require "extend/on_system" +require "on_system" require "api" -require "extend/api_hashable" +require "api_hashable" # A formula provides instructions and metadata for Homebrew to install a piece # of software. Every Homebrew formula is a {Formula}. @@ -730,7 +730,9 @@ class Formula tab = Tab.for_keg(prefix(version)) return true if tab.version_scheme < version_scheme - return true if stable && tab.stable_version && tab.stable_version < T.must(stable).version + + tab_stable_version = tab.stable_version + return true if stable && tab_stable_version && tab_stable_version < T.must(stable).version return false unless fetch_head return false unless head&.downloader.is_a?(VCSDownloadStrategy) @@ -2126,7 +2128,7 @@ class Formula bash: bash_completion/base_name, zsh: zsh_completion/"_#{base_name}", fish: fish_completion/"#{base_name}.fish", - pwsh: pwsh_completion/"#{base_name}.ps1", + pwsh: pwsh_completion/"_#{base_name}.ps1", } shells.each do |shell| @@ -2593,11 +2595,8 @@ class Formula if path.exist? && on_system_blocks_exist? formula_contents = path.read - OnSystem::ALL_OS_ARCH_COMBINATIONS.each do |os, arch| - bottle_tag = Utils::Bottles::Tag.new(system: os, arch:) - next unless bottle_tag.valid_combination? - - Homebrew::SimulateSystem.with(os:, arch:) do + OnSystem::VALID_OS_ARCH_TAGS.each do |bottle_tag| + Homebrew::SimulateSystem.with_tag(bottle_tag) do variations_namespace = Formulary.class_s("Variations#{bottle_tag.to_sym.capitalize}") variations_formula_class = Formulary.load_formula(name, path, formula_contents, variations_namespace, flags: self.class.build_flags, ignore_errors: true) @@ -3208,11 +3207,11 @@ class Formula patchlist.select(&:external?).each(&:fetch) end - sig { void } - def fetch_bottle_tab + sig { params(quiet: T::Boolean).void } + def fetch_bottle_tab(quiet: false) return unless bottled? - T.must(bottle).fetch_tab + T.must(bottle).fetch_tab(quiet: quiet) end sig { returns(T::Hash[String, T.untyped]) } diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index b08a3c013c..5a95f1d83d 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -114,7 +114,7 @@ module Homebrew ln -s #{formula.path.to_s.gsub(formula.tap.path, "..")} #{alias_name} EOS else - problem "Formula has other versions so create an alias named #{alias_name}." + problem "Formula has other versions so create an alias named '#{alias_name}'." end end @@ -153,7 +153,7 @@ module Homebrew next if synced_formula == name if (synced_version = Formulary.factory(synced_formula).version) != version - problem "Version of `#{synced_formula}` (#{synced_version}) should match version of `#{name}` (#{version})" + problem "Version of #{synced_formula} (#{synced_version}) should match version of #{name} (#{version})" end end @@ -170,9 +170,15 @@ module Homebrew last_word_connector: " or ")}." end - return unless @strict return unless @core_tap + if CoreCaskTap.instance.cask_tokens.include?(name) + problem "Formula name conflicts with an existing Homebrew/cask cask's token." + return + end + + return unless @strict + problem "'#{name}' is not allowed in homebrew/core." if MissingFormula.disallowed_reason(name) if Formula.aliases.include? name @@ -185,10 +191,15 @@ module Homebrew return end + if CoreCaskTap.instance.cask_tokens.include?(name) + problem "Formula name conflicts with an existing Homebrew/cask cask's token." + return + end + return if formula.core_formula? return unless Formula.core_names.include?(name) - problem "Formula name conflicts with existing core formula." + problem "Formula name conflicts with an existing formula in homebrew/core." end PERMITTED_LICENSE_MISMATCHES = { @@ -203,7 +214,7 @@ module Homebrew INCOMPATIBLE_LICENSES = [ "Aladdin", # https://www.gnu.org/licenses/license-list.html#Aladdin "CPOL-1.02", # https://www.gnu.org/licenses/license-list.html#cpol - "gSOAP-1.3b", # https://salsa.debian.org/ellert/gsoap/-/blob/master/debian/copyright + "gSOAP-1.3b", # https://salsa.debian.org/ellert/gsoap/-/blob/HEAD/debian/copyright "JSON", # https://wiki.debian.org/DFSGLicenses#JSON_evil_license "MS-LPL", # https://github.com/spdx/license-list-XML/issues/1432#issuecomment-1077680709 "OPL-1.0", # https://wiki.debian.org/DFSGLicenses#Open_Publication_License_.28OPL.29_v1.0 @@ -226,7 +237,7 @@ module Homebrew problem <<~EOS Formula #{formula.name} contains incompatible licenses: #{incompatible_licenses}. Formulae in homebrew/core must either use a Debian Free Software Guidelines license - or be released into the public domain. See #{Formatter.url("https://docs.brew.sh/License-Guidelines")} + or be released into the public domain: #{Formatter.url("https://docs.brew.sh/License-Guidelines")} EOS end @@ -327,7 +338,7 @@ module Homebrew end end - problem "Dependency '#{dep}' does not define option #{opt.name.inspect}" + problem "Dependency '#{dep}' does not define option: #{opt.name.inspect}" end problem "Don't use 'git' as a dependency (it's always available)" if @new_formula && dep.name == "git" @@ -396,7 +407,7 @@ module Homebrew base_info = event_payload.dig("pull_request", "base").to_h # handle `nil` # We need to read the head ref from `GITHUB_EVENT_PATH` because - # `git branch --show-current` returns `master` on PR branches. + # `git branch --show-current` returns the default branch on PR branches. staging_branch = base_info["ref"]&.end_with?("-staging") homebrew_owned_repo = base_info.dig("repo", "owner", "login") == "Homebrew" homebrew_core_pr = base_info.dig("repo", "name") == "homebrew-core" @@ -448,7 +459,7 @@ module Homebrew if T.must(tap).formula_renames.key?(conflict.name) || T.must(tap).aliases.include?(conflict.name) problem "Formula conflict should be declared using " \ - "canonical name (#{conflicting_formula.name}) instead of #{conflict.name}" + "canonical name (#{conflicting_formula.name}) instead of '#{conflict.name}'" end reverse_conflict_found = T.let(false, T::Boolean) @@ -457,7 +468,7 @@ module Homebrew if T.must(tap).formula_renames.key?(reverse_conflict.name) || T.must(tap).aliases.include?(reverse_conflict.name) problem "Formula #{conflicting_formula.name} conflict should be declared using " \ - "canonical name (#{reverse_conflict_formula.name}) instead of #{reverse_conflict.name}" + "canonical name (#{reverse_conflict_formula.name}) instead of '#{reverse_conflict.name}'" end reverse_conflict_found ||= reverse_conflict_formula == formula @@ -651,7 +662,7 @@ module Homebrew metadata = SharedAudits.github_repo_data(user, repo) return if metadata.nil? - problem "GitHub repo is archived" if metadata["archived"] + problem "GitHub repository is archived" if metadata["archived"] end def audit_gitlab_repository_archived @@ -663,7 +674,7 @@ module Homebrew metadata = SharedAudits.gitlab_repo_data(user, repo) return if metadata.nil? - problem "GitLab repo is archived" if metadata["archived"] + problem "GitLab repository is archived" if metadata["archived"] end def audit_github_repository @@ -712,7 +723,7 @@ module Homebrew end def audit_specs - problem "Head-only (no stable download)" if head_only?(formula) + problem "HEAD-only (no stable download)" if head_only?(formula) %w[Stable HEAD].each do |name| spec_name = name.downcase.to_sym @@ -759,7 +770,7 @@ module Homebrew if formula.head && @versioned_formula && !formula.tap&.audit_exception(:versioned_head_spec_allowlist, formula.name) - problem "Versioned formulae should not have a `HEAD` spec" + problem "Versioned formulae should not have a `head` spec" end stable = formula.stable @@ -771,7 +782,7 @@ module Homebrew stable_version_string = version.to_s if stable_version_string.start_with?("HEAD") - problem "Stable: non-HEAD version name (#{stable_version_string}) should not begin with HEAD" + problem "Stable: non-HEAD version (#{stable_version_string}) should not begin with `HEAD`" end stable_url_version = Version.parse(stable.url) @@ -790,7 +801,7 @@ module Homebrew return if formula.tap&.audit_exception :unstable_allowlist, formula.name, version_prefix return if formula.tap&.audit_exception :unstable_devel_allowlist, formula.name, version_prefix - problem "Stable version URLs should not contain #{matched}" + problem "Stable: version URLs should not contain `#{matched}`" when %r{download\.gnome\.org/sources}, %r{ftp\.gnome\.org/pub/GNOME/sources}i version_prefix = stable.version.major_minor return if formula.tap&.audit_exception :gnome_devel_allowlist, formula.name, version_prefix @@ -800,11 +811,11 @@ module Homebrew return if stable_url_version >= Version.new("40.0") return if stable_url_minor_version.even? - problem "#{stable.version} is a development release" + problem "Stable: version (#{stable.version}) is a development release" when %r{isc.org/isc/bind\d*/}i return if stable_url_minor_version.even? - problem "#{stable.version} is a development release" + problem "Stable: version (#{stable.version}) is a development release" when %r{https?://gitlab\.com/([\w-]+)/([\w-]+)} owner = T.must(Regexp.last_match(1)) @@ -845,7 +856,7 @@ module Homebrew if !newest_committed[:version].nil? && current_version < newest_committed[:version] && current_version_scheme == previous_committed[:version_scheme] - problem "stable version should not decrease (from #{newest_committed[:version]} to #{current_version})" + problem "Stable: version should not decrease (from #{newest_committed[:version]} to #{current_version})" end end @@ -867,14 +878,14 @@ module Homebrew !current_revision.zero? && current_revision == newest_committed[:revision] && current_revision == previous_committed[:revision] - problem "'revision #{current_revision}' should be removed" + problem "`revision #{current_revision}` should be removed" elsif current_version == previous_committed[:version] && !previous_committed[:revision].nil? && current_revision < previous_committed[:revision] - problem "revision should not decrease (from #{previous_committed[:revision]} to #{current_revision})" + problem "`revision` should not decrease (from #{previous_committed[:revision]} to #{current_revision})" elsif newest_committed[:revision] && current_revision > (newest_committed[:revision] + 1) - problem "revisions should only increment by 1" + problem "`revision` should only increment by 1" end end @@ -891,10 +902,10 @@ module Homebrew return if previous_committed[:version_scheme].nil? if current_version_scheme < previous_committed[:version_scheme] - problem "version_scheme should not decrease (from #{previous_committed[:version_scheme]} " \ + problem "`version_scheme` should not decrease (from #{previous_committed[:version_scheme]} " \ "to #{current_version_scheme})" elsif current_version_scheme > (previous_committed[:version_scheme] + 1) - problem "version_schemes should only increment by 1" + problem "`version_scheme` should only increment by 1" end end @@ -935,7 +946,7 @@ module Homebrew bin_names.each do |name| shell_commands.each do |cmd| if text.to_s.match?(/test do.*#{cmd}[(\s]+['"]#{Regexp.escape(name)}[\s'"]/m) - problem %Q(fully scope test #{cmd} calls, e.g. #{cmd} "\#{bin}/#{name}") + problem %Q(Fully scope test `#{cmd}` calls, e.g.: #{cmd} "\#{bin}/#{name}") end end end diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 42609a20db..eff5063169 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -84,7 +84,6 @@ module FormulaCellarChecks def valid_library_extension?(filename) VALID_LIBRARY_EXTENSIONS.include? filename.extname end - alias generic_valid_library_extension? valid_library_extension? sig { returns(T.nilable(String)) } def check_non_libraries @@ -437,7 +436,6 @@ module FormulaCellarChecks problem_if_output(check_cpuid_instruction(formula)) problem_if_output(check_binary_arches(formula)) end - alias generic_audit_installed audit_installed private diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 6bd6b0fdde..4c10a631e8 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -1,68 +1,107 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "digest" require "erb" +require "utils/github" module Homebrew # Class for generating a formula from a template. class FormulaCreator + sig { returns(String) } attr_accessor :name + sig { returns(Version) } + attr_reader :version + + sig { returns(String) } + attr_reader :url + + sig { returns(T::Boolean) } + attr_reader :head + sig { - params(name: T.nilable(String), version: T.nilable(String), tap: T.nilable(String), url: String, + params(url: String, name: T.nilable(String), version: T.nilable(String), tap: T.nilable(String), mode: T.nilable(Symbol), license: T.nilable(String), fetch: T::Boolean, head: T::Boolean).void } - def initialize(name, version, tap:, url:, mode:, license:, fetch:, head:) - @name = name - @version = Version.new(version) if version - @tap = Tap.fetch(tap || "homebrew/core") + def initialize(url:, name: nil, version: nil, tap: nil, mode: nil, license: nil, fetch: false, head: false) @url = url @mode = mode @license = license @fetch = fetch - @head = head - end - sig { void } - def verify - raise TapUnavailableError, @tap.name unless @tap.installed? - end - - sig { params(url: String).returns(T.nilable(String)) } - def self.name_from_url(url) - stem = Pathname.new(url).stem - # special cases first - if stem.start_with? "index.cgi" - # gitweb URLs e.g. http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary - stem.rpartition("=").last - elsif url =~ %r{github\.com/\S+/(\S+)/(archive|releases)/} - # e.g. https://github.com/stella-emu/stella/releases/download/6.7/stella-6.7-src.tar.xz - Regexp.last_match(1) + tap = if tap.blank? + CoreTap.instance else - # e.g. http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz - pathver = Version.parse(stem).to_s - stem.sub(/[-_.]?#{Regexp.escape(pathver)}$/, "") + Tap.fetch(tap) end + @tap = T.let(tap, Tap) + + if (match_github = url.match %r{github\.com/(?[^/]+)/(?[^/]+).*}) + user = T.must(match_github[:user]) + repository = T.must(match_github[:repo]) + if repository.end_with?(".git") + # e.g. https://github.com/Homebrew/brew.git + repository.delete_suffix!(".git") + head = true + end + odebug "github: #{user} #{repository} head:#{head}" + if name.blank? + name = repository + odebug "name from github: #{name}" + end + elsif name.blank? + stem = Pathname.new(url).stem + name = if stem.start_with?("index.cgi") && stem.include?("=") + # special cases first + # gitweb URLs e.g. http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary + stem.rpartition("=").last + else + # e.g. http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz + pathver = Version.parse(stem).to_s + stem.sub(/[-_.]?#{Regexp.escape(pathver)}$/, "") + end + odebug "name from url: #{name}" + end + @name = T.let(name, String) + @head = head + + if version.present? + version = Version.new(version) + odebug "version from user: #{version}" + else + version = Version.detect(url) + odebug "version from url: #{version}" + end + + if fetch && user && repository + github = GitHub.repository(user, repository) + + if version.null? && !head + begin + latest_release = GitHub.get_latest_release(user, repository) + version = Version.new(latest_release.fetch("tag_name")) + odebug "github: version from latest_release: #{version}" + + @url = "https://github.com/#{user}/#{repository}/archive/refs/tags/#{version}.tar.gz" + odebug "github: url changed to source archive #{@url}" + rescue GitHub::API::HTTPNotFoundError + odebug "github: latest_release lookup failed: #{url}" + end + end + end + @github = T.let(github, T.untyped) + @version = T.let(version, Version) + + @sha256 = T.let(nil, T.nilable(String)) + @desc = T.let(nil, T.nilable(String)) + @homepage = T.let(nil, T.nilable(String)) + @license = T.let(nil, T.nilable(String)) end sig { void } - def parse_url - @name = FormulaCreator.name_from_url(@url) if @name.blank? - odebug "name_from_url: #{@name}" - @version = Version.detect(@url) if @version.nil? - - case @url - when %r{github\.com/(\S+)/(\S+)\.git} - @head = true - user = Regexp.last_match(1) - repo = Regexp.last_match(2) - @github = GitHub.repository(user, repo) if @fetch - when %r{github\.com/(\S+)/(\S+)/(archive|releases)/} - user = Regexp.last_match(1) - repo = Regexp.last_match(2) - @github = GitHub.repository(user, repo) if @fetch - end + def verify_tap_available! + raise TapUnavailableError, @tap.name unless @tap.installed? end sig { returns(Pathname) } @@ -84,11 +123,14 @@ module Homebrew r.owner = self filepath = r.fetch html_doctype_prefix = " <<~ERB # Documentation: https://docs.brew.sh/Formula-Cookbook # https://rubydoc.brew.sh/Formula @@ -129,7 +171,7 @@ module Homebrew <% unless @head %> url "#{@url}" <% unless @version.detected_from_url? %> - version "#{@version}" + version "#{@version.to_s.delete_prefix("v")}" <% end %> sha256 "#{@sha256}" <% end %> @@ -138,7 +180,10 @@ module Homebrew head "#{@url}" <% end %> - <% if @mode == :cmake %> + <% if @mode == :cabal %> + depends_on "cabal-install" => :build + depends_on "ghc" => :build + <% elsif @mode == :cmake %> depends_on "cmake" => :build <% elsif @mode == :crystal %> depends_on "crystal" => :build @@ -172,7 +217,10 @@ module Homebrew <% end %> def install - <% if @mode == :cmake %> + <% if @mode == :cabal %> + system "cabal", "v2-update" + system "cabal", "v2-install", *std_cabal_v2_args + <% elsif @mode == :cmake %> system "cmake", "-S", ".", "-B", "build", *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" @@ -216,11 +264,14 @@ module Homebrew <% elsif @mode == :python %> virtualenv_install_with_resources <% elsif @mode == :ruby %> + ENV["BUNDLE_VERSION"] = "system" # Avoid installing Bundler into the keg ENV["GEM_HOME"] = libexec - system "bundle", "install", "-without", "development", "test" + system "bundle", "config", "set", "without", "development", "test" + system "bundle", "install" system "gem", "build", "\#{name}.gemspec" system "gem", "install", "\#{name}-\#{version}.gem" + bin.install libexec/"bin/\#{name}" bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"]) <% elsif @mode == :rust %> @@ -249,7 +300,6 @@ module Homebrew end end ERB - # end end end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 7d7aad186d..05b1bccf21 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -306,7 +306,7 @@ class FormulaInstaller if force? opoo message else - GitHub::Actions.puts_annotation_if_env_set(:error, message) + GitHub::Actions.puts_annotation_if_env_set!(:error, message) raise CannotInstallFormulaError, message end end @@ -420,7 +420,8 @@ class FormulaInstaller invalid_arch_dependencies = [] pinned_unsatisfied_deps = [] recursive_deps.each do |dep| - if (tab = Tab.for_formula(dep.to_formula)) && tab.arch.present? && tab.arch.to_s != Hardware::CPU.arch.to_s + tab = Tab.for_formula(dep.to_formula) + if tab.arch.present? && tab.arch.to_s != Hardware::CPU.arch.to_s invalid_arch_dependencies << "#{dep} was built for #{tab.arch}" end @@ -520,6 +521,7 @@ class FormulaInstaller oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip if show_header? if (tap = formula.tap) && tap.should_report_analytics? + require "utils/analytics" Utils::Analytics.report_package_event(:formula_install, package_name: formula.name, tap_name: tap.name, on_request: installed_on_request?, options:) end @@ -892,9 +894,11 @@ on_request: installed_on_request?, options:) return if quiet? caveats = Caveats.new(formula) - return if caveats.empty? + Homebrew.messages.record_completions_and_elisp(caveats.completions_and_elisp) + return if caveats.caveats.empty? + @show_summary_heading = true ohai "Caveats", caveats.to_s Homebrew.messages.record_caveats(formula.name, caveats) @@ -1352,12 +1356,12 @@ on_request: installed_on_request?, options:) end end - sig { void } - def fetch_bottle_tab + sig { params(quiet: T::Boolean).void } + def fetch_bottle_tab(quiet: false) return if @fetch_bottle_tab begin - formula.fetch_bottle_tab + formula.fetch_bottle_tab(quiet: quiet) @bottle_tab_runtime_dependencies = formula.bottle_tab_attributes .fetch("runtime_dependencies", []).then { |deps| deps || [] } .each_with_object({}) { |dep, h| h[dep["full_name"]] = dep } diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 2f191fb787..4e75312a8d 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true require "digest/sha2" -require "extend/cachable" +require "cachable" require "tab" require "utils" require "utils/bottles" @@ -79,6 +79,9 @@ module Formulary end module PathnameWriteMkpath + # TODO: migrate away from refinements here, they don't play nicely with + # Sorbet, when we migrate to `typed: strict` + # rubocop:todo Sorbet/BlockMethodDefinition refine Pathname do def write(content, offset = nil, **open_args) T.bind(self, Pathname) @@ -89,6 +92,7 @@ module Formulary super end end + # rubocop:enable Sorbet/BlockMethodDefinition end using PathnameWriteMkpath @@ -97,6 +101,11 @@ module Formulary require "formula" require "ignorable" + require "stringio" + + # Capture stdout to prevent formulae from printing to stdout unexpectedly. + old_stdout = $stdout + $stdout = StringIO.new mod = Module.new remove_const(namespace) if const_defined?(namespace) @@ -128,11 +137,21 @@ module Formulary rescue NameError => e class_list = mod.constants .map { |const_name| mod.const_get(const_name) } - .select { |const| const.is_a?(Class) } + .grep(Class) new_exception = FormulaClassUnavailableError.new(name, path, class_name, class_list) remove_const(namespace) raise new_exception, "", e.backtrace end + ensure + # TODO: Make printing to stdout an error so that we can print a tap name. + # See discussion at https://github.com/Homebrew/brew/pull/20226#discussion_r2195886888 + if (printed_to_stdout = $stdout.string.strip.presence) + opoo <<~WARNING + Formula #{name} attempted to print the following while being loaded: + #{printed_to_stdout} + WARNING + end + $stdout = old_stdout end sig { params(identifier: String).returns(String) } @@ -155,7 +174,7 @@ module Formulary end sig { params(name: String, flags: T::Array[String]).returns(T.class_of(Formula)) } - def self.load_formula_from_api(name, flags:) + def self.load_formula_from_api!(name, flags:) namespace = :"FormulaNamespaceAPI#{namespace_key(name)}" mod = Module.new @@ -249,6 +268,9 @@ module Formulary end end + # TODO: migrate away from this inline class here, they don't play nicely with + # Sorbet, when we migrate to `typed: strict` + # rubocop:todo Sorbet/BlockMethodDefinition klass = Class.new(::Formula) do @loaded_from_api = true @@ -416,6 +438,7 @@ module Formulary Checksum.new(checksum) if checksum end end + # rubocop:enable Sorbet/BlockMethodDefinition mod.const_set(class_name, klass) @@ -887,7 +910,7 @@ module Formulary private def load_from_api(flags:) - Formulary.load_formula_from_api(name, flags:) + Formulary.load_formula_from_api!(name, flags:) end end diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index 2e424c479d..1a86aa7942 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -95,7 +95,7 @@ class GitHubRunnerMatrix name: "Linux #{arch}", runner: linux_runner, container: { - image: "ghcr.io/homebrew/ubuntu22.04:master", + image: "ghcr.io/homebrew/ubuntu22.04:main", options: "--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED", }, workdir: "/github/home", @@ -255,17 +255,10 @@ class GitHubRunnerMatrix @testing_formulae.select do |formula| next false if macos_version && !formula.compatible_with?(macos_version) - simulate_arch = case arch - when :x86_64 - :intel - when :arm64 - :arm - else - :dunno - end - Homebrew::SimulateSystem.with(os: platform, arch: simulate_arch) do - formula.public_send(:"#{platform}_compatible?") && - formula.public_send(:"#{arch}_compatible?") + Homebrew::SimulateSystem.with(os: platform, arch: Homebrew::SimulateSystem.arch_symbols.fetch(arch)) do + simulated_formula = TestRunnerFormula.new(Formulary.factory(formula.name)) + simulated_formula.public_send(:"#{platform}_compatible?") && + simulated_formula.public_send(:"#{arch}_compatible?") end end end @@ -283,8 +276,11 @@ class GitHubRunnerMatrix .select do |dependent_f| next false if macos_version && !dependent_f.compatible_with?(macos_version) - dependent_f.public_send(:"#{platform}_compatible?") && - dependent_f.public_send(:"#{arch}_compatible?") + Homebrew::SimulateSystem.with(os: platform, arch: Homebrew::SimulateSystem.arch_symbols.fetch(arch)) do + simulated_dependent_f = TestRunnerFormula.new(Formulary.factory(dependent_f.name)) + simulated_dependent_f.public_send(:"#{platform}_compatible?") && + simulated_dependent_f.public_send(:"#{arch}_compatible?") + end end # These arrays will generally have been generated by different Formulary caches, diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index ee4f5fa916..46dac9b308 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -51,6 +51,7 @@ HOMEBREW_HOME_PLACEHOLDER = "/$HOME" HOMEBREW_CASK_APPDIR_PLACEHOLDER = "$APPDIR" HOMEBREW_MACOS_NEWEST_UNSUPPORTED = ENV.fetch("HOMEBREW_MACOS_NEWEST_UNSUPPORTED").freeze +HOMEBREW_MACOS_NEWEST_SUPPORTED = ENV.fetch("HOMEBREW_MACOS_NEWEST_SUPPORTED").freeze HOMEBREW_MACOS_OLDEST_SUPPORTED = ENV.fetch("HOMEBREW_MACOS_OLDEST_SUPPORTED").freeze HOMEBREW_MACOS_OLDEST_ALLOWED = ENV.fetch("HOMEBREW_MACOS_OLDEST_ALLOWED").freeze @@ -138,7 +139,7 @@ require "extend/kernel" require "os" require "extend/array" -require "extend/cachable" +require "cachable" require "extend/enumerable" require "extend/string" require "extend/pathname" diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index d7334667b5..6c21c8cdc9 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -42,7 +42,6 @@ module Hardware ppc64le: "-mcpu=powerpc64le", }.freeze, T.nilable(T::Hash[Symbol, String])) end - alias generic_optimization_flags optimization_flags sig { returns(Symbol) } def arch_32_bit @@ -219,6 +218,7 @@ module Hardware end end + sig { params(_version: T.nilable(MacOSVersion)).returns(Symbol) } def oldest_cpu(_version = nil) if Hardware::CPU.intel? if Hardware::CPU.is_64_bit? @@ -242,7 +242,6 @@ module Hardware Hardware::CPU.family end end - alias generic_oldest_cpu oldest_cpu # Returns a Rust flag to set the target CPU if necessary. # Defaults to nil. diff --git a/Library/Homebrew/ignorable.rb b/Library/Homebrew/ignorable.rb index 038bebd380..10d7ffe5c3 100644 --- a/Library/Homebrew/ignorable.rb +++ b/Library/Homebrew/ignorable.rb @@ -19,6 +19,9 @@ module Ignorable end def self.hook_raise + # TODO: migrate away from this inline class here, they don't play nicely with + # Sorbet, when we migrate to `typed: strict` + # rubocop:todo Sorbet/BlockMethodDefinition Object.class_eval do alias_method :original_raise, :raise @@ -37,6 +40,7 @@ module Ignorable alias_method :fail, :raise end + # rubocop:enable Sorbet/BlockMethodDefinition return unless block_given? diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 8fba7fabf7..807af20492 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -37,7 +37,6 @@ module Homebrew end def global_post_install; end - alias generic_global_post_install global_post_install def check_prefix if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) && @@ -232,7 +231,7 @@ module Homebrew false end - def install_formulae( + def formula_installers( formulae_to_install, installed_on_request: true, installed_as_dependency: false, @@ -257,11 +256,11 @@ module Homebrew skip_post_install: false, skip_link: false ) - formula_installers = formulae_to_install.filter_map do |formula| + formulae_to_install.filter_map do |formula| Migrator.migrate_if_needed(formula, force:, dry_run:) build_options = formula.build - formula_installer = FormulaInstaller.new( + FormulaInstaller.new( formula, options: build_options.used_options, installed_on_request:, @@ -286,24 +285,49 @@ module Homebrew skip_post_install:, skip_link:, ) + end + end - begin - unless dry_run - formula_installer.prelude - formula_installer.fetch - end - formula_installer + def install_formulae( + formula_installers, + installed_on_request: true, + installed_as_dependency: false, + build_bottle: false, + force_bottle: false, + bottle_arch: nil, + ignore_deps: false, + only_deps: false, + include_test_formulae: [], + build_from_source_formulae: [], + cc: nil, + git: false, + interactive: false, + keep_tmp: false, + debug_symbols: false, + force: false, + overwrite: false, + debug: false, + quiet: false, + verbose: false, + dry_run: false, + skip_post_install: false, + skip_link: false + ) + unless dry_run + formula_installers.each do |fi| + fi.prelude + fi.fetch rescue CannotInstallFormulaError => e ofail e.message - nil + next rescue UnsatisfiedRequirements, DownloadError, ChecksumMismatchError => e - ofail "#{formula}: #{e}" - nil + ofail "#{fi.formula}: #{e}" + next end end if dry_run - if (formulae_name_to_install = formulae_to_install.map(&:name)) + if (formulae_name_to_install = formula_installers.map { |fi| fi.formula.name }) ohai "Would install #{Utils.pluralize("formula", formulae_name_to_install.count, plural: "e", include_count: true)}:" puts formulae_name_to_install.join(" ") @@ -331,16 +355,17 @@ module Homebrew end # If asking the user is enabled, show dependency and size information. - def ask_formulae(formulae, args:) - return if formulae.empty? + def ask_formulae(formulae_installer, dependants, args:) + return if formulae_installer.empty? + + formulae = collect_dependencies(formulae_installer, dependants) ohai "Looking for bottles..." - sized_formulae = compute_sized_formulae(formulae, args: args) - sizes = compute_total_sizes(sized_formulae, debug: args.debug?) + sizes = compute_total_sizes(formulae, debug: args.debug?) - puts "#{::Utils.pluralize("Formula", sized_formulae.count, plural: "e")} \ -(#{sized_formulae.count}): #{sized_formulae.join(", ")}\n\n" + puts "#{::Utils.pluralize("Formula", formulae.count, plural: "e")} \ +(#{formulae.count}): #{formulae.join(", ")}\n\n" puts "Download Size: #{disk_usage_readable(sizes[:download])}" puts "Install Size: #{disk_usage_readable(sizes[:installed])}" puts "Net Install Size: #{disk_usage_readable(sizes[:net])}" if sizes[:net] != 0 @@ -366,7 +391,6 @@ module Homebrew Diagnostic.checks(:supported_configuration_checks, fatal: all_fatal) Diagnostic.checks(:fatal_preinstall_checks) end - alias generic_perform_preinstall_checks perform_preinstall_checks def attempt_directory_creation Keg.must_exist_directories.each do |dir| @@ -413,41 +437,6 @@ module Homebrew end end - # Build a unique list of formulae to size by including: - # 1. The original formulae to install. - # 2. Their outdated dependents (subject to pruning criteria). - # 3. Optionally, any installed formula that depends on one of these and is outdated. - def compute_sized_formulae(formulae, args:) - sized_formulae = formulae.flat_map do |formula| - # Always include the formula itself. - formula_list = [formula] - - deps = args.build_from_source? ? formula.deps.build : formula.deps.required - - outdated_dependents = deps.map(&:to_formula).reject(&:pinned?).select do |dep| - dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?) - end - deps.map(&:to_formula).each do |f| - outdated_dependents.concat(f.recursive_dependencies.map(&:to_formula).reject(&:pinned?).select do |dep| - dep.installed_kegs.empty? || (dep.bottled? && dep.outdated?) - end) - end - formula_list.concat(outdated_dependents) - - formula_list - end - - # Add any installed formula that depends on one of the sized formulae and is outdated. - unless Homebrew::EnvConfig.no_installed_dependents_check? - sized_formulae.concat(Formula.installed.select do |installed_formula| - installed_formula.bottled? && installed_formula.outdated? && - installed_formula.deps.required.map(&:to_formula).intersect?(sized_formulae) - end) - end - - sized_formulae.uniq(&:to_s).compact - end - # Compute the total sizes (download, installed, and net) for the given formulae. def compute_total_sizes(sized_formulae, debug: false) total_download_size = 0 @@ -473,6 +462,14 @@ module Homebrew installed: total_installed_size, net: total_net_size } end + + def collect_dependencies(formulae_installer, dependants) + formulae_dependencies = formulae_installer.flat_map do |f| + [f.formula, f.compute_dependencies.flatten.grep(Dependency).flat_map(&:to_formula)] + end.flatten.uniq + formulae_dependencies.concat(dependants.upgradeable) if dependants&.upgradeable + formulae_dependencies.uniq + end end end end diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 40f96d48ba..275cc8fed0 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -4,7 +4,7 @@ require "keg_relocate" require "language/python" require "lock_file" -require "extend/cachable" +require "cachable" # Installation prefix of a formula. class Keg diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 5ae085f769..c4e6621d8a 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -35,7 +35,7 @@ class Keg end sig { params(text: String).returns(T::Boolean) } - def replace_text(text) + def replace_text!(text) replacements = @replacement_map.values.to_h sorted_keys = replacements.keys.sort_by do |key| @@ -77,7 +77,6 @@ class Keg FileUtils.ln_s(new_src, file) end end - alias generic_fix_dynamic_linkage fix_dynamic_linkage def relocate_dynamic_linkage(_relocation) [] @@ -102,7 +101,6 @@ class Keg relocation end - alias generic_prepare_relocation_to_placeholders prepare_relocation_to_placeholders def replace_locations_with_placeholders relocation = prepare_relocation_to_placeholders.freeze @@ -123,7 +121,6 @@ class Keg relocation end - alias generic_prepare_relocation_to_locations prepare_relocation_to_locations def replace_placeholders_with_locations(files, skip_linkage: false) relocation = prepare_relocation_to_locations.freeze @@ -146,7 +143,7 @@ class Keg files.map { path.join(_1) }.group_by { |f| f.stat.ino }.each_value do |first, *rest| s = first.open("rb", &:read) - next unless relocation.replace_text(s) + next unless relocation.replace_text!(s) changed_files += [first, *rest].map { |file| file.relative_path_from(path) } @@ -221,7 +218,6 @@ class Keg [grep_bin, grep_args] end - alias generic_egrep_args egrep_args def each_unique_file_matching(string) Utils.popen_read("fgrep", recursive_fgrep_args, string, to_s) do |io| diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index ccd1467ada..cfa093e4db 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -96,7 +96,7 @@ module Language module_function # A regex to match potential shebang permutations. - NODE_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?node( |$)} + NODE_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?node( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. NODE_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env node ".length, Integer) diff --git a/Library/Homebrew/language/perl.rb b/Library/Homebrew/language/perl.rb index b163b1f85a..a7f43e9c5c 100644 --- a/Library/Homebrew/language/perl.rb +++ b/Library/Homebrew/language/perl.rb @@ -15,7 +15,7 @@ module Language module_function # A regex to match potential shebang permutations. - PERL_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?perl( |$)} + PERL_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?perl( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PERL_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env perl ".length, Integer) diff --git a/Library/Homebrew/language/php.rb b/Library/Homebrew/language/php.rb index c8ec368022..9ef2cfc943 100644 --- a/Library/Homebrew/language/php.rb +++ b/Library/Homebrew/language/php.rb @@ -15,7 +15,7 @@ module Language module_function # A regex to match potential shebang permutations. - PHP_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?php( |$)} + PHP_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?php( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PHP_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env php ".length, Integer) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index 5f26844d6f..aa62727bcd 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -112,7 +112,7 @@ module Language module_function # A regex to match potential shebang permutations. - PYTHON_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)} + PYTHON_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PYTHON_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env pythonx.yyy ".length, Integer) diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index 6d11765b2b..0db9ad05db 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -188,12 +188,10 @@ class LinkageChecker store&.update!(keg_files_dylibs:) end - alias generic_check_dylibs check_dylibs def system_libraries_exist_in_cache? false end - alias generic_system_libraries_exist_in_cache? system_libraries_exist_in_cache? def dylib_found_in_shared_cache?(dylib) @dyld_shared_cache_contains_path ||= begin diff --git a/Library/Homebrew/livecheck/skip_conditions.rb b/Library/Homebrew/livecheck/skip_conditions.rb index d1c5b7cc68..4ed474dea6 100644 --- a/Library/Homebrew/livecheck/skip_conditions.rb +++ b/Library/Homebrew/livecheck/skip_conditions.rb @@ -323,7 +323,7 @@ module Homebrew end return unless name - if skip_hash[:messages].is_a?(Array) && skip_hash[:messages].count.positive? + if skip_hash[:messages].is_a?(Array) && skip_hash[:messages].any? # TODO: Handle multiple messages, only if needed in the future if skip_hash[:status] == "skipped" puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{skip_hash[:messages][0]}" diff --git a/Library/Homebrew/macos_version.rb b/Library/Homebrew/macos_version.rb index 9c1cd7117f..6d1b8239ed 100644 --- a/Library/Homebrew/macos_version.rb +++ b/Library/Homebrew/macos_version.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strong # frozen_string_literal: true require "version" @@ -10,6 +10,7 @@ class MacOSVersion < Version sig { returns(T.nilable(T.any(String, Symbol))) } attr_reader :version + sig { params(version: T.nilable(T.any(String, Symbol))).void } def initialize(version) @version = version super "unknown or unsupported macOS version: #{version.inspect}" @@ -18,7 +19,8 @@ class MacOSVersion < Version # NOTE: When removing symbols here, ensure that they are added # to `DEPRECATED_MACOS_VERSIONS` in `MacOSRequirement`. - SYMBOLS = { + SYMBOLS = T.let({ + tahoe: "26", sequoia: "15", sonoma: "14", ventura: "13", @@ -29,12 +31,14 @@ class MacOSVersion < Version high_sierra: "10.13", sierra: "10.12", el_capitan: "10.11", - }.freeze + }.freeze, T::Hash[Symbol, String]) sig { params(macos_version: MacOSVersion).returns(Version) } def self.kernel_major_version(macos_version) version_major = macos_version.major.to_i - if version_major > 10 + if version_major >= 26 + Version.new((version_major - 1).to_s) + elsif version_major > 10 Version.new((version_major + 9).to_s) else version_minor = macos_version.minor.to_i @@ -50,11 +54,13 @@ class MacOSVersion < Version sig { params(version: T.nilable(String)).void } def initialize(version) - raise MacOSVersion::Error, version unless /\A1\d+(?:\.\d+){0,2}\Z/.match?(version) + raise MacOSVersion::Error, version unless /\A\d{2,}(?:\.\d+){0,2}\z/.match?(version) super(T.must(version)) - @comparison_cache = {} + @comparison_cache = T.let({}, T::Hash[T.untyped, T.nilable(Integer)]) + @pretty_name = T.let(nil, T.nilable(String)) + @sym = T.let(nil, T.nilable(Symbol)) end sig { override.params(other: T.untyped).returns(T.nilable(Integer)) } @@ -92,7 +98,7 @@ class MacOSVersion < Version sig { returns(Symbol) } def to_sym - return @sym if defined?(@sym) + return @sym if @sym sym = SYMBOLS.invert.fetch(strip_patch.to_s, :dunno) @@ -103,7 +109,7 @@ class MacOSVersion < Version sig { returns(String) } def pretty_name - return @pretty_name if defined?(@pretty_name) + return @pretty_name if @pretty_name pretty_name = to_sym.to_s.split("_").map(&:capitalize).join(" ").freeze @@ -151,5 +157,7 @@ class MacOSVersion < Version # Represents the absence of a version. # # NOTE: Constructor needs to called with an arbitrary macOS-like version which is then set to `nil`. - NULL = MacOSVersion.new("10.0").tap { |v| v.instance_variable_set(:@version, nil) }.freeze + NULL = T.let(MacOSVersion.new("10.0").tap do |v| + T.let(v, MacOSVersion).instance_variable_set(:@version, nil) + end.freeze, MacOSVersion) end diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index d3b0173d8a..13461256a3 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -133,7 +133,7 @@ If no search term is provided, all locally available formulae are listed. ## CUSTOM EXTERNAL COMMANDS Homebrew, like `git`(1), supports external commands. These are executable -scripts that reside somewhere in the `PATH`, named `brew-` or +scripts that reside somewhere in the `$PATH`, named `brew-` or `brew-``.rb`, which can be invoked like `brew` . This allows you to create your own commands without modifying Homebrew's internals. @@ -184,7 +184,7 @@ files: User-specific environment files take precedence over prefix-specific files and prefix-specific files take precedence over system-wide files (unless -`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` is set, see below). +`$HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` is set, see below). Note that these files do not support shell variable expansion e.g. `$HOME` or command execution e.g. `$(cat file)`. diff --git a/Library/Homebrew/mcp_server.rb b/Library/Homebrew/mcp_server.rb new file mode 100644 index 0000000000..5e0e440a56 --- /dev/null +++ b/Library/Homebrew/mcp_server.rb @@ -0,0 +1,274 @@ +# typed: strict +# frozen_string_literal: true + +# This is a standalone Ruby script as MCP servers need a faster startup time +# than a normal Homebrew Ruby command allows. +require_relative "standalone" +require "json" +require "stringio" + +module Homebrew + # Provides a Model Context Protocol (MCP) server for Homebrew. + # See https://modelcontextprotocol.io/introduction for more information. + # + # https://modelcontextprotocol.io/docs/tools/inspector is useful for testing. + class McpServer + HOMEBREW_BREW_FILE = T.let(ENV.fetch("HOMEBREW_BREW_FILE").freeze, String) + HOMEBREW_VERSION = T.let(ENV.fetch("HOMEBREW_VERSION").freeze, String) + JSON_RPC_VERSION = T.let("2.0", String) + MCP_PROTOCOL_VERSION = T.let("2025-03-26", String) + ERROR_CODE = T.let(-32601, Integer) + + SERVER_INFO = T.let({ + name: "brew-mcp-server", + version: HOMEBREW_VERSION, + }.freeze, T::Hash[Symbol, String]) + + FORMULA_OR_CASK_PROPERTIES = T.let({ + formula_or_cask: { + type: "string", + description: "Formula or cask name", + }, + }.freeze, T::Hash[Symbol, T.anything]) + + # NOTE: Cursor (as of June 2025) will only query/use a maximum of 40 tools. + TOOLS = T.let({ + search: { + name: "search", + description: "Perform a substring search of cask tokens and formula names for . " \ + "If is flanked by slashes, it is interpreted as a regular expression.", + command: "brew search", + inputSchema: { + type: "object", + properties: { + text_or_regex: { + type: "string", + description: "Text or regex to search for", + }, + }, + }, + required: ["text_or_regex"], + }, + info: { + name: "info", + description: "Display brief statistics for your Homebrew installation. " \ + "If a or is provided, show summary of information about it.", + command: "brew info", + inputSchema: { type: "object", properties: FORMULA_OR_CASK_PROPERTIES }, + }, + install: { + name: "install", + description: "Install a or .", + command: "brew install", + inputSchema: { type: "object", properties: FORMULA_OR_CASK_PROPERTIES }, + required: ["formula_or_cask"], + }, + update: { + name: "update", + description: "Fetch the newest version of Homebrew and all formulae from GitHub using `git` and " \ + "perform any necessary migrations.", + command: "brew update", + inputSchema: { type: "object", properties: {} }, + }, + upgrade: { + name: "upgrade", + description: "Upgrade outdated casks and outdated, unpinned formulae using the same options they were " \ + "originally installed with, plus any appended brew formula options. If or " \ + "are specified, upgrade only the given or kegs (unless they are pinned).", + command: "brew upgrade", + inputSchema: { type: "object", properties: FORMULA_OR_CASK_PROPERTIES }, + }, + uninstall: { + name: "uninstall", + description: "Uninstall a or .", + command: "brew uninstall", + inputSchema: { type: "object", properties: FORMULA_OR_CASK_PROPERTIES }, + required: ["formula_or_cask"], + }, + list: { + name: "list", + description: "List all installed formulae and casks. " \ + "If is provided, summarise the paths within its current keg. " \ + "If is provided, list its artifacts.", + command: "brew list", + inputSchema: { type: "object", properties: FORMULA_OR_CASK_PROPERTIES }, + }, + config: { + name: "config", + description: "Show Homebrew and system configuration info useful for debugging. " \ + "If you file a bug report, you will be required to provide this information.", + command: "brew config", + inputSchema: { type: "object", properties: {} }, + }, + doctor: { + name: "doctor", + description: "Check your system for potential problems. Will exit with a non-zero status " \ + "if any potential problems are found. " \ + "Please note that these warnings are just used to help the Homebrew maintainers " \ + "with debugging if you file an issue. If everything you use Homebrew for " \ + "is working fine: please don't worry or file an issue; just ignore this.", + command: "brew doctor", + inputSchema: { type: "object", properties: {} }, + }, + commands: { + name: "commands", + description: "Show lists of built-in and external commands.", + command: "brew commands", + inputSchema: { type: "object", properties: {} }, + }, + help: { + name: "help", + description: "Outputs the usage instructions for `brew` .", + command: "brew help", + inputSchema: { + type: "object", + properties: { + command: { + type: "string", + description: "Command to get help for", + }, + }, + }, + }, + }.freeze, T::Hash[Symbol, T::Hash[Symbol, T.anything]]) + + sig { params(stdin: T.any(IO, StringIO), stdout: T.any(IO, StringIO), stderr: T.any(IO, StringIO)).void } + def initialize(stdin: $stdin, stdout: $stdout, stderr: $stderr) + @debug_logging = T.let(ARGV.include?("--debug") || ARGV.include?("-d"), T::Boolean) + @ping_switch = T.let(ARGV.include?("--ping"), T::Boolean) + @stdin = T.let(stdin, T.any(IO, StringIO)) + @stdout = T.let(stdout, T.any(IO, StringIO)) + @stderr = T.let(stderr, T.any(IO, StringIO)) + end + + sig { returns(T::Boolean) } + def debug_logging? = @debug_logging + + sig { returns(T::Boolean) } + def ping_switch? = @ping_switch + + sig { void } + def run + @stderr.puts "==> Started Homebrew MCP server..." + + loop do + input = if ping_switch? + { jsonrpc: JSON_RPC_VERSION, id: 1, method: "ping" }.to_json + else + break if @stdin.eof? + + @stdin.gets + end + next if input.nil? || input.strip.empty? + + request = JSON.parse(input) + debug("Request: #{JSON.pretty_generate(request)}") + + response = handle_request(request) + if response.nil? + debug("Response: nil") + next + end + + debug("Response: #{JSON.pretty_generate(response)}") + output = JSON.dump(response).strip + @stdout.puts(output) + @stdout.flush + + break if ping_switch? + end + rescue Interrupt + exit 0 + rescue => e + log("Error: #{e.message}") + exit 1 + end + + sig { params(text: String).void } + def debug(text) + return unless debug_logging? + + log(text) + end + + sig { params(text: String).void } + def log(text) + @stderr.puts(text) + @stderr.flush + end + + sig { params(request: T::Hash[String, T.untyped]).returns(T.nilable(T::Hash[Symbol, T.anything])) } + def handle_request(request) + id = request["id"] + return if id.nil? + + case request["method"] + when "initialize" + respond_result(id, { + protocolVersion: MCP_PROTOCOL_VERSION, + capabilities: { + tools: { listChanged: false }, + prompts: {}, + resources: {}, + logging: {}, + roots: {}, + }, + serverInfo: SERVER_INFO, + }) + when "resources/list" + respond_result(id, { resources: [] }) + when "resources/templates/list" + respond_result(id, { resourceTemplates: [] }) + when "prompts/list" + respond_result(id, { prompts: [] }) + when "ping" + respond_result(id) + when "get_server_info" + respond_result(id, SERVER_INFO) + when "logging/setLevel" + @debug_logging = request["params"]["level"] == "debug" + respond_result(id) + when "notifications/initialized", "notifications/cancelled" + respond_result + when "tools/list" + respond_result(id, { tools: TOOLS.values }) + when "tools/call" + if (tool = TOOLS.fetch(request["params"]["name"].to_sym, nil)) + require "shellwords" + + arguments = request["params"]["arguments"] + argument = arguments.fetch("formula_or_cask", "") + argument = arguments.fetch("text_or_regex", "") if argument.strip.empty? + argument = arguments.fetch("command", "") if argument.strip.empty? + argument = nil if argument.strip.empty? + brew_command = T.cast(tool.fetch(:command), String) + .delete_prefix("brew ") + full_command = [HOMEBREW_BREW_FILE, brew_command, argument].compact + .map { |arg| Shellwords.escape(arg) } + .join(" ") + output = `#{full_command} 2>&1`.strip + respond_result(id, { content: [{ type: "text", text: output }] }) + else + respond_error(id, "Unknown tool") + end + else + respond_error(id, "Method not found") + end + end + + sig { + params(id: T.nilable(Integer), + result: T::Hash[Symbol, T.anything]).returns(T.nilable(T::Hash[Symbol, T.anything])) + } + def respond_result(id = nil, result = {}) + return if id.nil? + + { jsonrpc: JSON_RPC_VERSION, id:, result: } + end + + sig { params(id: T.nilable(Integer), message: String).returns(T::Hash[Symbol, T.anything]) } + def respond_error(id, message) + { jsonrpc: JSON_RPC_VERSION, id:, error: { code: ERROR_CODE, message: } } + end + end +end diff --git a/Library/Homebrew/messages.rb b/Library/Homebrew/messages.rb index cdbf7059e9..830ce46fac 100644 --- a/Library/Homebrew/messages.rb +++ b/Library/Homebrew/messages.rb @@ -16,6 +16,7 @@ class Messages sig { void } def initialize @caveats = T.let([], T::Array[T::Hash[Symbol, Symbol]]) + @completions_and_elisp = T.let(Set.new, T::Set[String]) @package_count = T.let(0, Integer) @install_times = T.let([], T::Array[T::Hash[String, Float]]) end @@ -25,6 +26,11 @@ class Messages @caveats.push(package:, caveats:) end + sig { params(completions_and_elisp: T::Array[String]).void } + def record_completions_and_elisp(completions_and_elisp) + @completions_and_elisp.merge(completions_and_elisp) + end + sig { params(package: String, elapsed_time: Float).void } def package_installed(package, elapsed_time) @package_count += 1 @@ -40,13 +46,14 @@ class Messages sig { params(force: T::Boolean).void } def display_caveats(force: false) return if @package_count.zero? - return if @package_count == 1 && !force - return if @caveats.empty? + return if @caveats.empty? && @completions_and_elisp.empty? - oh1 "Caveats" - @caveats.each do |c| - ohai c[:package], c[:caveats] - end + oh1 "Caveats" unless @completions_and_elisp.empty? + @completions_and_elisp.each { |c| puts c } + return if @package_count == 1 && !force + + oh1 "Caveats" if @completions_and_elisp.empty? + @caveats.each { |c| ohai c[:package], c[:caveats] } end sig { void } diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 4b9dbdaee4..43e82914e3 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -93,7 +93,6 @@ module Homebrew EOS end end - alias generic_disallowed_reason disallowed_reason sig { params(name: String).returns(T.nilable(String)) } def tap_migration_reason(name) @@ -195,8 +194,10 @@ module Homebrew end end + sig { params(name: String, silent: T::Boolean, show_info: T::Boolean).returns(T.nilable(String)) } def cask_reason(name, silent: false, show_info: false); end + sig { params(name: String, command: String).returns(T.nilable(String)) } def suggest_command(name, command); end require "extend/os/missing_formula" diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/on_system.rb similarity index 96% rename from Library/Homebrew/extend/on_system.rb rename to Library/Homebrew/on_system.rb index 3d6b97b95f..4e1854ad19 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/on_system.rb @@ -9,6 +9,13 @@ module OnSystem ALL_OS_OPTIONS = [*MacOSVersion::SYMBOLS.keys, :linux].freeze ALL_OS_ARCH_COMBINATIONS = ALL_OS_OPTIONS.product(ARCH_OPTIONS).freeze + VALID_OS_ARCH_TAGS = ALL_OS_ARCH_COMBINATIONS.filter_map do |os, arch| + tag = Utils::Bottles::Tag.new(system: os, arch:) + next unless tag.valid_combination? + + tag + end.freeze + sig { params(arch: Symbol).returns(T::Boolean) } def self.arch_condition_met?(arch) raise ArgumentError, "Invalid arch condition: #{arch.inspect}" if ARCH_OPTIONS.exclude?(arch) diff --git a/Library/Homebrew/extend/on_system.rbi b/Library/Homebrew/on_system.rbi similarity index 100% rename from Library/Homebrew/extend/on_system.rbi rename to Library/Homebrew/on_system.rbi diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index 4a7a1cb06c..39e24a1700 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -44,6 +44,19 @@ module ELFShim requires_ancestor { Pathname } + def initialize(*args) + @elf = T.let(nil, T.nilable(T::Boolean)) + @arch = T.let(nil, T.nilable(Symbol)) + @elf_type = T.let(nil, T.nilable(Symbol)) + @rpath = T.let(nil, T.nilable(String)) + @interpreter = T.let(nil, T.nilable(String)) + @dynamic_elf = T.let(nil, T.nilable(T::Boolean)) + @metadata = T.let(nil, T.nilable(Metadata)) + @patchelf_patcher = nil + + super + end + def read_uint8(offset) read(1, offset).unpack1("C") end @@ -52,8 +65,10 @@ module ELFShim read(2, offset).unpack1("v") end + sig { returns(T::Boolean) } def elf? - return @elf if defined? @elf + return @elf unless @elf.nil? + return @elf = false if read(MAGIC_NUMBER_ASCII.size, MAGIC_NUMBER_OFFSET) != MAGIC_NUMBER_ASCII # Check that this ELF file is for Linux or System V. @@ -61,6 +76,7 @@ module ELFShim @elf = [OS_ABI_LINUX, OS_ABI_SYSTEM_V].include? read_uint8(OS_ABI_OFFSET) end + sig { returns(Symbol) } def arch return :dunno unless elf? @@ -84,6 +100,7 @@ module ELFShim wanted_arch == arch end + sig { returns(Symbol) } def elf_type return :dunno unless elf? @@ -104,10 +121,9 @@ module ELFShim # The runtime search path, such as: # "/lib:/usr/lib:/usr/local/lib" + sig { returns(T.nilable(String)) } def rpath - return @rpath if defined? @rpath - - @rpath = rpath_using_patchelf_rb + @rpath ||= rpath_using_patchelf_rb end # An array of runtime search path entries, such as: @@ -116,10 +132,9 @@ module ELFShim Array(rpath&.split(":")) end + sig { returns(T.nilable(String)) } def interpreter - return @interpreter if defined? @interpreter - - @interpreter = patchelf_patcher.interpreter + @interpreter ||= patchelf_patcher.interpreter end def patch!(interpreter: nil, rpath: nil) @@ -128,23 +143,31 @@ module ELFShim save_using_patchelf_rb interpreter, rpath end + sig { returns(T::Boolean) } def dynamic_elf? - return @dynamic_elf if defined? @dynamic_elf - - @dynamic_elf = patchelf_patcher.elf.segment_by_type(:DYNAMIC).present? + @dynamic_elf ||= patchelf_patcher.elf.segment_by_type(:DYNAMIC).present? end # Helper class for reading metadata from an ELF file. class Metadata - attr_reader :path, :dylib_id, :dylibs + sig { returns(ELFShim) } + attr_reader :path + sig { returns(T.nilable(String)) } + attr_reader :dylib_id + + sig { returns(T::Array[String]) } + attr_reader :dylibs + + sig { params(path: ELFShim).void } def initialize(path) - @path = path - @dylibs = [] + @path = T.let(path, ELFShim) + @dylibs = T.let([], T::Array[String]) + @dylib_id = T.let(nil, T.nilable(String)) @dylib_id, needed = needed_libraries path - return if needed.empty? + @dylibs = needed.map { |lib| find_full_lib_path(lib).to_s } if needed.present? - @dylibs = needed.map { |lib| find_full_lib_path(lib).to_s } + @metadata = T.let(nil, T.nilable(T::Hash[String, T.untyped])) end private @@ -225,6 +248,7 @@ module ELFShim @patchelf_patcher ||= ::PatchELF::Patcher.new to_s, on_error: :silent end + sig { returns(Metadata) } def metadata @metadata ||= Metadata.new(self) end diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index d3e87cf859..9c704de981 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -12,11 +12,19 @@ module MachOShim delegate [:dylib_id] => :macho + def initialize(*args) + @macho = T.let(nil, T.nilable(MachO::MachOFile)) + @mach_data = T.let(nil, T.nilable(T::Array[T::Hash[Symbol, T.untyped]])) + + super + end + def macho @macho ||= MachO.open(to_s) end private :macho + sig { returns(T::Array[T::Hash[Symbol, T.untyped]]) } def mach_data @mach_data ||= begin machos = [] diff --git a/Library/Homebrew/os/mac/pkgconfig/15/expat.pc b/Library/Homebrew/os/mac/pkgconfig/15/expat.pc index 32ce93ec72..883859e68a 100644 --- a/Library/Homebrew/os/mac/pkgconfig/15/expat.pc +++ b/Library/Homebrew/os/mac/pkgconfig/15/expat.pc @@ -5,7 +5,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: expat -Version: 2.6.3 +Version: 2.7.1 Description: expat XML parser URL: https://libexpat.github.io/ Libs: -L${libdir} -lexpat diff --git a/Library/Homebrew/os/mac/pkgconfig/26/bzip2.pc b/Library/Homebrew/os/mac/pkgconfig/26/bzip2.pc new file mode 100644 index 0000000000..aded4844b2 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/bzip2.pc @@ -0,0 +1,12 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +bindir=${exec_prefix}/bin +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: bzip2 +Description: Lossless, block-sorting data compression +Version: 1.0.8 +Libs: -L${libdir} -lbz2 +Cflags: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/expat.pc b/Library/Homebrew/os/mac/pkgconfig/26/expat.pc new file mode 100644 index 0000000000..8395575305 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/expat.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: expat +Version: 2.7.1 +Description: expat XML parser +URL: https://libexpat.github.io/ +Libs: -L${libdir} -lexpat +Libs.private: +Cflags: +Cflags.private: -DXML_STATIC diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libcurl.pc b/Library/Homebrew/os/mac/pkgconfig/26/libcurl.pc new file mode 100644 index 0000000000..3247df2e81 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libcurl.pc @@ -0,0 +1,42 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### + +# This should most probably benefit from getting a "Requires:" field added +# dynamically by configure. +# +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include +supported_protocols="DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS IPFS IPNS LDAP LDAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP" +supported_features="alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets" + +Name: libcurl +URL: https://curl.se/ +Description: Library to transfer files with ftp, http, etc. +Version: 8.7.1 +Libs: -L${libdir} -lcurl +Libs.private: -lldap -lz +Cflags: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libedit.pc b/Library/Homebrew/os/mac/pkgconfig/26/libedit.pc new file mode 100644 index 0000000000..a20a0f6a13 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libedit.pc @@ -0,0 +1,12 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libedit +Description: command line editor library provides generic line editing, history, and tokenization functions. +Version: 3.0 +Requires: +Libs: -L${libdir} -ledit +Cflags: -I${includedir}/editline diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libexslt.pc b/Library/Homebrew/os/mac/pkgconfig/26/libexslt.pc new file mode 100644 index 0000000000..4da5570157 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libexslt.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + + +Name: libexslt +Version: 0.8.20 +Description: EXSLT Extension library +Requires: libxml-2.0, libxslt +Cflags: +Libs: -L${libdir} -lexslt +Libs.private: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libffi.pc b/Library/Homebrew/os/mac/pkgconfig/26/libffi.pc new file mode 100644 index 0000000000..2e462cc1eb --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libffi.pc @@ -0,0 +1,12 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +toolexeclibdir=${libdir} +includedir=${prefix}/include/ffi + +Name: libffi +Description: Library supporting Foreign Function Interfaces +Version: 3.4-rc1 +Libs: -L${toolexeclibdir} -lffi +Cflags: -I${includedir} diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libxml-2.0.pc b/Library/Homebrew/os/mac/pkgconfig/26/libxml-2.0.pc new file mode 100644 index 0000000000..214be9468b --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libxml-2.0.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include +modules=1 + +Name: libXML +Version: 2.9.13 +Description: libXML library version2. +Requires: +Libs: -L${libdir} -lxml2 +Libs.private: -lz -lpthread -licucore -lm +Cflags: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/libxslt.pc b/Library/Homebrew/os/mac/pkgconfig/26/libxslt.pc new file mode 100644 index 0000000000..09b03d6fb1 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/libxslt.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + + +Name: libxslt +Version: 1.1.35 +Description: XSLT library version 2. +Requires: libxml-2.0 +Cflags: +Libs: -L${libdir} -lxslt +Libs.private: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/ncurses.pc b/Library/Homebrew/os/mac/pkgconfig/26/ncurses.pc new file mode 100644 index 0000000000..05acdc3fbb --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/ncurses.pc @@ -0,0 +1,17 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include +abi_version=5.4 +major_version=6 +version=6.0.20150808 + +Name: ncurses +Description: ncurses 6.0 library +Version: ${version} +URL: http://invisible-island.net/ncurses +Requires.private: +Libs: -L${libdir} -lncurses +Libs.private: +Cflags: -D_DARWIN_C_SOURCE diff --git a/Library/Homebrew/os/mac/pkgconfig/26/ncursesw.pc b/Library/Homebrew/os/mac/pkgconfig/26/ncursesw.pc new file mode 100644 index 0000000000..1456908fa0 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/ncursesw.pc @@ -0,0 +1,17 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include +abi_version=5.4 +major_version=6 +version=6.0.20150808 + +Name: ncursesw +Description: ncurses 6.0 library +Version: ${version} +URL: http://invisible-island.net/ncurses +Requires.private: +Libs: -L${libdir} -lncurses +Libs.private: +Cflags: -D_DARWIN_C_SOURCE diff --git a/Library/Homebrew/os/mac/pkgconfig/26/sqlite3.pc b/Library/Homebrew/os/mac/pkgconfig/26/sqlite3.pc new file mode 100644 index 0000000000..e7f9019fd5 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/sqlite3.pc @@ -0,0 +1,12 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: SQLite +Description: SQL database engine +Version: 3.48.0 +Libs: -L${libdir} -lsqlite3 +Libs.private: +Cflags: diff --git a/Library/Homebrew/os/mac/pkgconfig/26/uuid.pc b/Library/Homebrew/os/mac/pkgconfig/26/uuid.pc new file mode 100644 index 0000000000..3dc8070ed2 --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/uuid.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +sharedlibdir=${libdir} +includedir=${prefix}/include/uuid + +Name: uuid +Description: Universally unique id library +Version: 1.0 + +Requires: +Libs: +Cflags: -I${includedir} diff --git a/Library/Homebrew/os/mac/pkgconfig/26/zlib.pc b/Library/Homebrew/os/mac/pkgconfig/26/zlib.pc new file mode 100644 index 0000000000..a86f93bc1b --- /dev/null +++ b/Library/Homebrew/os/mac/pkgconfig/26/zlib.pc @@ -0,0 +1,14 @@ +homebrew_sdkroot=/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk +prefix=${homebrew_sdkroot}/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: zlib +Description: zlib compression library +Version: 1.2.12 + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 5af295fcf6..cec906f25e 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -15,10 +15,10 @@ module OS # This may be a beta version for a beta macOS. sig { params(macos: MacOSVersion).returns(String) } def self.latest_version(macos: MacOS.version) - latest_stable = "15.4" + macos = macos.strip_patch case macos - when "15" then "16.0" - when "14" then latest_stable + when "15" then "16.4" + when "14" then "16.2" when "13" then "15.2" when "12" then "14.2" when "11" then "13.2.1" @@ -28,10 +28,10 @@ module OS when "10.12" then "9.2" when "10.11" then "8.2.1" else - raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.version.prerelease? + raise "macOS '#{macos}' is invalid" unless macos.prerelease? - # Default to newest known version of Xcode for unreleased macOS versions. - latest_stable + # Assume matching yearly Xcode release + "#{macos}.0" end end @@ -41,7 +41,8 @@ module OS # also in beta). sig { returns(String) } def self.minimum_version - case MacOS.version + macos = MacOS.version + case macos when "15" then "16.0" when "14" then "15.0" when "13" then "14.1" @@ -51,7 +52,9 @@ module OS when "10.14" then "10.2" when "10.13" then "9.0" when "10.12" then "8.0" - else "7.3" + when "10.11" then "7.3" + else + "#{macos}.0" end end @@ -225,10 +228,8 @@ module OS detect_version_from_clang_version end - sig { returns(String) } - def self.detect_version_from_clang_version - version = ::DevelopmentTools.clang_version - + sig { params(version: ::Version).returns(String) } + def self.detect_version_from_clang_version(version = ::DevelopmentTools.clang_version) return "dunno" if version.null? # This logic provides a fake Xcode version based on the @@ -255,8 +256,9 @@ module OS when "13.1.6" then "13.4.1" when "14.0.0" then "14.2" when "14.0.3" then "14.3.1" - when "16.0.0" then "16.0" - else "15.4" + when "15.0.0" then "15.4" + when "16.0.0" then "16.2" + else "26.0" end end @@ -355,8 +357,9 @@ module OS sig { returns(String) } def self.latest_clang_version case MacOS.version - when "15" then "1600.0.20.10" - when "14" then "1500.3.9.4" + when "26" then "1700.3.9.908" + when "15" then "1700.0.13.5" + when "14" then "1600.0.26.6" when "13" then "1500.1.0.2.5" when "12" then "1400.0.29.202" when "11" then "1300.0.29.30" @@ -373,7 +376,8 @@ module OS # that macOS version. sig { returns(String) } def self.minimum_version - case MacOS.version + macos = MacOS.version + case macos when "15" then "16.0.0" when "14" then "15.0.0" when "13" then "14.0.0" @@ -383,7 +387,9 @@ module OS when "10.14" then "10.0.0" when "10.13" then "9.0.0" when "10.12" then "8.0.0" - else "7.3.0" + when "10.11" then "7.3.0" + else + "#{macos}.0.0" end end @@ -410,7 +416,10 @@ module OS sig { returns(T.nilable(String)) } def self.detect_version_from_clang_version - detect_clang_version&.sub(/^(\d+)0(\d)\./, "\\1.\\2.") + clang_version = detect_clang_version + return if clang_version.nil? + + MacOS::Xcode.detect_version_from_clang_version(Version.new(clang_version)) end # Version string (a pretty long one) of the CLT package. diff --git a/Library/Homebrew/extend/io.rb b/Library/Homebrew/readline_nonblock.rb similarity index 60% rename from Library/Homebrew/extend/io.rb rename to Library/Homebrew/readline_nonblock.rb index a6eb7d4b70..7888b46399 100644 --- a/Library/Homebrew/extend/io.rb +++ b/Library/Homebrew/readline_nonblock.rb @@ -1,17 +1,17 @@ # typed: strict # frozen_string_literal: true -class IO - sig { params(sep: String).returns(String) } - def readline_nonblock(sep = $INPUT_RECORD_SEPARATOR) +class ReadlineNonblock + sig { params(io: IO).returns(String) } + def self.read(io) line = +"" buffer = +"" begin loop do - break if buffer == sep + break if buffer == $INPUT_RECORD_SEPARATOR - read_nonblock(1, buffer) + io.read_nonblock(1, buffer) line.concat(buffer) end diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index b8260b1116..9c1e7563e5 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -7,7 +7,9 @@ require "messages" module Homebrew module Reinstall - def self.reinstall_formula( + # struct to keep context of the current installer, keg, formula and option + InstallationContext = Struct.new(:formula_installer, :keg, :formula, :options) + def self.build_install_context( formula, flags:, force_bottle: false, @@ -61,16 +63,38 @@ module Homebrew verbose:, }.compact, ) - fi.prelude - fi.fetch + InstallationContext.new(fi, keg, formula, options) + end + + def self.reinstall_formula( + install_context, + flags:, + force_bottle: false, + build_from_source_formulae: [], + interactive: false, + keep_tmp: false, + debug_symbols: false, + force: false, + debug: false, + quiet: false, + verbose: false, + git: false + ) + formula_installer = install_context.formula_installer + keg = install_context.keg + formula = install_context.formula + options = install_context.options + link_keg = keg&.linked? + formula_installer.prelude + formula_installer.fetch oh1 "Reinstalling #{Formatter.identifier(formula.full_name)} #{options.to_a.join " "}" - fi.install - fi.finish + formula_installer.install + formula_installer.finish rescue FormulaInstallationAlreadyAttemptedError nil - # Any other exceptions we want to restore the previous keg and report the error. + # Any other exceptions we want to restore the previous keg and report the error. rescue Exception # rubocop:disable Lint/RescueException ignore_interrupts { restore_backup(keg, link_keg, verbose:) } raise diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 65940a9946..4847d97774 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "requirement" @@ -7,10 +7,14 @@ require "requirement" class ArchRequirement < Requirement fatal true + @arch = T.let(nil, T.nilable(Symbol)) + + sig { returns(T.nilable(Symbol)) } attr_reader :arch + sig { params(tags: T::Array[Symbol]).void } def initialize(tags) - @arch = tags.shift + @arch = T.let(tags.shift, T.nilable(Symbol)) super end diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index 3189259b8a..366348b893 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -68,6 +68,13 @@ class MacOSRequirement < Requirement @version end + def maximum_version + return MacOSVersion.new(HOMEBREW_MACOS_NEWEST_UNSUPPORTED) if @comparator == ">=" || !version_specified? + return @version.max if @version.respond_to?(:to_ary) + + @version + end + def allows?(other) return true unless version_specified? diff --git a/Library/Homebrew/requirements/xcode_requirement.rb b/Library/Homebrew/requirements/xcode_requirement.rb index 0d74f0e945..c0c9134238 100644 --- a/Library/Homebrew/requirements/xcode_requirement.rb +++ b/Library/Homebrew/requirements/xcode_requirement.rb @@ -1,4 +1,4 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "requirement" @@ -7,20 +7,23 @@ require "requirement" class XcodeRequirement < Requirement fatal true + sig { returns(T.nilable(String)) } attr_reader :version satisfy(build_env: false) do T.bind(self, XcodeRequirement) - xcode_installed_version + xcode_installed_version! end + sig { params(tags: T::Array[String]).void } def initialize(tags = []) - @version = tags.shift if tags.first.to_s.match?(/(\d\.)+\d/) + version = tags.shift if tags.first.to_s.match?(/(\d\.)+\d/) + @version = T.let(version, T.nilable(String)) super end sig { returns(T::Boolean) } - def xcode_installed_version + def xcode_installed_version! return false unless MacOS::Xcode.installed? return true unless @version @@ -53,6 +56,7 @@ class XcodeRequirement < Requirement "#<#{self.class.name}: version>=#{@version.inspect} #{tags.inspect}>" end + sig { returns(String) } def display_s return "#{name.capitalize} (on macOS)" unless @version diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 2b37c2ec43..a774f659df 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -4,7 +4,7 @@ require "downloadable" require "mktemp" require "livecheck" -require "extend/on_system" +require "on_system" # Resource is the fundamental representation of an external resource. The # primary formula download, along with other declared resources, are instances diff --git a/Library/Homebrew/resource_auditor.rb b/Library/Homebrew/resource_auditor.rb index 8e8a856d72..77216138e6 100644 --- a/Library/Homebrew/resource_auditor.rb +++ b/Library/Homebrew/resource_auditor.rb @@ -63,7 +63,7 @@ module Homebrew url_strategy = DownloadStrategyDetector.detect(url) if (using == :git || url_strategy == GitDownloadStrategy) && specs[:tag] && !specs[:revision] - problem "Git should specify :revision when a :tag is specified." + problem "Git should specify `revision:` when a `tag:` is specified." end return unless using @@ -71,7 +71,7 @@ module Homebrew if using == :cvs mod = specs[:module] - problem "Redundant :module value in URL" if mod == name + problem "Redundant `module:` value in URL" if mod == name if url.match?(%r{:[^/]+$}) mod = url.split(":").last @@ -79,14 +79,14 @@ module Homebrew if mod == name problem "Redundant CVS module appended to URL" else - problem "Specify CVS module as `:module => \"#{mod}\"` instead of appending it to the URL" + problem "Specify CVS module as `module: \"#{mod}\"` instead of appending it to the URL" end end end return if url_strategy != DownloadStrategyDetector.detect("", using) - problem "Redundant :using value in URL" + problem "Redundant `using:` value in URL" end def audit_checksum @@ -125,7 +125,7 @@ module Homebrew return if name.casecmp(pypi_package_name).zero? - problem "resource name should be `#{pypi_package_name}` to match the PyPI package name" + problem "`resource` name should be '#{pypi_package_name}' to match the PyPI package name" end def audit_urls @@ -166,12 +166,12 @@ module Homebrew remote_exists = Utils::Git.remote_exists?(url) attempts += 1 end - problem "The URL #{url} is not a valid git URL" unless remote_exists + problem "The URL #{url} is not a valid Git URL" unless remote_exists elsif strategy <= SubversionDownloadStrategy next unless DevelopmentTools.subversion_handles_most_https_certificates? next unless Utils::Svn.available? - problem "The URL #{url} is not a valid svn URL" unless Utils::Svn.remote_exists? url + problem "The URL #{url} is not a valid SVN URL" unless Utils::Svn.remote_exists? url end end end @@ -188,7 +188,7 @@ module Homebrew .match(%r{ref: refs/heads/(.*?)\s+HEAD})&.to_a&.second return if branch.blank? || branch == specs[:branch] - problem "Use `branch: \"#{branch}\"` to specify the default branch" + problem "Specify the default branch as `branch: \"#{branch}\"`" end def problem(text) diff --git a/Library/Homebrew/retryable_download.rb b/Library/Homebrew/retryable_download.rb index 63fd5ff5fe..8bcb6e9126 100644 --- a/Library/Homebrew/retryable_download.rb +++ b/Library/Homebrew/retryable_download.rb @@ -19,7 +19,7 @@ module Homebrew def mirrors = downloadable.mirrors sig { params(downloadable: Downloadable, tries: Integer).void } - def initialize(downloadable, tries: 3) + def initialize(downloadable, tries:) super() @downloadable = downloadable diff --git a/Library/Homebrew/rubocops/all.rb b/Library/Homebrew/rubocops/all.rb index 85ebc75082..d46a48b06a 100644 --- a/Library/Homebrew/rubocops/all.rb +++ b/Library/Homebrew/rubocops/all.rb @@ -28,6 +28,7 @@ require_relative "components_redundancy" require_relative "conflicts" require_relative "dependency_order" require_relative "deprecate_disable" +require_relative "no_autobump" require_relative "desc" require_relative "files" require_relative "homepage" @@ -42,5 +43,6 @@ require_relative "text" require_relative "urls" require_relative "uses_from_macos" require_relative "version" +require_relative "zero_zero_zero_zero" require_relative "rubocop-cask" diff --git a/Library/Homebrew/rubocops/cask/constants/stanza.rb b/Library/Homebrew/rubocops/cask/constants/stanza.rb index 400aa7cc17..d6d2e9a278 100644 --- a/Library/Homebrew/rubocops/cask/constants/stanza.rb +++ b/Library/Homebrew/rubocops/cask/constants/stanza.rb @@ -26,6 +26,7 @@ module RuboCop [:language], [:url, :appcast, :name, :desc, :homepage], [:livecheck], + [:no_autobump!], [:deprecate!, :disable!], [ :auto_updates, diff --git a/Library/Homebrew/rubocops/cask/no_autobump.rb b/Library/Homebrew/rubocops/cask/no_autobump.rb new file mode 100644 index 0000000000..6f6a93007f --- /dev/null +++ b/Library/Homebrew/rubocops/cask/no_autobump.rb @@ -0,0 +1,50 @@ +# typed: strict +# frozen_string_literal: true + +require "forwardable" +require "rubocops/shared/no_autobump_helper" + +module RuboCop + module Cop + module Cask + # This cop audits `no_autobump!` reason. + # See the {NoAutobumpHelper} module for details of the checks. + class NoAutobump < Base + extend Forwardable + extend AutoCorrector + include CaskHelp + include NoAutobumpHelper + + sig { override.params(cask_block: RuboCop::Cask::AST::CaskBlock).void } + def on_cask(cask_block) + @cask_block = T.let(cask_block, T.nilable(RuboCop::Cask::AST::CaskBlock)) + + toplevel_stanzas.select(&:no_autobump?).each do |stanza| + no_autobump_node = stanza.stanza_node + + reason_found = T.let(false, T::Boolean) + reason(no_autobump_node) do |reason_node| + reason_found = true + audit_no_autobump(:cask, reason_node) + end + + next if reason_found + + problem 'Add a reason for exclusion from autobump: `no_autobump! because: "..."`' + end + end + + private + + sig { returns(T.nilable(RuboCop::Cask::AST::CaskBlock)) } + attr_reader :cask_block + + def_delegators :cask_block, :toplevel_stanzas + + def_node_search :reason, <<~EOS + (pair (sym :because) ${str sym}) + EOS + end + end + end +end diff --git a/Library/Homebrew/rubocops/cask/no_autobump.rbi b/Library/Homebrew/rubocops/cask/no_autobump.rbi new file mode 100644 index 0000000000..18510d4014 --- /dev/null +++ b/Library/Homebrew/rubocops/cask/no_autobump.rbi @@ -0,0 +1,17 @@ +# typed: strict + +module RuboCop + module Cop + module Cask + class NoAutobump < Base + sig { + params( + base_node: RuboCop::AST::Node, + block: T.proc.params(node: RuboCop::AST::SendNode).void, + ).void + } + def reason(base_node, &block); end + end + end + end +end diff --git a/Library/Homebrew/rubocops/cask/no_overrides.rb b/Library/Homebrew/rubocops/cask/no_overrides.rb index 6f313f41ed..1eeb1e1df8 100644 --- a/Library/Homebrew/rubocops/cask/no_overrides.rb +++ b/Library/Homebrew/rubocops/cask/no_overrides.rb @@ -11,14 +11,14 @@ module RuboCop # TODO: Update this list if new stanzas are added to `Cask::DSL` that call `set_unique_stanza`. OVERRIDABLE_METHODS = [ :appcast, :arch, :auto_updates, :conflicts_with, :container, - :desc, :homepage, :sha256, :url, :version + :desc, :homepage, :os, :sha256, :url, :version ].freeze - MESSAGE = "Do not use a top-level `%s` stanza as the default. " \ - "Add it to an `on_{system}` block instead. " \ - "Use `:or_older` or `:or_newer` to specify a range of macOS versions." sig { override.params(cask_block: RuboCop::Cask::AST::CaskBlock).void } def on_cask(cask_block) + message = "Do not use a top-level `%s` stanza as the default. " \ + "Add it to an `on_{system}` block instead. " \ + "Use `:or_older` or `:or_newer` to specify a range of macOS versions." cask_stanzas = cask_block.toplevel_stanzas return if (on_blocks = on_system_methods(cask_stanzas)).none? @@ -31,12 +31,14 @@ module RuboCop # Skip if the stanza outside of a block is not also in an `on_*` block. next unless stanzas_in_blocks.include?(stanza.stanza_name) - add_offense(stanza.source_range, message: format(MESSAGE, stanza: stanza.stanza_name)) + add_offense(stanza.source_range, message: format(message, stanza: stanza.stanza_name)) end end sig { params(on_system: T::Array[RuboCop::Cask::AST::Stanza]).returns(T::Set[Symbol]) } def on_system_stanzas(on_system) + message = "Do not use a `depends_on macos:` stanza inside an `on_{system}` block. " \ + "Add it once to specify the oldest macOS supported by any version in the cask." names = T.let(Set.new, T::Set[Symbol]) method_nodes = on_system.map(&:method_node) method_nodes.select(&:block_type?).each do |node| @@ -51,6 +53,14 @@ module RuboCop end next if RuboCop::Cask::Constants::ON_SYSTEM_METHODS.include?(send_node.method_name) + if send_node.method_name == :depends_on && + send_node.arguments.first.pairs.any? { |a| a.key.value == :macos } && + OnSystemConditionalsHelper::ON_SYSTEM_OPTIONS.map do |m| + :"on_#{m}" + end.include?(T.cast(node, RuboCop::AST::BlockNode).method_name) + add_offense(send_node.source_range, message:) + end + names.add(send_node.method_name) end end diff --git a/Library/Homebrew/rubocops/cask/url.rb b/Library/Homebrew/rubocops/cask/url.rb index a62f5e884a..54ffcd1e84 100644 --- a/Library/Homebrew/rubocops/cask/url.rb +++ b/Library/Homebrew/rubocops/cask/url.rb @@ -41,6 +41,15 @@ module RuboCop return unless hash_node.hash_type? + unless stanza_node.source.match?(/",\n *\w+:/) + add_offense( + stanza_node.source_range, + message: "Keyword URL parameter should be on a new indented line.", + ) do |corrector| + corrector.replace(stanza_node.source_range, stanza_node.source.gsub(/",\s*/, "\",\n ")) + end + end + hash_node.each_pair do |key_node, value_node| next if key_node.source != "verified" next unless value_node.str_type? diff --git a/Library/Homebrew/rubocops/caveats.rb b/Library/Homebrew/rubocops/caveats.rb index 99ae5b826b..77f5cd0ea3 100644 --- a/Library/Homebrew/rubocops/caveats.rb +++ b/Library/Homebrew/rubocops/caveats.rb @@ -6,13 +6,25 @@ require "rubocops/extend/formula_cop" module RuboCop module Cop module FormulaAudit - # This cop ensures that caveats don't recommend unsupported or unsafe operations. + # This cop ensures that caveats don't have problematic text or logic. # # ### Example # # ```ruby # # bad # def caveats + # if File.exist?("/etc/issue") + # "This caveat only when file exists that won't work with JSON API." + # end + # end + # + # # good + # def caveats + # "This caveat always works regardless of the JSON API." + # end + # + # # bad + # def caveats # <<~EOS # Use `setuid` to allow running the executable by non-root users. # EOS @@ -30,11 +42,25 @@ module RuboCop def audit_formula(_formula_nodes) caveats_strings.each do |n| if regex_match_group(n, /\bsetuid\b/i) - problem "Don't recommend `setuid` in the caveats, suggest `sudo` instead." + problem "Instead of recommending `setuid` in the caveats, suggest `sudo`." end problem "Don't use ANSI escape codes in the caveats." if regex_match_group(n, /\e/) end + + return if formula_tap != "homebrew-core" + + # Forbid dynamic logic in caveats (only if/else/unless) + caveats_method = find_method_def(@body, :caveats) + return unless caveats_method + + dynamic_nodes = caveats_method.each_descendant.select do |descendant| + descendant.type == :if + end + dynamic_nodes.each do |node| + @offensive_node = node + problem "Don't use dynamic logic (if/else/unless) in caveats." + end end end end diff --git a/Library/Homebrew/rubocops/checksum.rb b/Library/Homebrew/rubocops/checksum.rb index 44d749db0d..e2040ec606 100644 --- a/Library/Homebrew/rubocops/checksum.rb +++ b/Library/Homebrew/rubocops/checksum.rb @@ -28,17 +28,17 @@ module RuboCop return if checksum.nil? if regex_match_group(checksum, /^$/) - problem "sha256 is empty" + problem "`sha256` is empty" return end if string_content(checksum).size != 64 && regex_match_group(checksum, /^\w*$/) - problem "sha256 should be 64 characters" + problem "`sha256` should be 64 characters" end return unless regex_match_group(checksum, /[^a-f0-9]+/i) - add_offense(T.must(@offensive_source_range), message: "sha256 contains invalid characters") + add_offense(T.must(@offensive_source_range), message: "`sha256` contains invalid characters") end end @@ -54,7 +54,7 @@ module RuboCop next if checksum.nil? next unless regex_match_group(checksum, /[A-F]+/) - add_offense(@offensive_source_range, message: "sha256 should be lowercase") do |corrector| + add_offense(@offensive_source_range, message: "`sha256` should be lowercase") do |corrector| correction = T.must(@offensive_node).source.downcase corrector.insert_before(T.must(@offensive_node).source_range, correction) corrector.remove(T.must(@offensive_node).source_range) diff --git a/Library/Homebrew/rubocops/class.rb b/Library/Homebrew/rubocops/class.rb index 2088ef1a59..d2b46d8faa 100644 --- a/Library/Homebrew/rubocops/class.rb +++ b/Library/Homebrew/rubocops/class.rb @@ -23,7 +23,7 @@ module RuboCop parent_class = class_name(parent_class_node) return unless DEPRECATED_CLASSES.include?(parent_class) - problem "#{parent_class} is deprecated, use Formula instead" do |corrector| + problem "`#{parent_class}` is deprecated, use `Formula` instead" do |corrector| corrector.replace(parent_class_node.source_range, "Formula") end end @@ -49,14 +49,14 @@ module RuboCop p1, p2 = params if (match = string_content(p1).match(%r{(/usr/local/(s?bin))})) offending_node(p1) - problem "use \#{#{match[2]}} instead of #{match[1]} in #{node}" do |corrector| + problem "Use `\#{#{match[2]}}` instead of `#{match[1]}` in `#{node}`" do |corrector| corrector.replace(p1.source_range, p1.source.sub(match[1], "\#{#{match[2]}}")) end end if node == :shell_output && node_equals?(p2, 0) offending_node(p2) - problem "Passing 0 to shell_output() is redundant" do |corrector| + problem "Passing 0 to `shell_output` is redundant" do |corrector| corrector.remove(range_with_surrounding_comma(range_with_surrounding_space(range: p2.source_range, side: :left))) end diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index 14ccb3973e..7b6fc8c8ba 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -39,7 +39,7 @@ module RuboCop if on_method_blocks.length > 1 @offensive_node = on_method_blocks.second - problem "there can only be one `#{on_method}` block in a formula." + problem "There can only be one `#{on_method}` block in a formula." end check_on_system_block_content(component_precedence_list, on_method_blocks.first) @@ -112,7 +112,7 @@ module RuboCop on_system_blocks.each do |on_method, blocks| if blocks.length > 1 - problem "there can only be one `#{on_method}` block in a resource block." + problem "There can only be one `#{on_method}` block in a resource block." next end end diff --git a/Library/Homebrew/rubocops/components_redundancy.rb b/Library/Homebrew/rubocops/components_redundancy.rb index 50557ab187..724f0af7bf 100644 --- a/Library/Homebrew/rubocops/components_redundancy.rb +++ b/Library/Homebrew/rubocops/components_redundancy.rb @@ -32,7 +32,7 @@ module RuboCop url_args = arg.keys.each.map(&:value) if method_called?(body_node, :sha256) && url_args.include?(:tag) && url_args.include?(:revision) - problem "Do not use both sha256 and tag/revision." + problem "Do not use both `sha256` and `tag:`/`revision:`." end end end diff --git a/Library/Homebrew/rubocops/dependency_order.rb b/Library/Homebrew/rubocops/dependency_order.rb index 3f9a343d6d..92ea918d88 100644 --- a/Library/Homebrew/rubocops/dependency_order.rb +++ b/Library/Homebrew/rubocops/dependency_order.rb @@ -108,8 +108,8 @@ module RuboCop offending_node(node_1) - problem "dependency \"#{dependency_name(node_1)}\" (line #{l1}) should be put before dependency " \ - "\"#{dependency_name(node_2)}\" (line #{l2})" do |corrector| + problem "`dependency \"#{dependency_name(node_1)}\"` (line #{l1}) should be put before " \ + "`dependency \"#{dependency_name(node_2)}\"` (line #{l2})" do |corrector| indentation = " " * (start_column(node_2) - line_start_column(node_2)) line_breaks = "\n" corrector.insert_before(node_2.source_range, diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb index 47cdbc3ed3..bf4e2d66ee 100644 --- a/Library/Homebrew/rubocops/extend/formula_cop.rb +++ b/Library/Homebrew/rubocops/extend/formula_cop.rb @@ -228,13 +228,13 @@ module RuboCop rescue JSON::ParserError nil end - next if list_contents.nil? || list_contents.count.zero? + next if list_contents.nil? || list_contents.none? @tap_style_exceptions[list_name] = list_contents end end - return false if @tap_style_exceptions.nil? || @tap_style_exceptions.count.zero? + return false if @tap_style_exceptions.nil? || @tap_style_exceptions.none? return false unless @tap_style_exceptions.key? list T.must(@tap_style_exceptions[list]).include?(formula || @formula_name) diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index 698aee4fc1..c3b0c578e5 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -165,41 +165,42 @@ module RuboCop next unless unless_modifier?(method.parent) correct = method.source.gsub("out?", "?") - problem "Use if #{correct} instead of unless #{method.source}" + problem "Use `if #{correct}` instead of `unless #{method.source}`" end find_instance_method_call(body_node, :build, :with?) do |method| next unless unless_modifier?(method.parent) correct = method.source.gsub("?", "out?") - problem "Use if #{correct} instead of unless #{method.source}" + problem "Use `if #{correct}` instead of `unless #{method.source}`" end find_instance_method_call(body_node, :build, :with?) do |method| next unless expression_negated?(method) - problem "Don't negate 'build.with?': use 'build.without?'" + problem "Instead of negating `build.with?`, use `build.without?`" end find_instance_method_call(body_node, :build, :without?) do |method| next unless expression_negated?(method) - problem "Don't negate 'build.without?': use 'build.with?'" + problem "Instead of negating `build.without?`, use `build.with?`" end find_instance_method_call(body_node, :build, :without?) do |method| arg = parameters(method).first next unless (match = regex_match_group(arg, /^-?-?without-(.*)/)) - problem "Don't duplicate 'without': " \ - "Use `build.without? \"#{match[1]}\"` to check for \"--without-#{match[1]}\"" + problem "Instead of duplicating `without`, " \ + "use `build.without? \"#{match[1]}\"` to check for \"--without-#{match[1]}\"" end find_instance_method_call(body_node, :build, :with?) do |method| arg = parameters(method).first next unless (match = regex_match_group(arg, /^-?-?with-(.*)/)) - problem "Don't duplicate 'with': Use `build.with? \"#{match[1]}\"` to check for \"--with-#{match[1]}\"" + problem "Instead of duplicating `with`, " \ + "use `build.with? \"#{match[1]}\"` to check for '--with-#{match[1]}'" end find_instance_method_call(body_node, :build, :include?) do @@ -234,8 +235,8 @@ module RuboCop return if formula_tap != "homebrew-core" find_method_with_args(body_node, :depends_on, "mpich") do - problem "Formulae in homebrew/core should use 'depends_on \"open-mpi\"' " \ - "instead of '#{T.must(@offensive_node).source}'." do |corrector| + problem "Formulae in homebrew/core should use `depends_on \"open-mpi\"` " \ + "instead of `#{T.must(@offensive_node).source}`." do |corrector| corrector.replace(T.must(@offensive_node).source_range, "depends_on \"open-mpi\"") end end @@ -252,15 +253,15 @@ module RuboCop return if (body_node = formula_nodes.body_node).nil? find_method_with_args(body_node, :local_npm_install_args) do - problem "Use 'std_npm_args' instead of '#{T.cast(@offensive_node, - RuboCop::AST::SendNode).method_name}'." do |corrector| + problem "Use `std_npm_args` instead of `#{T.cast(@offensive_node, + RuboCop::AST::SendNode).method_name}`." do |corrector| corrector.replace(T.must(@offensive_node).source_range, "std_npm_args(prefix: false)") end end find_method_with_args(body_node, :std_npm_install_args) do |method| - problem "Use 'std_npm_args' instead of '#{T.cast(@offensive_node, - RuboCop::AST::SendNode).method_name}'." do |corrector| + problem "Use `std_npm_args` instead of `#{T.cast(@offensive_node, + RuboCop::AST::SendNode).method_name}`." do |corrector| if (param = parameters(method).first.source) == "libexec" corrector.replace(T.must(@offensive_node).source_range, "std_npm_args") else @@ -293,8 +294,8 @@ module RuboCop return if formula_tap != "homebrew-core" find_method_with_args(body_node, :depends_on, "quictls") do - problem "Formulae in homebrew/core should use 'depends_on \"openssl@3\"' " \ - "instead of '#{T.must(@offensive_node).source}'." do |corrector| + problem "Formulae in homebrew/core should use `depends_on \"openssl@3\"` " \ + "instead of `#{T.must(@offensive_node).source}`." do |corrector| corrector.replace(T.must(@offensive_node).source_range, "depends_on \"openssl@3\"") end end @@ -311,7 +312,7 @@ module RuboCop return if formula_tap != "homebrew-core" return unless depends_on?("pyoxidizer") - problem "Formulae in homebrew/core should not use '#{T.must(@offensive_node).source}'." + problem "Formulae in homebrew/core should not use `#{T.must(@offensive_node).source}`." end end @@ -505,7 +506,7 @@ module RuboCop end end - # This cop makes sure the `MacOS` module is not used in Linux-facing formula code + # This cop makes sure the `MacOS` module is not used in Linux-facing formula code. class MacOSOnLinux < FormulaCop include OnSystemConditionalsHelper @@ -676,7 +677,7 @@ module RuboCop # FileUtils is included in Formula # encfs modifies a file with this name, so check for some leading characters find_instance_method_call(body_node, "FileUtils", nil) do |method_node| - problem "Don't need 'FileUtils.' before #{method_node.method_name}" + problem "No need for `FileUtils.` before `#{method_node.method_name}`" end # Check for long inreplace block vars @@ -684,45 +685,41 @@ module RuboCop block_arg = node.arguments.children.first next if block_arg.source.size <= 1 - problem "\"inreplace do |s|\" is preferred over \"|#{block_arg.source}|\"." + problem "`inreplace do |s|` is preferred over `|#{block_arg.source}|`." end [:rebuild, :version_scheme].each do |method_name| find_method_with_args(body_node, method_name, 0) do - problem "'#{method_name} 0' should be removed" + problem "`#{method_name} 0` should be removed" end end find_instance_call(body_node, "ARGV") do |_method_node| - problem "Use build instead of ARGV to check options" + problem "Use `build.with?` or `build.without?` instead of `ARGV` to check options" end find_instance_method_call(body_node, :man, :+) do |method| next unless (match = regex_match_group(parameters(method).first, /^man[1-8]$/)) - problem "\"#{method.source}\" should be \"#{match[0]}\"" + problem "`#{method.source}` should be `#{match[0]}`" end # Avoid hard-coding compilers find_every_method_call_by_name(body_node, :system).each do |method| - next if @formula_name == "bazel" # TODO: Remove shim bypass in bazel. - param = parameters(method).first if (match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|clang|cc|c[89]9)(\s|$)})) - problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\"" + problem "Use `\#{ENV.cc}` instead of hard-coding `#{match[2]}`" elsif (match = regex_match_group(param, %r{^(/usr/bin/)?((g|clang|c)\+\+)(\s|$)})) - problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\"" + problem "Use `\#{ENV.cxx}` instead of hard-coding `#{match[2]}`" end end find_instance_method_call(body_node, "ENV", :[]=) do |method| - next if @formula_name == "bazel" # TODO: Remove shim bypass in bazel. - param = parameters(method)[1] if (match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|clang|cc|c[89]9)(\s|$)})) - problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\"" + problem "Use `\#{ENV.cc}` instead of hard-coding `#{match[2]}`" elsif (match = regex_match_group(param, %r{^(/usr/bin/)?((g|clang|c)\+\+)(\s|$)})) - problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\"" + problem "Use `\#{ENV.cxx}` instead of hard-coding `#{match[2]}`" end end @@ -730,18 +727,18 @@ module RuboCop formula_path_strings(body_node, :share) do |p| next unless (match = regex_match_group(p, %r{^(/(man))/?})) - problem "\"\#{share}#{match[1]}\" should be \"\#{#{match[2]}}\"" + problem "`\#{share}#{match[1]}` should be `\#{#{match[2]}}`" end formula_path_strings(body_node, :prefix) do |p| if (match = regex_match_group(p, %r{^(/share/(info|man))$})) - problem ['"#', "{prefix}", match[1], '" should be "#{', match[2], '}"'].join + problem ["`#", "{prefix}", match[1], '` should be `#{', match[2], "}`"].join end if (match = regex_match_group(p, %r{^((/share/man/)(man[1-8]))})) - problem ['"#', "{prefix}", match[1], '" should be "#{', match[3], '}"'].join + problem ["`#", "{prefix}", match[1], '` should be `#{', match[3], "}`"].join end if (match = regex_match_group(p, %r{^(/(bin|include|libexec|lib|sbin|share|Frameworks))}i)) - problem ['"#', "{prefix}", match[1], '" should be "#{', match[2].downcase, '}"'].join + problem ["`#", "{prefix}", match[1], '` should be `#{', match[2].downcase, "}`"].join end end @@ -750,13 +747,13 @@ module RuboCop next if key.nil? || value.nil? next unless (match = regex_match_group(value, /^(lua|perl|python|ruby)(\d*)/)) - problem "#{match[1]} modules should be vendored rather than use deprecated `#{method.source}`" + problem "#{match[1]} modules should be vendored rather than using deprecated `#{method.source}`" end find_every_method_call_by_name(body_node, :system).each do |method| next unless (match = regex_match_group(parameters(method).first, /^(env|export)(\s+)?/)) - problem "Use ENV instead of invoking '#{match[1]}' to modify the environment" + problem "Use `ENV` instead of invoking `#{match[1]}` to modify the environment" end find_every_method_call_by_name(body_node, :depends_on).each do |method| @@ -768,7 +765,7 @@ module RuboCop find_strings(option).each do |dependency| next unless (match = regex_match_group(dependency, /(with(out)?-\w+|c\+\+11)/)) - problem "Dependency #{string_content(dep)} should not use option #{match[0]}" + problem "Dependency '#{string_content(dep)}' should not use option `#{match[0]}`" end end end @@ -776,21 +773,21 @@ module RuboCop find_instance_method_call(body_node, :version, :==) do |method| next unless parameters_passed?(method, ["HEAD"]) - problem "Use 'build.head?' instead of inspecting 'version'" + problem "Use `build.head?` instead of inspecting `version`" end find_instance_method_call(body_node, "ARGV", :include?) do |method| next unless parameters_passed?(method, ["--HEAD"]) - problem "Use \"if build.head?\" instead" + problem "Use `if build.head?` instead" end find_const(body_node, "MACOS_VERSION") do - problem "Use MacOS.version instead of MACOS_VERSION" + problem "Use `MacOS.version` instead of `MACOS_VERSION`" end find_const(body_node, "MACOS_FULL_VERSION") do - problem "Use MacOS.full_version instead of MACOS_FULL_VERSION" + problem "Use `MacOS.full_version` instead of `MACOS_FULL_VERSION`" end conditional_dependencies(body_node) do |node, method, param, dep_node| @@ -799,30 +796,30 @@ module RuboCop if (method == :include? && regex_match_group(param, /^with-#{dep}$/)) || (method == :with? && regex_match_group(param, /^#{dep}$/)) offending_node(dep_node.parent) - problem "Replace #{node.source} with #{dep_node.parent.source} => :optional" + problem "Replace `#{node.source}` with `#{dep_node.parent.source} => :optional`" end elsif node.unless? if (method == :include? && regex_match_group(param, /^without-#{dep}$/)) || (method == :without? && regex_match_group(param, /^#{dep}$/)) offending_node(dep_node.parent) - problem "Replace #{node.source} with #{dep_node.parent.source} => :recommended" + problem "Replace `#{node.source}` with `#{dep_node.parent.source} => :recommended`" end end end find_method_with_args(body_node, :fails_with, :llvm) do - problem "'fails_with :llvm' is now a no-op so should be removed" + problem "`fails_with :llvm` is now a no-op and should be removed" end find_method_with_args(body_node, :needs, :openmp) do - problem "'needs :openmp' should be replaced with 'depends_on \"gcc\"'" + problem "`needs :openmp` should be replaced with `depends_on \"gcc\"`" end find_method_with_args(body_node, :system, /^(otool|install_name_tool|lipo)/) do problem "Use ruby-macho instead of calling #{T.must(@offensive_node).source}" end - problem "Use new-style test definitions (test do)" if find_method_def(body_node, :test) + problem "Use new-style test definitions (`test do`)" if find_method_def(body_node, :test) find_method_with_args(body_node, :skip_clean, :all) do problem "`skip_clean :all` is deprecated; brew no longer strips symbols. " \ @@ -830,7 +827,7 @@ module RuboCop end if find_method_def(processed_source.ast) - problem "Define method #{method_name(@offensive_node)} in the class body, not at the top-level" + problem "Define method `#{method_name(@offensive_node)}` in the class body, not at the top-level" end find_instance_method_call(body_node, :build, :universal?) do @@ -849,7 +846,7 @@ module RuboCop next if tap_style_exception? :runtime_cpu_detection_allowlist problem "Formulae should be verified as having support for runtime hardware detection before " \ - "using ENV.runtime_cpu_detection." + "using `ENV.runtime_cpu_detection`." end find_every_method_call_by_name(body_node, :depends_on).each do |method| @@ -864,7 +861,7 @@ module RuboCop param = parameters(method).first next unless node_equals?(param, "CI") - problem 'Don\'t use ENV["CI"] for Homebrew CI checks.' + problem 'Don\'t use `ENV["CI"]` for Homebrew CI checks.' end find_instance_method_call(body_node, "Dir", :[]) do |method| @@ -874,7 +871,7 @@ module RuboCop next unless path.str_type? next unless (match = regex_match_group(path, /^[^*{},]+$/)) - problem "Dir([\"#{string_content(path)}\"]) is unnecessary; just use \"#{match[0]}\"" + problem "`Dir([\"#{string_content(path)}\"])` is unnecessary; just use `#{match[0]}`" end fileutils_methods = Regexp.new( @@ -946,7 +943,7 @@ module RuboCop end end - # This cop ensures that new formulae depending on removed Requirements are not used + # This cop ensures that new formulae depending on removed Requirements are not used. class Requirements < FormulaCop sig { override.params(_formula_nodes: FormulaNodes).void } def audit_formula(_formula_nodes) @@ -969,16 +966,16 @@ module RuboCop return if formula_tap != "homebrew-core" find_method_with_args(body_node, :depends_on, "rustup") do - problem "Formulae in homebrew/core should use 'depends_on \"rust\"' " \ - "instead of '#{T.must(@offensive_node).source}'." do |corrector| + problem "Formulae in homebrew/core should use `depends_on \"rust\"` " \ + "instead of `#{T.must(@offensive_node).source}`." do |corrector| corrector.replace(T.must(@offensive_node).source_range, "depends_on \"rust\"") end end [:build, [:build, :test], [:test, :build]].each do |type| find_method_with_args(body_node, :depends_on, "rustup" => type) do - problem "Formulae in homebrew/core should use 'depends_on \"rust\" => #{type}' " \ - "instead of '#{T.must(@offensive_node).source}'." do |corrector| + problem "Formulae in homebrew/core should use `depends_on \"rust\" => #{type}` " \ + "instead of `#{T.must(@offensive_node).source}`." do |corrector| corrector.replace(T.must(@offensive_node).source_range, "depends_on \"rust\" => #{type}") end end diff --git a/Library/Homebrew/rubocops/no_autobump.rb b/Library/Homebrew/rubocops/no_autobump.rb new file mode 100644 index 0000000000..bd237f82ca --- /dev/null +++ b/Library/Homebrew/rubocops/no_autobump.rb @@ -0,0 +1,41 @@ +# typed: strict +# frozen_string_literal: true + +require "rubocops/extend/formula_cop" +require "rubocops/shared/no_autobump_helper" + +module RuboCop + module Cop + module FormulaAudit + # This cop audits `no_autobump!` reason. + # See the {NoAutobumpHelper} module for details of the checks. + class NoAutobump < FormulaCop + include NoAutobumpHelper + extend AutoCorrector + + sig { override.params(formula_nodes: FormulaNodes).void } + def audit_formula(formula_nodes) + body_node = formula_nodes.body_node + no_autobump_call = find_node_method_by_name(body_node, :no_autobump!) + + return if no_autobump_call.nil? + + reason_found = T.let(false, T::Boolean) + reason(no_autobump_call) do |reason_node| + reason_found = true + offending_node(reason_node) + audit_no_autobump(:formula, reason_node) + end + + return if reason_found + + problem 'Add a reason for exclusion from autobump: `no_autobump! because: "..."`' + end + + def_node_search :reason, <<~EOS + (pair (sym :because) ${str sym}) + EOS + end + end + end +end diff --git a/Library/Homebrew/rubocops/options.rb b/Library/Homebrew/rubocops/options.rb index 8958b94dd8..b92fca4bbe 100644 --- a/Library/Homebrew/rubocops/options.rb +++ b/Library/Homebrew/rubocops/options.rb @@ -30,7 +30,7 @@ module RuboCop if !/with(out)?-/.match?(option) && option != "cxx11" && option != "universal" - problem "Options should begin with with/without. " \ + problem "Options should begin with `with` or `without`. " \ "Migrate '--#{option}' with `deprecated_option`." end diff --git a/Library/Homebrew/rubocops/patches.rb b/Library/Homebrew/rubocops/patches.rb index 4cc7a74066..5fd3a72741 100644 --- a/Library/Homebrew/rubocops/patches.rb +++ b/Library/Homebrew/rubocops/patches.rb @@ -30,14 +30,14 @@ module RuboCop if inline_patches.empty? && patch_end? offending_patch_end_node(node) - add_offense(@offense_source_range, message: "patch is missing 'DATA'") + add_offense(@offense_source_range, message: "Patch is missing `patch :DATA`") end patches_node = find_method_def(body_node, :patches) return if patches_node.nil? legacy_patches = find_strings(patches_node) - problem "Use the patch DSL instead of defining a 'patches' method" + problem "Use the `patch` DSL instead of defining a `patches` method" legacy_patches.each { |p| patch_problems(p) } end @@ -63,7 +63,7 @@ module RuboCop if regex_match_group(patch_url_node, bitbucket_regex) owner, repo, commit = patch_url_node.source.match(bitbucket_regex).captures correct_url = "https://api.bitbucket.org/2.0/repositories/#{owner}/#{repo}/diff/#{commit}" - problem "Bitbucket patches should use the api url: #{correct_url}" do |corrector| + problem "Bitbucket patches should use the API URL: #{correct_url}" do |corrector| corrector.replace(patch_url_node.source_range, %Q("#{correct_url}")) end end @@ -118,7 +118,7 @@ module RuboCop return if !patch_data?(patch) || patch_end? offending_node(patch) - problem "patch is missing '__END__'" + problem "Patch is missing `__END__`" end def_node_search :patch_data?, <<~AST diff --git a/Library/Homebrew/rubocops/rubocop-cask.rb b/Library/Homebrew/rubocops/rubocop-cask.rb index 668fcea57d..f304b53f01 100644 --- a/Library/Homebrew/rubocops/rubocop-cask.rb +++ b/Library/Homebrew/rubocops/rubocop-cask.rb @@ -16,6 +16,7 @@ require_relative "cask/array_alphabetization" require_relative "cask/desc" require_relative "cask/discontinued" require_relative "cask/homepage_url_styling" +require_relative "cask/no_autobump" require_relative "cask/no_overrides" require_relative "cask/on_system_conditionals" require_relative "cask/shared_filelist_glob" diff --git a/Library/Homebrew/rubocops/shared/desc_helper.rb b/Library/Homebrew/rubocops/shared/desc_helper.rb index 6e458f1378..cfab0c1978 100644 --- a/Library/Homebrew/rubocops/shared/desc_helper.rb +++ b/Library/Homebrew/rubocops/shared/desc_helper.rb @@ -21,7 +21,7 @@ module RuboCop def audit_desc(type, name, desc_call) # Check if a desc is present. if desc_call.nil? - problem "#{type.to_s.capitalize} should have a desc (Description)." + problem "#{type.to_s.capitalize} should have a `desc` (description)." return end @@ -32,7 +32,7 @@ module RuboCop # Check if the desc is empty. desc_length = string_content(desc).length if desc_length.zero? - problem "The desc (description) should not be an empty string." + problem "The `desc` (description) should not be an empty string." return end diff --git a/Library/Homebrew/rubocops/shared/homepage_helper.rb b/Library/Homebrew/rubocops/shared/homepage_helper.rb index f5f53d3544..2ecef2bec9 100644 --- a/Library/Homebrew/rubocops/shared/homepage_helper.rb +++ b/Library/Homebrew/rubocops/shared/homepage_helper.rb @@ -19,10 +19,10 @@ module RuboCop def audit_homepage(type, content, homepage_node, homepage_parameter_node) @offensive_node = T.let(homepage_node, T.nilable(RuboCop::AST::Node)) - problem "#{type.to_s.capitalize} should have a homepage." if content.empty? + problem "#{type.to_s.capitalize} should have a `homepage`." if content.empty? @offensive_node = homepage_parameter_node - problem "The homepage should start with http or https." unless content.match?(%r{^https?://}) + problem "The `homepage` should start with http or https." unless content.match?(%r{^https?://}) case content # Freedesktop is complicated to handle - It has SSL/TLS, but only on certain subdomains. @@ -31,10 +31,9 @@ module RuboCop # "Software" is redirected to https://wiki.freedesktop.org/www/Software/project_name when %r{^http://((?:www|nice|libopenraw|liboil|telepathy|xorg)\.)?freedesktop\.org/(?:wiki/)?} if content.include?("Software") - problem "Freedesktop homepages should be styled " \ - "`https://wiki.freedesktop.org/www/Software/project_name`" + problem "Freedesktop homepages should be styled: https://wiki.freedesktop.org/www/Software/project_name" else - problem "Freedesktop homepages should be styled `https://wiki.freedesktop.org/project_name`" + problem "Freedesktop homepages should be styled: https://wiki.freedesktop.org/project_name" end # Google Code homepages should end in a slash @@ -45,13 +44,13 @@ module RuboCop when %r{^http://([^/]*)\.(sf|sourceforge)\.net(/|$)} fixed = "https://#{Regexp.last_match(1)}.sourceforge.io/" - problem "Sourceforge homepages should be `#{fixed}`" do |corrector| + problem "SourceForge homepages should be: #{fixed}" do |corrector| corrector.replace(homepage_parameter_node.source_range, "\"#{fixed}\"") end when /readthedocs\.org/ fixed = content.sub("readthedocs.org", "readthedocs.io") - problem "Readthedocs homepages should be `#{fixed}`" do |corrector| + problem "Readthedocs homepages should be: #{fixed}" do |corrector| corrector.replace(homepage_parameter_node.source_range, "\"#{fixed}\"") end diff --git a/Library/Homebrew/rubocops/shared/no_autobump_helper.rb b/Library/Homebrew/rubocops/shared/no_autobump_helper.rb new file mode 100644 index 0000000000..08c30d5397 --- /dev/null +++ b/Library/Homebrew/rubocops/shared/no_autobump_helper.rb @@ -0,0 +1,41 @@ +# typed: strict +# frozen_string_literal: true + +require "rubocops/shared/helper_functions" + +module RuboCop + module Cop + # This cop audits `no_autobump!` reason. + module NoAutobumpHelper + include HelperFunctions + + PUNCTUATION_MARKS = %w[. ! ?].freeze + DISALLOWED_NO_AUTOBUMP_REASONS = %w[extract_plist latest_version].freeze + + sig { params(_type: Symbol, reason_node: RuboCop::AST::Node).void } + def audit_no_autobump(_type, reason_node) + @offensive_node = T.let(reason_node, T.nilable(RuboCop::AST::Node)) + + reason_string = string_content(reason_node) + + if reason_node.sym_type? && DISALLOWED_NO_AUTOBUMP_REASONS.include?(reason_string) + problem "`:#{reason_string}` reason should not be used" + end + + return if reason_node.sym_type? + + if reason_string.start_with?("it ") + problem "Do not start the reason with `it`" do |corrector| + corrector.replace(T.must(@offensive_node).source_range, "\"#{reason_string[3..]}\"") + end + end + + return unless PUNCTUATION_MARKS.include?(reason_string[-1]) + + problem "Do not end the reason with a punctuation mark" do |corrector| + corrector.replace(T.must(@offensive_node).source_range, "\"#{reason_string.chop}\"") + end + end + end + end +end diff --git a/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb b/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb index f973dd72b6..beb8a48a05 100644 --- a/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb +++ b/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb @@ -69,8 +69,8 @@ module RuboCop end offending_node(on_system_node) - problem "Don't use `#{on_system_node.source}` in `#{parent_string}`, " \ - "use `#{if_statement_string}#{if_conditional}` instead." do |corrector| + problem "Instead of using `#{on_system_node.source}` in `#{parent_string}`, " \ + "use `#{if_statement_string}#{if_conditional}`." do |corrector| block_node = offending_node.parent next if block_node.type != :block @@ -108,7 +108,7 @@ module RuboCop next if node_is_allowed?(method_node, allowed_methods:, allowed_blocks:) offending_node(method_node) - problem "Don't use `#{method_node.source}`, use `on_arm` and `on_intel` blocks instead." + problem "Instead of `#{method_node.source}`, use `on_arm` and `on_intel` blocks." end end end @@ -171,7 +171,7 @@ module RuboCop next if node_is_allowed?(method_node, allowed_methods:, allowed_blocks:) offending_node(method_node) - problem "Don't use `#{method_node.source}`, use `on_{macos_version}` blocks instead." + problem "Instead of `#{method_node.source}`, use `on_{macos_version}` blocks." end end end @@ -209,8 +209,7 @@ module RuboCop def if_statement_problem(if_node, if_statement_string, on_system_method_string, else_method: nil, else_node: nil, autocorrect: true) offending_node(if_node) - problem "Don't use `#{if_statement_string}`, " \ - "use `#{on_system_method_string} do` instead." do |corrector| + problem "Instead of `#{if_statement_string}`, use `#{on_system_method_string} do`." do |corrector| next unless autocorrect # TODO: could fix corrector to handle this but punting for now. next if if_node.unless? diff --git a/Library/Homebrew/rubocops/shared/url_helper.rb b/Library/Homebrew/rubocops/shared/url_helper.rb index 1d5e6a32ff..3919d63469 100644 --- a/Library/Homebrew/rubocops/shared/url_helper.rb +++ b/Library/Homebrew/rubocops/shared/url_helper.rb @@ -35,34 +35,40 @@ module RuboCop def audit_url(type, urls, mirrors, livecheck_url: false) @type = type + # URLs must be ASCII; IDNs must be punycode + ascii_pattern = /[^\p{ASCII}]+/ + audit_urls(urls, ascii_pattern) do |_, url| + problem "Please use the ASCII (Punycode-encoded host, URL-encoded path and query) version of #{url}." + end + # GNU URLs; doesn't apply to mirrors gnu_pattern = %r{^(?:https?|ftp)://ftpmirror\.gnu\.org/(.*)} audit_urls(urls, gnu_pattern) do |match, url| - problem "Please use \"https://ftp.gnu.org/gnu/#{match[1]}\" instead of #{url}." + problem "#{url} should be: https://ftp.gnu.org/gnu/#{match[1]}" end # Fossies upstream requests they aren't used as primary URLs # https://github.com/Homebrew/homebrew-core/issues/14486#issuecomment-307753234 fossies_pattern = %r{^https?://fossies\.org/} audit_urls(urls, fossies_pattern) do - problem "Please don't use fossies.org in the url (using as a mirror is fine)" + problem "Please don't use \"fossies.org\" in the `url` (using as a mirror is fine)" end apache_pattern = %r{^https?://(?:[^/]*\.)?apache\.org/(?:dyn/closer\.cgi\?path=/?|dist/)(.*)}i audit_urls(urls, apache_pattern) do |match, url| next if url == livecheck_url - problem "#{url} should be `https://www.apache.org/dyn/closer.lua?path=#{match[1]}`" + problem "#{url} should be: https://www.apache.org/dyn/closer.lua?path=#{match[1]}" end version_control_pattern = %r{^(cvs|bzr|hg|fossil)://} audit_urls(urls, version_control_pattern) do |match, _| - problem "Use of the #{match[1]}:// scheme is deprecated, pass `:using => :#{match[1]}` instead" + problem "Use of the \"#{match[1]}://\" scheme is deprecated, pass `using: :#{match[1]}` instead" end svn_pattern = %r{^svn\+http://} audit_urls(urls, svn_pattern) do |_, _| - problem "Use of the svn+http:// scheme is deprecated, pass `:using => :svn` instead" + problem "Use of the \"svn+http://\" scheme is deprecated, pass `using: :svn` instead" end audit_urls(mirrors, /.*/) do |_, mirror| @@ -111,22 +117,22 @@ module RuboCop apache_mirror_pattern = %r{^https?://(?:[^/]*\.)?apache\.org/dyn/closer\.(?:cgi|lua)\?path=/?(.*)}i audit_urls(mirrors, apache_mirror_pattern) do |match, mirror| - problem "Please use `https://archive.apache.org/dist/#{match[1]}` as a mirror instead of #{mirror}." + problem "#{mirror} should be: https://archive.apache.org/dist/#{match[1]}" end cpan_pattern = %r{^http://search\.mcpan\.org/CPAN/(.*)}i audit_urls(urls, cpan_pattern) do |match, url| - problem "#{url} should be `https://cpan.metacpan.org/#{match[1]}`" + problem "#{url} should be: https://cpan.metacpan.org/#{match[1]}" end gnome_pattern = %r{^(http|ftp)://ftp\.gnome\.org/pub/gnome/(.*)}i audit_urls(urls, gnome_pattern) do |match, url| - problem "#{url} should be `https://download.gnome.org/#{match[2]}`" + problem "#{url} should be: https://download.gnome.org/#{match[2]}" end debian_pattern = %r{^git://anonscm\.debian\.org/users/(.*)}i audit_urls(urls, debian_pattern) do |match, url| - problem "#{url} should be `https://anonscm.debian.org/git/users/#{match[1]}`" + problem "#{url} should be: https://anonscm.debian.org/git/users/#{match[1]}" end # Prefer HTTP/S when possible over FTP protocol due to possible firewalls. @@ -137,7 +143,7 @@ module RuboCop cpan_ftp_pattern = %r{^ftp://ftp\.cpan\.org/pub/CPAN(.*)}i audit_urls(urls, cpan_ftp_pattern) do |match_obj, url| - problem "#{url} should be `http://search.cpan.org/CPAN#{match_obj[1]}`" + problem "#{url} should be: http://search.cpan.org/CPAN#{match_obj[1]}" end # SourceForge url patterns @@ -149,26 +155,26 @@ module RuboCop next if url.include? "/p/" if url =~ /(\?|&)use_mirror=/ - problem "Don't use #{Regexp.last_match(1)}use_mirror in SourceForge urls (url is #{url})." + problem "Don't use \"#{Regexp.last_match(1)}use_mirror\" in SourceForge URLs (`url` is #{url})." end - problem "Don't use /download in SourceForge urls (url is #{url})." if url.end_with?("/download") + problem "Don't use \"/download\" in SourceForge URLs (`url` is #{url})." if url.end_with?("/download") if url.match?(%r{^https?://(sourceforge|sf)\.}) && url != livecheck_url - problem "Use https://downloads.sourceforge.net to get geolocation (url is #{url})." + problem "Use \"https://downloads.sourceforge.net\" to get geolocation (`url` is #{url})." end if url.match?(%r{^https?://prdownloads\.}) - problem "Don't use prdownloads in SourceForge urls (url is #{url})." + problem "Don't use \"prdownloads\" in SourceForge URLs (`url` is #{url})." end if url.match?(%r{^http://\w+\.dl\.}) - problem "Don't use specific dl mirrors in SourceForge urls (url is #{url})." + problem "Don't use specific \"dl\" mirrors in SourceForge URLs (`url` is #{url})." end # sf.net does HTTPS -> HTTP redirects. if url.match?(%r{^https?://downloads?\.sf\.net}) - problem "Use https://downloads.sourceforge.net instead of downloads.sf.net (url is #{url})" + problem "Use \"https://downloads.sourceforge.net\" instead of \"downloads.sf.net\" (`url` is #{url})" end end @@ -217,9 +223,9 @@ module RuboCop problem "Please use https:// for #{url}" end - # Check for master branch GitHub archives. + # Check for default branch GitHub archives. if type == :formula - tarball_gh_pattern = %r{^https://github\.com/.*archive/master\.(tar\.gz|zip)$} + tarball_gh_pattern = %r{^https://github\.com/.*archive/(main|master)\.(tar\.gz|zip)$} audit_urls(urls, tarball_gh_pattern) do problem "Use versioned rather than branch tarballs for stable checksums." end @@ -230,14 +236,14 @@ module RuboCop audit_urls(urls, archive_gh_pattern) do |_, url| next if url.end_with?(".git") - problem "Use /archive/ URLs for GitHub tarballs (url is #{url})." + problem "Use /archive/ URLs for GitHub tarballs (`url` is #{url})." end archive_refs_gh_pattern = %r{https://.*github.+/archive/(?![a-fA-F0-9]{40})(?!refs/(tags|heads)/)(.*)\.tar\.gz$} audit_urls(urls, archive_refs_gh_pattern) do |match, url| next if url.end_with?(".git") - problem "Use refs/tags/#{match[2]} or refs/heads/#{match[2]} for GitHub references (url is #{url})." + problem %Q(Use "refs/tags/#{match[2]}" or "refs/heads/#{match[2]}" for GitHub references (`url` is #{url}).) end # Don't use GitHub .zip files @@ -247,7 +253,7 @@ module RuboCop next if url.include?("releases/download") next if url.include?("desktop.githubusercontent.com/releases/") - problem "Use GitHub tarballs rather than zipballs (url is #{url})." + problem "Use GitHub tarballs rather than zipballs (`url` is #{url})." end # Don't use GitHub codeload URLs @@ -264,7 +270,7 @@ module RuboCop # Check for Maven Central URLs, prefer HTTPS redirector over specific host maven_pattern = %r{https?://(?:central|repo\d+)\.maven\.org/maven2/(.+)$} audit_urls(urls, maven_pattern) do |match, url| - problem "#{url} should be `https://search.maven.org/remotecontent?filepath=#{match[1]}`" + problem "#{url} should be: https://search.maven.org/remotecontent?filepath=#{match[1]}" end end end diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index 21c15615b8..3323aeb176 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -45,19 +45,19 @@ module RuboCop # processed_source.ast is passed instead of body_node because `require` would be outside body_node find_method_with_args(processed_source.ast, :require, "language/go") do - problem "require \"language/go\" is no longer necessary or correct" + problem '`require "language/go"` is no longer necessary or correct' end find_instance_method_call(body_node, "Formula", :factory) do - problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\"" + problem "`Formula.factory(name)` is deprecated in favour of `Formula[name]`" end find_method_with_args(body_node, :revision, 0) do - problem "\"revision 0\" is unnecessary" + problem "`revision 0` is unnecessary" end find_method_with_args(body_node, :system, "xcodebuild") do - problem %q(use "xcodebuild *args" instead of "system 'xcodebuild', *args") + problem "Use `xcodebuild *args` instead of `system 'xcodebuild', *args`" end if !depends_on?(:xcode) && method_called_ever?(body_node, :xcodebuild) @@ -72,7 +72,7 @@ module RuboCop find_method_with_args(method_node, :system, "cargo", "build") do |m| next if parameters_passed?(m, [/--lib/]) - problem "use \"cargo\", \"install\", *std_cargo_args" + problem 'Use `"cargo", "install", *std_cargo_args`' end end @@ -80,7 +80,7 @@ module RuboCop next if parameters_passed?(d, [/vendor-only/]) next if @formula_name == "goose" # needed in 2.3.0 - problem "use \"dep\", \"ensure\", \"-vendor-only\"" + problem 'Use `"dep", "ensure", "-vendor-only"`' end find_every_method_call_by_name(body_node, :system).each do |m| @@ -90,6 +90,30 @@ module RuboCop problem "Use separate `make` calls" end + find_every_method_call_by_name(body_node, :+).each do |plus_node| + next unless plus_node.receiver&.send_type? + next unless plus_node.first_argument&.str_type? + + receiver_method = plus_node.receiver.method_name + path_arg = plus_node.first_argument.str_content + + case receiver_method + when :prefix + next unless (match = path_arg.match(%r{^(bin|include|libexec|lib|sbin|share|Frameworks)(?:/| |$)})) + + offending_node(plus_node) + problem "Use `#{match[1].downcase}` instead of `prefix + \"#{match[1]}\"`" + when :bin, :include, :libexec, :lib, :sbin, :share + next if path_arg.empty? + + offending_node(plus_node) + good = "#{receiver_method}/\"#{path_arg}\"" + problem "Use `#{good}` instead of `#{plus_node.source}`" do |corrector| + corrector.replace(plus_node.loc.expression, good) + end + end + end + body_node.each_descendant(:dstr) do |dstr_node| dstr_node.each_descendant(:begin) do |interpolation_node| next unless interpolation_node.source.match?(/#\{\w+\s*\+\s*['"][^}]+\}/) @@ -98,19 +122,7 @@ module RuboCop problem "Do not concatenate paths in string interpolation" end end - - prefix_path(body_node) do |prefix_node, path| - next unless (match = path.match(%r{^(bin|include|libexec|lib|sbin|share|Frameworks)(?:/| |$)})) - - offending_node(prefix_node) - problem "Use `#{match[1].downcase}` instead of `prefix + \"#{match[1]}\"`" - end end - - # Find: prefix + "foo" - def_node_search :prefix_path, <<~EOS - $(send (send nil? :prefix) :+ (str $_)) - EOS end end diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index a37ba8705e..cbd9bcb393 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -54,13 +54,13 @@ module RuboCop # Check pypi URLs pypi_pattern = %r{^https?://pypi\.python\.org/} audit_urls(urls, pypi_pattern) do |_, url| - problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)" + problem "Use the \"Source\" URL found on the PyPI downloads page (#{get_pypi_url(url)})" end # Require long files.pythonhosted.org URLs pythonhosted_pattern = %r{^https?://files\.pythonhosted\.org/packages/source/} audit_urls(urls, pythonhosted_pattern) do |_, url| - problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)" + problem "Use the \"Source\" URL found on the PyPI downloads page (#{get_pypi_url(url)})" end end @@ -84,7 +84,7 @@ module RuboCop next if url_has_revision?(parameters(url).last) offending_node(url) - problem "Formulae in homebrew/core should specify a revision for git URLs" + problem "Formulae in homebrew/core should specify a revision for Git URLs" end end @@ -107,7 +107,7 @@ module RuboCop next if url_has_tag?(parameters(url).last) offending_node(url) - problem "Formulae in homebrew/core should specify a tag for git URLs" + problem "Formulae in homebrew/core should specify a tag for Git URLs" end end diff --git a/Library/Homebrew/rubocops/uses_from_macos.rb b/Library/Homebrew/rubocops/uses_from_macos.rb index 621f3bc3ed..8ebbc96483 100644 --- a/Library/Homebrew/rubocops/uses_from_macos.rb +++ b/Library/Homebrew/rubocops/uses_from_macos.rb @@ -66,7 +66,7 @@ module RuboCop return if PROVIDED_BY_MACOS_FORMULAE.include? @formula_name problem "Formulae that are `keg_only :provided_by_macos` should be " \ - "added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repo)" + "added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repository)" end end end @@ -116,7 +116,7 @@ module RuboCop next if ALLOWED_USES_FROM_MACOS_DEPS.include? dep_name next if ProvidedByMacos::PROVIDED_BY_MACOS_FORMULAE.include? dep_name - problem "`uses_from_macos` should only be used for macOS dependencies, not #{dep_name}." + problem "`uses_from_macos` should only be used for macOS dependencies, not '#{dep_name}'." end end end diff --git a/Library/Homebrew/rubocops/version.rb b/Library/Homebrew/rubocops/version.rb index 82863ab3a1..4492e57d9e 100644 --- a/Library/Homebrew/rubocops/version.rb +++ b/Library/Homebrew/rubocops/version.rb @@ -15,13 +15,13 @@ module RuboCop version = string_content(parameters(version_node).first) - problem "version is set to an empty string" if version.empty? + problem "Version is set to an empty string" if version.empty? - problem "version #{version} should not have a leading 'v'" if version.start_with?("v") + problem "Version #{version} should not have a leading 'v'" if version.start_with?("v") return unless version.match?(/_\d+$/) - problem "version #{version} should not end with an underline and a number" + problem "Version #{version} should not end with an underline and a number" end end end diff --git a/Library/Homebrew/rubocops/zero_zero_zero_zero.rb b/Library/Homebrew/rubocops/zero_zero_zero_zero.rb new file mode 100644 index 0000000000..92879abded --- /dev/null +++ b/Library/Homebrew/rubocops/zero_zero_zero_zero.rb @@ -0,0 +1,48 @@ +# typed: strict +# frozen_string_literal: true + +require "rubocops/extend/formula_cop" + +module RuboCop + module Cop + module FormulaAudit + # This cop audits the use of 0.0.0.0 in formulae. + # 0.0.0.0 should not be used outside of test do blocks as it can be a security risk. + class ZeroZeroZeroZero < FormulaCop + sig { override.params(formula_nodes: FormulaNodes).void } + def audit_formula(formula_nodes) + return if formula_tap != "homebrew-core" + + body_node = formula_nodes.body_node + return if body_node.nil? + + test_block = find_block(body_node, :test) + + # Find all string literals in the formula + body_node.each_descendant(:str) do |str_node| + content = string_content(str_node) + next unless content.include?("0.0.0.0") + next if test_block && str_node.ancestors.any?(test_block) + + next if valid_ip_range?(content) + + offending_node(str_node) + problem "Do not use 0.0.0.0 as it can be a security risk." + end + end + + private + + sig { params(content: String).returns(T::Boolean) } + def valid_ip_range?(content) + # Allow private IP ranges like 10.0.0.0, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255 + return true if content.match?(/\b(?:10|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\.\d+\.\d+\b/) + # Allow IP range notation like 0.0.0.0-255.255.255.255 + return true if content.match?(/\b0\.0\.0\.0\s*-\s*255\.255\.255\.255\b/) + + false + end + end + end + end +end diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 6b3ad1dabd..1f8e29c0ae 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -10,7 +10,6 @@ require "utils/fork" # Helper class for running a sub-process inside of a sandboxed environment. class Sandbox SANDBOX_EXEC = "/usr/bin/sandbox-exec" - private_constant :SANDBOX_EXEC # This is defined in the macOS SDK but Ruby unfortunately does not expose it. # This value can be found by compiling a C program that prints TIOCSCTTY. diff --git a/Library/Homebrew/sbom.rb b/Library/Homebrew/sbom.rb index 8873cdf751..4df1d7e815 100644 --- a/Library/Homebrew/sbom.rb +++ b/Library/Homebrew/sbom.rb @@ -4,7 +4,7 @@ require "cxxstdlib" require "json" require "development_tools" -require "extend/cachable" +require "cachable" require "utils/curl" # Rather than calling `new` directly, use one of the class methods like {SBOM.create}. diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb index 2ae807da14..b52c1bb083 100644 --- a/Library/Homebrew/service.rb +++ b/Library/Homebrew/service.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true require "ipaddr" -require "extend/on_system" +require "on_system" require "utils/service" module Homebrew diff --git a/Library/Homebrew/services/cli.rb b/Library/Homebrew/services/cli.rb index 9dbea84385..4cb4518eee 100644 --- a/Library/Homebrew/services/cli.rb +++ b/Library/Homebrew/services/cli.rb @@ -42,7 +42,7 @@ module Homebrew end # Check if formula has been found. - def self.check(targets) + def self.check!(targets) raise UsageError, "Formula(e) missing, please provide a formula name or use --all" if targets.empty? true diff --git a/Library/Homebrew/services/commands/info.rb b/Library/Homebrew/services/commands/info.rb index ed2bc32434..b797994659 100644 --- a/Library/Homebrew/services/commands/info.rb +++ b/Library/Homebrew/services/commands/info.rb @@ -17,7 +17,7 @@ module Homebrew ).void } def self.run(targets, verbose:, json:) - Services::Cli.check(targets) + Services::Cli.check!(targets) output = targets.map(&:to_hash) diff --git a/Library/Homebrew/services/commands/kill.rb b/Library/Homebrew/services/commands/kill.rb index c7182a33ce..cdec978c3f 100644 --- a/Library/Homebrew/services/commands/kill.rb +++ b/Library/Homebrew/services/commands/kill.rb @@ -11,7 +11,7 @@ module Homebrew sig { params(targets: T::Array[Services::FormulaWrapper], verbose: T::Boolean).void } def self.run(targets, verbose:) - Services::Cli.check(targets) + Services::Cli.check!(targets) Services::Cli.kill(targets, verbose:) end end diff --git a/Library/Homebrew/services/commands/restart.rb b/Library/Homebrew/services/commands/restart.rb index 4a357c6837..50ad79cc49 100644 --- a/Library/Homebrew/services/commands/restart.rb +++ b/Library/Homebrew/services/commands/restart.rb @@ -22,7 +22,7 @@ module Homebrew ).void } def self.run(targets, custom_plist, verbose:) - Services::Cli.check(targets) + Services::Cli.check!(targets) ran = [] started = [] diff --git a/Library/Homebrew/services/commands/run.rb b/Library/Homebrew/services/commands/run.rb index b46cc0c75b..fc82eec7fe 100644 --- a/Library/Homebrew/services/commands/run.rb +++ b/Library/Homebrew/services/commands/run.rb @@ -17,7 +17,7 @@ module Homebrew ).void } def self.run(targets, custom_plist, verbose:) - Services::Cli.check(targets) + Services::Cli.check!(targets) Services::Cli.run(targets, custom_plist, verbose:) end end diff --git a/Library/Homebrew/services/commands/start.rb b/Library/Homebrew/services/commands/start.rb index c20ef6cba5..58bdac1190 100644 --- a/Library/Homebrew/services/commands/start.rb +++ b/Library/Homebrew/services/commands/start.rb @@ -17,7 +17,7 @@ module Homebrew ).void } def self.run(targets, custom_plist, verbose:) - Services::Cli.check(targets) + Services::Cli.check!(targets) Services::Cli.start(targets, custom_plist, verbose:) end end diff --git a/Library/Homebrew/services/commands/stop.rb b/Library/Homebrew/services/commands/stop.rb index bdf1882e06..c1c7bb3cae 100644 --- a/Library/Homebrew/services/commands/stop.rb +++ b/Library/Homebrew/services/commands/stop.rb @@ -19,7 +19,7 @@ module Homebrew ).void } def self.run(targets, verbose:, no_wait:, max_wait:, keep:) - Services::Cli.check(targets) + Services::Cli.check!(targets) Services::Cli.stop(targets, verbose:, no_wait:, max_wait:, keep:) end end diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index e1b80b8415..840d4ea963 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -2,6 +2,7 @@ # frozen_string_literal: true require "macos_version" +require "utils/bottles" module Homebrew # Helper module for simulating different system configurations. @@ -9,6 +10,11 @@ module Homebrew class << self attr_reader :arch, :os + sig { returns(T::Hash[Symbol, Symbol]) } + def arch_symbols + { arm64: :arm, x86_64: :intel }.freeze + end + sig { type_parameters(:U).params( os: Symbol, @@ -33,6 +39,18 @@ module Homebrew end end + sig { + type_parameters(:U).params( + tag: Utils::Bottles::Tag, + block: T.proc.returns(T.type_parameter(:U)), + ).returns(T.type_parameter(:U)) + } + def with_tag(tag, &block) + raise ArgumentError, "Invalid tag: #{tag}" unless tag.valid_combination? + + with(os: tag.system, arch: tag.arch, &block) + end + sig { params(new_os: Symbol).void } def os=(new_os) os_options = [:macos, :linux, *MacOSVersion::SYMBOLS.keys] @@ -72,6 +90,14 @@ module Homebrew def current_os os || :generic end + + sig { returns(Utils::Bottles::Tag) } + def current_tag + Utils::Bottles::Tag.new( + system: current_os, + arch: current_arch, + ) + end end end end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 7463429257..a6172182cb 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -12,7 +12,7 @@ require "utils/bottles" require "patch" require "compilers" require "macos_version" -require "extend/on_system" +require "on_system" class SoftwareSpec include Downloadable diff --git a/Library/Homebrew/sorbet/rbi/annotations/.gitattributes b/Library/Homebrew/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 0000000000..d2eacd2c61 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/annotations/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-vendored=true diff --git a/Library/Homebrew/sorbet/rbi/annotations/minitest.rbi b/Library/Homebrew/sorbet/rbi/annotations/minitest.rbi new file mode 100644 index 0000000000..64a89286ee --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/annotations/minitest.rbi @@ -0,0 +1,119 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Minitest::Assertions + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def assert(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(MatchData) } + def assert_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_nil(obj, msg = nil); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(stdout: T.nilable(T.any(String, Regexp)), stderr: T.nilable(T.any(String, Regexp)), block: T.proc.void).returns(T::Boolean) } + def assert_output(stdout = nil, stderr = nil, &block); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def assert_path_exists(path, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def assert_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def assert_predicate(o1, op, msg = nil); end + + sig { params(exp: NilClass, block: T.proc.void).returns(StandardError) } + sig { type_parameters(:T).params(exp: T.any(T::Class[T.type_parameter(:T)], Regexp, String), block: T.proc.void).returns(T.type_parameter(:T)) } + def assert_raises(*exp, &block); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def assert_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_same(exp, act, msg = nil); end + + sig { params(send_ary: T::Array[T.anything], m: T.anything).returns(T::Boolean) } + def assert_send(send_ary, m = nil); end + + sig { params(block: T.proc.void).returns(T::Boolean) } + def assert_silent(&block); end + + sig { params(sym: Symbol, msg: T.anything, block: T.proc.void).returns(T.anything) } + def assert_throws(sym, msg = nil, &block); end + + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def refute(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_nil(obj, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def refute_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def refute_path_exists(path, msg = nil); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def refute_predicate(o1, op, msg = nil); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def refute_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_same(exp, act, msg = nil); end +end diff --git a/Library/Homebrew/sorbet/rbi/annotations/rainbow.rbi b/Library/Homebrew/sorbet/rbi/annotations/rainbow.rbi new file mode 100644 index 0000000000..0d2cb4e48a --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/annotations/rainbow.rbi @@ -0,0 +1,269 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rainbow + # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12 + sig { returns(T::Boolean) } + attr_accessor :enabled + + class Color + sig { returns(Symbol) } + attr_reader :ground + + sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) } + def self.build(ground, values); end + + sig { params(hex: String).returns([Integer, Integer, Integer]) } + def self.parse_hex_color(hex); end + + class Indexed < Rainbow::Color + sig { returns(Integer) } + attr_reader :num + + sig { params(ground: Symbol, num: Integer).void } + def initialize(ground, num); end + + sig { returns(T::Array[Integer]) } + def codes; end + end + + class Named < Rainbow::Color::Indexed + NAMES = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + + class RGB < Rainbow::Color::Indexed + sig { returns(Integer) } + attr_reader :r, :g, :b + + sig { params(ground: Symbol, values: Integer).void } + def initialize(ground, *values); end + + sig { returns(T::Array[Integer]) } + def codes; end + + sig { params(value: Numeric).returns(Integer) } + def self.to_ansi_domain(value); end + end + + class X11Named < Rainbow::Color::RGB + include Rainbow::X11ColorNames + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + end + + sig { returns(Wrapper) } + def self.global; end + + sig { returns(T::Boolean) } + def self.enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def self.enabled=(value); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + + class NullPresenter < String + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def bg(*values); end + + sig { returns(NullPresenter) } + def reset; end + + sig { returns(NullPresenter) } + def bright; end + + sig { returns(NullPresenter) } + def faint; end + + sig { returns(NullPresenter) } + def italic; end + + sig { returns(NullPresenter) } + def underline; end + + sig { returns(NullPresenter) } + def blink; end + + sig { returns(NullPresenter) } + def inverse; end + + sig { returns(NullPresenter) } + def hide; end + + sig { returns(NullPresenter) } + def cross_out; end + + sig { returns(NullPresenter) } + def black; end + + sig { returns(NullPresenter) } + def red; end + + sig { returns(NullPresenter) } + def green; end + + sig { returns(NullPresenter) } + def yellow; end + + sig { returns(NullPresenter) } + def blue; end + + sig { returns(NullPresenter) } + def magenta; end + + sig { returns(NullPresenter) } + def cyan; end + + sig { returns(NullPresenter) } + def white; end + + sig { returns(NullPresenter) } + def bold; end + + sig { returns(NullPresenter) } + def dark; end + + sig { returns(NullPresenter) } + def strike; end + end + + class Presenter < String + TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def bg(*values); end + + sig { returns(Presenter) } + def reset; end + + sig { returns(Presenter) } + def bright; end + + sig { returns(Presenter) } + def faint; end + + sig { returns(Presenter) } + def italic; end + + sig { returns(Presenter) } + def underline; end + + sig { returns(Presenter) } + def blink; end + + sig { returns(Presenter) } + def inverse; end + + sig { returns(Presenter) } + def hide; end + + sig { returns(Presenter) } + def cross_out; end + + sig { returns(Presenter) } + def black; end + + sig { returns(Presenter) } + def red; end + + sig { returns(Presenter) } + def green; end + + sig { returns(Presenter) } + def yellow; end + + sig { returns(Presenter) } + def blue; end + + sig { returns(Presenter) } + def magenta; end + + sig { returns(Presenter) } + def cyan; end + + sig { returns(Presenter) } + def white; end + + sig { returns(Presenter) } + def bold; end + + sig { returns(Presenter) } + def dark; end + + sig { returns(Presenter) } + def strike; end + end + + class StringUtils + sig { params(string: String, codes: T::Array[Integer]).returns(String) } + def self.wrap_with_sgr(string, codes); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + end + + VERSION = T.let(nil, String) + + class Wrapper + sig { returns(T::Boolean) } + attr_accessor :enabled + + sig { params(enabled: T::Boolean).void } + def initialize(enabled = true); end + + sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) } + def wrap(string); end + end + + module X11ColorNames + NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]]) + end +end + +sig { params(string: String).returns(Rainbow::Presenter) } +def Rainbow(string); end diff --git a/Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi b/Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi index 1ea511aa2e..c0aec7da89 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/cask/cask.rbi @@ -9,9 +9,6 @@ class Cask::Cask sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) } def app(*args, &block); end - sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) } - def appcast(*args, &block); end - sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) } def appdir(*args, &block); end diff --git a/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi new file mode 100644 index 0000000000..5e2f38940e --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/dsl/cask/config.rbi @@ -0,0 +1,58 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Cask::Config`. +# Please instead update this file by running `bin/tapioca dsl Cask::Config`. + + +module Cask + class Config + sig { returns(String) } + def appdir; end + + sig { returns(String) } + def audio_unit_plugindir; end + + sig { returns(String) } + def colorpickerdir; end + + sig { returns(String) } + def dictionarydir; end + + sig { returns(String) } + def fontdir; end + + sig { returns(String) } + def input_methoddir; end + + sig { returns(String) } + def internet_plugindir; end + + sig { returns(String) } + def keyboard_layoutdir; end + + sig { returns(T::Array[String]) } + def languages; end + + sig { returns(String) } + def mdimporterdir; end + + sig { returns(String) } + def prefpanedir; end + + sig { returns(String) } + def qlplugindir; end + + sig { returns(String) } + def screen_saverdir; end + + sig { returns(String) } + def servicedir; end + + sig { returns(String) } + def vst3_plugindir; end + + sig { returns(String) } + def vst_plugindir; end + end +end diff --git a/Library/Homebrew/sorbet/rbi/dsl/cask/url.rbi b/Library/Homebrew/sorbet/rbi/dsl/cask/url.rbi index 4dcb953471..f2c9c8a2ca 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/cask/url.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/cask/url.rbi @@ -32,7 +32,7 @@ class Cask::URL sig { returns(T.untyped) } def revision; end - sig { returns(T.nilable(T::Array[::String])) } + sig { returns(T.nilable(T::Hash[T.any(::String, ::Symbol), ::String])) } def revisions; end sig { returns(T.untyped) } diff --git a/Library/Homebrew/sorbet/rbi/dsl/caveats.rbi b/Library/Homebrew/sorbet/rbi/dsl/caveats.rbi index dbe807aa31..e544438a19 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/caveats.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/caveats.rbi @@ -6,9 +6,6 @@ class Caveats - sig { params(args: T.untyped, block: T.untyped).returns(T::Boolean) } - def empty?(*args, &block); end - sig { params(args: T.untyped, block: T.untyped).returns(String) } def to_s(*args, &block); end end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/bundle.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/bundle.rbi index 7e19689a21..f4def00cc6 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/bundle.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/bundle.rbi @@ -44,6 +44,9 @@ class Homebrew::Cmd::Bundle::Args < Homebrew::CLI::Args sig { returns(T::Boolean) } def formula?; end + sig { returns(T::Boolean) } + def formulae?; end + sig { returns(T::Boolean) } def global?; end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/mcp_server_cmd.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/mcp_server_cmd.rbi new file mode 100644 index 0000000000..c9fc49bef8 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/mcp_server_cmd.rbi @@ -0,0 +1,16 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Homebrew::Cmd::McpServerCmd`. +# Please instead update this file by running `bin/tapioca dsl Homebrew::Cmd::McpServerCmd`. + + +class Homebrew::Cmd::McpServerCmd + sig { returns(Homebrew::Cmd::McpServerCmd::Args) } + def args; end +end + +class Homebrew::Cmd::McpServerCmd::Args < Homebrew::CLI::Args + sig { returns(T::Boolean) } + def ping?; end +end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/tap_cmd.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/tap_cmd.rbi index 235eb5e106..92dc432325 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/tap_cmd.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/tap_cmd.rbi @@ -23,9 +23,6 @@ class Homebrew::Cmd::TapCmd::Args < Homebrew::CLI::Args sig { returns(T::Boolean) } def force?; end - sig { returns(T::Boolean) } - def force_auto_update?; end - sig { returns(T::Boolean) } def repair?; end end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/create.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/create.rbi index 150ac9e871..2912c9a025 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/create.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/create.rbi @@ -17,6 +17,9 @@ class Homebrew::DevCmd::Create::Args < Homebrew::CLI::Args sig { returns(T::Boolean) } def autotools?; end + sig { returns(T::Boolean) } + def cabal?; end + sig { returns(T::Boolean) } def cask?; end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/tests.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/tests.rbi index 863665ee93..32c70a843f 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/tests.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/tests.rbi @@ -23,6 +23,9 @@ class Homebrew::DevCmd::Tests::Args < Homebrew::CLI::Args sig { returns(T::Boolean) } def generic?; end + sig { returns(T::Boolean) } + def no_parallel?; end + sig { returns(T::Boolean) } def online?; end diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/update_perl_resources.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/update_perl_resources.rbi new file mode 100644 index 0000000000..b5e1429044 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/update_perl_resources.rbi @@ -0,0 +1,28 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Homebrew::DevCmd::UpdatePerlResources`. +# Please instead update this file by running `bin/tapioca dsl Homebrew::DevCmd::UpdatePerlResources`. + + +class Homebrew::DevCmd::UpdatePerlResources + sig { returns(Homebrew::DevCmd::UpdatePerlResources::Args) } + def args; end +end + +class Homebrew::DevCmd::UpdatePerlResources::Args < Homebrew::CLI::Args + sig { returns(T::Boolean) } + def ignore_errors?; end + + sig { returns(T::Boolean) } + def p?; end + + sig { returns(T::Boolean) } + def print_only?; end + + sig { returns(T::Boolean) } + def s?; end + + sig { returns(T::Boolean) } + def silent?; end +end diff --git a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cask/ast/stanza.rbi b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cask/ast/stanza.rbi index a8c6e4f8af..b07393aca9 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cask/ast/stanza.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cask/ast/stanza.rbi @@ -129,6 +129,9 @@ class RuboCop::Cask::AST::Stanza sig { params(args: T.untyped, block: T.untyped).returns(T::Boolean) } def on_system_block?(*args, &block); end + sig { returns(T::Boolean) } + def on_tahoe?; end + sig { returns(T::Boolean) } def on_ventura?; end diff --git a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/cask/no_autobump.rbi b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/cask/no_autobump.rbi new file mode 100644 index 0000000000..8eb33cc43f --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/cask/no_autobump.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `RuboCop::Cop::Cask::NoAutobump`. +# Please instead update this file by running `bin/tapioca dsl RuboCop::Cop::Cask::NoAutobump`. + + +class RuboCop::Cop::Cask::NoAutobump + sig { params(args: T.untyped, block: T.untyped).returns(T.untyped) } + def toplevel_stanzas(*args, &block); end +end diff --git a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/no_autobump.rbi b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/no_autobump.rbi new file mode 100644 index 0000000000..6a5019eee1 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/no_autobump.rbi @@ -0,0 +1,18 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `RuboCop::Cop::FormulaAudit::NoAutobump`. +# Please instead update this file by running `bin/tapioca dsl RuboCop::Cop::FormulaAudit::NoAutobump`. + + +class RuboCop::Cop::FormulaAudit::NoAutobump + sig do + params( + node: RuboCop::AST::Node, + pattern: T.any(String, Symbol), + kwargs: T.untyped, + block: T.untyped + ).returns(T.untyped) + end + def reason(node, *pattern, **kwargs, &block); end +end diff --git a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/text.rbi b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/text.rbi index 6107e5dc64..701f3a0d6c 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/text.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/formula_audit/text.rbi @@ -5,14 +5,4 @@ # Please instead update this file by running `bin/tapioca dsl RuboCop::Cop::FormulaAudit::Text`. -class RuboCop::Cop::FormulaAudit::Text - sig do - params( - node: RuboCop::AST::Node, - pattern: T.any(String, Symbol), - kwargs: T.untyped, - block: T.untyped - ).returns(T.untyped) - end - def prefix_path(node, *pattern, **kwargs, &block); end -end +class RuboCop::Cop::FormulaAudit::Text; end diff --git a/Library/Homebrew/sorbet/rbi/gems/csv@3.3.4.rbi b/Library/Homebrew/sorbet/rbi/gems/csv@3.3.5.rbi similarity index 96% rename from Library/Homebrew/sorbet/rbi/gems/csv@3.3.4.rbi rename to Library/Homebrew/sorbet/rbi/gems/csv@3.3.5.rbi index c82d13e613..1ad863986d 100644 --- a/Library/Homebrew/sorbet/rbi/gems/csv@3.3.4.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/csv@3.3.5.rbi @@ -915,14 +915,29 @@ class CSV # end # end # - # source://csv//lib/csv.rb#2507 + # source://csv//lib/csv.rb#2511 def add_row(row); end + # source://csv//lib/csv.rb#2389 + def binmode(*args, **_arg1, &block); end + # @return [Boolean] # # source://csv//lib/csv.rb#2396 def binmode?; end + # source://csv//lib/csv.rb#2389 + def close(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def close_read(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def close_write(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def closed?(*args, **_arg1, &block); end + # :call-seq: # csv.col_sep -> string # @@ -1075,7 +1090,7 @@ class CSV # @return [Boolean] # - # source://csv//lib/csv.rb#2432 + # source://csv//lib/csv.rb#2444 def eof; end # @return [Boolean] @@ -1083,6 +1098,12 @@ class CSV # source://csv//lib/csv.rb#2432 def eof?; end + # source://csv//lib/csv.rb#2389 + def external_encoding(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def fcntl(*args, **_arg1, &block); end + # :call-seq: # csv.field_size_limit -> integer or nil # @@ -1095,11 +1116,17 @@ class CSV # source://csv//lib/csv.rb#2176 def field_size_limit; end + # source://csv//lib/csv.rb#2389 + def fileno(*args, **_arg1, &block); end + # @raise [NotImplementedError] # # source://csv//lib/csv.rb#2404 def flock(*args); end + # source://csv//lib/csv.rb#2389 + def flush(*args, **_arg1, &block); end + # :call-seq: # csv.force_quotes? -> true or false # @@ -1113,6 +1140,9 @@ class CSV # source://csv//lib/csv.rb#2307 def force_quotes?; end + # source://csv//lib/csv.rb#2389 + def fsync(*args, **_arg1, &block); end + # :call-seq: # csv.shift -> array, csv_row, or nil # @@ -1147,7 +1177,7 @@ class CSV # # Raises IOError (not opened for reading) # csv.shift # - # source://csv//lib/csv.rb#2803 + # source://csv//lib/csv.rb#2814 def gets; end # The block need not return a \String object: @@ -1240,11 +1270,17 @@ class CSV # source://csv//lib/csv.rb#2825 def inspect; end + # source://csv//lib/csv.rb#2389 + def internal_encoding(*args, **_arg1, &block); end + # @raise [NotImplementedError] # # source://csv//lib/csv.rb#2409 def ioctl(*args); end + # source://csv//lib/csv.rb#2389 + def isatty(*args, **_arg1, &block); end + # :call-seq: # csv.liberal_parsing? -> true or false # @@ -1325,6 +1361,15 @@ class CSV # source://csv//lib/csv.rb#2414 def path; end + # source://csv//lib/csv.rb#2389 + def pid(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def pos(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def pos=(*args, **_arg1, &block); end + # :call-seq: # csv << row -> self # @@ -1376,7 +1421,7 @@ class CSV # end # end # - # source://csv//lib/csv.rb#2507 + # source://csv//lib/csv.rb#2512 def puts(row); end # :call-seq: @@ -1458,7 +1503,7 @@ class CSV # # Raises IOError (not opened for reading) # csv.shift # - # source://csv//lib/csv.rb#2803 + # source://csv//lib/csv.rb#2815 def readline; end # :call-seq: @@ -1493,9 +1538,12 @@ class CSV # # Raises IOError (not opened for reading) # csv.read # - # source://csv//lib/csv.rb#2730 + # source://csv//lib/csv.rb#2738 def readlines; end + # source://csv//lib/csv.rb#2389 + def reopen(*args, **_arg1, &block); end + # :call-seq: # csv.return_headers? -> true or false # @@ -1523,6 +1571,9 @@ class CSV # source://csv//lib/csv.rb#2154 def row_sep; end + # source://csv//lib/csv.rb#2389 + def seek(*args, **_arg1, &block); end + # :call-seq: # csv.shift -> array, csv_row, or nil # @@ -1587,6 +1638,18 @@ class CSV # source://csv//lib/csv.rb#2418 def stat(*args); end + # source://csv//lib/csv.rb#2389 + def string(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def sync(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def sync=(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def tell(*args, **_arg1, &block); end + # @raise [NotImplementedError] # # source://csv//lib/csv.rb#2423 @@ -1595,6 +1658,12 @@ class CSV # source://csv//lib/csv.rb#2428 def to_io; end + # source://csv//lib/csv.rb#2389 + def truncate(*args, **_arg1, &block); end + + # source://csv//lib/csv.rb#2389 + def tty?(*args, **_arg1, &block); end + # :call-seq: # csv.unconverted_fields? -> object # @@ -2500,16 +2569,6 @@ end # source://csv//lib/csv.rb#895 CSV::ConverterEncoding = T.let(T.unsafe(nil), Encoding) -# A \Hash containing the names and \Procs for the built-in field converters. -# See {Built-In Field Converters}[#class-CSV-label-Built-In+Field+Converters]. -# -# This \Hash is intentionally left unfrozen, and may be extended with -# custom field converters. -# See {Custom Field Converters}[#class-CSV-label-Custom+Field+Converters]. -# -# source://csv//lib/csv.rb#903 -CSV::Converters = T.let(T.unsafe(nil), Hash) - # A Regexp used to find and convert some common Date formats. # # source://csv//lib/csv.rb#884 @@ -2520,6 +2579,88 @@ CSV::DateMatcher = T.let(T.unsafe(nil), Regexp) # source://csv//lib/csv.rb#887 CSV::DateTimeMatcher = T.let(T.unsafe(nil), Regexp) +# A FieldInfo Struct contains details about a field's position in the data +# source it was read from. CSV will pass this Struct to some blocks that make +# decisions based on field structure. See CSV.convert_fields() for an +# example. +# +# index:: The zero-based index of the field in its row. +# line:: The line of the data source this row is from. +# header:: The header for the column, when available. +# quoted?:: True or false, whether the original value is quoted or not. +# +# source://csv//lib/csv.rb#881 +class CSV::FieldInfo < ::Struct + # Returns the value of attribute header + # + # @return [Object] the current value of header + # + # source://csv//lib/csv.rb#881 + def header; end + + # Sets the attribute header + # + # @param value [Object] the value to set the attribute header to. + # @return [Object] the newly set value + # + # source://csv//lib/csv.rb#881 + def header=(_); end + + # Returns the value of attribute index + # + # @return [Object] the current value of index + # + # source://csv//lib/csv.rb#881 + def index; end + + # Sets the attribute index + # + # @param value [Object] the value to set the attribute index to. + # @return [Object] the newly set value + # + # source://csv//lib/csv.rb#881 + def index=(_); end + + # Returns the value of attribute line + # + # @return [Object] the current value of line + # + # source://csv//lib/csv.rb#881 + def line; end + + # Sets the attribute line + # + # @param value [Object] the value to set the attribute line to. + # @return [Object] the newly set value + # + # source://csv//lib/csv.rb#881 + def line=(_); end + + # Returns the value of attribute quoted? + # + # @return [Object] the current value of quoted? + # + # source://csv//lib/csv.rb#881 + def quoted?; end + + class << self + # source://csv//lib/csv.rb#881 + def [](*_arg0); end + + # source://csv//lib/csv.rb#881 + def inspect; end + + # source://csv//lib/csv.rb#881 + def keyword_init?; end + + # source://csv//lib/csv.rb#881 + def members; end + + # source://csv//lib/csv.rb#881 + def new(*_arg0); end + end +end + # Note: Don't use this class directly. This is an internal class. # # source://csv//lib/csv/fields_converter.rb#5 @@ -2617,7 +2758,7 @@ class CSV::MalformedCSVError < ::RuntimeError # Returns the value of attribute line_number. # - # source://csv//lib/csv.rb#853 + # source://csv//lib/csv.rb#854 def lineno; end end @@ -2912,7 +3053,7 @@ CSV::Parser::STRING_SCANNER_SCAN_ACCEPT_STRING = T.let(T.unsafe(nil), TrueClass) # Uses StringScanner (the official strscan gem). Strscan provides lexical # scanning operations on a String. We inherit its object and take advantage # on the methods. For more information, please visit: -# https://ruby-doc.org/stdlib-2.6.1/libdoc/strscan/rdoc/StringScanner.html +# https://docs.ruby-lang.org/en/master/StringScanner.html # # source://csv//lib/csv/parser.rb#52 class CSV::Parser::Scanner < ::StringScanner @@ -2936,6 +3077,7 @@ class CSV::Parser::Scanner < ::StringScanner # source://csv//lib/csv/parser.rb#69 def keep_start; end + # source://csv//lib/csv/parser.rb#53 def scan_all(_arg0); end end @@ -3162,7 +3304,7 @@ class CSV::Row # # Returns +nil+ if the header does not exist. # - # source://csv//lib/csv/row.rb#203 + # source://csv//lib/csv/row.rb#215 def [](header_or_index, minimum_index = T.unsafe(nil)); end # :call-seq: @@ -3350,9 +3492,12 @@ class CSV::Row # If no block is given, returns a new Enumerator: # row.each # => #:each> # - # source://csv//lib/csv/row.rb#610 + # source://csv//lib/csv/row.rb#618 def each_pair(&block); end + # source://csv//lib/csv/row.rb#124 + def empty?(*args, **_arg1, &block); end + # :call-seq: # fetch(header) -> value # fetch(header, default) -> value @@ -3536,7 +3681,7 @@ class CSV::Row # # @return [Boolean] # - # source://csv//lib/csv/row.rb#279 + # source://csv//lib/csv/row.rb#285 def header?(header); end # :call-seq: @@ -3569,7 +3714,7 @@ class CSV::Row # # @return [Boolean] # - # source://csv//lib/csv/row.rb#279 + # source://csv//lib/csv/row.rb#282 def include?(header); end # :call-seq: @@ -3619,9 +3764,12 @@ class CSV::Row # # @return [Boolean] # - # source://csv//lib/csv/row.rb#279 + # source://csv//lib/csv/row.rb#283 def key?(header); end + # source://csv//lib/csv/row.rb#124 + def length(*args, **_arg1, &block); end + # :call-seq: # row.has_key?(header) -> true or false # @@ -3630,7 +3778,7 @@ class CSV::Row # # @return [Boolean] # - # source://csv//lib/csv/row.rb#279 + # source://csv//lib/csv/row.rb#284 def member?(header); end # :call-seq: @@ -3646,6 +3794,12 @@ class CSV::Row # source://csv//lib/csv/row.rb#410 def push(*args); end + # source://csv//lib/csv/row.rb#124 + def size(*args, **_arg1, &block); end + + # source://csv//lib/csv/row.rb#675 + def to_ary(*_arg0); end + # :call-seq: # row.to_csv -> csv_string # @@ -3693,7 +3847,7 @@ class CSV::Row # row = table[0] # row.to_h # => {"Name"=>"Foo"} # - # source://csv//lib/csv/row.rb#653 + # source://csv//lib/csv/row.rb#660 def to_hash; end # :call-seq: @@ -3705,7 +3859,7 @@ class CSV::Row # row = table[0] # row.to_csv # => "foo,0\n" # - # source://csv//lib/csv/row.rb#694 + # source://csv//lib/csv/row.rb#697 def to_s(**options); end # :call-seq: @@ -3755,7 +3909,7 @@ class CSV::Row # Returns all fields if no argument given: # row.fields # => ["Foo", "Bar", "Baz"] # - # source://csv//lib/csv/row.rb#530 + # source://csv//lib/csv/row.rb#551 def values_at(*headers_and_or_indices); end protected @@ -4533,6 +4687,9 @@ class CSV::Table # source://csv//lib/csv/table.rb#930 def each(&block); end + # source://csv//lib/csv/table.rb#223 + def empty?(*args, **_arg1, &block); end + # :call-seq: # table.headers -> array_of_headers # @@ -4574,6 +4731,9 @@ class CSV::Table # source://csv//lib/csv/table.rb#1048 def inspect; end + # source://csv//lib/csv/table.rb#223 + def length(*args, **_arg1, &block); end + # The current access mode for indexing and iteration. # # source://csv//lib/csv/table.rb#214 @@ -4598,6 +4758,9 @@ class CSV::Table # source://csv//lib/csv/table.rb#788 def push(*rows); end + # source://csv//lib/csv/table.rb#223 + def size(*args, **_arg1, &block); end + # :call-seq: # table.to_a -> array_of_arrays # @@ -4649,7 +4812,7 @@ class CSV::Table # Limit rows if option +limit+ is given like +2+: # table.to_csv(limit: 2) # => "Name,Value\nfoo,0\nbar,1\n" # - # source://csv//lib/csv/table.rb#1004 + # source://csv//lib/csv/table.rb#1015 def to_s(write_headers: T.unsafe(nil), limit: T.unsafe(nil), **options); end # :call-seq: diff --git a/Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.2.0.rbi b/Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.3.0.rbi similarity index 92% rename from Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.2.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.3.0.rbi index 045411b7f9..94358b7e40 100644 --- a/Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.2.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/parallel_tests@5.3.0.rbi @@ -78,36 +78,39 @@ class ParallelTests::CLI # source://parallel_tests//lib/parallel_tests/cli.rb#189 def any_test_failed?(test_results); end - # source://parallel_tests//lib/parallel_tests/cli.rb#375 + # source://parallel_tests//lib/parallel_tests/cli.rb#401 def append_test_options(options, argv); end - # source://parallel_tests//lib/parallel_tests/cli.rb#416 + # source://parallel_tests//lib/parallel_tests/cli.rb#442 def detailed_duration(seconds); end - # source://parallel_tests//lib/parallel_tests/cli.rb#390 + # source://parallel_tests//lib/parallel_tests/cli.rb#416 def execute_command_in_parallel(command, num_processes, options); end # source://parallel_tests//lib/parallel_tests/cli.rb#56 def execute_in_parallel(items, num_processes, options); end - # source://parallel_tests//lib/parallel_tests/cli.rb#364 + # source://parallel_tests//lib/parallel_tests/cli.rb#390 def extract_file_paths(argv); end - # source://parallel_tests//lib/parallel_tests/cli.rb#370 + # source://parallel_tests//lib/parallel_tests/cli.rb#396 def extract_test_options(argv); end - # source://parallel_tests//lib/parallel_tests/cli.rb#423 + # source://parallel_tests//lib/parallel_tests/cli.rb#449 def final_fail_message; end # @return [Boolean] # - # source://parallel_tests//lib/parallel_tests/cli.rb#433 + # source://parallel_tests//lib/parallel_tests/cli.rb#459 def first_is_1?; end # source://parallel_tests//lib/parallel_tests/cli.rb#31 def handle_interrupt; end - # source://parallel_tests//lib/parallel_tests/cli.rb#383 + # source://parallel_tests//lib/parallel_tests/cli.rb#482 + def heredoc(text, newline_padding); end + + # source://parallel_tests//lib/parallel_tests/cli.rb#409 def load_runner(type); end # source://parallel_tests//lib/parallel_tests/cli.rb#138 @@ -128,7 +131,7 @@ class ParallelTests::CLI # source://parallel_tests//lib/parallel_tests/cli.rb#148 def report_results(test_results, options); end - # source://parallel_tests//lib/parallel_tests/cli.rb#411 + # source://parallel_tests//lib/parallel_tests/cli.rb#437 def report_time_taken(&block); end # source://parallel_tests//lib/parallel_tests/cli.rb#130 @@ -142,12 +145,12 @@ class ParallelTests::CLI # CI systems often fail when there is no output for a long time, so simulate some output # - # source://parallel_tests//lib/parallel_tests/cli.rb#439 + # source://parallel_tests//lib/parallel_tests/cli.rb#465 def simulate_output_for_ci(simulate); end # @return [Boolean] # - # source://parallel_tests//lib/parallel_tests/cli.rb#429 + # source://parallel_tests//lib/parallel_tests/cli.rb#455 def use_colors?; end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rbi@0.3.3.rbi b/Library/Homebrew/sorbet/rbi/gems/rbi@0.3.6.rbi similarity index 65% rename from Library/Homebrew/sorbet/rbi/gems/rbi@0.3.3.rbi rename to Library/Homebrew/sorbet/rbi/gems/rbi@0.3.6.rbi index f60986ffae..fa14e8723a 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rbi@0.3.3.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rbi@0.3.6.rbi @@ -11,53 +11,41 @@ # This is an autogenerated file for types exported from the `rbi` gem. # Please instead update this file by running `spoom srb sigs export`. -# source://rbi//lib/rbi.rb#8 +# source://rbi//lib/rbi.rb#7 module RBI; end -# source://rbi//lib/rbi/model.rb#804 +# source://rbi//lib/rbi/model.rb#783 class RBI::Arg < ::RBI::Node - # : (String value, ?loc: Loc?) -> void - # # @return [Arg] a new instance of Arg # - # source://rbi//lib/rbi/model.rb#809 + # source://rbi//lib/rbi/model.rb#788 sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(value, loc: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#815 + # source://rbi//lib/rbi/model.rb#794 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#820 + # source://rbi//lib/rbi/model.rb#799 sig { returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#806 + # source://rbi//lib/rbi/model.rb#785 sig { returns(::String) } def value; end end -# Attributes +# @abstract # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://rbi//lib/rbi/model.rb#300 +# source://rbi//lib/rbi/model.rb#292 class RBI::Attr < ::RBI::NodeWithComments include ::RBI::Indexable abstract! - # : (Symbol name, Array[Symbol] names, ?visibility: Visibility, ?sigs: Array[Sig], ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [Attr] a new instance of Attr # - # source://rbi//lib/rbi/model.rb#316 + # source://rbi//lib/rbi/model.rb#303 sig do params( name: ::Symbol, @@ -70,67 +58,50 @@ class RBI::Attr < ::RBI::NodeWithComments end def initialize(name, names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#394 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#403 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end # @abstract # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#58 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#59 sig { abstract.returns(T::Array[::RBI::Method]) } def convert_to_methods; end # @abstract # - # source://rbi//lib/rbi/model.rb#324 + # source://rbi//lib/rbi/model.rb#312 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#109 + # source://rbi//lib/rbi/index.rb#104 sig { override.returns(T::Array[::String]) } def index_ids; end - # : (Node other) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#403 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#412 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#307 + # source://rbi//lib/rbi/model.rb#294 sig { returns(T::Array[::Symbol]) } def names; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#313 + # source://rbi//lib/rbi/model.rb#300 sig { returns(T::Array[::RBI::Sig]) } def sigs; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#310 + # source://rbi//lib/rbi/model.rb#297 sig { returns(::RBI::Visibility) } def visibility; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#310 - # @return [Visibility] + # source://rbi//lib/rbi/model.rb#297 def visibility=(_arg0); end private - # : (String name, Sig? sig, Visibility visibility, Loc? loc, Array[Comment] comments) -> Method - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#79 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#80 sig do params( name: ::String, @@ -142,9 +113,7 @@ class RBI::Attr < ::RBI::NodeWithComments end def create_getter_method(name, sig, visibility, loc, comments); end - # : (String name, Sig? sig, (Type | String)? attribute_type, Visibility visibility, Loc? loc, Array[Comment] comments) -> Method - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#91 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#92 sig do params( name: ::String, @@ -157,22 +126,18 @@ class RBI::Attr < ::RBI::NodeWithComments end def create_setter_method(name, sig, attribute_type, visibility, loc, comments); end - # : -> [Sig?, (Type | String)?] - # # @raise [UnexpectedMultipleSigsError] # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#64 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#65 sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) } def parse_sig; end end -# source://rbi//lib/rbi/model.rb#327 +# source://rbi//lib/rbi/model.rb#315 class RBI::AttrAccessor < ::RBI::Attr - # : (Symbol name, *Symbol names, ?visibility: Visibility, ?sigs: Array[Sig], ?loc: Loc?, ?comments: Array[Comment]) ?{ (AttrAccessor node) -> void } -> void - # # @return [AttrAccessor] a new instance of AttrAccessor # - # source://rbi//lib/rbi/model.rb#329 + # source://rbi//lib/rbi/model.rb#317 sig do params( name: ::Symbol, @@ -186,40 +151,30 @@ class RBI::AttrAccessor < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#432 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#441 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#122 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#123 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#336 + # source://rbi//lib/rbi/model.rb#324 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#343 + # source://rbi//lib/rbi/model.rb#331 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#349 +# source://rbi//lib/rbi/model.rb#337 class RBI::AttrReader < ::RBI::Attr - # : (Symbol name, *Symbol names, ?visibility: Visibility, ?sigs: Array[Sig], ?loc: Loc?, ?comments: Array[Comment]) ?{ (AttrReader node) -> void } -> void - # # @return [AttrReader] a new instance of AttrReader # - # source://rbi//lib/rbi/model.rb#351 + # source://rbi//lib/rbi/model.rb#339 sig do params( name: ::Symbol, @@ -233,40 +188,30 @@ class RBI::AttrReader < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#416 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#425 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#137 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#138 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#358 + # source://rbi//lib/rbi/model.rb#346 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#365 + # source://rbi//lib/rbi/model.rb#353 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#371 +# source://rbi//lib/rbi/model.rb#359 class RBI::AttrWriter < ::RBI::Attr - # : (Symbol name, *Symbol names, ?visibility: Visibility, ?sigs: Array[Sig], ?loc: Loc?, ?comments: Array[Comment]) ?{ (AttrWriter node) -> void } -> void - # # @return [AttrWriter] a new instance of AttrWriter # - # source://rbi//lib/rbi/model.rb#373 + # source://rbi//lib/rbi/model.rb#361 sig do params( name: ::Symbol, @@ -280,53 +225,41 @@ class RBI::AttrWriter < ::RBI::Attr end def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#424 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#433 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[Method] - # - # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#147 + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#148 sig { override.returns(T::Array[::RBI::Method]) } def convert_to_methods; end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#380 + # source://rbi//lib/rbi/model.rb#368 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#387 + # source://rbi//lib/rbi/model.rb#375 sig { override.returns(::String) } def to_s; end end # An arbitrary blank line that can be added both in trees and comments # -# source://rbi//lib/rbi/model.rb#73 +# source://rbi//lib/rbi/model.rb#70 class RBI::BlankLine < ::RBI::Comment - # : (?loc: Loc?) -> void - # # @return [BlankLine] a new instance of BlankLine # - # source://rbi//lib/rbi/model.rb#75 + # source://rbi//lib/rbi/model.rb#72 sig { params(loc: T.nilable(::RBI::Loc)).void } def initialize(loc: T.unsafe(nil)); end end -# source://rbi//lib/rbi/model.rb#644 +# source://rbi//lib/rbi/model.rb#629 class RBI::BlockParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (BlockParam node) -> void } -> void - # # @return [BlockParam] a new instance of BlockParam # - # source://rbi//lib/rbi/model.rb#646 + # source://rbi//lib/rbi/model.rb#631 sig do params( name: ::String, @@ -337,26 +270,20 @@ class RBI::BlockParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#658 + # source://rbi//lib/rbi/model.rb#643 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#653 + # source://rbi//lib/rbi/model.rb#638 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#204 +# source://rbi//lib/rbi/model.rb#195 class RBI::Class < ::RBI::Scope - # : (String name, ?superclass_name: String?, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Class node) -> void } -> void - # # @return [Class] a new instance of Class # - # source://rbi//lib/rbi/model.rb#212 + # source://rbi//lib/rbi/model.rb#203 sig do params( name: ::String, @@ -368,71 +295,48 @@ class RBI::Class < ::RBI::Scope end def initialize(name, superclass_name: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#362 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#371 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#221 + # source://rbi//lib/rbi/model.rb#212 sig { override.returns(::String) } def fully_qualified_name; end - # : String - # - # source://rbi//lib/rbi/model.rb#206 + # source://rbi//lib/rbi/model.rb#197 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#206 - # @return [String] + # source://rbi//lib/rbi/model.rb#197 def name=(_arg0); end - # : String? - # - # source://rbi//lib/rbi/model.rb#209 + # source://rbi//lib/rbi/model.rb#200 sig { returns(T.nilable(::String)) } def superclass_name; end - # : String? - # - # source://rbi//lib/rbi/model.rb#209 - # @return [String, nil] + # source://rbi//lib/rbi/model.rb#200 def superclass_name=(_arg0); end end -# source://rbi//lib/rbi/model.rb#54 +# source://rbi//lib/rbi/model.rb#51 class RBI::Comment < ::RBI::Node - # : (String text, ?loc: Loc?) -> void - # # @return [Comment] a new instance of Comment # - # source://rbi//lib/rbi/model.rb#59 + # source://rbi//lib/rbi/model.rb#56 sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(text, loc: T.unsafe(nil)); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#65 + # source://rbi//lib/rbi/model.rb#62 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#56 + # source://rbi//lib/rbi/model.rb#53 sig { returns(::String) } def text; end - # : String - # - # source://rbi//lib/rbi/model.rb#56 - # @return [String] + # source://rbi//lib/rbi/model.rb#53 def text=(_arg0); end end @@ -451,64 +355,38 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#546 -# A tree showing incompatibles nodes -# Is rendered as a merge conflict between `left` and` right`: -# ~~~rb -# class Foo -# <<<<<<< left -# def m1; end -# def m2(a); end -# ======= -# def m1(a); end -# def m2; end -# >>>>>>> right -# end +# source://rbi//lib/rbi/rewriters/merge_trees.rb#555 class RBI::ConflictTree < ::RBI::Tree - # : (?left_name: String, ?right_name: String) -> void - # # @return [ConflictTree] a new instance of ConflictTree # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#554 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#563 sig { params(left_name: ::String, right_name: ::String).void } def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end - # : Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#548 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#557 sig { returns(::RBI::Tree) } def left; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#551 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#560 sig { returns(::String) } def left_name; end - # : Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#548 - # @return [Tree] + # source://rbi//lib/rbi/rewriters/merge_trees.rb#557 def right; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#551 - # @return [String] + # source://rbi//lib/rbi/rewriters/merge_trees.rb#560 def right_name; end end # Consts # -# source://rbi//lib/rbi/model.rb#272 +# source://rbi//lib/rbi/model.rb#263 class RBI::Const < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Const node) -> void } -> void - # # @return [Const] a new instance of Const # - # source://rbi//lib/rbi/model.rb#277 + # source://rbi//lib/rbi/model.rb#268 sig do params( name: ::String, @@ -520,60 +398,45 @@ class RBI::Const < ::RBI::NodeWithComments end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#386 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#395 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#285 + # source://rbi//lib/rbi/model.rb#276 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#99 + # source://rbi//lib/rbi/index.rb#94 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#274 + # source://rbi//lib/rbi/model.rb#265 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#293 + # source://rbi//lib/rbi/model.rb#284 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#274 - # @return [String] + # source://rbi//lib/rbi/model.rb#265 def value; end end -# source://rbi//lib/rbi/rewriters/merge_trees.rb#332 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#341 class RBI::DuplicateNodeError < ::RBI::Error; end -# source://rbi//lib/rbi.rb#9 +# source://rbi//lib/rbi.rb#8 class RBI::Error < ::StandardError; end -# source://rbi//lib/rbi/model.rb#694 +# source://rbi//lib/rbi/model.rb#676 class RBI::Extend < ::RBI::Mixin include ::RBI::Indexable - # : (String name, *String names, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Extend node) -> void } -> void - # # @return [Extend] a new instance of Extend # - # source://rbi//lib/rbi/model.rb#696 + # source://rbi//lib/rbi/model.rb#678 sig do params( name: ::String, @@ -585,34 +448,26 @@ class RBI::Extend < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#479 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#488 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#139 + # source://rbi//lib/rbi/index.rb#134 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#703 + # source://rbi//lib/rbi/model.rb#685 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#137 +# source://rbi//lib/rbi/model.rb#131 class RBI::File - # : (?strictness: String?, ?comments: Array[Comment]) ?{ (File file) -> void } -> void - # # @return [File] a new instance of File # - # source://rbi//lib/rbi/model.rb#148 + # source://rbi//lib/rbi/model.rb#142 sig do params( strictness: T.nilable(::String), @@ -622,34 +477,23 @@ class RBI::File end def initialize(strictness: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/model.rb#156 + # source://rbi//lib/rbi/model.rb#150 sig { params(node: ::RBI::Node).void } def <<(node); end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#145 + # source://rbi//lib/rbi/model.rb#139 sig { returns(T::Array[::RBI::Comment]) } def comments; end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#145 - # @return [Array] + # source://rbi//lib/rbi/model.rb#139 def comments=(_arg0); end - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#161 + # source://rbi//lib/rbi/model.rb#155 sig { returns(T::Boolean) } def empty?; end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # # source://rbi//lib/rbi/printer.rb#817 sig do params( @@ -661,44 +505,28 @@ class RBI::File end def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1116 + # source://rbi//lib/rbi/rbs_printer.rb#1210 sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end - # : (?indent: Integer, ?print_locs: bool) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1122 + # source://rbi//lib/rbi/rbs_printer.rb#1216 sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) } def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end - # : Tree - # - # source://rbi//lib/rbi/model.rb#139 + # source://rbi//lib/rbi/model.rb#133 sig { returns(::RBI::Tree) } def root; end - # : Tree - # - # source://rbi//lib/rbi/model.rb#139 - # @return [Tree] + # source://rbi//lib/rbi/model.rb#133 def root=(_arg0); end - # : String? - # - # source://rbi//lib/rbi/model.rb#142 + # source://rbi//lib/rbi/model.rb#136 sig { returns(T.nilable(::String)) } def strictness; end - # : String? - # - # source://rbi//lib/rbi/model.rb#142 - # @return [String, nil] + # source://rbi//lib/rbi/model.rb#136 def strictness=(_arg0); end - # : (?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> String - # # source://rbi//lib/rbi/printer.rb#823 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end @@ -706,8 +534,6 @@ end # source://rbi//lib/rbi/formatter.rb#5 class RBI::Formatter - # : (?add_sig_templates: bool, ?group_nodes: bool, ?max_line_length: Integer?, ?nest_singleton_methods: bool, ?nest_non_public_members: bool, ?sort_nodes: bool, ?replace_attributes_with_methods: bool) -> void - # # @return [Formatter] a new instance of Formatter # # source://rbi//lib/rbi/formatter.rb#10 @@ -724,32 +550,21 @@ class RBI::Formatter end def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_members: T.unsafe(nil), sort_nodes: T.unsafe(nil), replace_attributes_with_methods: T.unsafe(nil)); end - # : (RBI::File file) -> void - # # source://rbi//lib/rbi/formatter.rb#35 sig { params(file: ::RBI::File).void } def format_file(file); end - # : (RBI::Tree tree) -> void - # # source://rbi//lib/rbi/formatter.rb#40 sig { params(tree: ::RBI::Tree).void } def format_tree(tree); end - # : Integer? - # # source://rbi//lib/rbi/formatter.rb#7 sig { returns(T.nilable(::Integer)) } def max_line_length; end - # : Integer? - # # source://rbi//lib/rbi/formatter.rb#7 - # @return [Integer, nil] def max_line_length=(_arg0); end - # : (RBI::File file) -> String - # # source://rbi//lib/rbi/formatter.rb#29 sig { params(file: ::RBI::File).returns(::String) } def print_file(file); end @@ -757,54 +572,78 @@ end # source://rbi//lib/rbi/rewriters/group_nodes.rb#84 class RBI::Group < ::RBI::Tree - # : (Kind kind) -> void - # # @return [Group] a new instance of Group # # source://rbi//lib/rbi/rewriters/group_nodes.rb#89 sig { params(kind: ::RBI::Group::Kind).void } def initialize(kind); end - # : Kind - # # source://rbi//lib/rbi/rewriters/group_nodes.rb#86 sig { returns(::RBI::Group::Kind) } def kind; end end # source://rbi//lib/rbi/rewriters/group_nodes.rb#94 -class RBI::Group::Kind < ::T::Enum - enums do - Attrs = new - Consts = new - Helpers = new - Inits = new - Methods = new - MixesInClassMethods = new - Mixins = new - RequiredAncestors = new - Sends = new - SingletonClasses = new - TEnums = new - TStructFields = new - TypeMembers = new +class RBI::Group::Kind + class << self + private + + # source://rbi//lib/rbi/rewriters/group_nodes.rb#109 + def new(*_arg0); end end end +# source://rbi//lib/rbi/rewriters/group_nodes.rb#101 +RBI::Group::Kind::Attrs = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#107 +RBI::Group::Kind::Consts = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#97 +RBI::Group::Kind::Helpers = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#104 +RBI::Group::Kind::Inits = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#105 +RBI::Group::Kind::Methods = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#99 +RBI::Group::Kind::MixesInClassMethods = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#95 +RBI::Group::Kind::Mixins = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#96 +RBI::Group::Kind::RequiredAncestors = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#100 +RBI::Group::Kind::Sends = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#106 +RBI::Group::Kind::SingletonClasses = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#103 +RBI::Group::Kind::TEnums = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#102 +RBI::Group::Kind::TStructFields = T.let(T.unsafe(nil), RBI::Group::Kind) + +# source://rbi//lib/rbi/rewriters/group_nodes.rb#98 +RBI::Group::Kind::TypeMembers = T.let(T.unsafe(nil), RBI::Group::Kind) + # source://rbi//lib/rbi/rewriters/group_nodes.rb#5 class RBI::GroupNodesError < ::RBI::Error; end # Sorbet's misc. # -# source://rbi//lib/rbi/model.rb#1069 +# source://rbi//lib/rbi/model.rb#1045 class RBI::Helper < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Helper node) -> void } -> void - # # @return [Helper] a new instance of Helper # - # source://rbi//lib/rbi/model.rb#1074 + # source://rbi//lib/rbi/model.rb#1050 sig do params( name: ::String, @@ -815,42 +654,32 @@ class RBI::Helper < ::RBI::NodeWithComments end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#495 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#504 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#169 + # source://rbi//lib/rbi/index.rb#164 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1071 + # source://rbi//lib/rbi/model.rb#1047 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1082 + # source://rbi//lib/rbi/model.rb#1058 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#680 +# source://rbi//lib/rbi/model.rb#662 class RBI::Include < ::RBI::Mixin include ::RBI::Indexable - # : (String name, *String names, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Include node) -> void } -> void - # # @return [Include] a new instance of Include # - # source://rbi//lib/rbi/model.rb#682 + # source://rbi//lib/rbi/model.rb#664 sig do params( name: ::String, @@ -862,73 +691,53 @@ class RBI::Include < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#471 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#480 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#129 + # source://rbi//lib/rbi/index.rb#124 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#689 + # source://rbi//lib/rbi/model.rb#671 sig { override.returns(::String) } def to_s; end end # source://rbi//lib/rbi/index.rb#5 class RBI::Index < ::RBI::Visitor - # : -> void - # # @return [Index] a new instance of Index # - # source://rbi//lib/rbi/index.rb#18 + # source://rbi//lib/rbi/index.rb#16 sig { void } def initialize; end - # : (String id) -> Array[Node] - # - # source://rbi//lib/rbi/index.rb#29 + # source://rbi//lib/rbi/index.rb#27 sig { params(id: ::String).returns(T::Array[::RBI::Node]) } def [](id); end - # : (*Node nodes) -> void - # - # source://rbi//lib/rbi/index.rb#34 + # source://rbi//lib/rbi/index.rb#32 sig { params(nodes: ::RBI::Node).void } def index(*nodes); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#24 + # source://rbi//lib/rbi/index.rb#22 sig { returns(T::Array[::String]) } def keys; end - # : (Node? node) -> void - # - # source://rbi//lib/rbi/index.rb#40 + # source://rbi//lib/rbi/index.rb#38 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : ((Indexable & Node) node) -> void - # - # source://rbi//lib/rbi/index.rb#57 + # source://rbi//lib/rbi/index.rb#55 sig { params(node: T.all(::RBI::Indexable, ::RBI::Node)).void } def index_node(node); end class << self - # : (*Node node) -> Index - # - # source://rbi//lib/rbi/index.rb#10 + # source://rbi//lib/rbi/index.rb#8 sig { params(node: ::RBI::Node).returns(::RBI::Index) } def index(*node); end end @@ -936,9 +745,7 @@ end # A Node that can be referred to by a unique ID inside an index # -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://rbi//lib/rbi/index.rb#70 +# source://rbi//lib/rbi/index.rb#69 module RBI::Indexable interface! @@ -949,49 +756,37 @@ module RBI::Indexable # # @abstract # - # source://rbi//lib/rbi/index.rb#81 - # Unique IDs that refer to this node. - # Some nodes can have multiple ids, for example an attribute accessor matches the ID of the + # source://rbi//lib/rbi/index.rb#76 sig { abstract.returns(T::Array[::String]) } def index_ids; end end -# source://rbi//lib/rbi/model.rb#825 +# source://rbi//lib/rbi/model.rb#804 class RBI::KwArg < ::RBI::Arg - # : (String keyword, String value, ?loc: Loc?) -> void - # # @return [KwArg] a new instance of KwArg # - # source://rbi//lib/rbi/model.rb#830 + # source://rbi//lib/rbi/model.rb#809 sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(keyword, value, loc: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#836 + # source://rbi//lib/rbi/model.rb#815 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#827 + # source://rbi//lib/rbi/model.rb#806 sig { returns(::String) } def keyword; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#841 + # source://rbi//lib/rbi/model.rb#820 sig { returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#602 +# source://rbi//lib/rbi/model.rb#587 class RBI::KwOptParam < ::RBI::Param - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwOptParam node) -> void } -> void - # # @return [KwOptParam] a new instance of KwOptParam # - # source://rbi//lib/rbi/model.rb#607 + # source://rbi//lib/rbi/model.rb#592 sig do params( name: ::String, @@ -1003,32 +798,24 @@ class RBI::KwOptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#620 + # source://rbi//lib/rbi/model.rb#605 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#615 + # source://rbi//lib/rbi/model.rb#600 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#604 + # source://rbi//lib/rbi/model.rb#589 sig { returns(::String) } def value; end end -# source://rbi//lib/rbi/model.rb#583 +# source://rbi//lib/rbi/model.rb#568 class RBI::KwParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwParam node) -> void } -> void - # # @return [KwParam] a new instance of KwParam # - # source://rbi//lib/rbi/model.rb#585 + # source://rbi//lib/rbi/model.rb#570 sig do params( name: ::String, @@ -1039,26 +826,20 @@ class RBI::KwParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#597 + # source://rbi//lib/rbi/model.rb#582 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#592 + # source://rbi//lib/rbi/model.rb#577 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#625 +# source://rbi//lib/rbi/model.rb#610 class RBI::KwRestParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (KwRestParam node) -> void } -> void - # # @return [KwRestParam] a new instance of KwRestParam # - # source://rbi//lib/rbi/model.rb#627 + # source://rbi//lib/rbi/model.rb#612 sig do params( name: ::String, @@ -1069,23 +850,17 @@ class RBI::KwRestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#639 + # source://rbi//lib/rbi/model.rb#624 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#634 + # source://rbi//lib/rbi/model.rb#619 sig { override.returns(::String) } def to_s; end end # source://rbi//lib/rbi/loc.rb#5 class RBI::Loc - # : (?file: String?, ?begin_line: Integer?, ?end_line: Integer?, ?begin_column: Integer?, ?end_column: Integer?) -> void - # # @return [Loc] a new instance of Loc # # source://rbi//lib/rbi/loc.rb#26 @@ -1100,51 +875,36 @@ class RBI::Loc end def initialize(file: T.unsafe(nil), begin_line: T.unsafe(nil), end_line: T.unsafe(nil), begin_column: T.unsafe(nil), end_column: T.unsafe(nil)); end - # : Integer? - # # source://rbi//lib/rbi/loc.rb#23 - # @return [Integer, nil] def begin_column; end - # : Integer? - # # source://rbi//lib/rbi/loc.rb#23 sig { returns(T.nilable(::Integer)) } def begin_line; end - # : Integer? - # # source://rbi//lib/rbi/loc.rb#23 - # @return [Integer, nil] def end_column; end - # : Integer? - # # source://rbi//lib/rbi/loc.rb#23 - # @return [Integer, nil] def end_line; end - # : String? - # # source://rbi//lib/rbi/loc.rb#20 sig { returns(T.nilable(::String)) } def file; end - # : -> String? - # - # source://rbi//lib/rbi/loc.rb#44 + # source://rbi//lib/rbi/loc.rb#35 + sig { params(other: ::RBI::Loc).returns(::RBI::Loc) } + def join(other); end + + # source://rbi//lib/rbi/loc.rb#55 sig { returns(T.nilable(::String)) } def source; end - # : -> String - # - # source://rbi//lib/rbi/loc.rb#35 + # source://rbi//lib/rbi/loc.rb#46 sig { returns(::String) } def to_s; end class << self - # : (String file, Prism::Location prism_location) -> Loc - # # source://rbi//lib/rbi/loc.rb#8 sig { params(file: ::String, prism_location: ::Prism::Location).returns(::RBI::Loc) } def from_prism(file, prism_location); end @@ -1153,13 +913,11 @@ end # A tree that _might_ contain conflicts # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#320 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#329 class RBI::MergeTree < ::RBI::Tree - # : (?loc: Loc?, ?comments: Array[Comment], ?conflicts: Array[Rewriters::Merge::Conflict]) ?{ (Tree node) -> void } -> void - # # @return [MergeTree] a new instance of MergeTree # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#325 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#334 sig do params( loc: T.nilable(::RBI::Loc), @@ -1170,24 +928,20 @@ class RBI::MergeTree < ::RBI::Tree end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), conflicts: T.unsafe(nil), &block); end - # : Array[Rewriters::Merge::Conflict] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#322 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#331 sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } def conflicts; end end # Methods and args # -# source://rbi//lib/rbi/model.rb#395 +# source://rbi//lib/rbi/model.rb#383 class RBI::Method < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?params: Array[Param], ?is_singleton: bool, ?visibility: Visibility, ?sigs: Array[Sig], ?loc: Loc?, ?comments: Array[Comment]) ?{ (Method node) -> void } -> void - # # @return [Method] a new instance of Method # - # source://rbi//lib/rbi/model.rb#412 + # source://rbi//lib/rbi/model.rb#400 sig do params( name: ::String, @@ -1202,57 +956,39 @@ class RBI::Method < ::RBI::NodeWithComments end def initialize(name, params: T.unsafe(nil), is_singleton: T.unsafe(nil), visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Param param) -> void - # - # source://rbi//lib/rbi/model.rb#432 + # source://rbi//lib/rbi/model.rb#420 sig { params(param: ::RBI::Param).void } def <<(param); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#467 + # source://rbi//lib/rbi/model.rb#455 sig { params(name: ::String).void } def add_block_param(name); end - # : (String name, String default_value) -> void - # - # source://rbi//lib/rbi/model.rb#457 + # source://rbi//lib/rbi/model.rb#445 sig { params(name: ::String, default_value: ::String).void } def add_kw_opt_param(name, default_value); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#452 + # source://rbi//lib/rbi/model.rb#440 sig { params(name: ::String).void } def add_kw_param(name); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#462 + # source://rbi//lib/rbi/model.rb#450 sig { params(name: ::String).void } def add_kw_rest_param(name); end - # : (String name, String default_value) -> void - # - # source://rbi//lib/rbi/model.rb#442 + # source://rbi//lib/rbi/model.rb#430 sig { params(name: ::String, default_value: ::String).void } def add_opt_param(name, default_value); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#437 + # source://rbi//lib/rbi/model.rb#425 sig { params(name: ::String).void } def add_param(name); end - # : (String name) -> void - # - # source://rbi//lib/rbi/model.rb#447 + # source://rbi//lib/rbi/model.rb#435 sig { params(name: ::String).void } def add_rest_param(name); end - # : (?params: Array[SigParam], ?return_type: (String | Type), ?is_abstract: bool, ?is_override: bool, ?is_overridable: bool, ?is_final: bool, ?type_params: Array[String], ?checked: Symbol?) ?{ (Sig node) -> void } -> void - # - # source://rbi//lib/rbi/model.rb#472 + # source://rbi//lib/rbi/model.rb#460 sig do params( params: T::Array[::RBI::SigParam], @@ -1268,102 +1004,68 @@ class RBI::Method < ::RBI::NodeWithComments end def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#440 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#449 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#498 + # source://rbi//lib/rbi/model.rb#486 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#119 + # source://rbi//lib/rbi/index.rb#114 sig { override.returns(T::Array[::String]) } def index_ids; end - # : bool - # - # source://rbi//lib/rbi/model.rb#403 + # source://rbi//lib/rbi/model.rb#391 sig { returns(T::Boolean) } def is_singleton; end - # : bool - # - # source://rbi//lib/rbi/model.rb#403 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#391 def is_singleton=(_arg0); end - # : (Node other) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#450 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#459 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#397 + # source://rbi//lib/rbi/model.rb#385 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#397 - # @return [String] + # source://rbi//lib/rbi/model.rb#385 def name=(_arg0); end - # : Array[Param] - # - # source://rbi//lib/rbi/model.rb#400 + # source://rbi//lib/rbi/model.rb#388 sig { returns(T::Array[::RBI::Param]) } def params; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#409 + # source://rbi//lib/rbi/model.rb#397 sig { returns(T::Array[::RBI::Sig]) } def sigs; end - # : Array[Sig] - # - # source://rbi//lib/rbi/model.rb#409 - # @return [Array] + # source://rbi//lib/rbi/model.rb#397 def sigs=(_arg0); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#508 + # source://rbi//lib/rbi/model.rb#496 sig { override.returns(::String) } def to_s; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#406 + # source://rbi//lib/rbi/model.rb#394 sig { returns(::RBI::Visibility) } def visibility; end - # : Visibility - # - # source://rbi//lib/rbi/model.rb#406 - # @return [Visibility] + # source://rbi//lib/rbi/model.rb#394 def visibility=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1113 +# source://rbi//lib/rbi/model.rb#1089 class RBI::MixesInClassMethods < ::RBI::Mixin include ::RBI::Indexable - # : (String name, *String names, ?loc: Loc?, ?comments: Array[Comment]) ?{ (MixesInClassMethods node) -> void } -> void - # # @return [MixesInClassMethods] a new instance of MixesInClassMethods # - # source://rbi//lib/rbi/model.rb#1115 + # source://rbi//lib/rbi/model.rb#1091 sig do params( name: ::String, @@ -1375,40 +1077,30 @@ class RBI::MixesInClassMethods < ::RBI::Mixin end def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#487 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#496 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#149 + # source://rbi//lib/rbi/index.rb#144 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1122 + # source://rbi//lib/rbi/model.rb#1098 sig { override.returns(::String) } def to_s; end end -# Mixins +# @abstract # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://rbi//lib/rbi/model.rb#665 +# source://rbi//lib/rbi/model.rb#651 class RBI::Mixin < ::RBI::NodeWithComments abstract! - # : (String name, Array[String] names, ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [Mixin] a new instance of Mixin # - # source://rbi//lib/rbi/model.rb#674 + # source://rbi//lib/rbi/model.rb#656 sig do params( name: ::String, @@ -1419,28 +1111,22 @@ class RBI::Mixin < ::RBI::NodeWithComments end def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#463 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#472 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : Array[String] - # - # source://rbi//lib/rbi/model.rb#671 + # source://rbi//lib/rbi/model.rb#653 sig { returns(T::Array[::String]) } def names; end end -# source://rbi//lib/rbi/model.rb#184 +# source://rbi//lib/rbi/model.rb#175 class RBI::Module < ::RBI::Scope - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Module node) -> void } -> void - # # @return [Module] a new instance of Module # - # source://rbi//lib/rbi/model.rb#189 + # source://rbi//lib/rbi/model.rb#180 sig do params( name: ::String, @@ -1451,109 +1137,76 @@ class RBI::Module < ::RBI::Scope end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#370 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#379 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#197 + # source://rbi//lib/rbi/model.rb#188 sig { override.returns(::String) } def fully_qualified_name; end - # : String - # - # source://rbi//lib/rbi/model.rb#186 + # source://rbi//lib/rbi/model.rb#177 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#186 - # @return [String] + # source://rbi//lib/rbi/model.rb#177 def name=(_arg0); end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/model.rb#7 +# source://rbi//lib/rbi/model.rb#8 class RBI::Node abstract! - # : (?loc: Loc?) -> void - # # @return [Node] a new instance of Node # - # source://rbi//lib/rbi/model.rb#19 + # source://rbi//lib/rbi/model.rb#16 sig { params(loc: T.nilable(::RBI::Loc)).void } def initialize(loc: T.unsafe(nil)); end # Can `self` and `_other` be merged into a single definition? - # : (Node _other) -> bool # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#280 - # Can `self` and `_other` be merged into a single definition? + # source://rbi//lib/rbi/rewriters/merge_trees.rb#289 sig { params(_other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(_other); end - # : -> void - # - # source://rbi//lib/rbi/model.rb#25 + # source://rbi//lib/rbi/model.rb#22 sig { void } def detach; end - # : Loc? - # - # source://rbi//lib/rbi/model.rb#16 + # source://rbi//lib/rbi/model.rb#13 sig { returns(T.nilable(::RBI::Loc)) } def loc; end - # : Loc? - # - # source://rbi//lib/rbi/model.rb#16 - # @return [Loc, nil] + # source://rbi//lib/rbi/model.rb#13 def loc=(_arg0); end # Merge `self` and `other` into a single definition - # : (Node other) -> void # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#286 - # Merge `self` and `other` into a single definition + # source://rbi//lib/rbi/rewriters/merge_trees.rb#295 sig { params(other: ::RBI::Node).void } def merge_with(other); end - # : -> ConflictTree? - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#289 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#298 sig { returns(T.nilable(::RBI::ConflictTree)) } def parent_conflict_tree; end - # : -> Scope? - # - # source://rbi//lib/rbi/model.rb#47 + # source://rbi//lib/rbi/model.rb#44 sig { returns(T.nilable(::RBI::Scope)) } def parent_scope; end - # : Tree? - # - # source://rbi//lib/rbi/model.rb#13 + # source://rbi//lib/rbi/model.rb#10 sig { returns(T.nilable(::RBI::Tree)) } def parent_tree; end - # : Tree? - # - # source://rbi//lib/rbi/model.rb#13 - # @return [Tree, nil] + # source://rbi//lib/rbi/model.rb#10 def parent_tree=(_arg0); end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # # source://rbi//lib/rbi/printer.rb#832 sig do params( @@ -1565,9 +1218,7 @@ class RBI::Node end def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?positional_names: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1131 + # source://rbi//lib/rbi/rbs_printer.rb#1225 sig do params( out: T.any(::IO, ::StringIO), @@ -1578,87 +1229,64 @@ class RBI::Node end def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end - # : (?indent: Integer, ?print_locs: bool, ?positional_names: bool) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1137 + # source://rbi//lib/rbi/rbs_printer.rb#1231 sig { params(indent: ::Integer, print_locs: T::Boolean, positional_names: T::Boolean).returns(::String) } def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end - # : (Node node) -> void - # # @raise [ReplaceNodeError] # - # source://rbi//lib/rbi/model.rb#34 + # source://rbi//lib/rbi/model.rb#31 sig { params(node: ::RBI::Node).void } def replace(node); end - # : (Gem::Version version) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/rewriters/filter_versions.rb#91 sig { params(version: ::Gem::Version).returns(T::Boolean) } def satisfies_version?(version); end - # : (?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> String - # # source://rbi//lib/rbi/printer.rb#838 sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) } def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/model.rb#90 +# source://rbi//lib/rbi/model.rb#88 class RBI::NodeWithComments < ::RBI::Node abstract! - # : (?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [NodeWithComments] a new instance of NodeWithComments # - # source://rbi//lib/rbi/model.rb#99 + # source://rbi//lib/rbi/model.rb#93 sig { params(loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#105 + # source://rbi//lib/rbi/model.rb#99 sig { returns(T::Array[::String]) } def annotations; end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#96 + # source://rbi//lib/rbi/model.rb#90 sig { returns(T::Array[::RBI::Comment]) } def comments; end - # : Array[Comment] - # - # source://rbi//lib/rbi/model.rb#96 - # @return [Array] + # source://rbi//lib/rbi/model.rb#90 def comments=(_arg0); end - # : (Node other) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#303 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#312 sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # : -> Array[Gem::Requirement] - # # source://rbi//lib/rbi/rewriters/filter_versions.rb#101 sig { returns(T::Array[::Gem::Requirement]) } def version_requirements; end end -# source://rbi//lib/rbi/model.rb#547 +# source://rbi//lib/rbi/model.rb#532 class RBI::OptParam < ::RBI::Param - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (OptParam node) -> void } -> void - # # @return [OptParam] a new instance of OptParam # - # source://rbi//lib/rbi/model.rb#552 + # source://rbi//lib/rbi/model.rb#537 sig do params( name: ::String, @@ -1670,58 +1298,44 @@ class RBI::OptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#559 + # source://rbi//lib/rbi/model.rb#544 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#549 + # source://rbi//lib/rbi/model.rb#534 sig { returns(::String) } def value; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/model.rb#513 +# source://rbi//lib/rbi/model.rb#502 class RBI::Param < ::RBI::NodeWithComments abstract! - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [Param] a new instance of Param # - # source://rbi//lib/rbi/model.rb#522 + # source://rbi//lib/rbi/model.rb#507 sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : String - # - # source://rbi//lib/rbi/model.rb#519 + # source://rbi//lib/rbi/model.rb#504 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#529 + # source://rbi//lib/rbi/model.rb#514 sig { override.returns(::String) } def to_s; end end # source://rbi//lib/rbi/parser.rb#7 class RBI::ParseError < ::RBI::Error - # : (String message, Loc location) -> void - # # @return [ParseError] a new instance of ParseError # # source://rbi//lib/rbi/parser.rb#12 sig { params(message: ::String, location: ::RBI::Loc).void } def initialize(message, location); end - # : Loc - # # source://rbi//lib/rbi/parser.rb#9 sig { returns(::RBI::Loc) } def location; end @@ -1729,191 +1343,135 @@ end # source://rbi//lib/rbi/parser.rb#49 class RBI::Parser - # : (String path) -> Tree - # # source://rbi//lib/rbi/parser.rb#80 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # : (String string) -> Tree - # # source://rbi//lib/rbi/parser.rb#75 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end private - # : (String source, file: String) -> Tree - # # source://rbi//lib/rbi/parser.rb#87 sig { params(source: ::String, file: ::String).returns(::RBI::Tree) } def parse(source, file:); end class << self - # : (String path) -> Tree - # # source://rbi//lib/rbi/parser.rb#57 sig { params(path: ::String).returns(::RBI::Tree) } def parse_file(path); end - # : (Array[String] paths) -> Array[Tree] - # # source://rbi//lib/rbi/parser.rb#62 sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_files(paths); end - # : (String string) -> Tree - # # source://rbi//lib/rbi/parser.rb#52 sig { params(string: ::String).returns(::RBI::Tree) } def parse_string(string); end - # : (Array[String] strings) -> Array[Tree] - # # source://rbi//lib/rbi/parser.rb#68 sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) } def parse_strings(strings); end end end -# source://rbi//lib/rbi/parser.rb#970 +# source://rbi//lib/rbi/parser.rb#1000 class RBI::Parser::HeredocLocationVisitor < ::Prism::Visitor - # : (Prism::Source source, Integer begin_offset, Integer end_offset) -> void - # # @return [HeredocLocationVisitor] a new instance of HeredocLocationVisitor # - # source://rbi//lib/rbi/parser.rb#972 + # source://rbi//lib/rbi/parser.rb#1002 sig { params(source: ::Prism::Source, begin_offset: ::Integer, end_offset: ::Integer).void } def initialize(source, begin_offset, end_offset); end - # : -> Prism::Location - # - # source://rbi//lib/rbi/parser.rb#1003 + # source://rbi//lib/rbi/parser.rb#1033 sig { returns(::Prism::Location) } def location; end - # : (Prism::InterpolatedStringNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#993 + # source://rbi//lib/rbi/parser.rb#1023 sig { override.params(node: ::Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end - # : (Prism::StringNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#982 + # source://rbi//lib/rbi/parser.rb#1012 sig { override.params(node: ::Prism::StringNode).void } def visit_string_node(node); end private - # : (Prism::StringNode | Prism::InterpolatedStringNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#1014 + # source://rbi//lib/rbi/parser.rb#1044 sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void } def handle_string_node(node); end end -# source://rbi//lib/rbi/parser.rb#885 +# source://rbi//lib/rbi/parser.rb#915 class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor - # : (String content, file: String) -> void - # # @return [SigBuilder] a new instance of SigBuilder # - # source://rbi//lib/rbi/parser.rb#890 + # source://rbi//lib/rbi/parser.rb#920 sig { params(content: ::String, file: ::String).void } def initialize(content, file:); end - # : Sig - # - # source://rbi//lib/rbi/parser.rb#887 + # source://rbi//lib/rbi/parser.rb#917 sig { returns(::RBI::Sig) } def current; end - # : (Prism::AssocNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#962 + # source://rbi//lib/rbi/parser.rb#992 sig { override.params(node: ::Prism::AssocNode).void } def visit_assoc_node(node); end - # : (Prism::CallNode node) -> void - # - # source://rbi//lib/rbi/parser.rb#898 + # source://rbi//lib/rbi/parser.rb#928 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end end # source://rbi//lib/rbi/parser.rb#164 class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor - # : (String source, comments: Array[Prism::Comment], file: String) -> void - # # @return [TreeBuilder] a new instance of TreeBuilder # # source://rbi//lib/rbi/parser.rb#172 sig { params(source: ::String, comments: T::Array[::Prism::Comment], file: ::String).void } def initialize(source, comments:, file:); end - # : Prism::Node? - # # source://rbi//lib/rbi/parser.rb#169 sig { returns(T.nilable(::Prism::Node)) } def last_node; end - # : Tree - # # source://rbi//lib/rbi/parser.rb#166 sig { returns(::RBI::Tree) } def tree; end - # : (Prism::CallNode node) -> void - # # source://rbi//lib/rbi/parser.rb#361 sig { params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # : (Prism::ClassNode node) -> void - # # source://rbi//lib/rbi/parser.rb#185 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # : ((Prism::ConstantWriteNode | Prism::ConstantPathWriteNode) node) -> void - # # source://rbi//lib/rbi/parser.rb#236 sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void } def visit_constant_assign(node); end - # : (Prism::ConstantPathWriteNode node) -> void - # # source://rbi//lib/rbi/parser.rb#229 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # : (Prism::ConstantWriteNode node) -> void - # # source://rbi//lib/rbi/parser.rb#221 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # : (Prism::DefNode node) -> void - # # source://rbi//lib/rbi/parser.rb#291 sig { override.params(node: ::Prism::DefNode).void } def visit_def_node(node); end - # : (Prism::ModuleNode node) -> void - # # source://rbi//lib/rbi/parser.rb#313 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # : (Prism::ProgramNode node) -> void - # # source://rbi//lib/rbi/parser.rb#332 sig { override.params(node: ::Prism::ProgramNode).void } def visit_program_node(node); end - # : (Prism::SingletonClassNode node) -> void - # # source://rbi//lib/rbi/parser.rb#344 sig { override.params(node: ::Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end @@ -1921,72 +1479,50 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor private # Collect all the remaining comments within a node - # : (Prism::Node node) -> void # # source://rbi//lib/rbi/parser.rb#539 - # Collect all the remaining comments within a node sig { params(node: ::Prism::Node).void } def collect_dangling_comments(node); end # Collect all the remaining comments after visiting the tree - # : -> void # # source://rbi//lib/rbi/parser.rb#557 - # Collect all the remaining comments after visiting the tree sig { void } def collect_orphan_comments; end - # : -> Tree - # # source://rbi//lib/rbi/parser.rb#580 sig { returns(::RBI::Tree) } def current_scope; end - # : -> Array[Sig] - # # source://rbi//lib/rbi/parser.rb#585 sig { returns(T::Array[::RBI::Sig]) } def current_sigs; end - # : (Array[Sig] sigs) -> Array[Comment] - # # source://rbi//lib/rbi/parser.rb#592 sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } def detach_comments_from_sigs(sigs); end - # : (Prism::Node node) -> Array[Comment] - # # source://rbi//lib/rbi/parser.rb#604 sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) } def node_comments(node); end - # : (Prism::Comment node) -> Comment - # - # source://rbi//lib/rbi/parser.rb#622 + # source://rbi//lib/rbi/parser.rb#666 sig { params(node: ::Prism::Comment).returns(::RBI::Comment) } def parse_comment(node); end - # : (Prism::Node? node) -> Array[Param] - # - # source://rbi//lib/rbi/parser.rb#661 + # source://rbi//lib/rbi/parser.rb#699 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) } def parse_params(node); end - # : (Prism::Node? node) -> Array[Arg] - # - # source://rbi//lib/rbi/parser.rb#635 + # source://rbi//lib/rbi/parser.rb#673 sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) } def parse_send_args(node); end - # : (Prism::CallNode node) -> Sig - # - # source://rbi//lib/rbi/parser.rb#735 + # source://rbi//lib/rbi/parser.rb#765 sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) } def parse_sig(node); end - # : ((Prism::ConstantWriteNode | Prism::ConstantPathWriteNode) node) -> Struct? - # - # source://rbi//lib/rbi/parser.rb#744 + # source://rbi//lib/rbi/parser.rb#774 sig do params( node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode) @@ -1994,51 +1530,37 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor end def parse_struct(node); end - # : (Prism::CallNode send) -> void - # - # source://rbi//lib/rbi/parser.rb#792 + # source://rbi//lib/rbi/parser.rb#822 sig { params(send: ::Prism::CallNode).void } def parse_tstruct_field(send); end - # : (String name, Prism::Node node) -> Visibility - # - # source://rbi//lib/rbi/parser.rb#829 + # source://rbi//lib/rbi/parser.rb#859 sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) } def parse_visibility(name, node); end - # : -> void - # - # source://rbi//lib/rbi/parser.rb#843 + # source://rbi//lib/rbi/parser.rb#873 sig { void } def separate_header_comments; end - # : -> void - # - # source://rbi//lib/rbi/parser.rb#853 + # source://rbi//lib/rbi/parser.rb#883 sig { void } def set_root_tree_loc; end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/parser.rb#872 + # source://rbi//lib/rbi/parser.rb#902 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_enum_value?(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/parser.rb#867 + # source://rbi//lib/rbi/parser.rb#897 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def type_variable_definition?(node); end end # source://rbi//lib/rbi/parser.rb#114 class RBI::Parser::Visitor < ::Prism::Visitor - # : (String source, file: String) -> void - # # @return [Visitor] a new instance of Visitor # # source://rbi//lib/rbi/parser.rb#116 @@ -2047,40 +1569,28 @@ class RBI::Parser::Visitor < ::Prism::Visitor private - # : (Prism::Node node) -> Prism::Location - # # source://rbi//lib/rbi/parser.rb#143 sig { params(node: ::Prism::Node).returns(::Prism::Location) } def adjust_prism_location_for_heredoc(node); end - # : (Prism::Node node) -> Loc - # # source://rbi//lib/rbi/parser.rb#126 sig { params(node: ::Prism::Node).returns(::RBI::Loc) } def node_loc(node); end - # : (Prism::Node? node) -> String? - # # source://rbi//lib/rbi/parser.rb#131 sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) } def node_string(node); end - # : (Prism::Node node) -> String - # # source://rbi//lib/rbi/parser.rb#138 sig { params(node: ::Prism::Node).returns(::String) } def node_string!(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/parser.rb#154 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def self?(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/parser.rb#159 @@ -2090,8 +1600,6 @@ end # source://rbi//lib/rbi/printer.rb#7 class RBI::Printer < ::RBI::Visitor - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?max_line_length: Integer?) -> void - # # @return [Printer] a new instance of Printer # # source://rbi//lib/rbi/printer.rb#21 @@ -2105,459 +1613,307 @@ class RBI::Printer < ::RBI::Visitor end def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : Integer - # # source://rbi//lib/rbi/printer.rb#15 sig { returns(::Integer) } def current_indent; end - # : -> void - # # source://rbi//lib/rbi/printer.rb#39 sig { void } def dedent; end - # : bool - # # source://rbi//lib/rbi/printer.rb#9 - # @return [Boolean] def in_visibility_group; end - # : bool - # # source://rbi//lib/rbi/printer.rb#9 - # @return [Boolean] def in_visibility_group=(_arg0); end - # : -> void - # # source://rbi//lib/rbi/printer.rb#34 - # Printing sig { void } def indent; end - # : Integer? - # # source://rbi//lib/rbi/printer.rb#18 sig { returns(T.nilable(::Integer)) } def max_line_length; end - # : Node? - # # source://rbi//lib/rbi/printer.rb#12 sig { returns(T.nilable(::RBI::Node)) } def previous_node; end # Print a string without indentation nor `\n` at the end. - # : (String string) -> void # # source://rbi//lib/rbi/printer.rb#45 - # Print a string without indentation nor `\n` at the end. sig { params(string: ::String).void } def print(string); end - # : bool - # # source://rbi//lib/rbi/printer.rb#9 sig { returns(T::Boolean) } def print_locs; end - # : bool - # # source://rbi//lib/rbi/printer.rb#9 - # @return [Boolean] def print_locs=(_arg0); end # Print a string with indentation and `\n` at the end. - # : (String string) -> void # # source://rbi//lib/rbi/printer.rb#65 - # Print a string with indentation and `\n` at the end. sig { params(string: ::String).void } def printl(string); end # Print a string without indentation but with a `\n` at the end. - # : (?String? string) -> void # # source://rbi//lib/rbi/printer.rb#51 - # Print a string without indentation but with a `\n` at the end. sig { params(string: T.nilable(::String)).void } def printn(string = T.unsafe(nil)); end # Print a string with indentation but without a `\n` at the end. - # : (?String? string) -> void # # source://rbi//lib/rbi/printer.rb#58 - # Print a string with indentation but without a `\n` at the end. sig { params(string: T.nilable(::String)).void } def printt(string = T.unsafe(nil)); end - # : (Array[Node] nodes) -> void - # # source://rbi//lib/rbi/printer.rb#72 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (File file) -> void - # # source://rbi//lib/rbi/printer.rb#84 sig { override.params(file: ::RBI::File).void } def visit_file(file); end private - # : (Node node) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/printer.rb#680 sig { params(node: ::RBI::Node).returns(T::Boolean) } def oneline?(node); end - # : (Node node) -> void - # # source://rbi//lib/rbi/printer.rb#638 sig { params(node: ::RBI::Node).void } def print_blank_line_before(node); end - # : (Node node) -> void - # # source://rbi//lib/rbi/printer.rb#648 sig { params(node: ::RBI::Node).void } def print_loc(node); end - # : (Param node, last: bool) -> void - # # source://rbi//lib/rbi/printer.rb#654 sig { params(node: ::RBI::Param, last: T::Boolean).void } def print_param_comment_leading_space(node, last:); end - # : (Sig node) -> void - # # source://rbi//lib/rbi/printer.rb#736 sig { params(node: ::RBI::Sig).void } def print_sig_as_block(node); end - # : (Sig node) -> void - # # source://rbi//lib/rbi/printer.rb#709 sig { params(node: ::RBI::Sig).void } def print_sig_as_line(node); end - # : (SigParam node, last: bool) -> void - # # source://rbi//lib/rbi/printer.rb#672 sig { params(node: ::RBI::SigParam, last: T::Boolean).void } def print_sig_param_comment_leading_space(node, last:); end - # : (Sig node) -> Array[String] - # # source://rbi//lib/rbi/printer.rb#796 sig { params(node: ::RBI::Sig).returns(T::Array[::String]) } def sig_modifiers(node); end - # : (Arg node) -> void - # # source://rbi//lib/rbi/printer.rb#453 sig { override.params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (Attr node) -> void - # # source://rbi//lib/rbi/printer.rb#258 sig { params(node: ::RBI::Attr).void } def visit_attr(node); end - # : (AttrAccessor node) -> void - # # source://rbi//lib/rbi/printer.rb#241 sig { override.params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void - # # source://rbi//lib/rbi/printer.rb#247 sig { override.params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void - # # source://rbi//lib/rbi/printer.rb#253 sig { override.params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void - # # source://rbi//lib/rbi/printer.rb#138 sig { override.params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void - # # source://rbi//lib/rbi/printer.rb#373 sig { override.params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void - # # source://rbi//lib/rbi/printer.rb#158 sig { override.params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void - # # source://rbi//lib/rbi/printer.rb#121 sig { override.params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void - # # source://rbi//lib/rbi/printer.rb#614 sig { override.params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void - # # source://rbi//lib/rbi/printer.rb#231 sig { override.params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void - # # source://rbi//lib/rbi/printer.rb#385 sig { override.params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (Group node) -> void - # # source://rbi//lib/rbi/printer.rb#583 sig { override.params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void - # # source://rbi//lib/rbi/printer.rb#567 sig { override.params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void - # # source://rbi//lib/rbi/printer.rb#379 sig { override.params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void - # # source://rbi//lib/rbi/printer.rb#459 sig { override.params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void - # # source://rbi//lib/rbi/printer.rb#361 sig { override.params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void - # # source://rbi//lib/rbi/printer.rb#355 sig { override.params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void - # # source://rbi//lib/rbi/printer.rb#367 sig { override.params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void - # # source://rbi//lib/rbi/printer.rb#287 sig { override.params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void - # # source://rbi//lib/rbi/printer.rb#577 sig { override.params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Mixin node) -> void - # # source://rbi//lib/rbi/printer.rb#390 sig { params(node: ::RBI::Mixin).void } def visit_mixin(node); end - # : (Module node) -> void - # # source://rbi//lib/rbi/printer.rb#152 sig { override.params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void - # # source://rbi//lib/rbi/printer.rb#343 sig { override.params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void - # # source://rbi//lib/rbi/printer.rb#420 sig { override.params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void - # # source://rbi//lib/rbi/printer.rb#414 sig { override.params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void - # # source://rbi//lib/rbi/printer.rb#408 sig { override.params(node: ::RBI::Public).void } def visit_public(node); end - # : (RBSComment node) -> void - # # source://rbi//lib/rbi/printer.rb#104 sig { override.params(node: ::RBI::RBSComment).void } def visit_rbs_comment(node); end - # : (ReqParam node) -> void - # # source://rbi//lib/rbi/printer.rb#337 sig { override.params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void - # # source://rbi//lib/rbi/printer.rb#604 sig { override.params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void - # # source://rbi//lib/rbi/printer.rb#349 sig { override.params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (Scope node) -> void - # # source://rbi//lib/rbi/printer.rb#175 sig { params(node: ::RBI::Scope).void } def visit_scope(node); end - # : (Scope node) -> void - # # source://rbi//lib/rbi/printer.rb#220 sig { params(node: ::RBI::Scope).void } def visit_scope_body(node); end - # : (ScopeConflict node) -> void - # # source://rbi//lib/rbi/printer.rb#624 sig { override.params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Scope node) -> void - # # source://rbi//lib/rbi/printer.rb#185 sig { params(node: ::RBI::Scope).void } def visit_scope_header(node); end - # : (Send node) -> void - # # source://rbi//lib/rbi/printer.rb#435 sig { override.params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void - # # source://rbi//lib/rbi/printer.rb#465 sig { override.params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void - # # source://rbi//lib/rbi/printer.rb#486 sig { override.params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void - # # source://rbi//lib/rbi/printer.rb#170 sig { override.params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void - # # source://rbi//lib/rbi/printer.rb#164 sig { override.params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TStructField node) -> void - # # source://rbi//lib/rbi/printer.rb#509 sig { params(node: ::RBI::TStructField).void } def visit_t_struct_field(node); end - # : (TEnum node) -> void - # # source://rbi//lib/rbi/printer.rb#528 sig { override.params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void - # # source://rbi//lib/rbi/printer.rb#534 sig { override.params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void - # # source://rbi//lib/rbi/printer.rb#547 sig { override.params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void - # # source://rbi//lib/rbi/printer.rb#144 sig { override.params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void - # # source://rbi//lib/rbi/printer.rb#492 sig { override.params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void - # # source://rbi//lib/rbi/printer.rb#498 sig { override.params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void - # # source://rbi//lib/rbi/printer.rb#504 sig { override.params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void - # # source://rbi//lib/rbi/printer.rb#557 sig { override.params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (Visibility node) -> void - # # source://rbi//lib/rbi/printer.rb#425 sig { params(node: ::RBI::Visibility).void } def visit_visibility(node); end - # : (VisibilityGroup node) -> void - # # source://rbi//lib/rbi/printer.rb#590 sig { override.params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end @@ -2566,13 +1922,11 @@ end # source://rbi//lib/rbi/printer.rb#5 class RBI::PrinterError < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#763 +# source://rbi//lib/rbi/model.rb#742 class RBI::Private < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Private node) -> void } -> void - # # @return [Private] a new instance of Private # - # source://rbi//lib/rbi/model.rb#765 + # source://rbi//lib/rbi/model.rb#744 sig do params( loc: T.nilable(::RBI::Loc), @@ -2583,13 +1937,11 @@ class RBI::Private < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#755 +# source://rbi//lib/rbi/model.rb#734 class RBI::Protected < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Protected node) -> void } -> void - # # @return [Protected] a new instance of Protected # - # source://rbi//lib/rbi/model.rb#757 + # source://rbi//lib/rbi/model.rb#736 sig do params( loc: T.nilable(::RBI::Loc), @@ -2600,13 +1952,11 @@ class RBI::Protected < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#747 +# source://rbi//lib/rbi/model.rb#726 class RBI::Public < ::RBI::Visibility - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Public node) -> void } -> void - # # @return [Public] a new instance of Public # - # source://rbi//lib/rbi/model.rb#749 + # source://rbi//lib/rbi/model.rb#728 sig do params( loc: T.nilable(::RBI::Loc), @@ -2622,57 +1972,41 @@ module RBI::RBS; end # source://rbi//lib/rbi/rbs/method_type_translator.rb#6 class RBI::RBS::MethodTypeTranslator - # : (Method) -> void - # # @return [MethodTypeTranslator] a new instance of MethodTypeTranslator # # source://rbi//lib/rbi/rbs/method_type_translator.rb#22 sig { params(method: ::RBI::Method).void } def initialize(method); end - # : Sig - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#19 sig { returns(::RBI::Sig) } def result; end - # : (::RBS::MethodType) -> void - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#28 sig { params(type: ::RBS::MethodType).void } def visit(type); end private - # : (::RBS::Types::Function::Param, Integer) -> SigParam - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#100 sig { params(param: ::RBS::Types::Function::Param, index: ::Integer).returns(::RBI::SigParam) } def translate_function_param(param, index); end - # : (untyped) -> Type - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#115 sig { params(type: T.untyped).returns(::RBI::Type) } def translate_type(type); end - # : (::RBS::Types::Block) -> void - # # @raise [Error] # # source://rbi//lib/rbi/rbs/method_type_translator.rb#42 sig { params(type: ::RBS::Types::Block).void } def visit_block_type(type); end - # : (::RBS::Types::Function) -> void - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#57 sig { params(type: ::RBS::Types::Function).void } def visit_function_type(type); end class << self - # : (Method, ::RBS::MethodType) -> Sig - # # source://rbi//lib/rbi/rbs/method_type_translator.rb#11 sig { params(method: ::RBI::Method, type: ::RBS::MethodType).returns(::RBI::Sig) } def translate(method, type); end @@ -2685,9 +2019,7 @@ class RBI::RBS::MethodTypeTranslator::Error < ::RBI::Error; end # source://rbi//lib/rbi/rbs/type_translator.rb#6 class RBI::RBS::TypeTranslator class << self - # : (NodeType) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#37 + # source://rbi//lib/rbi/rbs/type_translator.rb#33 sig do params( type: T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable) @@ -2697,21 +2029,15 @@ class RBI::RBS::TypeTranslator private - # : (::RBS::Types::ClassInstance) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#99 + # source://rbi//lib/rbi/rbs/type_translator.rb#95 sig { params(type: ::RBS::Types::ClassInstance).returns(::RBI::Type) } def translate_class_instance(type); end - # : (::RBS::Types::Function) -> Type - # - # source://rbi//lib/rbi/rbs/type_translator.rb#107 + # source://rbi//lib/rbi/rbs/type_translator.rb#103 sig { params(type: ::RBS::Types::Function).returns(::RBI::Type) } def translate_function(type); end - # : (String type_name) -> String - # - # source://rbi//lib/rbi/rbs/type_translator.rb#154 + # source://rbi//lib/rbi/rbs/type_translator.rb#150 sig { params(type_name: ::String).returns(::String) } def translate_t_generic_type(type_name); end end @@ -2719,497 +2045,350 @@ end # A comment representing a RBS type prefixed with `#:` # -# source://rbi//lib/rbi/model.rb#81 +# source://rbi//lib/rbi/model.rb#78 class RBI::RBSComment < ::RBI::Comment - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#83 + # source://rbi//lib/rbi/model.rb#80 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end end # source://rbi//lib/rbi/rbs_printer.rb#5 class RBI::RBSPrinter < ::RBI::Visitor - # : (?out: (IO | StringIO), ?indent: Integer, ?print_locs: bool, ?positional_names: bool) -> void - # # @return [RBSPrinter] a new instance of RBSPrinter # - # source://rbi//lib/rbi/rbs_printer.rb#21 + # source://rbi//lib/rbi/rbs_printer.rb#30 sig do params( out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean, - positional_names: T::Boolean + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer) ).void end - def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end + def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - # : Integer - # # source://rbi//lib/rbi/rbs_printer.rb#15 sig { returns(::Integer) } def current_indent; end - # : -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#39 + # source://rbi//lib/rbi/rbs_printer.rb#49 sig { void } def dedent; end - # : bool - # # source://rbi//lib/rbi/rbs_printer.rb#9 - # @return [Boolean] def in_visibility_group; end - # : bool - # # source://rbi//lib/rbi/rbs_printer.rb#9 - # @return [Boolean] def in_visibility_group=(_arg0); end - # : -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#34 - # Printing + # source://rbi//lib/rbi/rbs_printer.rb#44 sig { void } def indent; end - # : bool - # + # source://rbi//lib/rbi/rbs_printer.rb#21 + sig { returns(T.nilable(::Integer)) } + def max_line_length; end + # source://rbi//lib/rbi/rbs_printer.rb#18 sig { returns(T::Boolean) } def positional_names; end - # : bool - # # source://rbi//lib/rbi/rbs_printer.rb#18 - # @return [Boolean] def positional_names=(_arg0); end - # : Node? - # # source://rbi//lib/rbi/rbs_printer.rb#12 sig { returns(T.nilable(::RBI::Node)) } def previous_node; end # Print a string without indentation nor `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#45 - # Print a string without indentation nor `\n` at the end. + # source://rbi//lib/rbi/rbs_printer.rb#55 sig { params(string: ::String).void } def print(string); end - # : (RBI::Attr node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#292 + # source://rbi//lib/rbi/rbs_printer.rb#302 sig { params(node: ::RBI::Attr, sig: ::RBI::Sig).void } def print_attr_sig(node, sig); end - # : bool - # # source://rbi//lib/rbi/rbs_printer.rb#9 sig { returns(T::Boolean) } def print_locs; end - # : bool - # # source://rbi//lib/rbi/rbs_printer.rb#9 - # @return [Boolean] def print_locs=(_arg0); end - # : (RBI::Method node, Sig sig) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#388 + # source://rbi//lib/rbi/rbs_printer.rb#398 sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } def print_method_sig(node, sig); end + # source://rbi//lib/rbi/rbs_printer.rb#415 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig_inline(node, sig); end + + # source://rbi//lib/rbi/rbs_printer.rb#477 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig_multiline(node, sig); end + # Print a string with indentation and `\n` at the end. - # : (String string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#65 - # Print a string with indentation and `\n` at the end. + # source://rbi//lib/rbi/rbs_printer.rb#75 sig { params(string: ::String).void } def printl(string); end # Print a string without indentation but with a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#51 - # Print a string without indentation but with a `\n` at the end. + # source://rbi//lib/rbi/rbs_printer.rb#61 sig { params(string: T.nilable(::String)).void } def printn(string = T.unsafe(nil)); end # Print a string with indentation but without a `\n` at the end. - # : (?String? string) -> void # - # source://rbi//lib/rbi/rbs_printer.rb#58 - # Print a string with indentation but without a `\n` at the end. + # source://rbi//lib/rbi/rbs_printer.rb#68 sig { params(string: T.nilable(::String)).void } def printt(string = T.unsafe(nil)); end - # : (Array[Node] nodes) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#72 + # source://rbi//lib/rbi/rbs_printer.rb#82 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (Arg node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#585 + # source://rbi//lib/rbi/rbs_printer.rb#678 sig { override.params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (Attr node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#260 + # source://rbi//lib/rbi/rbs_printer.rb#270 sig { params(node: ::RBI::Attr).void } def visit_attr(node); end - # : (AttrAccessor node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#243 + # source://rbi//lib/rbi/rbs_printer.rb#253 sig { override.params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#249 + # source://rbi//lib/rbi/rbs_printer.rb#259 sig { override.params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#255 + # source://rbi//lib/rbi/rbs_printer.rb#265 sig { override.params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#114 + # source://rbi//lib/rbi/rbs_printer.rb#124 sig { override.params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#517 + # source://rbi//lib/rbi/rbs_printer.rb#610 sig { override.params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#134 + # source://rbi//lib/rbi/rbs_printer.rb#144 sig { override.params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#97 + # source://rbi//lib/rbi/rbs_printer.rb#107 sig { override.params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#721 + # source://rbi//lib/rbi/rbs_printer.rb#814 sig { override.params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#227 + # source://rbi//lib/rbi/rbs_printer.rb#237 sig { override.params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#529 + # source://rbi//lib/rbi/rbs_printer.rb#622 sig { override.params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (File file) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#84 + # source://rbi//lib/rbi/rbs_printer.rb#94 sig { override.params(file: ::RBI::File).void } def visit_file(file); end - # : (Group node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#694 + # source://rbi//lib/rbi/rbs_printer.rb#787 sig { override.params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#682 + # source://rbi//lib/rbi/rbs_printer.rb#775 sig { override.params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#523 + # source://rbi//lib/rbi/rbs_printer.rb#616 sig { override.params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#591 + # source://rbi//lib/rbi/rbs_printer.rb#684 sig { override.params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#505 + # source://rbi//lib/rbi/rbs_printer.rb#598 sig { override.params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#499 + # source://rbi//lib/rbi/rbs_printer.rb#592 sig { override.params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#511 + # source://rbi//lib/rbi/rbs_printer.rb#604 sig { override.params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#315 + # source://rbi//lib/rbi/rbs_printer.rb#325 sig { override.params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#688 + # source://rbi//lib/rbi/rbs_printer.rb#781 sig { override.params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Mixin node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#534 + # source://rbi//lib/rbi/rbs_printer.rb#627 sig { params(node: ::RBI::Mixin).void } def visit_mixin(node); end - # : (Module node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#128 + # source://rbi//lib/rbi/rbs_printer.rb#138 sig { override.params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#479 + # source://rbi//lib/rbi/rbs_printer.rb#572 sig { override.params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#564 + # source://rbi//lib/rbi/rbs_printer.rb#657 sig { override.params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#558 + # source://rbi//lib/rbi/rbs_printer.rb#651 sig { override.params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#552 + # source://rbi//lib/rbi/rbs_printer.rb#645 sig { override.params(node: ::RBI::Public).void } def visit_public(node); end - # : (ReqParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#469 + # source://rbi//lib/rbi/rbs_printer.rb#562 sig { override.params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#715 + # source://rbi//lib/rbi/rbs_printer.rb#808 sig { override.params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#489 + # source://rbi//lib/rbi/rbs_printer.rb#582 sig { override.params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#151 + # source://rbi//lib/rbi/rbs_printer.rb#161 sig { params(node: ::RBI::Scope).void } def visit_scope(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#214 + # source://rbi//lib/rbi/rbs_printer.rb#224 sig { params(node: ::RBI::Scope).void } def visit_scope_body(node); end - # : (ScopeConflict node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#731 + # source://rbi//lib/rbi/rbs_printer.rb#824 sig { override.params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Scope node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#161 + # source://rbi//lib/rbi/rbs_printer.rb#171 sig { params(node: ::RBI::Scope).void } def visit_scope_header(node); end - # : (Send node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#579 + # source://rbi//lib/rbi/rbs_printer.rb#672 sig { override.params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#450 + # source://rbi//lib/rbi/rbs_printer.rb#543 sig { params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#463 + # source://rbi//lib/rbi/rbs_printer.rb#556 sig { params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#146 + # source://rbi//lib/rbi/rbs_printer.rb#156 sig { override.params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#140 + # source://rbi//lib/rbi/rbs_printer.rb#150 sig { override.params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TEnum node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#648 + # source://rbi//lib/rbi/rbs_printer.rb#741 sig { override.params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#654 + # source://rbi//lib/rbi/rbs_printer.rb#747 sig { override.params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#660 + # source://rbi//lib/rbi/rbs_printer.rb#753 sig { override.params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#120 + # source://rbi//lib/rbi/rbs_printer.rb#130 sig { override.params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#597 + # source://rbi//lib/rbi/rbs_printer.rb#690 sig { override.params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#632 + # source://rbi//lib/rbi/rbs_printer.rb#725 sig { override.params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#640 + # source://rbi//lib/rbi/rbs_printer.rb#733 sig { override.params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#676 + # source://rbi//lib/rbi/rbs_printer.rb#769 sig { override.params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (Visibility node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#569 + # source://rbi//lib/rbi/rbs_printer.rb#662 sig { params(node: ::RBI::Visibility).void } def visit_visibility(node); end - # : (VisibilityGroup node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#701 + # source://rbi//lib/rbi/rbs_printer.rb#794 sig { override.params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end private - # : (Node node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rbs_printer.rb#834 + # source://rbi//lib/rbi/rbs_printer.rb#927 sig { params(node: ::RBI::Node).returns(T::Boolean) } def oneline?(node); end # Parse a string containing a `T.let(x, X)` and extract the type # # Returns `nil` is the string is not a `T.let`. - # : (String? code) -> String? # - # source://rbi//lib/rbi/rbs_printer.rb#868 - # Parse a string containing a `T.let(x, X)` and extract the type - # Returns `nil` is the string is not a `T.let`. + # source://rbi//lib/rbi/rbs_printer.rb#961 sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) } def parse_t_let(code); end - # : ((Type | String) type) -> Type - # - # source://rbi//lib/rbi/rbs_printer.rb#856 + # source://rbi//lib/rbi/rbs_printer.rb#949 sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) } def parse_type(type); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#747 + # source://rbi//lib/rbi/rbs_printer.rb#840 sig { params(node: ::RBI::Node).void } def print_blank_line_before(node); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#766 + # source://rbi//lib/rbi/rbs_printer.rb#859 sig { params(node: ::RBI::Node).void } def print_loc(node); end - # : (Param node, last: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#808 + # source://rbi//lib/rbi/rbs_printer.rb#901 sig { params(node: ::RBI::Param, last: T::Boolean).void } def print_param_comment_leading_space(node, last:); end - # : (Method node, SigParam param) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#772 + # source://rbi//lib/rbi/rbs_printer.rb#865 sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void } def print_sig_param(node, param); end - # : (SigParam node, last: bool) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#826 + # source://rbi//lib/rbi/rbs_printer.rb#919 sig { params(node: ::RBI::SigParam, last: T::Boolean).void } def print_sig_param_comment_leading_space(node, last:); end end @@ -3220,13 +2399,11 @@ class RBI::RBSPrinter::Error < ::RBI::Error; end # source://rbi//lib/rbi/model.rb#5 class RBI::ReplaceNodeError < ::RBI::Error; end -# source://rbi//lib/rbi/model.rb#534 +# source://rbi//lib/rbi/model.rb#519 class RBI::ReqParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (ReqParam node) -> void } -> void - # # @return [ReqParam] a new instance of ReqParam # - # source://rbi//lib/rbi/model.rb#536 + # source://rbi//lib/rbi/model.rb#521 sig do params( name: ::String, @@ -3237,51 +2414,39 @@ class RBI::ReqParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#542 + # source://rbi//lib/rbi/model.rb#527 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end end -# source://rbi//lib/rbi/model.rb#1127 +# source://rbi//lib/rbi/model.rb#1103 class RBI::RequiresAncestor < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [RequiresAncestor] a new instance of RequiresAncestor # - # source://rbi//lib/rbi/model.rb#1132 + # source://rbi//lib/rbi/model.rb#1108 sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#159 + # source://rbi//lib/rbi/index.rb#154 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1129 + # source://rbi//lib/rbi/model.rb#1105 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1139 + # source://rbi//lib/rbi/model.rb#1115 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#564 +# source://rbi//lib/rbi/model.rb#549 class RBI::RestParam < ::RBI::Param - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (RestParam node) -> void } -> void - # # @return [RestParam] a new instance of RestParam # - # source://rbi//lib/rbi/model.rb#566 + # source://rbi//lib/rbi/model.rb#551 sig do params( name: ::String, @@ -3292,15 +2457,11 @@ class RBI::RestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#578 + # source://rbi//lib/rbi/model.rb#563 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#573 + # source://rbi//lib/rbi/model.rb#558 sig { override.returns(::String) } def to_s; end end @@ -3310,36 +2471,26 @@ module RBI::Rewriters; end # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#6 class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor - # : (?with_todo_comment: bool) -> void - # # @return [AddSigTemplates] a new instance of AddSigTemplates # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#8 sig { params(with_todo_comment: T::Boolean).void } def initialize(with_todo_comment: T.unsafe(nil)); end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#15 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Attr attr) -> void - # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#29 sig { params(attr: ::RBI::Attr).void } def add_attr_sig(attr); end - # : (Method method) -> void - # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#44 sig { params(method: ::RBI::Method).void } def add_method_sig(method); end - # : (NodeWithComments node) -> void - # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#55 sig { params(node: ::RBI::NodeWithComments).void } def add_todo_comment(node); end @@ -3347,30 +2498,22 @@ end # source://rbi//lib/rbi/rewriters/annotate.rb#6 class RBI::Rewriters::Annotate < ::RBI::Visitor - # : (String annotation, ?annotate_scopes: bool, ?annotate_properties: bool) -> void - # # @return [Annotate] a new instance of Annotate # # source://rbi//lib/rbi/rewriters/annotate.rb#8 sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def initialize(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/annotate.rb#17 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (NodeWithComments node) -> void - # # source://rbi//lib/rbi/rewriters/annotate.rb#30 sig { params(node: ::RBI::NodeWithComments).void } def annotate_node(node); end - # : (Node node) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/rewriters/annotate.rb#37 @@ -3380,16 +2523,12 @@ end # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#22 class RBI::Rewriters::AttrToMethods < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#25 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Node node, with: Array[Node]) -> void - # # @raise [ReplaceNodeError] # # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#38 @@ -3399,24 +2538,18 @@ end # source://rbi//lib/rbi/rewriters/deannotate.rb#6 class RBI::Rewriters::Deannotate < ::RBI::Visitor - # : (String annotation) -> void - # # @return [Deannotate] a new instance of Deannotate # # source://rbi//lib/rbi/rewriters/deannotate.rb#8 sig { params(annotation: ::String).void } def initialize(annotation); end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/deannotate.rb#15 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (NodeWithComments node) -> void - # # source://rbi//lib/rbi/rewriters/deannotate.rb#26 sig { params(node: ::RBI::NodeWithComments).void } def deannotate_node(node); end @@ -3475,59 +2608,18 @@ end # - RBI with no version annotations are automatically counted towards ALL versions # # source://rbi//lib/rbi/rewriters/filter_versions.rb#57 -# Take a gem version and filter out all RBI that is not relevant to that version based on @version annotations -# in comments. As an example: -# ~~~rb -# tree = Parser.parse_string(<<~RBI) -# class Foo -# # @version > 0.3.0 -# def bar -# end -# # @version <= 0.3.0 -# def bar(arg1) -# end -# RBI -# Rewriters::FilterVersions.filter(tree, Gem::Version.new("0.3.1")) -# assert_equal(<<~RBI, tree.string) -# ~~~ -# Supported operators: -# - equals `=` -# - not equals `!=` -# - greater than `>` -# - greater than or equal to `>=` -# - less than `<` -# - less than or equal to `<=` -# - pessimistic or twiddle-wakka`~>` -# And/or logic: -# - "And" logic: put multiple versions on the same line -# - e.g. `@version > 0.3.0, <1.0.0` means version must be greater than 0.3.0 AND less than 1.0.0 -# - "Or" logic: put multiple versions on subsequent lines -# - e.g. the following means version must be less than 0.3.0 OR greater than 1.0.0 -# ``` -# # @version < 0.3.0 -# # @version > 1.0.0 -# Prerelease versions: -# - Prerelease versions are considered less than their non-prerelease counterparts -# - e.g. `0.4.0-prerelease` is less than `0.4.0` -# RBI with no versions: class RBI::Rewriters::FilterVersions < ::RBI::Visitor - # : (Gem::Version version) -> void - # # @return [FilterVersions] a new instance of FilterVersions # # source://rbi//lib/rbi/rewriters/filter_versions.rb#69 sig { params(version: ::Gem::Version).void } def initialize(version); end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/filter_versions.rb#76 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end class << self - # : (Tree tree, Gem::Version version) -> void - # # source://rbi//lib/rbi/rewriters/filter_versions.rb#62 sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void } def filter(tree, version); end @@ -3563,23 +2655,7 @@ RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String) # ~~~ # # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#30 -# Rewrite non-singleton methods inside singleton classes to singleton methods -# Example: -# ~~~rb -# class << self -# def m1; end -# def self.m2; end -# class << self -# def m3; end -# end -# end -# will be rewritten to: -# def self.m1; end -# def self.m2; end -# def self.m3; end class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#33 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end @@ -3608,29 +2684,13 @@ end # ~~~ # # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#27 -# Flattens visibility nodes into method nodes -# Example: -# ~~~rb -# class A -# def m1; end -# private -# def m2; end -# def m3; end -# end -# will be transformed into: -# private def m2; end -# private def m3; end class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor - # : -> void - # # @return [FlattenVisibilities] a new instance of FlattenVisibilities # # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#29 sig { void } def initialize; end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#37 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end @@ -3638,16 +2698,12 @@ end # source://rbi//lib/rbi/rewriters/group_nodes.rb#8 class RBI::Rewriters::GroupNodes < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/group_nodes.rb#11 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Node node) -> Group::Kind - # # source://rbi//lib/rbi/rewriters/group_nodes.rb#35 sig { params(node: ::RBI::Node).returns(::RBI::Group::Kind) } def group_kind(node); end @@ -3688,45 +2744,22 @@ end # ~~~ # # source://rbi//lib/rbi/rewriters/merge_trees.rb#39 -# Merge two RBI trees together -# Be this `Tree`: -# ~~~rb -# class Foo -# attr_accessor :a -# def m; end -# C = 10 -# end -# Merged with this one: -# attr_reader :a -# def m(x); end -# Compatible definitions are merged together while incompatible definitions are moved into a `ConflictTree`: -# <<<<<<< left -# ======= -# >>>>>>> right class RBI::Rewriters::Merge - # : (?left_name: String, ?right_name: String, ?keep: Keep) -> void - # # @return [Merge] a new instance of Merge # # source://rbi//lib/rbi/rewriters/merge_trees.rb#66 sig { params(left_name: ::String, right_name: ::String, keep: ::RBI::Rewriters::Merge::Keep).void } def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # : (Tree tree) -> void - # # source://rbi//lib/rbi/rewriters/merge_trees.rb#75 sig { params(tree: ::RBI::Tree).void } def merge(tree); end - # : MergeTree - # # source://rbi//lib/rbi/rewriters/merge_trees.rb#63 sig { returns(::RBI::MergeTree) } def tree; end class << self - # : (Tree left, Tree right, ?left_name: String, ?right_name: String, ?keep: Keep) -> MergeTree - # # source://rbi//lib/rbi/rewriters/merge_trees.rb#50 sig do params( @@ -3744,22 +2777,30 @@ end # Used for logging / error displaying purpose # # source://rbi//lib/rbi/rewriters/merge_trees.rb#82 -class RBI::Rewriters::Merge::Conflict < ::T::Struct - const :left, ::RBI::Node - const :right, ::RBI::Node - const :left_name, ::String - const :right_name, ::String - - # : -> String +class RBI::Rewriters::Merge::Conflict + # @return [Conflict] a new instance of Conflict # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#89 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#90 + sig { params(left: ::RBI::Node, right: ::RBI::Node, left_name: ::String, right_name: ::String).void } + def initialize(left:, right:, left_name:, right_name:); end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#84 + sig { returns(::RBI::Node) } + def left; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#87 + sig { returns(::String) } + def left_name; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#84 + def right; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#87 + def right_name; end + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#98 sig { returns(::String) } def to_s; end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # Merge adjacent conflict trees @@ -3793,58 +2834,47 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#238 -# Merge adjacent conflict trees -# Transform this: -# ~~~rb -# class Foo -# <<<<<<< left -# def m1; end -# ======= -# def m1(a); end -# >>>>>>> right -# def m2(a); end -# def m2; end -# end -# Into this: +# source://rbi//lib/rbi/rewriters/merge_trees.rb#247 class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor - # : (Node? node) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#241 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#250 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#247 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#256 sig { override.params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end private - # : (Tree left, Tree right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#268 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#277 sig { params(left: ::RBI::Tree, right: ::RBI::Tree).void } def merge_conflict_trees(left, right); end end # source://rbi//lib/rbi/rewriters/merge_trees.rb#40 -class RBI::Rewriters::Merge::Keep < ::T::Enum - enums do - LEFT = new - NONE = new - RIGHT = new +class RBI::Rewriters::Merge::Keep + class << self + private + + # source://rbi//lib/rbi/rewriters/merge_trees.rb#45 + def new(*_arg0); end end end -# source://rbi//lib/rbi/rewriters/merge_trees.rb#94 +# source://rbi//lib/rbi/rewriters/merge_trees.rb#42 +RBI::Rewriters::Merge::Keep::LEFT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#41 +RBI::Rewriters::Merge::Keep::NONE = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#43 +RBI::Rewriters::Merge::Keep::RIGHT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep) + +# source://rbi//lib/rbi/rewriters/merge_trees.rb#103 class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor - # : (Tree output, ?left_name: String, ?right_name: String, ?keep: Keep) -> void - # # @return [TreeMerger] a new instance of TreeMerger # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#99 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#108 sig do params( output: ::RBI::Tree, @@ -3855,55 +2885,39 @@ class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor end def initialize(output, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # : Array[Conflict] - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#96 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#105 sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) } def conflicts; end - # : (Node? node) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#112 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#121 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : -> Tree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#161 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#170 sig { returns(::RBI::Tree) } def current_scope; end - # : (Scope left, Scope right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#178 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#187 sig { params(left: ::RBI::Scope, right: ::RBI::Scope).void } def make_conflict_scope(left, right); end - # : (Node left, Node right) -> void - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#185 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#194 sig { params(left: ::RBI::Node, right: ::RBI::Node).void } def make_conflict_tree(left, right); end - # : (Node node) -> Node? - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#166 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#175 sig { params(node: ::RBI::Node).returns(T.nilable(::RBI::Node)) } def previous_definition(node); end - # : (Scope left, Scope right) -> Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#197 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#206 sig { params(left: ::RBI::Scope, right: ::RBI::Scope).returns(::RBI::Scope) } def replace_scope_header(left, right); end end # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#6 class RBI::Rewriters::NestNonPublicMembers < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end @@ -3911,8 +2925,6 @@ end # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#6 class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end @@ -3936,27 +2948,13 @@ end # ~~~ # # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#22 -# This rewriter moves top-level members into a top-level Object class -# Example: -# ~~~rb -# def foo; end -# attr_reader :bar -# will be rewritten to: -# class Object -# def foo; end -# attr_reader :bar -# end class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor - # : -> void - # # @return [NestTopLevelMembers] a new instance of NestTopLevelMembers # # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#24 sig { void } def initialize; end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#32 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end @@ -4006,79 +3004,42 @@ end # ~~~ # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#48 -# Remove all definitions existing in the index from the current tree -# Let's create an `Index` from two different `Tree`s: -# ~~~rb -# tree1 = Parse.parse_string(<<~RBI) -# class Foo -# def foo; end -# end -# RBI -# tree2 = Parse.parse_string(<<~RBI) -# FOO = 10 -# index = Index.index(tree1, tree2) -# We can use `RemoveKnownDefinitions` to remove the definitions found in the `index` from the `Tree` to clean: -# tree_to_clean = Parser.parse_string(<<~RBI) -# def bar; end -# BAR = 42 -# cleaned_tree, operations = RemoveKnownDefinitions.remove(tree_to_clean, index) -# assert_equal(<<~RBI, cleaned_tree) -# assert_equal(<<~OPERATIONS, operations.join("\n")) -# Deleted ::Foo#foo at -:2:2-2-16 (duplicate from -:2:2-2:16) -# Deleted ::FOO at -:5:0-5:8 (duplicate from -:1:0-1:8) -# OPERATIONS class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor - # : (Index index) -> void - # # @return [RemoveKnownDefinitions] a new instance of RemoveKnownDefinitions # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#53 sig { params(index: ::RBI::Index).void } def initialize(index); end - # : Array[Operation] - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#50 sig { returns(T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]) } def operations; end - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#75 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#69 sig { params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end private - # : (Node node, Node previous) -> bool - # # @return [Boolean] # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#103 sig { params(node: ::RBI::Node, previous: ::RBI::Node).returns(T::Boolean) } def can_delete_node?(node, previous); end - # : (Node node, Node previous) -> void - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#121 sig { params(node: ::RBI::Node, previous: ::RBI::Node).void } def delete_node(node, previous); end - # : (Indexable node) -> Node? - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#94 sig { params(node: ::RBI::Indexable).returns(T.nilable(::RBI::Node)) } def previous_definition_for(node); end class << self - # : (Tree tree, Index index) -> [Tree, Array[Operation]] - # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#61 sig do params( @@ -4091,52 +3052,45 @@ class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor end # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#126 -class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct - const :deleted_node, ::RBI::Node - const :duplicate_of, ::RBI::Node - - # : -> String +class RBI::Rewriters::RemoveKnownDefinitions::Operation + # @return [Operation] a new instance of Operation # # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#131 + sig { params(deleted_node: ::RBI::Node, duplicate_of: ::RBI::Node).void } + def initialize(deleted_node:, duplicate_of:); end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#128 + sig { returns(::RBI::Node) } + def deleted_node; end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#128 + def duplicate_of; end + + # source://rbi//lib/rbi/rewriters/remove_known_definitions.rb#137 sig { returns(::String) } def to_s; end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # source://rbi//lib/rbi/rewriters/sort_nodes.rb#6 class RBI::Rewriters::SortNodes < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#9 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Group::Kind kind) -> Integer - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#74 sig { params(kind: ::RBI::Group::Kind).returns(::Integer) } def group_rank(kind); end - # : (Node node) -> String? - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#95 sig { params(node: ::RBI::Node).returns(T.nilable(::String)) } def node_name(node); end - # : (Node node) -> Integer - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#46 sig { params(node: ::RBI::Node).returns(::Integer) } def node_rank(node); end - # : (Node node) -> void - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#107 sig { params(node: ::RBI::Node).void } def sort_node_names!(node); end @@ -4146,28 +3100,20 @@ end # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#7 class RBI::Rewriters::TranslateRBSSigs < ::RBI::Visitor - # : (Node? node) -> void - # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#12 sig { override.params(node: T.nilable(::RBI::Node)).void } def visit(node); end private - # : (Method | Attr) -> Array[RBSComment] - # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#34 sig { params(node: T.any(::RBI::Attr, ::RBI::Method)).returns(T::Array[::RBI::RBSComment]) } def extract_rbs_comments(node); end - # : (Attr, RBSComment) -> Sig - # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#61 sig { params(node: ::RBI::Attr, comment: ::RBI::RBSComment).returns(::RBI::Sig) } def translate_rbs_attr_type(node, comment); end - # : (Method, RBSComment) -> Sig - # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#53 sig { params(node: ::RBI::Method, comment: ::RBI::RBSComment).returns(::RBI::Sig) } def translate_rbs_method_type(node, comment); end @@ -4176,39 +3122,31 @@ end # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#8 class RBI::Rewriters::TranslateRBSSigs::Error < ::RBI::Error; end -# Scopes +# @abstract # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://rbi//lib/rbi/model.rb#168 +# source://rbi//lib/rbi/model.rb#163 class RBI::Scope < ::RBI::Tree include ::RBI::Indexable abstract! # Duplicate `self` scope without its body - # : -> self # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#337 - # Duplicate `self` scope without its body + # source://rbi//lib/rbi/rewriters/merge_trees.rb#346 sig { returns(T.self_type) } def dup_empty; end # @abstract # - # source://rbi//lib/rbi/model.rb#175 + # source://rbi//lib/rbi/model.rb#166 sig { abstract.returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#89 + # source://rbi//lib/rbi/index.rb#84 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#179 + # source://rbi//lib/rbi/model.rb#170 sig { override.returns(::String) } def to_s; end end @@ -4226,62 +3164,38 @@ end # end # ~~~ # -# source://rbi//lib/rbi/rewriters/merge_trees.rb#577 -# A conflict between two scope headers -# Is rendered as a merge conflict between `left` and` right` for scope definitions: -# ~~~rb -# <<<<<<< left -# class Foo -# ======= -# module Foo -# >>>>>>> right -# def m1; end -# end +# source://rbi//lib/rbi/rewriters/merge_trees.rb#586 class RBI::ScopeConflict < ::RBI::Tree - # : (left: Scope, right: Scope, ?left_name: String, ?right_name: String) -> void - # # @return [ScopeConflict] a new instance of ScopeConflict # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#585 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#594 sig { params(left: ::RBI::Scope, right: ::RBI::Scope, left_name: ::String, right_name: ::String).void } def initialize(left:, right:, left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end - # : Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#579 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#588 sig { returns(::RBI::Scope) } def left; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#582 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#591 sig { returns(::String) } def left_name; end - # : Scope - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#579 - # @return [Scope] + # source://rbi//lib/rbi/rewriters/merge_trees.rb#588 def right; end - # : String - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#582 - # @return [String] + # source://rbi//lib/rbi/rewriters/merge_trees.rb#591 def right_name; end end # Sends # -# source://rbi//lib/rbi/model.rb#773 +# source://rbi//lib/rbi/model.rb#752 class RBI::Send < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String method, ?Array[Arg] args, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Send node) -> void } -> void - # # @return [Send] a new instance of Send # - # source://rbi//lib/rbi/model.rb#781 + # source://rbi//lib/rbi/model.rb#760 sig do params( method: ::String, @@ -4293,60 +3207,44 @@ class RBI::Send < ::RBI::NodeWithComments end def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Arg arg) -> void - # - # source://rbi//lib/rbi/model.rb#789 + # source://rbi//lib/rbi/model.rb#768 sig { params(arg: ::RBI::Arg).void } def <<(arg); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#794 + # source://rbi//lib/rbi/model.rb#773 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : Array[Arg] - # - # source://rbi//lib/rbi/model.rb#778 + # source://rbi//lib/rbi/model.rb#757 sig { returns(T::Array[::RBI::Arg]) } def args; end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#503 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#512 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#189 + # source://rbi//lib/rbi/index.rb#184 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#775 + # source://rbi//lib/rbi/model.rb#754 sig { returns(::String) } def method; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#799 + # source://rbi//lib/rbi/model.rb#778 sig { returns(::String) } def to_s; end end # Sorbet's sigs # -# source://rbi//lib/rbi/model.rb#848 +# source://rbi//lib/rbi/model.rb#827 class RBI::Sig < ::RBI::NodeWithComments - # : (?params: Array[SigParam], ?return_type: (Type | String), ?is_abstract: bool, ?is_override: bool, ?is_overridable: bool, ?is_final: bool, ?allow_incompatible_override: bool, ?without_runtime: bool, ?type_params: Array[String], ?checked: Symbol?, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Sig node) -> void } -> void - # # @return [Sig] a new instance of Sig # - # source://rbi//lib/rbi/model.rb#865 + # source://rbi//lib/rbi/model.rb#844 sig do params( params: T::Array[::RBI::SigParam], @@ -4366,140 +3264,83 @@ class RBI::Sig < ::RBI::NodeWithComments end def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), without_runtime: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (SigParam param) -> void - # - # source://rbi//lib/rbi/model.rb#895 + # source://rbi//lib/rbi/model.rb#874 sig { params(param: ::RBI::SigParam).void } def <<(param); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#905 + # source://rbi//lib/rbi/model.rb#884 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : (String name, (Type | String) type) -> void - # - # source://rbi//lib/rbi/model.rb#900 + # source://rbi//lib/rbi/model.rb#879 sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void } def add_param(name, type); end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def allow_incompatible_override; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def allow_incompatible_override=(_arg0); end - # : Symbol? - # - # source://rbi//lib/rbi/model.rb#862 + # source://rbi//lib/rbi/model.rb#841 sig { returns(T.nilable(::Symbol)) } def checked; end - # : Symbol? - # - # source://rbi//lib/rbi/model.rb#862 - # @return [Symbol, nil] + # source://rbi//lib/rbi/model.rb#841 def checked=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 + # source://rbi//lib/rbi/model.rb#835 sig { returns(T::Boolean) } def is_abstract; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_abstract=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_final; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_final=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_overridable; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_overridable=(_arg0); end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_override; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def is_override=(_arg0); end - # : Array[SigParam] - # - # source://rbi//lib/rbi/model.rb#850 + # source://rbi//lib/rbi/model.rb#829 sig { returns(T::Array[::RBI::SigParam]) } def params; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#853 + # source://rbi//lib/rbi/model.rb#832 sig { returns(T.any(::RBI::Type, ::String)) } def return_type; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#853 - # @return [Type, String] + # source://rbi//lib/rbi/model.rb#832 def return_type=(_arg0); end - # : Array[String] - # - # source://rbi//lib/rbi/model.rb#859 + # source://rbi//lib/rbi/model.rb#838 sig { returns(T::Array[::String]) } def type_params; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def without_runtime; end - # : bool - # - # source://rbi//lib/rbi/model.rb#856 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#835 def without_runtime=(_arg0); end end -# source://rbi//lib/rbi/model.rb#914 +# source://rbi//lib/rbi/model.rb#893 class RBI::SigParam < ::RBI::NodeWithComments - # : (String name, (Type | String) type, ?loc: Loc?, ?comments: Array[Comment]) ?{ (SigParam node) -> void } -> void - # # @return [SigParam] a new instance of SigParam # - # source://rbi//lib/rbi/model.rb#922 + # source://rbi//lib/rbi/model.rb#901 sig do params( name: ::String, @@ -4511,32 +3352,24 @@ class RBI::SigParam < ::RBI::NodeWithComments end def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Object other) -> bool - # - # source://rbi//lib/rbi/model.rb#930 + # source://rbi//lib/rbi/model.rb#909 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/model.rb#916 + # source://rbi//lib/rbi/model.rb#895 sig { returns(::String) } def name; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#919 + # source://rbi//lib/rbi/model.rb#898 sig { returns(T.any(::RBI::Type, ::String)) } def type; end end -# source://rbi//lib/rbi/model.rb#228 +# source://rbi//lib/rbi/model.rb#219 class RBI::SingletonClass < ::RBI::Scope - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (SingletonClass node) -> void } -> void - # # @return [SingletonClass] a new instance of SingletonClass # - # source://rbi//lib/rbi/model.rb#230 + # source://rbi//lib/rbi/model.rb#221 sig do params( loc: T.nilable(::RBI::Loc), @@ -4546,20 +3379,16 @@ class RBI::SingletonClass < ::RBI::Scope end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#237 + # source://rbi//lib/rbi/model.rb#228 sig { override.returns(::String) } def fully_qualified_name; end end -# source://rbi//lib/rbi/model.rb#242 +# source://rbi//lib/rbi/model.rb#233 class RBI::Struct < ::RBI::Scope - # : (String name, ?members: Array[Symbol], ?keyword_init: bool, ?loc: Loc?, ?comments: Array[Comment]) ?{ (Struct struct) -> void } -> void - # # @return [Struct] a new instance of Struct # - # source://rbi//lib/rbi/model.rb#253 + # source://rbi//lib/rbi/model.rb#244 sig do params( name: ::String, @@ -4572,66 +3401,45 @@ class RBI::Struct < ::RBI::Scope end def initialize(name, members: T.unsafe(nil), keyword_init: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#378 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#387 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#263 + # source://rbi//lib/rbi/model.rb#254 sig { override.returns(::String) } def fully_qualified_name; end - # : bool - # - # source://rbi//lib/rbi/model.rb#250 + # source://rbi//lib/rbi/model.rb#241 sig { returns(T::Boolean) } def keyword_init; end - # : bool - # - # source://rbi//lib/rbi/model.rb#250 - # @return [Boolean] + # source://rbi//lib/rbi/model.rb#241 def keyword_init=(_arg0); end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#247 + # source://rbi//lib/rbi/model.rb#238 sig { returns(T::Array[::Symbol]) } def members; end - # : Array[Symbol] - # - # source://rbi//lib/rbi/model.rb#247 - # @return [Array] + # source://rbi//lib/rbi/model.rb#238 def members=(_arg0); end - # : String - # - # source://rbi//lib/rbi/model.rb#244 + # source://rbi//lib/rbi/model.rb#235 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#244 - # @return [String] + # source://rbi//lib/rbi/model.rb#235 def name=(_arg0); end end # Sorbet's T::Enum # -# source://rbi//lib/rbi/model.rb#1016 +# source://rbi//lib/rbi/model.rb#992 class RBI::TEnum < ::RBI::Class - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnum klass) -> void } -> void - # # @return [TEnum] a new instance of TEnum # - # source://rbi//lib/rbi/model.rb#1018 + # source://rbi//lib/rbi/model.rb#994 sig do params( name: ::String, @@ -4643,13 +3451,11 @@ class RBI::TEnum < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1024 +# source://rbi//lib/rbi/model.rb#1000 class RBI::TEnumBlock < ::RBI::Scope - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnumBlock node) -> void } -> void - # # @return [TEnumBlock] a new instance of TEnumBlock # - # source://rbi//lib/rbi/model.rb#1026 + # source://rbi//lib/rbi/model.rb#1002 sig do params( loc: T.nilable(::RBI::Loc), @@ -4659,34 +3465,26 @@ class RBI::TEnumBlock < ::RBI::Scope end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1033 + # source://rbi//lib/rbi/model.rb#1009 sig { override.returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#219 + # source://rbi//lib/rbi/index.rb#214 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1039 + # source://rbi//lib/rbi/model.rb#1015 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#1044 +# source://rbi//lib/rbi/model.rb#1020 class RBI::TEnumValue < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TEnumValue node) -> void } -> void - # # @return [TEnumValue] a new instance of TEnumValue # - # source://rbi//lib/rbi/model.rb#1049 + # source://rbi//lib/rbi/model.rb#1025 sig do params( name: ::String, @@ -4697,40 +3495,30 @@ class RBI::TEnumValue < ::RBI::NodeWithComments end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1056 + # source://rbi//lib/rbi/model.rb#1032 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#229 + # source://rbi//lib/rbi/index.rb#224 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1046 + # source://rbi//lib/rbi/model.rb#1022 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1062 + # source://rbi//lib/rbi/model.rb#1038 sig { override.returns(::String) } def to_s; end end # Sorbet's T::Struct # -# source://rbi//lib/rbi/model.rb#937 +# source://rbi//lib/rbi/model.rb#916 class RBI::TStruct < ::RBI::Class - # : (String name, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TStruct klass) -> void } -> void - # # @return [TStruct] a new instance of TStruct # - # source://rbi//lib/rbi/model.rb#939 + # source://rbi//lib/rbi/model.rb#918 sig do params( name: ::String, @@ -4742,15 +3530,13 @@ class RBI::TStruct < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#972 +# source://rbi//lib/rbi/model.rb#948 class RBI::TStructConst < ::RBI::TStructField include ::RBI::Indexable - # : (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TStructConst node) -> void } -> void - # # @return [TStructConst] a new instance of TStructConst # - # source://rbi//lib/rbi/model.rb#974 + # source://rbi//lib/rbi/model.rb#950 sig do params( name: ::String, @@ -4763,44 +3549,34 @@ class RBI::TStructConst < ::RBI::TStructField end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#519 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#528 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#981 + # source://rbi//lib/rbi/model.rb#957 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#199 + # source://rbi//lib/rbi/index.rb#194 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#988 + # source://rbi//lib/rbi/model.rb#964 sig { override.returns(::String) } def to_s; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/model.rb#945 +# source://rbi//lib/rbi/model.rb#925 class RBI::TStructField < ::RBI::NodeWithComments abstract! - # : (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [TStructField] a new instance of TStructField # - # source://rbi//lib/rbi/model.rb#961 + # source://rbi//lib/rbi/model.rb#936 sig do params( name: ::String, @@ -4812,66 +3588,47 @@ class RBI::TStructField < ::RBI::NodeWithComments end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#511 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#520 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : String? - # - # source://rbi//lib/rbi/model.rb#958 + # source://rbi//lib/rbi/model.rb#933 sig { returns(T.nilable(::String)) } def default; end - # : String? - # - # source://rbi//lib/rbi/model.rb#958 - # @return [String, nil] + # source://rbi//lib/rbi/model.rb#933 def default=(_arg0); end # @abstract # - # source://rbi//lib/rbi/model.rb#969 + # source://rbi//lib/rbi/model.rb#945 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # : String - # - # source://rbi//lib/rbi/model.rb#952 + # source://rbi//lib/rbi/model.rb#927 sig { returns(::String) } def name; end - # : String - # - # source://rbi//lib/rbi/model.rb#952 - # @return [String] + # source://rbi//lib/rbi/model.rb#927 def name=(_arg0); end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#955 + # source://rbi//lib/rbi/model.rb#930 sig { returns(T.any(::RBI::Type, ::String)) } def type; end - # : (Type | String) - # - # source://rbi//lib/rbi/model.rb#955 - # @return [Type, String] + # source://rbi//lib/rbi/model.rb#930 def type=(_arg0); end end -# source://rbi//lib/rbi/model.rb#993 +# source://rbi//lib/rbi/model.rb#969 class RBI::TStructProp < ::RBI::TStructField include ::RBI::Indexable - # : (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TStructProp node) -> void } -> void - # # @return [TStructProp] a new instance of TStructProp # - # source://rbi//lib/rbi/model.rb#995 + # source://rbi//lib/rbi/model.rb#971 sig do params( name: ::String, @@ -4884,40 +3641,30 @@ class RBI::TStructProp < ::RBI::TStructField end def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#527 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#536 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # : -> Array[String] - # - # source://rbi//lib/rbi/model.rb#1002 + # source://rbi//lib/rbi/model.rb#978 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#209 + # source://rbi//lib/rbi/index.rb#204 sig { override.returns(T::Array[::String]) } def index_ids; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1009 + # source://rbi//lib/rbi/model.rb#985 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#114 +# source://rbi//lib/rbi/model.rb#108 class RBI::Tree < ::RBI::NodeWithComments - # : (?loc: Loc?, ?comments: Array[Comment]) ?{ (Tree node) -> void } -> void - # # @return [Tree] a new instance of Tree # - # source://rbi//lib/rbi/model.rb#119 + # source://rbi//lib/rbi/model.rb#113 sig do params( loc: T.nilable(::RBI::Loc), @@ -4927,25 +3674,18 @@ class RBI::Tree < ::RBI::NodeWithComments end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : (Node node) -> void - # - # source://rbi//lib/rbi/model.rb#126 + # source://rbi//lib/rbi/model.rb#120 sig { params(node: ::RBI::Node).void } def <<(node); end - # : (?with_todo_comment: bool) -> void - # # source://rbi//lib/rbi/rewriters/add_sig_templates.rb#63 sig { params(with_todo_comment: T::Boolean).void } def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - # : (String annotation, ?annotate_scopes: bool, ?annotate_properties: bool) -> void - # # source://rbi//lib/rbi/rewriters/annotate.rb#46 sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#38 sig do params( name: ::String, @@ -4955,19 +3695,15 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#45 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#55 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#50 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#90 sig do params( name: ::String, @@ -4981,19 +3717,18 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#60 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#25 sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_module(name, &block); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#9 + sig { params(node: ::RBI::Node).returns(::RBI::Node) } + def create_node(node); end + sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_path(constant, &block); end - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#74 sig do params( name: ::String, @@ -5006,53 +3741,37 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end - # : (String annotation) -> void - # # source://rbi//lib/rbi/rewriters/deannotate.rb#38 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#132 + # source://rbi//lib/rbi/model.rb#126 sig { returns(T::Boolean) } def empty?; end - # : (Gem::Version version) -> void - # # source://rbi//lib/rbi/rewriters/filter_versions.rb#113 sig { params(version: ::Gem::Version).void } def filter_versions!(version); end - # : -> void - # # source://rbi//lib/rbi/rewriters/flatten_singleton_methods.rb#58 sig { void } def flatten_singleton_methods!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/flatten_visibilities.rb#57 sig { void } def flatten_visibilities!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/group_nodes.rb#78 sig { void } def group_nodes!; end - # : -> Index - # - # source://rbi//lib/rbi/index.rb#64 + # source://rbi//lib/rbi/index.rb#62 sig { returns(::RBI::Index) } def index; end - # : (Tree other, ?left_name: String, ?right_name: String, ?keep: Rewriters::Merge::Keep) -> MergeTree - # - # source://rbi//lib/rbi/rewriters/merge_trees.rb#314 + # source://rbi//lib/rbi/rewriters/merge_trees.rb#323 sig do params( other: ::RBI::Tree, @@ -5063,92 +3782,65 @@ class RBI::Tree < ::RBI::NodeWithComments end def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # : -> void - # # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#43 sig { void } def nest_non_public_members!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/nest_singleton_methods.rb#33 sig { void } def nest_singleton_methods!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/nest_top_level_members.rb#60 sig { void } def nest_top_level_members!; end - # : Array[Node] - # - # source://rbi//lib/rbi/model.rb#116 + # source://rbi//lib/rbi/model.rb#110 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # : -> void - # + sig { returns(T::Hash[::String, ::RBI::Node]) } + def nodes_cache; end + # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#50 sig { void } def replace_attributes_with_methods!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/sort_nodes.rb#118 sig { void } def sort_nodes!; end - # : -> void - # # source://rbi//lib/rbi/rewriters/translate_rbs_sigs.rb#82 sig { void } def translate_rbs_sigs!; end - - private - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#123 - sig { params(node: ::RBI::Node).returns(::RBI::Node) } - def create_node(node); end - - # source://tapioca/0.16.11/lib/tapioca/rbi_ext/model.rb#118 - sig { returns(T::Hash[::String, ::RBI::Node]) } - def nodes_cache; end end # The base class for all RBI types. # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/type.rb#6 +# source://rbi//lib/rbi/type.rb#7 class RBI::Type abstract! - # : -> void - # # @return [Type] a new instance of Type # - # source://rbi//lib/rbi/type.rb#695 + # source://rbi//lib/rbi/type.rb#905 sig { void } def initialize; end # @abstract # - # source://rbi//lib/rbi/type.rb#741 + # source://rbi//lib/rbi/type.rb#976 sig { abstract.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : (BasicObject other) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type.rb#744 + # source://rbi//lib/rbi/type.rb#979 sig { params(other: ::BasicObject).returns(T::Boolean) } def eql?(other); end - # : -> Integer - # - # source://rbi//lib/rbi/type.rb#750 + # source://rbi//lib/rbi/type.rb#985 sig { override.returns(::Integer) } def hash; end @@ -5161,27 +3853,16 @@ class RBI::Type # type.nilable.to_rbi # => "T.nilable(String)" # type.nilable.nilable.to_rbi # => "T.nilable(String)" # ``` - # : -> Type # - # source://rbi//lib/rbi/type.rb#709 - # Returns a new type that is `nilable` if it is not already. - # If the type is already nilable, it returns itself. - # ```ruby - # type = RBI::Type.simple("String") - # type.to_rbi # => "String" - # type.nilable.to_rbi # => "T.nilable(String)" - # type.nilable.nilable.to_rbi # => "T.nilable(String)" - # ``` + # source://rbi//lib/rbi/type.rb#919 sig { returns(::RBI::Type) } def nilable; end # Returns whether the type is nilable. - # : -> bool # # @return [Boolean] # - # source://rbi//lib/rbi/type.rb#736 - # Returns whether the type is nilable. + # source://rbi//lib/rbi/type.rb#946 sig { returns(T::Boolean) } def nilable?; end @@ -5195,36 +3876,52 @@ class RBI::Type # type.non_nilable.to_rbi # => "String" # type.non_nilable.non_nilable.to_rbi # => "String" # ``` - # : -> Type # - # source://rbi//lib/rbi/type.rb#724 - # Returns the non-nilable version of the type. - # If the type is already non-nilable, it returns itself. - # If the type is nilable, it returns the inner type. - # ```ruby - # type = RBI::Type.nilable(RBI::Type.simple("String")) - # type.to_rbi # => "T.nilable(String)" - # type.non_nilable.to_rbi # => "String" - # type.non_nilable.non_nilable.to_rbi # => "String" - # ``` + # source://rbi//lib/rbi/type.rb#934 sig { returns(::RBI::Type) } def non_nilable; end - # : -> String + # Returns a normalized version of the type. # - # source://rbi//lib/rbi/rbs_printer.rb#1146 + # Normalized types are meant to be easier to process, not to read. + # For example, `T.any(TrueClass, FalseClass)` instead of `T::Boolean` or + # `T.any(String, NilClass)` instead of `T.nilable(String)`. + # + # This is the inverse of `#simplify`. + # + # + # @abstract + # + # source://rbi//lib/rbi/type.rb#960 + sig { abstract.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/rbs_printer.rb#1240 sig { returns(::String) } def rbs_string; end + # Returns a simplified version of the type. + # + # Simplified types are meant to be easier to read, not to process. + # For example, `T::Boolean` instead of `T.any(TrueClass, FalseClass)` or + # `T.nilable(String)` instead of `T.any(String, NilClass)`. + # + # This is the inverse of `#normalize`. + # + # # @abstract # - # source://rbi//lib/rbi/type.rb#755 + # source://rbi//lib/rbi/type.rb#972 + sig { abstract.returns(::RBI::Type) } + def simplify; end + + # @abstract + # + # source://rbi//lib/rbi/type.rb#991 sig { abstract.returns(::String) } def to_rbi; end - # : -> String - # - # source://rbi//lib/rbi/type.rb#759 + # source://rbi//lib/rbi/type.rb#995 sig { override.returns(::String) } def to_s; end @@ -5233,12 +3930,8 @@ class RBI::Type # # Note that this method transforms types such as `T.all(String, String)` into `String`, so # it may return something other than a `All`. - # : (Type type1, Type type2, *Type types) -> Type # - # source://rbi//lib/rbi/type.rb#559 - # Builds a type that represents an intersection of multiple types like `T.all(String, Integer)`. - # Note that this method transforms types such as `T.all(String, String)` into `String`, so - # it may return something other than a `All`. + # source://rbi//lib/rbi/type.rb#847 sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } def all(type1, type2, *types); end @@ -5246,52 +3939,38 @@ class RBI::Type # # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so # it may return something other than a `Any`. - # : (Type type1, Type type2, *Type types) -> Type # - # source://rbi//lib/rbi/type.rb#586 - # Builds a type that represents a union of multiple types like `T.any(String, Integer)`. - # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so - # it may return something other than a `Any`. + # source://rbi//lib/rbi/type.rb#856 sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) } def any(type1, type2, *types); end # Builds a type that represents `T.anything`. - # : -> Anything # - # source://rbi//lib/rbi/type.rb#484 - # Builds a type that represents `T.anything`. + # source://rbi//lib/rbi/type.rb#778 sig { returns(::RBI::Type::Anything) } def anything; end # Builds a type that represents `T.attached_class`. - # : -> AttachedClass # - # source://rbi//lib/rbi/type.rb#490 - # Builds a type that represents `T.attached_class`. + # source://rbi//lib/rbi/type.rb#784 sig { returns(::RBI::Type::AttachedClass) } def attached_class; end # Builds a type that represents `T::Boolean`. - # : -> Boolean # - # source://rbi//lib/rbi/type.rb#496 - # Builds a type that represents `T::Boolean`. + # source://rbi//lib/rbi/type.rb#790 sig { returns(::RBI::Type::Boolean) } def boolean; end # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`. - # : (Simple type, ?Type? type_parameter) -> ClassOf # - # source://rbi//lib/rbi/type.rb#534 - # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`. + # source://rbi//lib/rbi/type.rb#828 sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) } def class_of(type, type_parameter = T.unsafe(nil)); end # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. - # : (String name, *(Type | Array[Type]) params) -> Generic # - # source://rbi//lib/rbi/type.rb#651 - # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. + # source://rbi//lib/rbi/type.rb#864 sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) } def generic(name, *params); end @@ -5299,31 +3978,21 @@ class RBI::Type # # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so # it may return something other than a `RBI::Type::Nilable`. - # : (Type type) -> Type # - # source://rbi//lib/rbi/type.rb#543 - # Builds a type that represents a nilable of another type like `T.nilable(String)`. - # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so - # it may return something other than a `RBI::Type::Nilable`. + # source://rbi//lib/rbi/type.rb#837 sig { params(type: ::RBI::Type).returns(::RBI::Type) } def nilable(type); end # Builds a type that represents `T.noreturn`. - # : -> NoReturn # - # source://rbi//lib/rbi/type.rb#502 - # Builds a type that represents `T.noreturn`. + # source://rbi//lib/rbi/type.rb#796 sig { returns(::RBI::Type::NoReturn) } def noreturn; end - # : (Prism::Node node) -> Type - # # source://rbi//lib/rbi/type_parser.rb#26 sig { params(node: ::Prism::Node).returns(::RBI::Type) } def parse_node(node); end - # : (String string) -> Type - # # @raise [Error] # # source://rbi//lib/rbi/type_parser.rb#10 @@ -5331,181 +4000,134 @@ class RBI::Type def parse_string(string); end # Builds a type that represents a proc type like `T.proc.void`. - # : -> Proc # - # source://rbi//lib/rbi/type.rb#679 - # Builds a type that represents a proc type like `T.proc.void`. + # source://rbi//lib/rbi/type.rb#892 sig { returns(::RBI::Type::Proc) } def proc; end # Builds a type that represents `T.self_type`. - # : -> SelfType # - # source://rbi//lib/rbi/type.rb#508 - # Builds a type that represents `T.self_type`. + # source://rbi//lib/rbi/type.rb#802 sig { returns(::RBI::Type::SelfType) } def self_type; end # Builds a type that represents a shape type like `{name: String, age: Integer}`. - # : (?Hash[(String | Symbol), Type] types) -> Shape # - # source://rbi//lib/rbi/type.rb#671 - # Builds a type that represents a shape type like `{name: String, age: Integer}`. + # source://rbi//lib/rbi/type.rb#884 sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) } def shape(types = T.unsafe(nil)); end # Builds a simple type like `String` or `::Foo::Bar`. # # It raises a `NameError` if the name is not a valid Ruby class identifier. - # : (String name) -> Simple # # @raise [NameError] # - # source://rbi//lib/rbi/type.rb#473 - # Builds a simple type like `String` or `::Foo::Bar`. - # It raises a `NameError` if the name is not a valid Ruby class identifier. + # source://rbi//lib/rbi/type.rb#767 sig { params(name: ::String).returns(::RBI::Type::Simple) } def simple(name); end # Builds a type that represents the class of another type like `T::Class[Foo]`. - # : (Type type) -> Class # - # source://rbi//lib/rbi/type.rb#528 - # Builds a type that represents the class of another type like `T::Class[Foo]`. + # source://rbi//lib/rbi/type.rb#822 sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) } def t_class(type); end # Builds a type that represents a tuple type like `[String, Integer]`. - # : (*(Type | Array[Type]) types) -> Tuple # - # source://rbi//lib/rbi/type.rb#665 - # Builds a type that represents a tuple type like `[String, Integer]`. + # source://rbi//lib/rbi/type.rb#878 sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) } def tuple(*types); end # Builds a type that represents a type parameter like `T.type_parameter(:U)`. - # : (Symbol name) -> TypeParameter # - # source://rbi//lib/rbi/type.rb#657 - # Builds a type that represents a type parameter like `T.type_parameter(:U)`. + # source://rbi//lib/rbi/type.rb#870 sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) } def type_parameter(name); end # Builds a type that represents `T.untyped`. - # : -> Untyped # - # source://rbi//lib/rbi/type.rb#514 - # Builds a type that represents `T.untyped`. + # source://rbi//lib/rbi/type.rb#808 sig { returns(::RBI::Type::Untyped) } def untyped; end # Builds a type that represents `void`. - # : -> Void # - # source://rbi//lib/rbi/type.rb#520 - # Builds a type that represents `void`. + # source://rbi//lib/rbi/type.rb#814 sig { returns(::RBI::Type::Void) } def void; end private - # : (Prism::CallNode node) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#287 + # source://rbi//lib/rbi/type_parser.rb#289 sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) } def call_chain(node); end - # : (Prism::CallNode node, Integer count) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#274 + # source://rbi//lib/rbi/type_parser.rb#276 sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } def check_arguments_at_least!(node, count); end - # : (Prism::CallNode node, Integer count) -> Array[Prism::Node] - # - # source://rbi//lib/rbi/type_parser.rb#259 + # source://rbi//lib/rbi/type_parser.rb#261 sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) } def check_arguments_exactly!(node, count); end - # : (Prism::CallNode node) -> Type - # # @raise [Error] # # source://rbi//lib/rbi/type_parser.rb#71 sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } def parse_call(node); end - # : ((Prism::ConstantReadNode | Prism::ConstantPathNode) node) -> Type - # # source://rbi//lib/rbi/type_parser.rb#54 sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) } def parse_constant(node); end - # : (Prism::CallNode node) -> Type - # # @raise [Error] # # source://rbi//lib/rbi/type_parser.rb#211 sig { params(node: ::Prism::CallNode).returns(::RBI::Type) } def parse_proc(node); end - # : ((Prism::HashNode | Prism::KeywordHashNode) node) -> Type - # # source://rbi//lib/rbi/type_parser.rb#190 sig { params(node: T.any(::Prism::HashNode, ::Prism::KeywordHashNode)).returns(::RBI::Type) } def parse_shape(node); end - # : (Prism::ArrayNode node) -> Type - # # source://rbi//lib/rbi/type_parser.rb#185 sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) } def parse_tuple(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type_parser.rb#300 + # source://rbi//lib/rbi/type_parser.rb#302 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t?(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type_parser.rb#312 + # source://rbi//lib/rbi/type_parser.rb#314 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_boolean?(node); end - # : (Prism::ConstantPathNode node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type_parser.rb#319 + # source://rbi//lib/rbi/type_parser.rb#321 sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) } def t_class?(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type_parser.rb#324 + # source://rbi//lib/rbi/type_parser.rb#326 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def t_class_of?(node); end - # : (Prism::CallNode node) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type_parser.rb#331 + # source://rbi//lib/rbi/type_parser.rb#333 sig { params(node: ::Prism::CallNode).returns(T::Boolean) } def t_proc?(node); end - # : (String name) -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type.rb#689 + # source://rbi//lib/rbi/type.rb#899 sig { params(name: ::String).returns(T::Boolean) } def valid_identifier?(name); end end @@ -5513,178 +4135,192 @@ end # A type that is intersection of multiple types like `T.all(String, Integer)`. # -# source://rbi//lib/rbi/type.rb#252 +# source://rbi//lib/rbi/type.rb#384 class RBI::Type::All < ::RBI::Type::Composite - # : -> String - # - # source://rbi//lib/rbi/type.rb#255 + # source://rbi//lib/rbi/type.rb#393 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#413 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#387 sig { override.returns(::String) } def to_rbi; end end # A type that is union of multiple types like `T.any(String, Integer)`. # -# source://rbi//lib/rbi/type.rb#261 +# source://rbi//lib/rbi/type.rb#426 class RBI::Type::Any < ::RBI::Type::Composite - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/type.rb#269 + # source://rbi//lib/rbi/type.rb#434 sig { returns(T::Boolean) } def nilable?; end - # : -> String - # - # source://rbi//lib/rbi/type.rb#264 + # source://rbi//lib/rbi/type.rb#440 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#460 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#429 sig { override.returns(::String) } def to_rbi; end end # `T.anything`. # -# source://rbi//lib/rbi/type.rb#43 +# source://rbi//lib/rbi/type.rb#51 class RBI::Type::Anything < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#46 + # source://rbi//lib/rbi/type.rb#54 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#52 + # source://rbi//lib/rbi/type.rb#66 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#72 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#60 sig { override.returns(::String) } def to_rbi; end end # `T.attached_class`. # -# source://rbi//lib/rbi/type.rb#58 +# source://rbi//lib/rbi/type.rb#78 class RBI::Type::AttachedClass < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#61 + # source://rbi//lib/rbi/type.rb#81 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#67 + # source://rbi//lib/rbi/type.rb#93 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#99 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#87 sig { override.returns(::String) } def to_rbi; end end # `T::Boolean`. # -# source://rbi//lib/rbi/type.rb#73 +# source://rbi//lib/rbi/type.rb#105 class RBI::Type::Boolean < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#76 + # source://rbi//lib/rbi/type.rb#108 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#82 + # source://rbi//lib/rbi/type.rb#120 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#126 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#114 sig { override.returns(::String) } def to_rbi; end end # The class of another type like `T::Class[Foo]`. # -# source://rbi//lib/rbi/type.rb#150 +# source://rbi//lib/rbi/type.rb#242 class RBI::Type::Class < ::RBI::Type - # : (Type type) -> void - # # @return [Class] a new instance of Class # - # source://rbi//lib/rbi/type.rb#155 + # source://rbi//lib/rbi/type.rb#247 sig { params(type: ::RBI::Type).void } def initialize(type); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#162 + # source://rbi//lib/rbi/type.rb#254 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#168 + # source://rbi//lib/rbi/type.rb#266 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#272 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#260 sig { override.returns(::String) } def to_rbi; end - # : Type - # - # source://rbi//lib/rbi/type.rb#152 + # source://rbi//lib/rbi/type.rb#244 sig { returns(::RBI::Type) } def type; end end # The singleton class of another type like `T.class_of(Foo)`. # -# source://rbi//lib/rbi/type.rb#174 +# source://rbi//lib/rbi/type.rb#278 class RBI::Type::ClassOf < ::RBI::Type - # : (Simple type, ?Type? type_parameter) -> void - # # @return [ClassOf] a new instance of ClassOf # - # source://rbi//lib/rbi/type.rb#182 + # source://rbi//lib/rbi/type.rb#286 sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).void } def initialize(type, type_parameter = T.unsafe(nil)); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#190 + # source://rbi//lib/rbi/type.rb#294 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#196 + # source://rbi//lib/rbi/type.rb#310 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#316 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#300 sig { override.returns(::String) } def to_rbi; end - # : Simple - # - # source://rbi//lib/rbi/type.rb#176 + # source://rbi//lib/rbi/type.rb#280 sig { returns(::RBI::Type::Simple) } def type; end - # : Type? - # - # source://rbi//lib/rbi/type.rb#179 + # source://rbi//lib/rbi/type.rb#283 sig { returns(T.nilable(::RBI::Type)) } def type_parameter; end end # A type that is composed of multiple types like `T.all(String, Integer)`. # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/type.rb#230 +# source://rbi//lib/rbi/type.rb#366 class RBI::Type::Composite < ::RBI::Type abstract! - # : (Array[Type] types) -> void - # # @return [Composite] a new instance of Composite # - # source://rbi//lib/rbi/type.rb#239 + # source://rbi//lib/rbi/type.rb#371 sig { params(types: T::Array[::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#246 + # source://rbi//lib/rbi/type.rb#378 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#236 + # source://rbi//lib/rbi/type.rb#368 sig { returns(T::Array[::RBI::Type]) } def types; end end @@ -5694,200 +4330,194 @@ class RBI::Type::Error < ::RBI::Error; end # A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`. # -# source://rbi//lib/rbi/type.rb#277 +# source://rbi//lib/rbi/type.rb#511 class RBI::Type::Generic < ::RBI::Type - # : (String name, *Type params) -> void - # # @return [Generic] a new instance of Generic # - # source://rbi//lib/rbi/type.rb#285 + # source://rbi//lib/rbi/type.rb#519 sig { params(name: ::String, params: ::RBI::Type).void } def initialize(name, *params); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#293 + # source://rbi//lib/rbi/type.rb#527 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/type.rb#279 + # source://rbi//lib/rbi/type.rb#513 sig { returns(::String) } def name; end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#282 + # source://rbi//lib/rbi/type.rb#539 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#516 sig { returns(T::Array[::RBI::Type]) } def params; end - # : -> String - # - # source://rbi//lib/rbi/type.rb#299 + # source://rbi//lib/rbi/type.rb#545 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#533 sig { override.returns(::String) } def to_rbi; end end # A type that can be `nil` like `T.nilable(String)`. # -# source://rbi//lib/rbi/type.rb#206 +# source://rbi//lib/rbi/type.rb#322 class RBI::Type::Nilable < ::RBI::Type - # : (Type type) -> void - # # @return [Nilable] a new instance of Nilable # - # source://rbi//lib/rbi/type.rb#211 + # source://rbi//lib/rbi/type.rb#327 sig { params(type: ::RBI::Type).void } def initialize(type); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#218 + # source://rbi//lib/rbi/type.rb#334 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#224 + # source://rbi//lib/rbi/type.rb#346 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#352 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#340 sig { override.returns(::String) } def to_rbi; end - # : Type - # - # source://rbi//lib/rbi/type.rb#208 + # source://rbi//lib/rbi/type.rb#324 sig { returns(::RBI::Type) } def type; end end # `T.noreturn`. # -# source://rbi//lib/rbi/type.rb#88 +# source://rbi//lib/rbi/type.rb#132 class RBI::Type::NoReturn < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#91 + # source://rbi//lib/rbi/type.rb#135 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#97 + # source://rbi//lib/rbi/type.rb#147 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#153 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#141 sig { override.returns(::String) } def to_rbi; end end # A proc type like `T.proc.void`. # -# source://rbi//lib/rbi/type.rb#385 +# source://rbi//lib/rbi/type.rb#667 class RBI::Type::Proc < ::RBI::Type - # : -> void - # # @return [Proc] a new instance of Proc # - # source://rbi//lib/rbi/type.rb#396 + # source://rbi//lib/rbi/type.rb#678 sig { void } def initialize; end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#405 + # source://rbi//lib/rbi/type.rb#687 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : (untyped type) -> self - # - # source://rbi//lib/rbi/type.rb#433 + # source://rbi//lib/rbi/type.rb#715 sig { params(type: T.untyped).returns(T.self_type) } def bind(type); end - # : (**Type params) -> self - # - # source://rbi//lib/rbi/type.rb#415 + # source://rbi//lib/rbi/type.rb#747 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#697 sig { params(params: ::RBI::Type).returns(T.self_type) } def params(**params); end - # : Type? - # - # source://rbi//lib/rbi/type.rb#393 + # source://rbi//lib/rbi/type.rb#675 sig { returns(T.nilable(::RBI::Type)) } def proc_bind; end - # : Hash[Symbol, Type] - # - # source://rbi//lib/rbi/type.rb#387 + # source://rbi//lib/rbi/type.rb#669 sig { returns(T::Hash[::Symbol, ::RBI::Type]) } def proc_params; end - # : Type - # - # source://rbi//lib/rbi/type.rb#390 + # source://rbi//lib/rbi/type.rb#672 sig { returns(::RBI::Type) } def proc_returns; end - # : (untyped type) -> self - # - # source://rbi//lib/rbi/type.rb#421 + # source://rbi//lib/rbi/type.rb#703 sig { params(type: T.untyped).returns(T.self_type) } def returns(type); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#440 + # source://rbi//lib/rbi/type.rb#753 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#722 sig { override.returns(::String) } def to_rbi; end - # : -> self - # - # source://rbi//lib/rbi/type.rb#427 + # source://rbi//lib/rbi/type.rb#709 sig { returns(T.self_type) } def void; end end # `T.self_type`. # -# source://rbi//lib/rbi/type.rb#103 +# source://rbi//lib/rbi/type.rb#159 class RBI::Type::SelfType < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#106 + # source://rbi//lib/rbi/type.rb#162 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#112 + # source://rbi//lib/rbi/type.rb#174 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#180 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#168 sig { override.returns(::String) } def to_rbi; end end # A shape type like `{name: String, age: Integer}`. # -# source://rbi//lib/rbi/type.rb#355 +# source://rbi//lib/rbi/type.rb#625 class RBI::Type::Shape < ::RBI::Type - # : (Hash[(String | Symbol), Type] types) -> void - # # @return [Shape] a new instance of Shape # - # source://rbi//lib/rbi/type.rb#360 + # source://rbi//lib/rbi/type.rb#630 sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#367 + # source://rbi//lib/rbi/type.rb#637 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#373 + # source://rbi//lib/rbi/type.rb#653 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#659 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#643 sig { override.returns(::String) } def to_rbi; end - # : Hash[(String | Symbol), Type] - # - # source://rbi//lib/rbi/type.rb#357 + # source://rbi//lib/rbi/type.rb#627 sig { returns(T::Hash[T.any(::String, ::Symbol), ::RBI::Type]) } def types; end end @@ -5896,229 +4526,194 @@ end # # It can also be a qualified name like `::Foo` or `Foo::Bar`. # -# source://rbi//lib/rbi/type.rb#17 -# A type that represents a simple class name like `String` or `Foo`. +# source://rbi//lib/rbi/type.rb#13 class RBI::Type::Simple < ::RBI::Type - # : (String name) -> void - # # @return [Simple] a new instance of Simple # - # source://rbi//lib/rbi/type.rb#22 + # source://rbi//lib/rbi/type.rb#18 sig { params(name: ::String).void } def initialize(name); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#29 + # source://rbi//lib/rbi/type.rb#25 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : String - # - # source://rbi//lib/rbi/type.rb#19 + # source://rbi//lib/rbi/type.rb#15 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/type.rb#35 + # source://rbi//lib/rbi/type.rb#37 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#43 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#31 sig { override.returns(::String) } def to_rbi; end end # A tuple type like `[String, Integer]`. # -# source://rbi//lib/rbi/type.rb#331 +# source://rbi//lib/rbi/type.rb#589 class RBI::Type::Tuple < ::RBI::Type - # : (Array[Type] types) -> void - # # @return [Tuple] a new instance of Tuple # - # source://rbi//lib/rbi/type.rb#336 + # source://rbi//lib/rbi/type.rb#594 sig { params(types: T::Array[::RBI::Type]).void } def initialize(types); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#343 + # source://rbi//lib/rbi/type.rb#601 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#349 + # source://rbi//lib/rbi/type.rb#613 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#619 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#607 sig { override.returns(::String) } def to_rbi; end - # : Array[Type] - # - # source://rbi//lib/rbi/type.rb#333 + # source://rbi//lib/rbi/type.rb#591 sig { returns(T::Array[::RBI::Type]) } def types; end end # A type parameter like `T.type_parameter(:U)`. # -# source://rbi//lib/rbi/type.rb#305 +# source://rbi//lib/rbi/type.rb#551 class RBI::Type::TypeParameter < ::RBI::Type - # : (Symbol name) -> void - # # @return [TypeParameter] a new instance of TypeParameter # - # source://rbi//lib/rbi/type.rb#310 + # source://rbi//lib/rbi/type.rb#556 sig { params(name: ::Symbol).void } def initialize(name); end - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#317 + # source://rbi//lib/rbi/type.rb#563 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : Symbol - # - # source://rbi//lib/rbi/type.rb#307 + # source://rbi//lib/rbi/type.rb#553 sig { returns(::Symbol) } def name; end - # : -> String - # - # source://rbi//lib/rbi/type.rb#323 + # source://rbi//lib/rbi/type.rb#575 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#581 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#569 sig { override.returns(::String) } def to_rbi; end end # `T.untyped`. # -# source://rbi//lib/rbi/type.rb#118 +# source://rbi//lib/rbi/type.rb#186 class RBI::Type::Untyped < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#121 + # source://rbi//lib/rbi/type.rb#189 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#127 + # source://rbi//lib/rbi/type.rb#201 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#207 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#195 sig { override.returns(::String) } def to_rbi; end end # source://rbi//lib/rbi/type_visitor.rb#6 class RBI::Type::Visitor - # : (Type node) -> void - # # source://rbi//lib/rbi/type_visitor.rb#10 sig { params(node: ::RBI::Type).void } def visit(node); end private - # : (Type::All type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#56 sig { params(type: ::RBI::Type::All).void } def visit_all(type); end - # : (Type::Any type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#59 sig { params(type: ::RBI::Type::Any).void } def visit_any(type); end - # : (Type::Anything type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#62 sig { params(type: ::RBI::Type::Anything).void } def visit_anything(type); end - # : (Type::AttachedClass type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#65 sig { params(type: ::RBI::Type::AttachedClass).void } def visit_attached_class(type); end - # : (Type::Boolean type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#68 sig { params(type: ::RBI::Type::Boolean).void } def visit_boolean(type); end - # : (Type::Class type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#71 sig { params(type: ::RBI::Type::Class).void } def visit_class(type); end - # : (Type::ClassOf type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#74 sig { params(type: ::RBI::Type::ClassOf).void } def visit_class_of(type); end - # : (Type::Generic type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#77 sig { params(type: ::RBI::Type::Generic).void } def visit_generic(type); end - # : (Type::Nilable type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#80 sig { params(type: ::RBI::Type::Nilable).void } def visit_nilable(type); end - # : (Type::NoReturn type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#86 sig { params(type: ::RBI::Type::NoReturn).void } def visit_no_return(type); end - # : (Type::Proc type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#89 sig { params(type: ::RBI::Type::Proc).void } def visit_proc(type); end - # : (Type::SelfType type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#92 sig { params(type: ::RBI::Type::SelfType).void } def visit_self_type(type); end - # : (Type::Shape type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#98 sig { params(type: ::RBI::Type::Shape).void } def visit_shape(type); end - # : (Type::Simple type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#83 sig { params(type: ::RBI::Type::Simple).void } def visit_simple(type); end - # : (Type::Tuple type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#101 sig { params(type: ::RBI::Type::Tuple).void } def visit_tuple(type); end - # : (Type::TypeParameter type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#104 sig { params(type: ::RBI::Type::TypeParameter).void } def visit_type_parameter(type); end - # : (Type::Untyped type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#107 sig { params(type: ::RBI::Type::Untyped).void } def visit_untyped(type); end - # : (Type::Void type) -> void - # # source://rbi//lib/rbi/type_visitor.rb#95 sig { params(type: ::RBI::Type::Void).void } def visit_void(type); end @@ -6129,30 +4724,32 @@ class RBI::Type::Visitor::Error < ::RBI::Error; end # `void`. # -# source://rbi//lib/rbi/type.rb#133 +# source://rbi//lib/rbi/type.rb#213 class RBI::Type::Void < ::RBI::Type - # : (BasicObject other) -> bool - # - # source://rbi//lib/rbi/type.rb#136 + # source://rbi//lib/rbi/type.rb#216 sig { override.params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # : -> String - # - # source://rbi//lib/rbi/type.rb#142 + # source://rbi//lib/rbi/type.rb#228 + sig { override.returns(::RBI::Type) } + def normalize; end + + # source://rbi//lib/rbi/type.rb#234 + sig { override.returns(::RBI::Type) } + def simplify; end + + # source://rbi//lib/rbi/type.rb#222 sig { override.returns(::String) } def to_rbi; end end -# source://rbi//lib/rbi/model.rb#1087 +# source://rbi//lib/rbi/model.rb#1063 class RBI::TypeMember < ::RBI::NodeWithComments include ::RBI::Indexable - # : (String name, String value, ?loc: Loc?, ?comments: Array[Comment]) ?{ (TypeMember node) -> void } -> void - # # @return [TypeMember] a new instance of TypeMember # - # source://rbi//lib/rbi/model.rb#1092 + # source://rbi//lib/rbi/model.rb#1068 sig do params( name: ::String, @@ -6164,188 +4761,129 @@ class RBI::TypeMember < ::RBI::NodeWithComments end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1100 + # source://rbi//lib/rbi/model.rb#1076 sig { returns(::String) } def fully_qualified_name; end - # : -> Array[String] - # - # source://rbi//lib/rbi/index.rb#179 + # source://rbi//lib/rbi/index.rb#174 sig { override.returns(T::Array[::String]) } def index_ids; end - # : String - # - # source://rbi//lib/rbi/model.rb#1089 + # source://rbi//lib/rbi/model.rb#1065 sig { returns(::String) } def name; end - # : -> String - # - # source://rbi//lib/rbi/model.rb#1108 + # source://rbi//lib/rbi/model.rb#1084 sig { override.returns(::String) } def to_s; end - # : String - # - # source://rbi//lib/rbi/model.rb#1089 - # @return [String] + # source://rbi//lib/rbi/model.rb#1065 def value; end end -# source://rbi//lib/rbi/rbs_printer.rb#889 +# source://rbi//lib/rbi/rbs_printer.rb#982 class RBI::TypePrinter - # : -> void - # # @return [TypePrinter] a new instance of TypePrinter # - # source://rbi//lib/rbi/rbs_printer.rb#894 - sig { void } - def initialize; end + # source://rbi//lib/rbi/rbs_printer.rb#987 + sig { params(max_line_length: T.nilable(::Integer)).void } + def initialize(max_line_length: T.unsafe(nil)); end - # : String - # - # source://rbi//lib/rbi/rbs_printer.rb#891 + # source://rbi//lib/rbi/rbs_printer.rb#984 sig { returns(::String) } def string; end - # : (Type node) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#899 + # source://rbi//lib/rbi/rbs_printer.rb#993 sig { params(node: ::RBI::Type).void } def visit(node); end - # : (Type::All type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1014 + # source://rbi//lib/rbi/rbs_printer.rb#1108 sig { params(type: ::RBI::Type::All).void } def visit_all(type); end - # : (Type::Any type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1024 + # source://rbi//lib/rbi/rbs_printer.rb#1118 sig { params(type: ::RBI::Type::Any).void } def visit_any(type); end - # : (Type::Anything type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#964 + # source://rbi//lib/rbi/rbs_printer.rb#1058 sig { params(type: ::RBI::Type::Anything).void } def visit_anything(type); end - # : (Type::AttachedClass type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#989 + # source://rbi//lib/rbi/rbs_printer.rb#1083 sig { params(type: ::RBI::Type::AttachedClass).void } def visit_attached_class(type); end - # : (Type::Boolean type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#948 + # source://rbi//lib/rbi/rbs_printer.rb#1042 sig { params(type: ::RBI::Type::Boolean).void } def visit_boolean(type); end - # : (Type::Class type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1091 + # source://rbi//lib/rbi/rbs_printer.rb#1185 sig { params(type: ::RBI::Type::Class).void } def visit_class(type); end - # : (Type::ClassOf type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1007 + # source://rbi//lib/rbi/rbs_printer.rb#1101 sig { params(type: ::RBI::Type::ClassOf).void } def visit_class_of(type); end - # : (Type::Generic type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#953 + # source://rbi//lib/rbi/rbs_printer.rb#1047 sig { params(type: ::RBI::Type::Generic).void } def visit_generic(type); end - # : (Type::Nilable type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#994 + # source://rbi//lib/rbi/rbs_printer.rb#1088 sig { params(type: ::RBI::Type::Nilable).void } def visit_nilable(type); end - # : (Type::NoReturn type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#974 + # source://rbi//lib/rbi/rbs_printer.rb#1068 sig { params(type: ::RBI::Type::NoReturn).void } def visit_no_return(type); end - # : (Type::Proc type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1064 + # source://rbi//lib/rbi/rbs_printer.rb#1158 sig { params(type: ::RBI::Type::Proc).void } def visit_proc(type); end - # : (Type::SelfType type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#984 + # source://rbi//lib/rbi/rbs_printer.rb#1078 sig { params(type: ::RBI::Type::SelfType).void } def visit_self_type(type); end - # : (Type::Shape type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1044 + # source://rbi//lib/rbi/rbs_printer.rb#1138 sig { params(type: ::RBI::Type::Shape).void } def visit_shape(type); end - # : (Type::Simple type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#943 + # source://rbi//lib/rbi/rbs_printer.rb#1037 sig { params(type: ::RBI::Type::Simple).void } def visit_simple(type); end - # : (Type::Tuple type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1034 + # source://rbi//lib/rbi/rbs_printer.rb#1128 sig { params(type: ::RBI::Type::Tuple).void } def visit_tuple(type); end - # : (Type::TypeParameter type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#1086 + # source://rbi//lib/rbi/rbs_printer.rb#1180 sig { params(type: ::RBI::Type::TypeParameter).void } def visit_type_parameter(type); end - # : (Type::Untyped type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#979 + # source://rbi//lib/rbi/rbs_printer.rb#1073 sig { params(type: ::RBI::Type::Untyped).void } def visit_untyped(type); end - # : (Type::Void type) -> void - # - # source://rbi//lib/rbi/rbs_printer.rb#969 + # source://rbi//lib/rbi/rbs_printer.rb#1063 sig { params(type: ::RBI::Type::Void).void } def visit_void(type); end private - # : (String type_name) -> String - # - # source://rbi//lib/rbi/rbs_printer.rb#1100 + # source://rbi//lib/rbi/rbs_printer.rb#1194 sig { params(type_name: ::String).returns(::String) } def translate_t_type(type_name); end end # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#5 class RBI::UnexpectedMultipleSigsError < ::RBI::Error - # : (Node node) -> void - # # @return [UnexpectedMultipleSigsError] a new instance of UnexpectedMultipleSigsError # # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#10 sig { params(node: ::RBI::Node).void } def initialize(node); end - # : Node - # # source://rbi//lib/rbi/rewriters/attr_to_methods.rb#7 sig { returns(::RBI::Node) } def node; end @@ -6353,22 +4891,16 @@ end # source://rbi//lib/rbi/parser.rb#18 class RBI::UnexpectedParserError < ::RBI::Error - # : (Exception parent_exception, Loc last_location) -> void - # # @return [UnexpectedParserError] a new instance of UnexpectedParserError # # source://rbi//lib/rbi/parser.rb#23 sig { params(parent_exception: ::Exception, last_location: ::RBI::Loc).void } def initialize(parent_exception, last_location); end - # : Loc - # # source://rbi//lib/rbi/parser.rb#20 sig { returns(::RBI::Loc) } def last_location; end - # : (?io: (IO | StringIO)) -> void - # # source://rbi//lib/rbi/parser.rb#30 sig { params(io: T.any(::IO, ::StringIO)).void } def print_debug(io: T.unsafe(nil)); end @@ -6377,363 +4909,251 @@ end # source://rbi//lib/rbi/version.rb#5 RBI::VERSION = T.let(T.unsafe(nil), String) -# Visibility +# @abstract # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://rbi//lib/rbi/model.rb#710 +# source://rbi//lib/rbi/model.rb#693 class RBI::Visibility < ::RBI::NodeWithComments abstract! - # : (Symbol visibility, ?loc: Loc?, ?comments: Array[Comment]) -> void - # # @return [Visibility] a new instance of Visibility # - # source://rbi//lib/rbi/model.rb#719 + # source://rbi//lib/rbi/model.rb#698 sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # : (Object? other) -> bool - # - # source://rbi//lib/rbi/model.rb#725 + # source://rbi//lib/rbi/model.rb#704 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#742 + # source://rbi//lib/rbi/model.rb#721 sig { returns(T::Boolean) } def private?; end - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#737 + # source://rbi//lib/rbi/model.rb#716 sig { returns(T::Boolean) } def protected?; end - # : -> bool - # # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#732 + # source://rbi//lib/rbi/model.rb#711 sig { returns(T::Boolean) } def public?; end - # : Symbol - # - # source://rbi//lib/rbi/model.rb#716 + # source://rbi//lib/rbi/model.rb#695 sig { returns(::Symbol) } def visibility; end end # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#49 class RBI::VisibilityGroup < ::RBI::Tree - # : (Visibility visibility) -> void - # # @return [VisibilityGroup] a new instance of VisibilityGroup # # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#54 sig { params(visibility: ::RBI::Visibility).void } def initialize(visibility); end - # : Visibility - # # source://rbi//lib/rbi/rewriters/nest_non_public_members.rb#51 sig { returns(::RBI::Visibility) } def visibility; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://rbi//lib/rbi/visitor.rb#7 +# source://rbi//lib/rbi/visitor.rb#8 class RBI::Visitor abstract! - # : (Node? node) -> void - # - # source://rbi//lib/rbi/visitor.rb#13 + # source://rbi//lib/rbi/visitor.rb#10 sig { params(node: T.nilable(::RBI::Node)).void } def visit(node); end - # : (Array[Node] nodes) -> void - # - # source://rbi//lib/rbi/visitor.rb#111 + # source://rbi//lib/rbi/visitor.rb#108 sig { params(nodes: T::Array[::RBI::Node]).void } def visit_all(nodes); end - # : (File file) -> void - # - # source://rbi//lib/rbi/visitor.rb#116 + # source://rbi//lib/rbi/visitor.rb#113 sig { params(file: ::RBI::File).void } def visit_file(file); end private - # : (Arg node) -> void - # - # source://rbi//lib/rbi/visitor.rb#201 + # source://rbi//lib/rbi/visitor.rb#198 sig { params(node: ::RBI::Arg).void } def visit_arg(node); end - # : (AttrAccessor node) -> void - # - # source://rbi//lib/rbi/visitor.rb#150 + # source://rbi//lib/rbi/visitor.rb#147 sig { params(node: ::RBI::AttrAccessor).void } def visit_attr_accessor(node); end - # : (AttrReader node) -> void - # - # source://rbi//lib/rbi/visitor.rb#153 + # source://rbi//lib/rbi/visitor.rb#150 sig { params(node: ::RBI::AttrReader).void } def visit_attr_reader(node); end - # : (AttrWriter node) -> void - # - # source://rbi//lib/rbi/visitor.rb#156 + # source://rbi//lib/rbi/visitor.rb#153 sig { params(node: ::RBI::AttrWriter).void } def visit_attr_writer(node); end - # : (BlankLine node) -> void - # - # source://rbi//lib/rbi/visitor.rb#129 + # source://rbi//lib/rbi/visitor.rb#126 sig { params(node: ::RBI::BlankLine).void } def visit_blank_line(node); end - # : (BlockParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#180 + # source://rbi//lib/rbi/visitor.rb#177 sig { params(node: ::RBI::BlockParam).void } def visit_block_param(node); end - # : (Class node) -> void - # - # source://rbi//lib/rbi/visitor.rb#135 + # source://rbi//lib/rbi/visitor.rb#132 sig { params(node: ::RBI::Class).void } def visit_class(node); end - # : (Comment node) -> void - # - # source://rbi//lib/rbi/visitor.rb#123 + # source://rbi//lib/rbi/visitor.rb#120 sig { params(node: ::RBI::Comment).void } def visit_comment(node); end - # : (ConflictTree node) -> void - # - # source://rbi//lib/rbi/visitor.rb#249 + # source://rbi//lib/rbi/visitor.rb#246 sig { params(node: ::RBI::ConflictTree).void } def visit_conflict_tree(node); end - # : (Const node) -> void - # - # source://rbi//lib/rbi/visitor.rb#147 + # source://rbi//lib/rbi/visitor.rb#144 sig { params(node: ::RBI::Const).void } def visit_const(node); end - # : (Extend node) -> void - # - # source://rbi//lib/rbi/visitor.rb#186 + # source://rbi//lib/rbi/visitor.rb#183 sig { params(node: ::RBI::Extend).void } def visit_extend(node); end - # : (Group node) -> void - # - # source://rbi//lib/rbi/visitor.rb#243 + # source://rbi//lib/rbi/visitor.rb#240 sig { params(node: ::RBI::Group).void } def visit_group(node); end - # : (Helper node) -> void - # - # source://rbi//lib/rbi/visitor.rb#231 + # source://rbi//lib/rbi/visitor.rb#228 sig { params(node: ::RBI::Helper).void } def visit_helper(node); end - # : (Include node) -> void - # - # source://rbi//lib/rbi/visitor.rb#183 + # source://rbi//lib/rbi/visitor.rb#180 sig { params(node: ::RBI::Include).void } def visit_include(node); end - # : (KwArg node) -> void - # - # source://rbi//lib/rbi/visitor.rb#204 + # source://rbi//lib/rbi/visitor.rb#201 sig { params(node: ::RBI::KwArg).void } def visit_kw_arg(node); end - # : (KwOptParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#174 + # source://rbi//lib/rbi/visitor.rb#171 sig { params(node: ::RBI::KwOptParam).void } def visit_kw_opt_param(node); end - # : (KwParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#171 + # source://rbi//lib/rbi/visitor.rb#168 sig { params(node: ::RBI::KwParam).void } def visit_kw_param(node); end - # : (KwRestParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#177 + # source://rbi//lib/rbi/visitor.rb#174 sig { params(node: ::RBI::KwRestParam).void } def visit_kw_rest_param(node); end - # : (Method node) -> void - # - # source://rbi//lib/rbi/visitor.rb#159 + # source://rbi//lib/rbi/visitor.rb#156 sig { params(node: ::RBI::Method).void } def visit_method(node); end - # : (MixesInClassMethods node) -> void - # - # source://rbi//lib/rbi/visitor.rb#237 + # source://rbi//lib/rbi/visitor.rb#234 sig { params(node: ::RBI::MixesInClassMethods).void } def visit_mixes_in_class_methods(node); end - # : (Module node) -> void - # - # source://rbi//lib/rbi/visitor.rb#132 + # source://rbi//lib/rbi/visitor.rb#129 sig { params(node: ::RBI::Module).void } def visit_module(node); end - # : (OptParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#165 + # source://rbi//lib/rbi/visitor.rb#162 sig { params(node: ::RBI::OptParam).void } def visit_opt_param(node); end - # : (Private node) -> void - # - # source://rbi//lib/rbi/visitor.rb#195 + # source://rbi//lib/rbi/visitor.rb#192 sig { params(node: ::RBI::Private).void } def visit_private(node); end - # : (Protected node) -> void - # - # source://rbi//lib/rbi/visitor.rb#192 + # source://rbi//lib/rbi/visitor.rb#189 sig { params(node: ::RBI::Protected).void } def visit_protected(node); end - # : (Public node) -> void - # - # source://rbi//lib/rbi/visitor.rb#189 + # source://rbi//lib/rbi/visitor.rb#186 sig { params(node: ::RBI::Public).void } def visit_public(node); end - # : (RBSComment node) -> void - # - # source://rbi//lib/rbi/visitor.rb#126 + # source://rbi//lib/rbi/visitor.rb#123 sig { params(node: ::RBI::RBSComment).void } def visit_rbs_comment(node); end - # : (ReqParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#162 + # source://rbi//lib/rbi/visitor.rb#159 sig { params(node: ::RBI::ReqParam).void } def visit_req_param(node); end - # : (RequiresAncestor node) -> void - # - # source://rbi//lib/rbi/visitor.rb#240 + # source://rbi//lib/rbi/visitor.rb#237 sig { params(node: ::RBI::RequiresAncestor).void } def visit_requires_ancestor(node); end - # : (RestParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#168 + # source://rbi//lib/rbi/visitor.rb#165 sig { params(node: ::RBI::RestParam).void } def visit_rest_param(node); end - # : (ScopeConflict node) -> void - # - # source://rbi//lib/rbi/visitor.rb#252 + # source://rbi//lib/rbi/visitor.rb#249 sig { params(node: ::RBI::ScopeConflict).void } def visit_scope_conflict(node); end - # : (Send node) -> void - # - # source://rbi//lib/rbi/visitor.rb#198 + # source://rbi//lib/rbi/visitor.rb#195 sig { params(node: ::RBI::Send).void } def visit_send(node); end - # : (Sig node) -> void - # - # source://rbi//lib/rbi/visitor.rb#207 + # source://rbi//lib/rbi/visitor.rb#204 sig { params(node: ::RBI::Sig).void } def visit_sig(node); end - # : (SigParam node) -> void - # - # source://rbi//lib/rbi/visitor.rb#210 + # source://rbi//lib/rbi/visitor.rb#207 sig { params(node: ::RBI::SigParam).void } def visit_sig_param(node); end - # : (SingletonClass node) -> void - # - # source://rbi//lib/rbi/visitor.rb#138 + # source://rbi//lib/rbi/visitor.rb#135 sig { params(node: ::RBI::SingletonClass).void } def visit_singleton_class(node); end - # : (Struct node) -> void - # - # source://rbi//lib/rbi/visitor.rb#141 + # source://rbi//lib/rbi/visitor.rb#138 sig { params(node: ::RBI::Struct).void } def visit_struct(node); end - # : (TEnum node) -> void - # - # source://rbi//lib/rbi/visitor.rb#222 + # source://rbi//lib/rbi/visitor.rb#219 sig { params(node: ::RBI::TEnum).void } def visit_tenum(node); end - # : (TEnumBlock node) -> void - # - # source://rbi//lib/rbi/visitor.rb#225 + # source://rbi//lib/rbi/visitor.rb#222 sig { params(node: ::RBI::TEnumBlock).void } def visit_tenum_block(node); end - # : (TEnumValue node) -> void - # - # source://rbi//lib/rbi/visitor.rb#228 + # source://rbi//lib/rbi/visitor.rb#225 sig { params(node: ::RBI::TEnumValue).void } def visit_tenum_value(node); end - # : (Tree node) -> void - # - # source://rbi//lib/rbi/visitor.rb#144 + # source://rbi//lib/rbi/visitor.rb#141 sig { params(node: ::RBI::Tree).void } def visit_tree(node); end - # : (TStruct node) -> void - # - # source://rbi//lib/rbi/visitor.rb#213 + # source://rbi//lib/rbi/visitor.rb#210 sig { params(node: ::RBI::TStruct).void } def visit_tstruct(node); end - # : (TStructConst node) -> void - # - # source://rbi//lib/rbi/visitor.rb#216 + # source://rbi//lib/rbi/visitor.rb#213 sig { params(node: ::RBI::TStructConst).void } def visit_tstruct_const(node); end - # : (TStructProp node) -> void - # - # source://rbi//lib/rbi/visitor.rb#219 + # source://rbi//lib/rbi/visitor.rb#216 sig { params(node: ::RBI::TStructProp).void } def visit_tstruct_prop(node); end - # : (TypeMember node) -> void - # - # source://rbi//lib/rbi/visitor.rb#234 + # source://rbi//lib/rbi/visitor.rb#231 sig { params(node: ::RBI::TypeMember).void } def visit_type_member(node); end - # : (VisibilityGroup node) -> void - # - # source://rbi//lib/rbi/visitor.rb#246 + # source://rbi//lib/rbi/visitor.rb#243 sig { params(node: ::RBI::VisibilityGroup).void } def visit_visibility_group(node); end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rbs@3.9.4.rbi b/Library/Homebrew/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi similarity index 80% rename from Library/Homebrew/sorbet/rbi/gems/rbs@3.9.4.rbi rename to Library/Homebrew/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi index 681f7787dd..dec3eaa23c 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rbs@3.9.4.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi @@ -5,38 +5,29 @@ # Please instead update this file by running `bin/tapioca gem rbs`. -# source://rbs//lib/rbs/namespace.rb#120 -module Kernel - # source://rbs//lib/rbs/namespace.rb#121 - def Namespace(name); end - - # source://rbs//lib/rbs/type_name.rb#105 - def TypeName(string); end -end - # source://rbs//lib/rbs/version.rb#3 module RBS class << self - # source://rbs//lib/rbs.rb#69 + # source://rbs//lib/rbs.rb#81 def logger; end # Returns the value of attribute logger_level. # - # source://rbs//lib/rbs.rb#66 + # source://rbs//lib/rbs.rb#78 def logger_level; end - # source://rbs//lib/rbs.rb#78 + # source://rbs//lib/rbs.rb#90 def logger_level=(level); end # Returns the value of attribute logger_output. # - # source://rbs//lib/rbs.rb#67 + # source://rbs//lib/rbs.rb#79 def logger_output; end - # source://rbs//lib/rbs.rb#73 + # source://rbs//lib/rbs.rb#85 def logger_output=(val); end - # source://rbs//lib/rbs.rb#83 + # source://rbs//lib/rbs.rb#95 def print_warning; end end end @@ -54,7 +45,7 @@ class RBS::AST::Annotation # source://rbs//lib/rbs/ast/annotation.rb#14 def ==(other); end - # source://rbs//lib/rbs/ast/annotation.rb#14 + # source://rbs//lib/rbs/ast/annotation.rb#18 def eql?(other); end # source://rbs//lib/rbs/ast/annotation.rb#20 @@ -84,7 +75,7 @@ class RBS::AST::Comment # source://rbs//lib/rbs/ast/comment.rb#14 def ==(other); end - # source://rbs//lib/rbs/ast/comment.rb#14 + # source://rbs//lib/rbs/ast/comment.rb#18 def eql?(other); end # source://rbs//lib/rbs/ast/comment.rb#20 @@ -127,7 +118,7 @@ class RBS::AST::Declarations::AliasDecl < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#424 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#434 + # source://rbs//lib/rbs/ast/declarations.rb#440 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#442 @@ -175,7 +166,7 @@ class RBS::AST::Declarations::Class < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#95 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#119 + # source://rbs//lib/rbs/ast/declarations.rb#127 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#129 @@ -228,7 +219,7 @@ class RBS::AST::Declarations::Class::Super # source://rbs//lib/rbs/ast/declarations.rb#58 def args; end - # source://rbs//lib/rbs/ast/declarations.rb#67 + # source://rbs//lib/rbs/ast/declarations.rb#71 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#73 @@ -274,7 +265,7 @@ class RBS::AST::Declarations::Constant < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#351 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#362 + # source://rbs//lib/rbs/ast/declarations.rb#368 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#370 @@ -319,7 +310,7 @@ class RBS::AST::Declarations::Global < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#389 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#400 + # source://rbs//lib/rbs/ast/declarations.rb#406 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#408 @@ -366,7 +357,7 @@ class RBS::AST::Declarations::Interface < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#254 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#278 + # source://rbs//lib/rbs/ast/declarations.rb#285 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#287 @@ -428,7 +419,7 @@ class RBS::AST::Declarations::Module < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#195 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#220 + # source://rbs//lib/rbs/ast/declarations.rb#228 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#230 @@ -481,7 +472,7 @@ class RBS::AST::Declarations::Module::Self # source://rbs//lib/rbs/ast/declarations.rb#150 def args; end - # source://rbs//lib/rbs/ast/declarations.rb#159 + # source://rbs//lib/rbs/ast/declarations.rb#163 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#165 @@ -539,7 +530,7 @@ class RBS::AST::Declarations::TypeAlias < ::RBS::AST::Declarations::Base # source://rbs//lib/rbs/ast/declarations.rb#310 def comment; end - # source://rbs//lib/rbs/ast/declarations.rb#321 + # source://rbs//lib/rbs/ast/declarations.rb#328 def eql?(other); end # source://rbs//lib/rbs/ast/declarations.rb#330 @@ -675,7 +666,7 @@ class RBS::AST::Members::Alias < ::RBS::AST::Members::Base # source://rbs//lib/rbs/ast/members.rb#405 def comment; end - # source://rbs//lib/rbs/ast/members.rb#416 + # source://rbs//lib/rbs/ast/members.rb#423 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#425 @@ -757,7 +748,7 @@ module RBS::AST::Members::Attribute # source://rbs//lib/rbs/ast/members.rb#267 def comment; end - # source://rbs//lib/rbs/ast/members.rb#281 + # source://rbs//lib/rbs/ast/members.rb#290 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#292 @@ -848,7 +839,7 @@ module RBS::AST::Members::LocationOnly # source://rbs//lib/rbs/ast/members.rb#372 def ==(other); end - # source://rbs//lib/rbs/ast/members.rb#372 + # source://rbs//lib/rbs/ast/members.rb#376 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#378 @@ -880,7 +871,7 @@ class RBS::AST::Members::MethodDefinition < ::RBS::AST::Members::Base # source://rbs//lib/rbs/ast/members.rb#51 def comment; end - # source://rbs//lib/rbs/ast/members.rb#66 + # source://rbs//lib/rbs/ast/members.rb#75 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#77 @@ -953,7 +944,7 @@ class RBS::AST::Members::MethodDefinition::Overload # source://rbs//lib/rbs/ast/members.rb#11 def annotations; end - # source://rbs//lib/rbs/ast/members.rb#18 + # source://rbs//lib/rbs/ast/members.rb#26 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#22 @@ -1053,7 +1044,7 @@ module RBS::AST::Members::Var # source://rbs//lib/rbs/ast/members.rb#125 def comment; end - # source://rbs//lib/rbs/ast/members.rb#134 + # source://rbs//lib/rbs/ast/members.rb#138 def eql?(other); end # source://rbs//lib/rbs/ast/members.rb#140 @@ -1075,6 +1066,475 @@ module RBS::AST::Members::Var def type; end end +# source://rbs//lib/rbs/ast/ruby/comment_block.rb#5 +module RBS::AST::Ruby; end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#6 +module RBS::AST::Ruby::Annotations; end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#7 +class RBS::AST::Ruby::Annotations::Base + # @return [Base] a new instance of Base + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#10 + def initialize(location, prefix_location); end + + # source://rbs//lib/rbs/ast/ruby/annotations.rb#15 + def buffer; end + + # Returns the value of attribute location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#8 + def location; end + + # Returns the value of attribute prefix_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#8 + def prefix_location; end +end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#36 +class RBS::AST::Ruby::Annotations::ColonMethodTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # @return [ColonMethodTypeAnnotation] a new instance of ColonMethodTypeAnnotation + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#39 + def initialize(location:, prefix_location:, annotations:, method_type:); end + + # Returns the value of attribute annotations. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#37 + def annotations; end + + # source://rbs//lib/rbs/ast/ruby/annotations.rb#45 + def map_type_name; end + + # Returns the value of attribute method_type. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#37 + def method_type; end +end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#55 +class RBS::AST::Ruby::Annotations::MethodTypesAnnotation < ::RBS::AST::Ruby::Annotations::Base + # @return [MethodTypesAnnotation] a new instance of MethodTypesAnnotation + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#60 + def initialize(location:, prefix_location:, overloads:, vertical_bar_locations:); end + + # source://rbs//lib/rbs/ast/ruby/annotations.rb#66 + def map_type_name(&block); end + + # Returns the value of attribute overloads. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#58 + def overloads; end + + # Returns the value of attribute vertical_bar_locations. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#58 + def vertical_bar_locations; end +end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#56 +RBS::AST::Ruby::Annotations::MethodTypesAnnotation::Overload = RBS::AST::Members::MethodDefinition::Overload + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#20 +class RBS::AST::Ruby::Annotations::NodeTypeAssertion < ::RBS::AST::Ruby::Annotations::Base + # @return [NodeTypeAssertion] a new instance of NodeTypeAssertion + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#23 + def initialize(location:, prefix_location:, type:); end + + # source://rbs//lib/rbs/ast/ruby/annotations.rb#28 + def map_type_name; end + + # Returns the value of attribute type. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#21 + def type; end +end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#88 +class RBS::AST::Ruby::Annotations::ReturnTypeAnnotation < ::RBS::AST::Ruby::Annotations::Base + # @return [ReturnTypeAnnotation] a new instance of ReturnTypeAnnotation + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#97 + def initialize(location:, prefix_location:, return_location:, colon_location:, return_type:, comment_location:); end + + # Returns the value of attribute colon_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#91 + def colon_location; end + + # Returns the value of attribute comment_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#95 + def comment_location; end + + # source://rbs//lib/rbs/ast/ruby/annotations.rb#105 + def map_type_name(&block); end + + # Returns the value of attribute return_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#89 + def return_location; end + + # Returns the value of attribute return_type. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#93 + def return_type; end +end + +# source://rbs//lib/rbs/ast/ruby/annotations.rb#78 +class RBS::AST::Ruby::Annotations::SkipAnnotation < ::RBS::AST::Ruby::Annotations::Base + # @return [SkipAnnotation] a new instance of SkipAnnotation + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#81 + def initialize(location:, prefix_location:, skip_location:, comment_location:); end + + # Returns the value of attribute comment_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#79 + def comment_location; end + + # Returns the value of attribute skip_location. + # + # source://rbs//lib/rbs/ast/ruby/annotations.rb#79 + def skip_location; end +end + +# source://rbs//lib/rbs/ast/ruby/comment_block.rb#6 +class RBS::AST::Ruby::CommentBlock + # @return [CommentBlock] a new instance of CommentBlock + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#9 + def initialize(source_buffer, comments); end + + # Returns the value of attribute comment_buffer. + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#7 + def comment_buffer; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#204 + def comments; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#98 + def each_paragraph(variables, &block); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#50 + def end_line; end + + # @return [Boolean] + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#36 + def leading?; end + + # @return [Boolean] + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#208 + def leading_annotation?(index); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#174 + def line_location(start_line, end_line); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#54 + def line_starts; end + + # Returns the value of attribute name. + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#7 + def name; end + + # Returns the value of attribute offsets. + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#7 + def offsets; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#180 + def parse_annotation_lines(start_line, end_line, variables); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#46 + def start_line; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#169 + def text(comment_index); end + + # @return [Boolean] + # + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#41 + def trailing?; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#190 + def trailing_annotation(variables); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#130 + def yield_annotation(start_line, end_line, current_line, variables, &block); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#110 + def yield_paragraph(start_line, current_line, variables, &block); end + + class << self + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#60 + def build(buffer, comments); end + end +end + +# source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 +class RBS::AST::Ruby::CommentBlock::AnnotationSyntaxError < ::Struct + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def error; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def error=(_); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def location; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def location=(_); end + + class << self + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def [](*_arg0); end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def inspect; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def keyword_init?; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def members; end + + # source://rbs//lib/rbs/ast/ruby/comment_block.rb#96 + def new(*_arg0); end + end +end + +# source://rbs//lib/rbs/ast/ruby/declarations.rb#6 +module RBS::AST::Ruby::Declarations; end + +# source://rbs//lib/rbs/ast/ruby/declarations.rb#7 +class RBS::AST::Ruby::Declarations::Base + include ::RBS::AST::Ruby::Helpers::ConstantHelper + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # @return [Base] a new instance of Base + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#13 + def initialize(buffer); end + + # Returns the value of attribute buffer. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#8 + def buffer; end +end + +# source://rbs//lib/rbs/ast/ruby/declarations.rb#18 +class RBS::AST::Ruby::Declarations::ClassDecl < ::RBS::AST::Ruby::Declarations::Base + # @return [ClassDecl] a new instance of ClassDecl + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#25 + def initialize(buffer, name, node); end + + # Returns the value of attribute class_name. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#19 + def class_name; end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#32 + def each_decl(&block); end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#46 + def location; end + + # Returns the value of attribute members. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#21 + def members; end + + # Returns the value of attribute node. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#23 + def node; end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#42 + def super_class; end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#44 + def type_params; end +end + +# source://rbs//lib/rbs/ast/ruby/declarations.rb#51 +class RBS::AST::Ruby::Declarations::ModuleDecl < ::RBS::AST::Ruby::Declarations::Base + # @return [ModuleDecl] a new instance of ModuleDecl + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#58 + def initialize(buffer, name, node); end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#65 + def each_decl(&block); end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#79 + def location; end + + # Returns the value of attribute members. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#54 + def members; end + + # Returns the value of attribute module_name. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#52 + def module_name; end + + # Returns the value of attribute node. + # + # source://rbs//lib/rbs/ast/ruby/declarations.rb#56 + def node; end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#77 + def self_types; end + + # source://rbs//lib/rbs/ast/ruby/declarations.rb#75 + def type_params; end +end + +# source://rbs//lib/rbs/ast/ruby/helpers/constant_helper.rb#6 +module RBS::AST::Ruby::Helpers; end + +# source://rbs//lib/rbs/ast/ruby/helpers/constant_helper.rb#7 +module RBS::AST::Ruby::Helpers::ConstantHelper + private + + # source://rbs//lib/rbs/ast/ruby/helpers/constant_helper.rb#10 + def constant_as_type_name(node); end + + class << self + # source://rbs//lib/rbs/ast/ruby/helpers/constant_helper.rb#10 + def constant_as_type_name(node); end + end +end + +# source://rbs//lib/rbs/ast/ruby/helpers/location_helper.rb#7 +module RBS::AST::Ruby::Helpers::LocationHelper + # source://rbs//lib/rbs/ast/ruby/helpers/location_helper.rb#8 + def rbs_location(location); end +end + +# source://rbs//lib/rbs/ast/ruby/members.rb#6 +module RBS::AST::Ruby::Members; end + +# source://rbs//lib/rbs/ast/ruby/members.rb#7 +class RBS::AST::Ruby::Members::Base + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # @return [Base] a new instance of Base + # + # source://rbs//lib/rbs/ast/ruby/members.rb#10 + def initialize(buffer); end + + # Returns the value of attribute buffer. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#8 + def buffer; end +end + +# source://rbs//lib/rbs/ast/ruby/members.rb#180 +class RBS::AST::Ruby::Members::DefMember < ::RBS::AST::Ruby::Members::Base + # @return [DefMember] a new instance of DefMember + # + # source://rbs//lib/rbs/ast/ruby/members.rb#187 + def initialize(buffer, name, node, method_type); end + + # source://rbs//lib/rbs/ast/ruby/members.rb#206 + def annotations; end + + # source://rbs//lib/rbs/ast/ruby/members.rb#194 + def location; end + + # Returns the value of attribute method_type. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#185 + def method_type; end + + # Returns the value of attribute name. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#183 + def name; end + + # Returns the value of attribute node. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#184 + def node; end + + # @return [Boolean] + # + # source://rbs//lib/rbs/ast/ruby/members.rb#202 + def overloading?; end + + # source://rbs//lib/rbs/ast/ruby/members.rb#198 + def overloads; end +end + +# source://rbs//lib/rbs/ast/ruby/members.rb#181 +RBS::AST::Ruby::Members::DefMember::Overload = RBS::AST::Members::MethodDefinition::Overload + +# source://rbs//lib/rbs/ast/ruby/members.rb#17 +class RBS::AST::Ruby::Members::MethodTypeAnnotation + # @return [MethodTypeAnnotation] a new instance of MethodTypeAnnotation + # + # source://rbs//lib/rbs/ast/ruby/members.rb#64 + def initialize(type_annotations:); end + + # @return [Boolean] + # + # source://rbs//lib/rbs/ast/ruby/members.rb#139 + def empty?; end + + # source://rbs//lib/rbs/ast/ruby/members.rb#68 + def map_type_name(&block); end + + # source://rbs//lib/rbs/ast/ruby/members.rb#143 + def overloads; end + + # Returns the value of attribute type_annotations. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#62 + def type_annotations; end + + class << self + # source://rbs//lib/rbs/ast/ruby/members.rb#81 + def build(leading_block, trailing_block, variables); end + end +end + +# source://rbs//lib/rbs/ast/ruby/members.rb#18 +class RBS::AST::Ruby::Members::MethodTypeAnnotation::DocStyle + # @return [DocStyle] a new instance of DocStyle + # + # source://rbs//lib/rbs/ast/ruby/members.rb#21 + def initialize; end + + # source://rbs//lib/rbs/ast/ruby/members.rb#25 + def map_type_name(&block); end + + # source://rbs//lib/rbs/ast/ruby/members.rb#31 + def method_type; end + + # Returns the value of attribute return_type_annotation. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#19 + def return_type_annotation; end + + # Sets the attribute return_type_annotation + # + # @param value the value to set the attribute return_type_annotation to. + # + # source://rbs//lib/rbs/ast/ruby/members.rb#19 + def return_type_annotation=(_arg0); end +end + # source://rbs//lib/rbs/ast/type_param.rb#5 class RBS::AST::TypeParam # @return [TypeParam] a new instance of TypeParam @@ -1090,7 +1550,7 @@ class RBS::AST::TypeParam # source://rbs//lib/rbs/ast/type_param.rb#6 def default_type; end - # source://rbs//lib/rbs/ast/type_param.rb#33 + # source://rbs//lib/rbs/ast/type_param.rb#42 def eql?(other); end # source://rbs//lib/rbs/ast/type_param.rb#44 @@ -1296,28 +1756,52 @@ end # source://rbs//lib/rbs/ancestor_graph.rb#5 class RBS::AncestorGraph::InstanceNode < ::Struct + # source://rbs//lib/rbs/ancestor_graph.rb#5 def type_name; end + + # source://rbs//lib/rbs/ancestor_graph.rb#5 def type_name=(_); end class << self + # source://rbs//lib/rbs/ancestor_graph.rb#5 def [](*_arg0); end + + # source://rbs//lib/rbs/ancestor_graph.rb#5 def inspect; end + + # source://rbs//lib/rbs/ancestor_graph.rb#5 def keyword_init?; end + + # source://rbs//lib/rbs/ancestor_graph.rb#5 def members; end + + # source://rbs//lib/rbs/ancestor_graph.rb#5 def new(*_arg0); end end end # source://rbs//lib/rbs/ancestor_graph.rb#6 class RBS::AncestorGraph::SingletonNode < ::Struct + # source://rbs//lib/rbs/ancestor_graph.rb#6 def type_name; end + + # source://rbs//lib/rbs/ancestor_graph.rb#6 def type_name=(_); end class << self + # source://rbs//lib/rbs/ancestor_graph.rb#6 def [](*_arg0); end + + # source://rbs//lib/rbs/ancestor_graph.rb#6 def inspect; end + + # source://rbs//lib/rbs/ancestor_graph.rb#6 def keyword_init?; end + + # source://rbs//lib/rbs/ancestor_graph.rb#6 def members; end + + # source://rbs//lib/rbs/ancestor_graph.rb#6 def new(*_arg0); end end end @@ -1329,24 +1813,33 @@ class RBS::BaseError < ::StandardError; end class RBS::Buffer # @return [Buffer] a new instance of Buffer # - # source://rbs//lib/rbs/buffer.rb#8 - def initialize(name:, content:); end + # source://rbs//lib/rbs/buffer.rb#9 + def initialize(content:, name: T.unsafe(nil), parent: T.unsafe(nil)); end + + # source://rbs//lib/rbs/buffer.rb#126 + def absolute_position(position); end # Returns the value of attribute content. # # source://rbs//lib/rbs/buffer.rb#6 def content; end - # source://rbs//lib/rbs/buffer.rb#63 + # source://rbs//lib/rbs/buffer.rb#143 + def detach; end + + # source://rbs//lib/rbs/buffer.rb#81 def inspect; end - # source://rbs//lib/rbs/buffer.rb#59 + # source://rbs//lib/rbs/buffer.rb#73 def last_position; end - # source://rbs//lib/rbs/buffer.rb#13 + # source://rbs//lib/rbs/buffer.rb#26 + def line_count; end + + # source://rbs//lib/rbs/buffer.rb#22 def lines; end - # source://rbs//lib/rbs/buffer.rb#49 + # source://rbs//lib/rbs/buffer.rb#63 def loc_to_pos(loc); end # Returns the value of attribute name. @@ -1354,11 +1847,31 @@ class RBS::Buffer # source://rbs//lib/rbs/buffer.rb#5 def name; end - # source://rbs//lib/rbs/buffer.rb#37 + # Returns the value of attribute parent. + # + # source://rbs//lib/rbs/buffer.rb#7 + def parent; end + + # source://rbs//lib/rbs/buffer.rb#111 + def parent_buffer; end + + # source://rbs//lib/rbs/buffer.rb#117 + def parent_position(position); end + + # source://rbs//lib/rbs/buffer.rb#51 def pos_to_loc(pos); end - # source://rbs//lib/rbs/buffer.rb#17 + # source://rbs//lib/rbs/buffer.rb#30 def ranges; end + + # source://rbs//lib/rbs/buffer.rb#85 + def rbs_location(location, loc2 = T.unsafe(nil)); end + + # source://rbs//lib/rbs/buffer.rb#93 + def sub_buffer(lines:); end + + # source://rbs//lib/rbs/buffer.rb#135 + def top_buffer; end end # source://rbs//lib/rbs/builtin_names.rb#4 @@ -1959,7 +2472,10 @@ class RBS::Collection::Sources::Rubygems class << self private + # source://rbs//lib/rbs/collection/sources/rubygems.rb#11 def allocate; end + + # source://rbs//lib/rbs/collection/sources/rubygems.rb#11 def new(*_arg0); end end end @@ -1998,7 +2514,10 @@ class RBS::Collection::Sources::Stdlib class << self private + # source://rbs//lib/rbs/collection/sources/stdlib.rb#11 def allocate; end + + # source://rbs//lib/rbs/collection/sources/stdlib.rb#11 def new(*_arg0); end end end @@ -2021,7 +2540,7 @@ class RBS::Constant # source://rbs//lib/rbs/constant.rb#7 def entry; end - # source://rbs//lib/rbs/constant.rb#15 + # source://rbs//lib/rbs/constant.rb#22 def eql?(other); end # source://rbs//lib/rbs/constant.rb#24 @@ -2038,51 +2557,51 @@ class RBS::Constant def type; end end -# source://rbs//lib/rbs/errors.rb#577 +# source://rbs//lib/rbs/errors.rb#578 class RBS::CyclicClassAliasDefinitionError < ::RBS::BaseError include ::RBS::DetailedMessageable # @return [CyclicClassAliasDefinitionError] a new instance of CyclicClassAliasDefinitionError # - # source://rbs//lib/rbs/errors.rb#582 + # source://rbs//lib/rbs/errors.rb#583 def initialize(entry); end # Returns the value of attribute alias_entry. # - # source://rbs//lib/rbs/errors.rb#580 + # source://rbs//lib/rbs/errors.rb#581 def alias_entry; end - # source://rbs//lib/rbs/errors.rb#588 + # source://rbs//lib/rbs/errors.rb#589 def location; end end -# source://rbs//lib/rbs/errors.rb#538 +# source://rbs//lib/rbs/errors.rb#539 class RBS::CyclicTypeParameterBound < ::RBS::BaseError include ::RBS::DetailedMessageable # @return [CyclicTypeParameterBound] a new instance of CyclicTypeParameterBound # - # source://rbs//lib/rbs/errors.rb#543 + # source://rbs//lib/rbs/errors.rb#544 def initialize(type_name:, method_name:, params:, location:); end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#541 + # source://rbs//lib/rbs/errors.rb#542 def location; end # Returns the value of attribute method_name. # - # source://rbs//lib/rbs/errors.rb#541 + # source://rbs//lib/rbs/errors.rb#542 def method_name; end # Returns the value of attribute params. # - # source://rbs//lib/rbs/errors.rb#541 + # source://rbs//lib/rbs/errors.rb#542 def params; end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/errors.rb#541 + # source://rbs//lib/rbs/errors.rb#542 def type_name; end end @@ -2090,170 +2609,170 @@ end class RBS::Definition # @return [Definition] a new instance of Definition # - # source://rbs//lib/rbs/definition.rb#297 + # source://rbs//lib/rbs/definition.rb#302 def initialize(type_name:, entry:, self_type:, ancestors:); end # Returns the value of attribute ancestors. # - # source://rbs//lib/rbs/definition.rb#291 + # source://rbs//lib/rbs/definition.rb#296 def ancestors; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#320 + # source://rbs//lib/rbs/definition.rb#325 def class?; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#337 + # source://rbs//lib/rbs/definition.rb#342 def class_type?; end # Returns the value of attribute class_variables. # - # source://rbs//lib/rbs/definition.rb#295 + # source://rbs//lib/rbs/definition.rb#300 def class_variables; end - # source://rbs//lib/rbs/definition.rb#384 + # source://rbs//lib/rbs/definition.rb#389 def each_type(&block); end # Returns the value of attribute entry. # - # source://rbs//lib/rbs/definition.rb#290 + # source://rbs//lib/rbs/definition.rb#295 def entry; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#341 + # source://rbs//lib/rbs/definition.rb#346 def instance_type?; end # Returns the value of attribute instance_variables. # - # source://rbs//lib/rbs/definition.rb#294 + # source://rbs//lib/rbs/definition.rb#299 def instance_variables; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#328 + # source://rbs//lib/rbs/definition.rb#333 def interface?; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#345 + # source://rbs//lib/rbs/definition.rb#350 def interface_type?; end - # source://rbs//lib/rbs/definition.rb#374 + # source://rbs//lib/rbs/definition.rb#379 def map_method_type(&block); end # Returns the value of attribute methods. # - # source://rbs//lib/rbs/definition.rb#293 + # source://rbs//lib/rbs/definition.rb#298 def methods; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#324 + # source://rbs//lib/rbs/definition.rb#329 def module?; end # Returns the value of attribute self_type. # - # source://rbs//lib/rbs/definition.rb#292 + # source://rbs//lib/rbs/definition.rb#297 def self_type; end - # source://rbs//lib/rbs/definition.rb#362 + # source://rbs//lib/rbs/definition.rb#367 def sub(s); end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/definition.rb#289 + # source://rbs//lib/rbs/definition.rb#294 def type_name; end - # source://rbs//lib/rbs/definition.rb#349 + # source://rbs//lib/rbs/definition.rb#354 def type_params; end - # source://rbs//lib/rbs/definition.rb#353 + # source://rbs//lib/rbs/definition.rb#358 def type_params_decl; end end -# source://rbs//lib/rbs/definition.rb#204 +# source://rbs//lib/rbs/definition.rb#209 module RBS::Definition::Ancestor; end -# source://rbs//lib/rbs/definition.rb#205 +# source://rbs//lib/rbs/definition.rb#210 class RBS::Definition::Ancestor::Instance # @return [Instance] a new instance of Instance # - # source://rbs//lib/rbs/definition.rb#208 + # source://rbs//lib/rbs/definition.rb#213 def initialize(name:, args:, source:); end - # source://rbs//lib/rbs/definition.rb#214 + # source://rbs//lib/rbs/definition.rb#219 def ==(other); end # Returns the value of attribute args. # - # source://rbs//lib/rbs/definition.rb#206 + # source://rbs//lib/rbs/definition.rb#211 def args; end - # source://rbs//lib/rbs/definition.rb#214 + # source://rbs//lib/rbs/definition.rb#223 def eql?(other); end - # source://rbs//lib/rbs/definition.rb#220 + # source://rbs//lib/rbs/definition.rb#225 def hash; end # Returns the value of attribute name. # - # source://rbs//lib/rbs/definition.rb#206 + # source://rbs//lib/rbs/definition.rb#211 def name; end # Returns the value of attribute source. # - # source://rbs//lib/rbs/definition.rb#206 + # source://rbs//lib/rbs/definition.rb#211 def source; end end -# source://rbs//lib/rbs/definition.rb#225 +# source://rbs//lib/rbs/definition.rb#230 class RBS::Definition::Ancestor::Singleton # @return [Singleton] a new instance of Singleton # - # source://rbs//lib/rbs/definition.rb#228 + # source://rbs//lib/rbs/definition.rb#233 def initialize(name:); end - # source://rbs//lib/rbs/definition.rb#232 + # source://rbs//lib/rbs/definition.rb#237 def ==(other); end - # source://rbs//lib/rbs/definition.rb#232 + # source://rbs//lib/rbs/definition.rb#241 def eql?(other); end - # source://rbs//lib/rbs/definition.rb#238 + # source://rbs//lib/rbs/definition.rb#243 def hash; end # Returns the value of attribute name. # - # source://rbs//lib/rbs/definition.rb#226 + # source://rbs//lib/rbs/definition.rb#231 def name; end end -# source://rbs//lib/rbs/definition.rb#244 +# source://rbs//lib/rbs/definition.rb#249 class RBS::Definition::InstanceAncestors # @return [InstanceAncestors] a new instance of InstanceAncestors # - # source://rbs//lib/rbs/definition.rb#249 + # source://rbs//lib/rbs/definition.rb#254 def initialize(type_name:, params:, ancestors:); end # Returns the value of attribute ancestors. # - # source://rbs//lib/rbs/definition.rb#247 + # source://rbs//lib/rbs/definition.rb#252 def ancestors; end - # source://rbs//lib/rbs/definition.rb#255 + # source://rbs//lib/rbs/definition.rb#260 def apply(args, env:, location:); end # Returns the value of attribute params. # - # source://rbs//lib/rbs/definition.rb#246 + # source://rbs//lib/rbs/definition.rb#251 def params; end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/definition.rb#245 + # source://rbs//lib/rbs/definition.rb#250 def type_name; end end @@ -2261,91 +2780,91 @@ end class RBS::Definition::Method # @return [Method] a new instance of Method # - # source://rbs//lib/rbs/definition.rb#102 + # source://rbs//lib/rbs/definition.rb#107 def initialize(super_method:, defs:, accessibility:, alias_of:, annotations: T.unsafe(nil), alias_member: T.unsafe(nil)); end - # source://rbs//lib/rbs/definition.rb#112 + # source://rbs//lib/rbs/definition.rb#117 def ==(other); end # Returns the value of attribute accessibility. # - # source://rbs//lib/rbs/definition.rb#96 + # source://rbs//lib/rbs/definition.rb#101 def accessibility; end # Returns the value of attribute alias_member. # - # source://rbs//lib/rbs/definition.rb#100 + # source://rbs//lib/rbs/definition.rb#105 def alias_member; end # Returns the value of attribute alias_of. # - # source://rbs//lib/rbs/definition.rb#99 + # source://rbs//lib/rbs/definition.rb#104 def alias_of; end # Returns the value of attribute annotations. # - # source://rbs//lib/rbs/definition.rb#98 + # source://rbs//lib/rbs/definition.rb#103 def annotations; end - # source://rbs//lib/rbs/definition.rb#146 + # source://rbs//lib/rbs/definition.rb#151 def comments; end - # source://rbs//lib/rbs/definition.rb#128 + # source://rbs//lib/rbs/definition.rb#133 def defined_in; end # Returns the value of attribute defs. # - # source://rbs//lib/rbs/definition.rb#95 + # source://rbs//lib/rbs/definition.rb#100 def defs; end - # source://rbs//lib/rbs/definition.rb#112 + # source://rbs//lib/rbs/definition.rb#127 def eql?(other); end # Returns the value of attribute extra_annotations. # - # source://rbs//lib/rbs/definition.rb#97 + # source://rbs//lib/rbs/definition.rb#102 def extra_annotations; end - # source://rbs//lib/rbs/definition.rb#124 + # source://rbs//lib/rbs/definition.rb#129 def hash; end - # source://rbs//lib/rbs/definition.rb#135 + # source://rbs//lib/rbs/definition.rb#140 def implemented_in; end - # source://rbs//lib/rbs/definition.rb#185 + # source://rbs//lib/rbs/definition.rb#190 def map_method_type(&block); end - # source://rbs//lib/rbs/definition.rb#171 + # source://rbs//lib/rbs/definition.rb#176 def map_type(&block); end - # source://rbs//lib/rbs/definition.rb#178 + # source://rbs//lib/rbs/definition.rb#183 def map_type_bound(&block); end - # source://rbs//lib/rbs/definition.rb#150 + # source://rbs//lib/rbs/definition.rb#155 def members; end - # source://rbs//lib/rbs/definition.rb#142 + # source://rbs//lib/rbs/definition.rb#147 def method_types; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#158 + # source://rbs//lib/rbs/definition.rb#163 def private?; end # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#154 + # source://rbs//lib/rbs/definition.rb#159 def public?; end - # source://rbs//lib/rbs/definition.rb#162 + # source://rbs//lib/rbs/definition.rb#167 def sub(s); end # Returns the value of attribute super_method. # - # source://rbs//lib/rbs/definition.rb#94 + # source://rbs//lib/rbs/definition.rb#99 def super_method; end - # source://rbs//lib/rbs/definition.rb#191 + # source://rbs//lib/rbs/definition.rb#196 def update(super_method: T.unsafe(nil), defs: T.unsafe(nil), accessibility: T.unsafe(nil), alias_of: T.unsafe(nil), annotations: T.unsafe(nil), alias_member: T.unsafe(nil)); end end @@ -2372,10 +2891,10 @@ class RBS::Definition::Method::TypeDef # source://rbs//lib/rbs/definition.rb#34 def defined_in; end - # source://rbs//lib/rbs/definition.rb#84 + # source://rbs//lib/rbs/definition.rb#89 def each_annotation(&block); end - # source://rbs//lib/rbs/definition.rb#50 + # source://rbs//lib/rbs/definition.rb#58 def eql?(other); end # source://rbs//lib/rbs/definition.rb#60 @@ -2398,7 +2917,7 @@ class RBS::Definition::Method::TypeDef # @return [Boolean] # - # source://rbs//lib/rbs/definition.rb#75 + # source://rbs//lib/rbs/definition.rb#80 def overload?; end # Returns the value of attribute overload_annotations. @@ -2411,25 +2930,25 @@ class RBS::Definition::Method::TypeDef # source://rbs//lib/rbs/definition.rb#32 def type; end - # source://rbs//lib/rbs/definition.rb#68 + # source://rbs//lib/rbs/definition.rb#73 def update(type: T.unsafe(nil), member: T.unsafe(nil), defined_in: T.unsafe(nil), implemented_in: T.unsafe(nil)); end end -# source://rbs//lib/rbs/definition.rb#279 +# source://rbs//lib/rbs/definition.rb#284 class RBS::Definition::SingletonAncestors # @return [SingletonAncestors] a new instance of SingletonAncestors # - # source://rbs//lib/rbs/definition.rb#283 + # source://rbs//lib/rbs/definition.rb#288 def initialize(type_name:, ancestors:); end # Returns the value of attribute ancestors. # - # source://rbs//lib/rbs/definition.rb#281 + # source://rbs//lib/rbs/definition.rb#286 def ancestors; end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/definition.rb#280 + # source://rbs//lib/rbs/definition.rb#285 def type_name; end end @@ -2496,7 +3015,7 @@ class RBS::DefinitionBuilder # source://rbs//lib/rbs/definition_builder.rb#33 def define_interface(definition, type_name, subst); end - # source://rbs//lib/rbs/definition_builder.rb#642 + # source://rbs//lib/rbs/definition_builder.rb#646 def define_method(methods, definition, method, subst, self_type_methods, defined_in:, implemented_in: T.unsafe(nil)); end # source://rbs//lib/rbs/definition_builder.rb#25 @@ -2507,19 +3026,19 @@ class RBS::DefinitionBuilder # source://rbs//lib/rbs/definition_builder.rb#5 def env; end - # source://rbs//lib/rbs/definition_builder.rb#826 + # source://rbs//lib/rbs/definition_builder.rb#861 def expand_alias(type_name); end - # source://rbs//lib/rbs/definition_builder.rb#830 + # source://rbs//lib/rbs/definition_builder.rb#865 def expand_alias1(type_name); end - # source://rbs//lib/rbs/definition_builder.rb#837 + # source://rbs//lib/rbs/definition_builder.rb#872 def expand_alias2(type_name, args); end - # source://rbs//lib/rbs/definition_builder.rb#581 + # source://rbs//lib/rbs/definition_builder.rb#585 def import_methods(definition, module_name, module_methods, interfaces_methods, subst, self_type_methods); end - # source://rbs//lib/rbs/definition_builder.rb#543 + # source://rbs//lib/rbs/definition_builder.rb#547 def insert_variable(type_name, variables, name:, type:, source:); end # Returns the value of attribute instance_cache. @@ -2556,10 +3075,10 @@ class RBS::DefinitionBuilder # source://rbs//lib/rbs/definition_builder.rb#66 def tapp_subst(name, args); end - # source://rbs//lib/rbs/definition_builder.rb#822 + # source://rbs//lib/rbs/definition_builder.rb#857 def try_cache(type_name, cache:); end - # source://rbs//lib/rbs/definition_builder.rb#861 + # source://rbs//lib/rbs/definition_builder.rb#896 def update(env:, except:, ancestor_builder:); end # source://rbs//lib/rbs/definition_builder.rb#437 @@ -2567,16 +3086,16 @@ class RBS::DefinitionBuilder # @raise [NoTypeFoundError] # - # source://rbs//lib/rbs/definition_builder.rb#890 + # source://rbs//lib/rbs/definition_builder.rb#925 def validate_type_name(name, location); end - # source://rbs//lib/rbs/definition_builder.rb#461 + # source://rbs//lib/rbs/definition_builder.rb#465 def validate_type_params(definition, ancestors:, methods:); end - # source://rbs//lib/rbs/definition_builder.rb#879 + # source://rbs//lib/rbs/definition_builder.rb#914 def validate_type_presence(type); end - # source://rbs//lib/rbs/definition_builder.rb#553 + # source://rbs//lib/rbs/definition_builder.rb#557 def validate_variable(var); end end @@ -2592,10 +3111,10 @@ class RBS::DefinitionBuilder::AncestorBuilder # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#151 def env; end - # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#608 + # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#611 def fill_ancestor_source(ancestor, name:, source:, &block); end - # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#436 + # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#439 def instance_ancestors(type_name, building_ancestors: T.unsafe(nil)); end # Returns the value of attribute instance_ancestors_cache. @@ -2603,7 +3122,7 @@ class RBS::DefinitionBuilder::AncestorBuilder # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#154 def instance_ancestors_cache; end - # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#572 + # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#575 def interface_ancestors(type_name, building_ancestors: T.unsafe(nil)); end # Returns the value of attribute interface_ancestors_cache. @@ -2611,7 +3130,7 @@ class RBS::DefinitionBuilder::AncestorBuilder # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#160 def interface_ancestors_cache; end - # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#416 + # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#421 def mixin_ancestors(entry, type_name, included_modules:, included_interfaces:, extended_modules:, prepended_modules:, extended_interfaces:); end # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#350 @@ -2641,7 +3160,7 @@ class RBS::DefinitionBuilder::AncestorBuilder # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#156 def one_singleton_ancestors_cache; end - # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#517 + # source://rbs//lib/rbs/definition_builder/ancestor_builder.rb#520 def singleton_ancestors(type_name, building_ancestors: T.unsafe(nil)); end # Returns the value of attribute singleton_ancestors_cache. @@ -2750,26 +3269,26 @@ class RBS::DefinitionBuilder::MethodBuilder # source://rbs//lib/rbs/definition_builder/method_builder.rb#91 def initialize(env:); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#194 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#209 def build_alias(methods, type, member:); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#199 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#214 def build_attribute(methods, type, member:, accessibility:); end # source://rbs//lib/rbs/definition_builder/method_builder.rb#99 def build_instance(type_name); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#174 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#189 def build_interface(type_name); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#215 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#230 def build_method(methods, type, member:, accessibility:); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#145 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#160 def build_singleton(type_name); end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#226 - def each_member_with_accessibility(members, accessibility: T.unsafe(nil)); end + # source://rbs//lib/rbs/definition_builder/method_builder.rb#241 + def each_rbs_member_with_accessibility(members, accessibility: T.unsafe(nil)); end # Returns the value of attribute env. # @@ -2791,7 +3310,7 @@ class RBS::DefinitionBuilder::MethodBuilder # source://rbs//lib/rbs/definition_builder/method_builder.rb#88 def singleton_methods; end - # source://rbs//lib/rbs/definition_builder/method_builder.rb#239 + # source://rbs//lib/rbs/definition_builder/method_builder.rb#254 def update(env:, except:); end end @@ -2897,21 +3416,21 @@ class RBS::Diff def each_diff_methods(kind, before_methods, after_methods); end end -# source://rbs//lib/rbs/errors.rb#418 +# source://rbs//lib/rbs/errors.rb#419 class RBS::DuplicatedDeclarationError < ::RBS::LoadingError # @return [DuplicatedDeclarationError] a new instance of DuplicatedDeclarationError # - # source://rbs//lib/rbs/errors.rb#422 + # source://rbs//lib/rbs/errors.rb#423 def initialize(name, *decls); end # Returns the value of attribute decls. # - # source://rbs//lib/rbs/errors.rb#420 + # source://rbs//lib/rbs/errors.rb#421 def decls; end # Returns the value of attribute name. # - # source://rbs//lib/rbs/errors.rb#419 + # source://rbs//lib/rbs/errors.rb#420 def name; end end @@ -2990,330 +3509,337 @@ end class RBS::Environment # @return [Environment] a new instance of Environment # - # source://rbs//lib/rbs/environment.rb#145 + # source://rbs//lib/rbs/environment.rb#48 def initialize; end - # source://rbs//lib/rbs/environment.rb#470 - def <<(decl); end - - # source://rbs//lib/rbs/environment.rb#807 + # source://rbs//lib/rbs/environment.rb#841 def absolute_type(resolver, map, type, context:); end - # source://rbs//lib/rbs/environment.rb#802 + # source://rbs//lib/rbs/environment.rb#836 def absolute_type_name(resolver, map, type_name, context:); end - # source://rbs//lib/rbs/environment.rb#476 - def add_signature(buffer:, directives:, decls:); end + # source://rbs//lib/rbs/environment.rb#417 + def add_source(source); end - # source://rbs//lib/rbs/environment.rb#539 + # source://rbs//lib/rbs/environment.rb#522 def append_context(context, decl); end - # source://rbs//lib/rbs/environment.rb#818 + # source://rbs//lib/rbs/environment.rb#852 def buffers; end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#218 + # source://rbs//lib/rbs/environment.rb#117 def class_alias?(name); end # Returns the value of attribute class_alias_decls. # - # source://rbs//lib/rbs/environment.rb#12 + # source://rbs//lib/rbs/environment.rb#10 def class_alias_decls; end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#202 + # source://rbs//lib/rbs/environment.rb#101 def class_decl?(name); end # Returns the value of attribute class_decls. # - # source://rbs//lib/rbs/environment.rb#7 + # source://rbs//lib/rbs/environment.rb#5 def class_decls; end - # source://rbs//lib/rbs/environment.rb#226 + # source://rbs//lib/rbs/environment.rb#125 def class_entry(type_name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#198 + # source://rbs//lib/rbs/environment.rb#97 def constant_decl?(name); end # Returns the value of attribute constant_decls. # - # source://rbs//lib/rbs/environment.rb#10 + # source://rbs//lib/rbs/environment.rb#8 def constant_decls; end - # source://rbs//lib/rbs/environment.rb#274 + # source://rbs//lib/rbs/environment.rb#173 def constant_entry(type_name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#194 + # source://rbs//lib/rbs/environment.rb#93 def constant_name?(name); end - # Returns the value of attribute declarations. - # - # source://rbs//lib/rbs/environment.rb#5 + # source://rbs//lib/rbs/environment.rb#14 def declarations; end + # source://rbs//lib/rbs/environment.rb#432 + def each_rbs_source(&block); end + + # source://rbs//lib/rbs/environment.rb#444 + def each_ruby_source(&block); end + # Returns the value of attribute global_decls. # - # source://rbs//lib/rbs/environment.rb#11 + # source://rbs//lib/rbs/environment.rb#9 def global_decls; end - # source://rbs//lib/rbs/environment.rb#373 - def insert_decl(decl, outer:, namespace:); end + # source://rbs//lib/rbs/environment.rb#272 + def insert_rbs_decl(decl, context:, namespace:); end - # source://rbs//lib/rbs/environment.rb#813 + # source://rbs//lib/rbs/environment.rb#369 + def insert_ruby_decl(decl, context:, namespace:); end + + # source://rbs//lib/rbs/environment.rb#847 def inspect; end # Returns the value of attribute interface_decls. # - # source://rbs//lib/rbs/environment.rb#8 + # source://rbs//lib/rbs/environment.rb#6 def interface_decls; end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#176 + # source://rbs//lib/rbs/environment.rb#75 def interface_name?(name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#210 + # source://rbs//lib/rbs/environment.rb#109 def module_alias?(name); end - # source://rbs//lib/rbs/environment.rb#266 + # source://rbs//lib/rbs/environment.rb#165 def module_class_entry(type_name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#206 + # source://rbs//lib/rbs/environment.rb#105 def module_decl?(name); end - # source://rbs//lib/rbs/environment.rb#235 + # source://rbs//lib/rbs/environment.rb#134 def module_entry(type_name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#184 + # source://rbs//lib/rbs/environment.rb#83 def module_name?(name); end - # source://rbs//lib/rbs/environment.rb#332 + # source://rbs//lib/rbs/environment.rb#231 def normalize_module_name(name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#336 + # source://rbs//lib/rbs/environment.rb#235 def normalize_module_name?(name); end - # source://rbs//lib/rbs/environment.rb#328 + # source://rbs//lib/rbs/environment.rb#227 def normalize_type_name(name); end - # source://rbs//lib/rbs/environment.rb#297 + # source://rbs//lib/rbs/environment.rb#196 def normalize_type_name!(name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#278 + # source://rbs//lib/rbs/environment.rb#177 def normalize_type_name?(name); end - # source://rbs//lib/rbs/environment.rb#244 + # source://rbs//lib/rbs/environment.rb#143 def normalized_class_entry(type_name); end - # source://rbs//lib/rbs/environment.rb#270 + # source://rbs//lib/rbs/environment.rb#169 def normalized_module_class_entry(type_name); end - # source://rbs//lib/rbs/environment.rb#255 + # source://rbs//lib/rbs/environment.rb#154 def normalized_module_entry(type_name); end - # source://rbs//lib/rbs/environment.rb#323 + # source://rbs//lib/rbs/environment.rb#222 def normalized_type_name!(name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#310 + # source://rbs//lib/rbs/environment.rb#209 def normalized_type_name?(type_name); end - # source://rbs//lib/rbs/environment.rb#548 - def resolve_declaration(resolver, map, decl, outer:, prefix:); end + # source://rbs//lib/rbs/environment.rb#531 + def resolve_declaration(resolver, map, decl, context:, prefix:); end - # source://rbs//lib/rbs/environment.rb#688 + # source://rbs//lib/rbs/environment.rb#722 def resolve_member(resolver, map, member, context:); end - # source://rbs//lib/rbs/environment.rb#788 + # source://rbs//lib/rbs/environment.rb#822 def resolve_method_type(resolver, map, type, context:); end - # source://rbs//lib/rbs/environment.rb#489 + # source://rbs//lib/rbs/environment.rb#667 + def resolve_ruby_decl(resolver, decl, context:, prefix:); end + + # source://rbs//lib/rbs/environment.rb#708 + def resolve_ruby_member(resolver, member, context:); end + + # source://rbs//lib/rbs/environment.rb#462 def resolve_signature(resolver, table, dirs, decls, only: T.unsafe(nil)); end - # source://rbs//lib/rbs/environment.rb#511 + # source://rbs//lib/rbs/environment.rb#484 def resolve_type_names(only: T.unsafe(nil)); end - # source://rbs//lib/rbs/environment.rb#796 + # source://rbs//lib/rbs/environment.rb#830 def resolve_type_params(resolver, map, params, context:); end - # source://rbs//lib/rbs/environment.rb#533 + # source://rbs//lib/rbs/environment.rb#516 def resolver_context(*nesting); end - # Returns the value of attribute signatures. + # Returns the value of attribute sources. # - # source://rbs//lib/rbs/environment.rb#14 - def signatures; end + # source://rbs//lib/rbs/environment.rb#12 + def sources; end # Returns the value of attribute type_alias_decls. # - # source://rbs//lib/rbs/environment.rb#9 + # source://rbs//lib/rbs/environment.rb#7 def type_alias_decls; end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#180 + # source://rbs//lib/rbs/environment.rb#79 def type_alias_name?(name); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#188 + # source://rbs//lib/rbs/environment.rb#87 def type_name?(name); end - # source://rbs//lib/rbs/environment.rb#822 + # source://rbs//lib/rbs/environment.rb#856 def unload(buffers); end - # source://rbs//lib/rbs/environment.rb#483 + # source://rbs//lib/rbs/environment.rb#456 def validate_type_params; end private - # source://rbs//lib/rbs/environment.rb#158 + # source://rbs//lib/rbs/environment.rb#59 def initialize_copy(other); end class << self - # source://rbs//lib/rbs/environment.rb#170 + # source://rbs//lib/rbs/environment.rb#69 def from_loader(loader); end end end -# source://rbs//lib/rbs/environment.rb#130 +# source://rbs//lib/rbs/environment.rb#33 class RBS::Environment::ClassAliasEntry < ::RBS::Environment::SingleEntry; end -# source://rbs//lib/rbs/environment.rb#100 -class RBS::Environment::ClassEntry < ::RBS::Environment::MultiEntry - # source://rbs//lib/rbs/environment.rb#101 - def primary; end -end - -# source://rbs//lib/rbs/environment.rb#139 -class RBS::Environment::ConstantEntry < ::RBS::Environment::SingleEntry; end - -# source://rbs//lib/rbs/environment.rb#16 -module RBS::Environment::ContextUtil - # source://rbs//lib/rbs/environment.rb#17 - def calculate_context(decls); end -end - -# source://rbs//lib/rbs/environment.rb#142 -class RBS::Environment::GlobalEntry < ::RBS::Environment::SingleEntry; end - -# source://rbs//lib/rbs/environment.rb#133 -class RBS::Environment::InterfaceEntry < ::RBS::Environment::SingleEntry; end - -# source://rbs//lib/rbs/environment.rb#127 -class RBS::Environment::ModuleAliasEntry < ::RBS::Environment::SingleEntry; end - -# source://rbs//lib/rbs/environment.rb#85 -class RBS::Environment::ModuleEntry < ::RBS::Environment::MultiEntry - # source://rbs//lib/rbs/environment.rb#92 - def primary; end - - # source://rbs//lib/rbs/environment.rb#86 - def self_types; end -end - -# source://rbs//lib/rbs/environment.rb#29 -class RBS::Environment::MultiEntry - # @return [MultiEntry] a new instance of MultiEntry +# source://rbs//lib/rbs/environment/class_entry.rb#5 +class RBS::Environment::ClassEntry + # @return [ClassEntry] a new instance of ClassEntry # - # source://rbs//lib/rbs/environment.rb#43 - def initialize(name:); end + # source://rbs//lib/rbs/environment/class_entry.rb#10 + def initialize(name); end + + # source://rbs//lib/rbs/environment/class_entry.rb#15 + def <<(context_decl); end + + # Returns the value of attribute context_decls. + # + # source://rbs//lib/rbs/environment/class_entry.rb#8 + def context_decls; end + + # source://rbs//lib/rbs/environment/class_entry.rb#21 + def each_decl(&block); end # @return [Boolean] # - # source://rbs//lib/rbs/environment.rb#70 - def compatible_params?(ps1, ps2); end - - # Returns the value of attribute decls. - # - # source://rbs//lib/rbs/environment.rb#41 - def decls; end - - # source://rbs//lib/rbs/environment.rb#48 - def insert(decl:, outer:); end + # source://rbs//lib/rbs/environment/class_entry.rb#31 + def empty?; end # Returns the value of attribute name. # - # source://rbs//lib/rbs/environment.rb#40 + # source://rbs//lib/rbs/environment/class_entry.rb#6 def name; end - # source://rbs//lib/rbs/environment.rb#80 - def primary; end + # source://rbs//lib/rbs/environment/class_entry.rb#35 + def primary_decl; end - # source://rbs//lib/rbs/environment.rb#76 + # source://rbs//lib/rbs/environment/class_entry.rb#47 def type_params; end - # source://rbs//lib/rbs/environment.rb#53 + # source://rbs//lib/rbs/environment/class_entry.rb#52 def validate_type_params; end end +# source://rbs//lib/rbs/environment.rb#42 +class RBS::Environment::ConstantEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs//lib/rbs/environment.rb#45 +class RBS::Environment::GlobalEntry < ::RBS::Environment::SingleEntry; end + +# source://rbs//lib/rbs/environment.rb#36 +class RBS::Environment::InterfaceEntry < ::RBS::Environment::SingleEntry; end + # source://rbs//lib/rbs/environment.rb#30 -class RBS::Environment::MultiEntry::D < ::Struct - include ::RBS::Environment::ContextUtil +class RBS::Environment::ModuleAliasEntry < ::RBS::Environment::SingleEntry; end - # source://rbs//lib/rbs/environment.rb#35 - def context; end +# source://rbs//lib/rbs/environment/module_entry.rb#5 +class RBS::Environment::ModuleEntry + # @return [ModuleEntry] a new instance of ModuleEntry + # + # source://rbs//lib/rbs/environment/module_entry.rb#10 + def initialize(name); end - def decl; end - def decl=(_); end - def outer; end - def outer=(_); end + # source://rbs//lib/rbs/environment/module_entry.rb#15 + def <<(context_decl); end - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end + # Returns the value of attribute context_decls. + # + # source://rbs//lib/rbs/environment/module_entry.rb#8 + def context_decls; end + + # source://rbs//lib/rbs/environment/module_entry.rb#20 + def each_decl(&block); end + + # @return [Boolean] + # + # source://rbs//lib/rbs/environment/module_entry.rb#30 + def empty?; end + + # Returns the value of attribute name. + # + # source://rbs//lib/rbs/environment/module_entry.rb#6 + def name; end + + # source://rbs//lib/rbs/environment/module_entry.rb#34 + def primary_decl; end + + # source://rbs//lib/rbs/environment/module_entry.rb#43 + def self_types; end + + # source://rbs//lib/rbs/environment/module_entry.rb#38 + def type_params; end + + # source://rbs//lib/rbs/environment/module_entry.rb#49 + def validate_type_params; end end -# source://rbs//lib/rbs/environment.rb#109 +# source://rbs//lib/rbs/environment.rb#18 class RBS::Environment::SingleEntry - include ::RBS::Environment::ContextUtil - # @return [SingleEntry] a new instance of SingleEntry # - # source://rbs//lib/rbs/environment.rb#114 - def initialize(name:, decl:, outer:); end + # source://rbs//lib/rbs/environment.rb#23 + def initialize(name:, decl:, context:); end - # source://rbs//lib/rbs/environment.rb#122 + # Returns the value of attribute context. + # + # source://rbs//lib/rbs/environment.rb#20 def context; end # Returns the value of attribute decl. # - # source://rbs//lib/rbs/environment.rb#112 + # source://rbs//lib/rbs/environment.rb#21 def decl; end # Returns the value of attribute name. # - # source://rbs//lib/rbs/environment.rb#110 + # source://rbs//lib/rbs/environment.rb#19 def name; end - - # Returns the value of attribute outer. - # - # source://rbs//lib/rbs/environment.rb#111 - def outer; end end -# source://rbs//lib/rbs/environment.rb#136 +# source://rbs//lib/rbs/environment.rb#39 class RBS::Environment::TypeAliasEntry < ::RBS::Environment::SingleEntry; end # source://rbs//lib/rbs/environment/use_map.rb#5 @@ -3478,42 +4004,78 @@ end # source://rbs//lib/rbs/environment_walker.rb#5 class RBS::EnvironmentWalker::InstanceNode < ::Struct + # source://rbs//lib/rbs/environment_walker.rb#5 def type_name; end + + # source://rbs//lib/rbs/environment_walker.rb#5 def type_name=(_); end class << self + # source://rbs//lib/rbs/environment_walker.rb#5 def [](*_arg0); end + + # source://rbs//lib/rbs/environment_walker.rb#5 def inspect; end + + # source://rbs//lib/rbs/environment_walker.rb#5 def keyword_init?; end + + # source://rbs//lib/rbs/environment_walker.rb#5 def members; end + + # source://rbs//lib/rbs/environment_walker.rb#5 def new(*_arg0); end end end # source://rbs//lib/rbs/environment_walker.rb#6 class RBS::EnvironmentWalker::SingletonNode < ::Struct + # source://rbs//lib/rbs/environment_walker.rb#6 def type_name; end + + # source://rbs//lib/rbs/environment_walker.rb#6 def type_name=(_); end class << self + # source://rbs//lib/rbs/environment_walker.rb#6 def [](*_arg0); end + + # source://rbs//lib/rbs/environment_walker.rb#6 def inspect; end + + # source://rbs//lib/rbs/environment_walker.rb#6 def keyword_init?; end + + # source://rbs//lib/rbs/environment_walker.rb#6 def members; end + + # source://rbs//lib/rbs/environment_walker.rb#6 def new(*_arg0); end end end # source://rbs//lib/rbs/environment_walker.rb#7 class RBS::EnvironmentWalker::TypeNameNode < ::Struct + # source://rbs//lib/rbs/environment_walker.rb#7 def type_name; end + + # source://rbs//lib/rbs/environment_walker.rb#7 def type_name=(_); end class << self + # source://rbs//lib/rbs/environment_walker.rb#7 def [](*_arg0); end + + # source://rbs//lib/rbs/environment_walker.rb#7 def inspect; end + + # source://rbs//lib/rbs/environment_walker.rb#7 def keyword_init?; end + + # source://rbs//lib/rbs/environment_walker.rb#7 def members; end + + # source://rbs//lib/rbs/environment_walker.rb#7 def new(*_arg0); end end end @@ -3537,7 +4099,7 @@ class RBS::GenericParameterMismatchError < ::RBS::LoadingError # @return [GenericParameterMismatchError] a new instance of GenericParameterMismatchError # # source://rbs//lib/rbs/errors.rb#411 - def initialize(name:, decl:); end + def initialize(name:, decl:, location: T.unsafe(nil)); end # Returns the value of attribute decl. # @@ -3550,21 +4112,21 @@ class RBS::GenericParameterMismatchError < ::RBS::LoadingError def name; end end -# source://rbs//lib/rbs/errors.rb#553 +# source://rbs//lib/rbs/errors.rb#554 class RBS::InconsistentClassModuleAliasError < ::RBS::BaseError include ::RBS::DetailedMessageable # @return [InconsistentClassModuleAliasError] a new instance of InconsistentClassModuleAliasError # - # source://rbs//lib/rbs/errors.rb#558 + # source://rbs//lib/rbs/errors.rb#559 def initialize(entry); end # Returns the value of attribute alias_entry. # - # source://rbs//lib/rbs/errors.rb#556 + # source://rbs//lib/rbs/errors.rb#557 def alias_entry; end - # source://rbs//lib/rbs/errors.rb#572 + # source://rbs//lib/rbs/errors.rb#573 def location; end end @@ -3591,6 +4153,217 @@ class RBS::InheritModuleError < ::RBS::DefinitionError end end +# source://rbs//lib/rbs/inline_parser.rb#4 +class RBS::InlineParser + class << self + # source://rbs//lib/rbs/inline_parser.rb#34 + def parse(buffer, prism); end + end +end + +# source://rbs//lib/rbs/inline_parser/comment_association.rb#5 +class RBS::InlineParser::CommentAssociation + # @return [CommentAssociation] a new instance of CommentAssociation + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#8 + def initialize(blocks); end + + # Returns the value of attribute associated_blocks. + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#6 + def associated_blocks; end + + # Returns the value of attribute blocks. + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#6 + def blocks; end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#84 + def each_enclosed_block(node); end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#104 + def each_unassociated_block; end + + # Returns the value of attribute end_line_map. + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#6 + def end_line_map; end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#47 + def leading_block(node); end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#55 + def leading_block!(node); end + + # Returns the value of attribute start_line_map. + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#6 + def start_line_map; end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#63 + def trailing_block(node); end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#76 + def trailing_block!(node); end + + class << self + # source://rbs//lib/rbs/inline_parser/comment_association.rb#24 + def build(buffer, result); end + end +end + +# source://rbs//lib/rbs/inline_parser/comment_association.rb#29 +class RBS::InlineParser::CommentAssociation::Reference + # @return [Reference] a new instance of Reference + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#32 + def initialize(block, association); end + + # source://rbs//lib/rbs/inline_parser/comment_association.rb#37 + def associate!; end + + # @return [Boolean] + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#42 + def associated?; end + + # Returns the value of attribute block. + # + # source://rbs//lib/rbs/inline_parser/comment_association.rb#30 + def block; end +end + +# source://rbs//lib/rbs/inline_parser.rb#16 +module RBS::InlineParser::Diagnostic; end + +# source://rbs//lib/rbs/inline_parser.rb#31 +class RBS::InlineParser::Diagnostic::AnnotationSyntaxError < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#17 +class RBS::InlineParser::Diagnostic::Base + # @return [Base] a new instance of Base + # + # source://rbs//lib/rbs/inline_parser.rb#20 + def initialize(location, message); end + + # Returns the value of attribute location. + # + # source://rbs//lib/rbs/inline_parser.rb#18 + def location; end + + # Returns the value of attribute message. + # + # source://rbs//lib/rbs/inline_parser.rb#18 + def message; end +end + +# source://rbs//lib/rbs/inline_parser.rb#27 +class RBS::InlineParser::Diagnostic::NonConstantClassName < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#28 +class RBS::InlineParser::Diagnostic::NonConstantModuleName < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#26 +class RBS::InlineParser::Diagnostic::NotImplementedYet < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#29 +class RBS::InlineParser::Diagnostic::TopLevelMethodDefinition < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#30 +class RBS::InlineParser::Diagnostic::UnusedInlineAnnotation < ::RBS::InlineParser::Diagnostic::Base; end + +# source://rbs//lib/rbs/inline_parser.rb#42 +class RBS::InlineParser::Parser < ::Prism::Visitor + include ::RBS::AST::Ruby::Helpers::ConstantHelper + include ::RBS::AST::Ruby::Helpers::LocationHelper + + # @return [Parser] a new instance of Parser + # + # source://rbs//lib/rbs/inline_parser.rb#48 + def initialize(result); end + + # source://rbs//lib/rbs/inline_parser.rb#54 + def buffer; end + + # Returns the value of attribute comments. + # + # source://rbs//lib/rbs/inline_parser.rb#43 + def comments; end + + # source://rbs//lib/rbs/inline_parser.rb#58 + def current_module; end + + # source://rbs//lib/rbs/inline_parser.rb#62 + def current_module!; end + + # source://rbs//lib/rbs/inline_parser.rb#66 + def diagnostics; end + + # source://rbs//lib/rbs/inline_parser.rb#171 + def insert_declaration(decl); end + + # Returns the value of attribute module_nesting. + # + # source://rbs//lib/rbs/inline_parser.rb#43 + def module_nesting; end + + # source://rbs//lib/rbs/inline_parser.rb#70 + def push_module_nesting(mod); end + + # source://rbs//lib/rbs/inline_parser.rb#179 + def report_unused_annotation(*annotations); end + + # source://rbs//lib/rbs/inline_parser.rb#194 + def report_unused_block(block); end + + # Returns the value of attribute result. + # + # source://rbs//lib/rbs/inline_parser.rb#43 + def result; end + + # @return [Boolean] + # + # source://rbs//lib/rbs/inline_parser.rb#77 + def skip_node?(node); end + + # source://rbs//lib/rbs/inline_parser.rb#88 + def visit_class_node(node); end + + # source://rbs//lib/rbs/inline_parser.rb#132 + def visit_def_node(node); end + + # source://rbs//lib/rbs/inline_parser.rb#110 + def visit_module_node(node); end +end + +# source://rbs//lib/rbs/inline_parser.rb#5 +class RBS::InlineParser::Result + # @return [Result] a new instance of Result + # + # source://rbs//lib/rbs/inline_parser.rb#8 + def initialize(buffer, prism); end + + # Returns the value of attribute buffer. + # + # source://rbs//lib/rbs/inline_parser.rb#6 + def buffer; end + + # Returns the value of attribute declarations. + # + # source://rbs//lib/rbs/inline_parser.rb#6 + def declarations; end + + # Returns the value of attribute diagnostics. + # + # source://rbs//lib/rbs/inline_parser.rb#6 + def diagnostics; end + + # Returns the value of attribute prism_result. + # + # source://rbs//lib/rbs/inline_parser.rb#6 + def prism_result; end +end + # source://rbs//lib/rbs/errors.rb#341 class RBS::InstanceVariableDuplicationError < ::RBS::VariableDuplicationError # source://rbs//lib/rbs/errors.rb#342 @@ -3671,28 +4444,28 @@ class RBS::InvalidTypeApplicationError < ::RBS::DefinitionError end end -# source://rbs//lib/rbs/errors.rb#431 +# source://rbs//lib/rbs/errors.rb#432 class RBS::InvalidVarianceAnnotationError < ::RBS::DefinitionError include ::RBS::DetailedMessageable # @return [InvalidVarianceAnnotationError] a new instance of InvalidVarianceAnnotationError # - # source://rbs//lib/rbs/errors.rb#438 + # source://rbs//lib/rbs/errors.rb#439 def initialize(type_name:, param:, location:); end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#436 + # source://rbs//lib/rbs/errors.rb#437 def location; end # Returns the value of attribute param. # - # source://rbs//lib/rbs/errors.rb#435 + # source://rbs//lib/rbs/errors.rb#436 def param; end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/errors.rb#434 + # source://rbs//lib/rbs/errors.rb#435 def type_name; end end @@ -3701,42 +4474,64 @@ class RBS::LoadingError < ::RBS::BaseError; end # source://rbs//lib/rbs/location_aux.rb#4 class RBS::Location + # source://rbs//lib/rbs.rb#72 def initialize(_arg0, _arg1, _arg2); end - # source://rbs//lib/rbs/location_aux.rb#71 + # source://rbs//lib/rbs/location_aux.rb#79 def ==(other); end + # source://rbs//lib/rbs.rb#72 def [](_arg0); end + + # source://rbs//lib/rbs.rb#72 def _add_optional_child(_arg0, _arg1, _arg2); end + + # source://rbs//lib/rbs.rb#72 def _add_optional_no_child(_arg0); end + + # source://rbs//lib/rbs.rb#72 def _add_required_child(_arg0, _arg1, _arg2); end + + # source://rbs//lib/rbs.rb#72 + def _end_pos; end + + # source://rbs//lib/rbs.rb#72 def _optional_keys; end + + # source://rbs//lib/rbs.rb#72 def _required_keys; end - # source://rbs//lib/rbs/location_aux.rb#102 - def add_optional_child(name, range); end - - # source://rbs//lib/rbs/location_aux.rb#98 - def add_required_child(name, range); end - - def aref(_arg0); end - def buffer; end + # source://rbs//lib/rbs.rb#72 + def _start_pos; end # source://rbs//lib/rbs/location_aux.rb#110 - def each_optional_key(&block); end + def add_optional_child(name, range); end + + # source://rbs//lib/rbs/location_aux.rb#106 + def add_required_child(name, range); end + + # source://rbs//lib/rbs/location_aux.rb#27 + def aref(_arg0); end + + # source://rbs//lib/rbs.rb#72 + def buffer; end # source://rbs//lib/rbs/location_aux.rb#118 + def each_optional_key(&block); end + + # source://rbs//lib/rbs/location_aux.rb#126 def each_required_key(&block); end - # source://rbs//lib/rbs/location_aux.rb#47 + # source://rbs//lib/rbs/location_aux.rb#55 def end_column; end - # source://rbs//lib/rbs/location_aux.rb#43 + # source://rbs//lib/rbs/location_aux.rb#51 def end_line; end - # source://rbs//lib/rbs/location_aux.rb#55 + # source://rbs//lib/rbs/location_aux.rb#63 def end_loc; end + # source://rbs//lib/rbs/location_aux.rb#35 def end_pos; end # source://rbs//lib/rbs/location_aux.rb#5 @@ -3744,54 +4539,62 @@ class RBS::Location # @return [Boolean] # - # source://rbs//lib/rbs/location_aux.rb#126 + # source://rbs//lib/rbs/location_aux.rb#134 def key?(name); end - # source://rbs//lib/rbs/location_aux.rb#31 + # source://rbs//lib/rbs/location_aux.rb#146 + def local_location; end + + # source://rbs//lib/rbs/location_aux.rb#166 + def local_source; end + + # source://rbs//lib/rbs/location_aux.rb#39 def name; end # @return [Boolean] # - # source://rbs//lib/rbs/location_aux.rb#130 + # source://rbs//lib/rbs/location_aux.rb#138 def optional_key?(name); end - # source://rbs//lib/rbs/location_aux.rb#59 + # source://rbs//lib/rbs/location_aux.rb#67 def range; end # @return [Boolean] # - # source://rbs//lib/rbs/location_aux.rb#134 + # source://rbs//lib/rbs/location_aux.rb#142 def required_key?(name); end - # source://rbs//lib/rbs/location_aux.rb#63 + # source://rbs//lib/rbs/location_aux.rb#71 def source; end - # source://rbs//lib/rbs/location_aux.rb#39 + # source://rbs//lib/rbs/location_aux.rb#47 def start_column; end - # source://rbs//lib/rbs/location_aux.rb#35 + # source://rbs//lib/rbs/location_aux.rb#43 def start_line; end - # source://rbs//lib/rbs/location_aux.rb#51 + # source://rbs//lib/rbs/location_aux.rb#59 def start_loc; end + # source://rbs//lib/rbs/location_aux.rb#31 def start_pos; end - # source://rbs//lib/rbs/location_aux.rb#78 + # source://rbs//lib/rbs/location_aux.rb#86 def to_json(state = T.unsafe(nil)); end - # source://rbs//lib/rbs/location_aux.rb#67 + # source://rbs//lib/rbs/location_aux.rb#75 def to_s; end private + # source://rbs//lib/rbs.rb#72 def initialize_copy(_arg0); end class << self # source://rbs//lib/rbs/location_aux.rb#16 def new(buffer_ = T.unsafe(nil), start_pos_ = T.unsafe(nil), end_pos_ = T.unsafe(nil), buffer: T.unsafe(nil), start_pos: T.unsafe(nil), end_pos: T.unsafe(nil)); end - # source://rbs//lib/rbs/location_aux.rb#94 + # source://rbs//lib/rbs/location_aux.rb#102 def to_string(location, default: T.unsafe(nil)); end end end @@ -3931,35 +4734,35 @@ class RBS::MethodType def with_nonreturn_void?; end end -# source://rbs//lib/rbs/errors.rb#467 +# source://rbs//lib/rbs/errors.rb#468 class RBS::MixinClassError < ::RBS::DefinitionError include ::RBS::DetailedMessageable # @return [MixinClassError] a new instance of MixinClassError # - # source://rbs//lib/rbs/errors.rb#473 + # source://rbs//lib/rbs/errors.rb#474 def initialize(type_name:, member:); end - # source://rbs//lib/rbs/errors.rb#480 + # source://rbs//lib/rbs/errors.rb#481 def location; end # Returns the value of attribute member. # - # source://rbs//lib/rbs/errors.rb#471 + # source://rbs//lib/rbs/errors.rb#472 def member; end # Returns the value of attribute type_name. # - # source://rbs//lib/rbs/errors.rb#470 + # source://rbs//lib/rbs/errors.rb#471 def type_name; end private - # source://rbs//lib/rbs/errors.rb#492 + # source://rbs//lib/rbs/errors.rb#493 def mixin_name; end class << self - # source://rbs//lib/rbs/errors.rb#484 + # source://rbs//lib/rbs/errors.rb#485 def check!(type_name:, env:, member:); end end end @@ -3996,7 +4799,7 @@ class RBS::Namespace # source://rbs//lib/rbs/namespace.rb#55 def empty?; end - # source://rbs//lib/rbs/namespace.rb#59 + # source://rbs//lib/rbs/namespace.rb#63 def eql?(other); end # source://rbs//lib/rbs/namespace.rb#65 @@ -4140,43 +4943,65 @@ class RBS::NoTypeFoundError < ::RBS::DefinitionError end end -# source://rbs//lib/rbs/errors.rb#524 +# source://rbs//lib/rbs/errors.rb#525 class RBS::NonregularTypeAliasError < ::RBS::BaseError include ::RBS::DetailedMessageable # @return [NonregularTypeAliasError] a new instance of NonregularTypeAliasError # - # source://rbs//lib/rbs/errors.rb#530 + # source://rbs//lib/rbs/errors.rb#531 def initialize(diagnostic:, location:); end # Returns the value of attribute diagnostic. # - # source://rbs//lib/rbs/errors.rb#527 + # source://rbs//lib/rbs/errors.rb#528 def diagnostic; end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#528 + # source://rbs//lib/rbs/errors.rb#529 def location; end end # source://rbs//lib/rbs/parser/lex_result.rb#4 class RBS::Parser class << self + # source://rbs//lib/rbs.rb#72 def _lex(_arg0, _arg1); end + + # source://rbs//lib/rbs.rb#72 + def _parse_inline_leading_annotation(_arg0, _arg1, _arg2, _arg3); end + + # source://rbs//lib/rbs.rb#72 + def _parse_inline_trailing_annotation(_arg0, _arg1, _arg2, _arg3); end + + # source://rbs//lib/rbs.rb#72 def _parse_method_type(_arg0, _arg1, _arg2, _arg3, _arg4); end + + # source://rbs//lib/rbs.rb#72 def _parse_signature(_arg0, _arg1, _arg2); end + + # source://rbs//lib/rbs.rb#72 def _parse_type(_arg0, _arg1, _arg2, _arg3, _arg4); end - # source://rbs//lib/rbs/parser_aux.rb#71 + # source://rbs//lib/rbs.rb#72 + def _parse_type_params(_arg0, _arg1, _arg2, _arg3); end + + # source://rbs//lib/rbs/parser_aux.rb#76 def buffer(source); end - # source://rbs//lib/rbs/parser_aux.rb#62 + # source://rbs//lib/rbs/parser_aux.rb#67 def lex(source); end - # source://rbs//lib/rbs/parser_aux.rb#38 + # source://rbs//lib/rbs/parser_aux.rb#43 def magic_comment(buf); end + # source://rbs//lib/rbs/parser_aux.rb#119 + def parse_inline_leading_annotation(source, range, variables: T.unsafe(nil)); end + + # source://rbs//lib/rbs/parser_aux.rb#124 + def parse_inline_trailing_annotation(source, range, variables: T.unsafe(nil)); end + # source://rbs//lib/rbs/parser_aux.rb#13 def parse_method_type(source, range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil)); end @@ -4185,10 +5010,13 @@ class RBS::Parser # source://rbs//lib/rbs/parser_aux.rb#8 def parse_type(source, range: T.unsafe(nil), variables: T.unsafe(nil), require_eof: T.unsafe(nil)); end + + # source://rbs//lib/rbs/parser_aux.rb#38 + def parse_type_params(source, module_type_params: T.unsafe(nil)); end end end -# source://rbs//lib/rbs/parser_aux.rb#80 +# source://rbs//lib/rbs/parser_aux.rb#85 RBS::Parser::KEYWORDS = T.let(T.unsafe(nil), Hash) # source://rbs//lib/rbs/parser/lex_result.rb#5 @@ -4374,7 +5202,7 @@ class RBS::Prototype::RB # backward compatible # - # source://rbs//lib/rbs/prototype/rb.rb#719 + # source://rbs//lib/rbs/prototype/rb.rb#762 def node_type(node, default: T.unsafe(nil)); end # source://rbs//lib/rbs/prototype/rb.rb#719 @@ -4661,7 +5489,6 @@ class RBS::Prototype::Runtime::DataGenerator < ::RBS::Prototype::Runtime::ValueO def add_decl_members(decl); end # def self.new: (untyped foo, untyped bar) -> instance - # | (foo: untyped, bar: untyped) -> instance # # source://rbs//lib/rbs/prototype/runtime/value_object_generator.rb#237 def build_s_new; end @@ -4729,7 +5556,6 @@ class RBS::Prototype::Runtime::StructGenerator < ::RBS::Prototype::Runtime::Valu def build_s_keyword_init_p; end # def self.new: (?untyped foo, ?untyped bar) -> instance - # | (?foo: untyped, ?bar: untyped) -> instance # # source://rbs//lib/rbs/prototype/runtime/value_object_generator.rb#117 def build_s_new; end @@ -4807,102 +5633,26 @@ class RBS::Prototype::Runtime::ValueObjectBase def build_s_members; end end -# source://rbs//lib/rdoc_plugin/parser.rb#6 -module RBS::RDocPlugin; end - -# source://rbs//lib/rdoc_plugin/parser.rb#7 -class RBS::RDocPlugin::Parser - # @return [Parser] a new instance of Parser - # - # source://rbs//lib/rdoc_plugin/parser.rb#11 - def initialize(top_level, content); end - - # Returns the value of attribute content. - # - # source://rbs//lib/rdoc_plugin/parser.rb#9 - def content; end - - # Sets the attribute content - # - # @param value the value to set the attribute content to. - # - # source://rbs//lib/rdoc_plugin/parser.rb#9 - def content=(_arg0); end - - # source://rbs//lib/rdoc_plugin/parser.rb#94 - def parse_attr_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#53 - def parse_class_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#67 - def parse_constant_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#125 - def parse_extend_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#109 - def parse_include_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#24 - def parse_member(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#88 - def parse_method_alias_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#73 - def parse_method_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#60 - def parse_module_decl(decl:, context:, outer_name: T.unsafe(nil)); end - - # source://rbs//lib/rdoc_plugin/parser.rb#16 - def scan; end - - # Returns the value of attribute top_level. - # - # source://rbs//lib/rdoc_plugin/parser.rb#9 - def top_level; end - - # Sets the attribute top_level - # - # @param value the value to set the attribute top_level to. - # - # source://rbs//lib/rdoc_plugin/parser.rb#9 - def top_level=(_arg0); end - - private - - # source://rbs//lib/rdoc_plugin/parser.rb#149 - def comment_string(with_comment); end - - # source://rbs//lib/rdoc_plugin/parser.rb#143 - def construct_comment(context:, comment:); end - - # source://rbs//lib/rdoc_plugin/parser.rb#154 - def fully_qualified_name(outer_name:, decl:); end -end - -# source://rbs//lib/rbs/errors.rb#447 +# source://rbs//lib/rbs/errors.rb#448 class RBS::RecursiveAliasDefinitionError < ::RBS::DefinitionError include ::RBS::DetailedMessageable # @return [RecursiveAliasDefinitionError] a new instance of RecursiveAliasDefinitionError # - # source://rbs//lib/rbs/errors.rb#453 + # source://rbs//lib/rbs/errors.rb#454 def initialize(type:, defs:); end # Returns the value of attribute defs. # - # source://rbs//lib/rbs/errors.rb#451 + # source://rbs//lib/rbs/errors.rb#452 def defs; end - # source://rbs//lib/rbs/errors.rb#460 + # source://rbs//lib/rbs/errors.rb#461 def location; end # Returns the value of attribute type. # - # source://rbs//lib/rbs/errors.rb#450 + # source://rbs//lib/rbs/errors.rb#451 def type; end end @@ -4929,26 +5679,26 @@ class RBS::RecursiveAncestorError < ::RBS::DefinitionError end end -# source://rbs//lib/rbs/errors.rb#506 +# source://rbs//lib/rbs/errors.rb#507 class RBS::RecursiveTypeAliasError < ::RBS::BaseError include ::RBS::DetailedMessageable # @return [RecursiveTypeAliasError] a new instance of RecursiveTypeAliasError # - # source://rbs//lib/rbs/errors.rb#512 + # source://rbs//lib/rbs/errors.rb#513 def initialize(alias_names:, location:); end # Returns the value of attribute alias_names. # - # source://rbs//lib/rbs/errors.rb#509 + # source://rbs//lib/rbs/errors.rb#510 def alias_names; end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#510 + # source://rbs//lib/rbs/errors.rb#511 def location; end - # source://rbs//lib/rbs/errors.rb#519 + # source://rbs//lib/rbs/errors.rb#520 def name; end end @@ -5033,18 +5783,38 @@ end # source://rbs//lib/rbs/repository.rb#69 class RBS::Repository::VersionPath < ::Struct + # source://rbs//lib/rbs/repository.rb#69 def gem; end + + # source://rbs//lib/rbs/repository.rb#69 def gem=(_); end + + # source://rbs//lib/rbs/repository.rb#69 def path; end + + # source://rbs//lib/rbs/repository.rb#69 def path=(_); end + + # source://rbs//lib/rbs/repository.rb#69 def version; end + + # source://rbs//lib/rbs/repository.rb#69 def version=(_); end class << self + # source://rbs//lib/rbs/repository.rb#69 def [](*_arg0); end + + # source://rbs//lib/rbs/repository.rb#69 def inspect; end + + # source://rbs//lib/rbs/repository.rb#69 def keyword_init?; end + + # source://rbs//lib/rbs/repository.rb#69 def members; end + + # source://rbs//lib/rbs/repository.rb#69 def new(*_arg0); end end end @@ -5182,6 +5952,72 @@ class RBS::Resolver::TypeNameResolver def try_cache(query); end end +# source://rbs//lib/rbs/source.rb#4 +module RBS::Source; end + +# source://rbs//lib/rbs/source.rb#5 +class RBS::Source::RBS + # @return [RBS] a new instance of RBS + # + # source://rbs//lib/rbs/source.rb#8 + def initialize(buffer, directives, decls); end + + # Returns the value of attribute buffer. + # + # source://rbs//lib/rbs/source.rb#6 + def buffer; end + + # Returns the value of attribute declarations. + # + # source://rbs//lib/rbs/source.rb#6 + def declarations; end + + # Returns the value of attribute directives. + # + # source://rbs//lib/rbs/source.rb#6 + def directives; end + + # source://rbs//lib/rbs/source.rb#25 + def each_declaration_type_name(names, decl, &block); end + + # source://rbs//lib/rbs/source.rb#14 + def each_type_name(&block); end +end + +# source://rbs//lib/rbs/source.rb#52 +class RBS::Source::Ruby + # @return [Ruby] a new instance of Ruby + # + # source://rbs//lib/rbs/source.rb#58 + def initialize(buffer, prism, declarations, diagnostics); end + + # Returns the value of attribute buffer. + # + # source://rbs//lib/rbs/source.rb#53 + def buffer; end + + # Returns the value of attribute declarations. + # + # source://rbs//lib/rbs/source.rb#55 + def declarations; end + + # Returns the value of attribute diagnostics. + # + # source://rbs//lib/rbs/source.rb#56 + def diagnostics; end + + # source://rbs//lib/rbs/source.rb#76 + def each_declaration_type_name(names, decl, &block); end + + # source://rbs//lib/rbs/source.rb#65 + def each_type_name(&block); end + + # Returns the value of attribute prism_result. + # + # source://rbs//lib/rbs/source.rb#54 + def prism_result; end +end + # source://rbs//lib/rbs/substitution.rb#4 class RBS::Substitution # @return [Substitution] a new instance of Substitution @@ -5192,7 +6028,7 @@ class RBS::Substitution # source://rbs//lib/rbs/substitution.rb#66 def +(other); end - # source://rbs//lib/rbs/substitution.rb#37 + # source://rbs//lib/rbs/substitution.rb#53 def [](ty); end # source://rbs//lib/rbs/substitution.rb#16 @@ -5244,12 +6080,12 @@ class RBS::Subtractor private - # source://rbs//lib/rbs/subtractor.rb#177 + # source://rbs//lib/rbs/subtractor.rb#178 def absolute_typename(name, context:); end # @return [Boolean] # - # source://rbs//lib/rbs/subtractor.rb#160 + # source://rbs//lib/rbs/subtractor.rb#161 def access_modifier?(decl); end # @return [Boolean] @@ -5263,7 +6099,7 @@ class RBS::Subtractor # source://rbs//lib/rbs/subtractor.rb#48 def filter_members(decl, context:); end - # source://rbs//lib/rbs/subtractor.rb#148 + # source://rbs//lib/rbs/subtractor.rb#149 def filter_redundant_access_modifiers(decls); end # @return [Boolean] @@ -5283,13 +6119,13 @@ class RBS::Subtractor # @return [Boolean] # - # source://rbs//lib/rbs/subtractor.rb#137 + # source://rbs//lib/rbs/subtractor.rb#138 def mixin_exist?(owner, mixin, context:); end - # source://rbs//lib/rbs/subtractor.rb#186 + # source://rbs//lib/rbs/subtractor.rb#187 def typename_candidates(name, context:); end - # source://rbs//lib/rbs/subtractor.rb#164 + # source://rbs//lib/rbs/subtractor.rb#165 def update_decl(decl, members:); end end @@ -5469,7 +6305,7 @@ class RBS::TypeName # source://rbs//lib/rbs/type_name.rb#47 def class?; end - # source://rbs//lib/rbs/type_name.rb#25 + # source://rbs//lib/rbs/type_name.rb#29 def eql?(other); end # source://rbs//lib/rbs/type_name.rb#31 @@ -5519,27 +6355,27 @@ class RBS::TypeName end end -# source://rbs//lib/rbs/errors.rb#604 +# source://rbs//lib/rbs/errors.rb#605 class RBS::TypeParamDefaultReferenceError < ::RBS::DefinitionError include ::RBS::DetailedMessageable # @return [TypeParamDefaultReferenceError] a new instance of TypeParamDefaultReferenceError # - # source://rbs//lib/rbs/errors.rb#610 + # source://rbs//lib/rbs/errors.rb#611 def initialize(type_param, location:); end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#608 + # source://rbs//lib/rbs/errors.rb#609 def location; end # Returns the value of attribute type_param. # - # source://rbs//lib/rbs/errors.rb#607 + # source://rbs//lib/rbs/errors.rb#608 def type_param; end class << self - # source://rbs//lib/rbs/errors.rb#616 + # source://rbs//lib/rbs/errors.rb#617 def check!(type_params); end end end @@ -5587,7 +6423,7 @@ module RBS::Types::Application # source://rbs//lib/rbs/types.rb#284 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#258 + # source://rbs//lib/rbs/types.rb#262 def eql?(other); end # source://rbs//lib/rbs/types.rb#268 @@ -5649,7 +6485,7 @@ class RBS::Types::Bases::Base # source://rbs//lib/rbs/types.rb#49 def ==(other); end - # source://rbs//lib/rbs/types.rb#49 + # source://rbs//lib/rbs/types.rb#57 def eql?(other); end # @return [Boolean] @@ -5713,13 +6549,18 @@ class RBS::Types::Bases::Void < ::RBS::Types::Bases::Base; end class RBS::Types::Block # @return [Block] a new instance of Block # - # source://rbs//lib/rbs/types.rb#1343 - def initialize(type:, required:, self_type: T.unsafe(nil)); end + # source://rbs//lib/rbs/types.rb#1344 + def initialize(type:, required:, location: T.unsafe(nil), self_type: T.unsafe(nil)); end - # source://rbs//lib/rbs/types.rb#1349 + # source://rbs//lib/rbs/types.rb#1351 def ==(other); end - # source://rbs//lib/rbs/types.rb#1374 + # Returns the value of attribute location. + # + # source://rbs//lib/rbs/types.rb#1342 + def location; end + + # source://rbs//lib/rbs/types.rb#1376 def map_type(&block); end # Returns the value of attribute required. @@ -5732,10 +6573,10 @@ class RBS::Types::Block # source://rbs//lib/rbs/types.rb#1341 def self_type; end - # source://rbs//lib/rbs/types.rb#1364 + # source://rbs//lib/rbs/types.rb#1366 def sub(s); end - # source://rbs//lib/rbs/types.rb#1356 + # source://rbs//lib/rbs/types.rb#1358 def to_json(state = T.unsafe(nil)); end # Returns the value of attribute type. @@ -5785,7 +6626,7 @@ class RBS::Types::ClassSingleton # source://rbs//lib/rbs/types.rb#211 def ==(other); end - # source://rbs//lib/rbs/types.rb#211 + # source://rbs//lib/rbs/types.rb#215 def eql?(other); end # @return [Boolean] @@ -5865,7 +6706,7 @@ class RBS::Types::Function # source://rbs//lib/rbs/types.rb#1153 def empty?; end - # source://rbs//lib/rbs/types.rb#972 + # source://rbs//lib/rbs/types.rb#984 def eql?(other); end # source://rbs//lib/rbs/types.rb#998 @@ -5977,7 +6818,7 @@ class RBS::Types::Function::Param # source://rbs//lib/rbs/types.rb#917 def ==(other); end - # source://rbs//lib/rbs/types.rb#917 + # source://rbs//lib/rbs/types.rb#921 def eql?(other); end # source://rbs//lib/rbs/types.rb#923 @@ -6048,7 +6889,7 @@ class RBS::Types::Intersection # source://rbs//lib/rbs/types.rb#869 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#831 + # source://rbs//lib/rbs/types.rb#835 def eql?(other); end # source://rbs//lib/rbs/types.rb#841 @@ -6098,7 +6939,7 @@ class RBS::Types::Intersection def with_nonreturn_void?; end end -# source://rbs//lib/rbs/types.rb#1518 +# source://rbs//lib/rbs/types.rb#1520 class RBS::Types::Literal include ::RBS::Types::NoFreeVariables include ::RBS::Types::NoSubst @@ -6107,56 +6948,56 @@ class RBS::Types::Literal # @return [Literal] a new instance of Literal # - # source://rbs//lib/rbs/types.rb#1522 + # source://rbs//lib/rbs/types.rb#1524 def initialize(literal:, location:); end - # source://rbs//lib/rbs/types.rb#1527 + # source://rbs//lib/rbs/types.rb#1529 def ==(other); end - # source://rbs//lib/rbs/types.rb#1527 + # source://rbs//lib/rbs/types.rb#1533 def eql?(other); end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1554 + # source://rbs//lib/rbs/types.rb#1556 def has_classish_type?; end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1550 + # source://rbs//lib/rbs/types.rb#1552 def has_self_type?; end - # source://rbs//lib/rbs/types.rb#1533 + # source://rbs//lib/rbs/types.rb#1535 def hash; end # Returns the value of attribute literal. # - # source://rbs//lib/rbs/types.rb#1519 + # source://rbs//lib/rbs/types.rb#1521 def literal; end # Returns the value of attribute location. # - # source://rbs//lib/rbs/types.rb#1520 + # source://rbs//lib/rbs/types.rb#1522 def location; end - # source://rbs//lib/rbs/types.rb#1542 + # source://rbs//lib/rbs/types.rb#1544 def to_json(state = T.unsafe(nil)); end - # source://rbs//lib/rbs/types.rb#1546 + # source://rbs//lib/rbs/types.rb#1548 def to_s(level = T.unsafe(nil)); end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1558 + # source://rbs//lib/rbs/types.rb#1560 def with_nonreturn_void?; end class << self - # source://rbs//lib/rbs/types.rb#1578 + # source://rbs//lib/rbs/types.rb#1580 def unescape_string(string, is_double_quote); end end end -# source://rbs//lib/rbs/types.rb#1562 +# source://rbs//lib/rbs/types.rb#1564 RBS::Types::Literal::TABLE = T.let(T.unsafe(nil), Hash) # source://rbs//lib/rbs/types.rb#5 @@ -6190,7 +7031,7 @@ class RBS::Types::Optional # source://rbs//lib/rbs/types.rb#692 def each_type; end - # source://rbs//lib/rbs/types.rb#654 + # source://rbs//lib/rbs/types.rb#658 def eql?(other); end # source://rbs//lib/rbs/types.rb#664 @@ -6240,76 +7081,76 @@ class RBS::Types::Optional def with_nonreturn_void?; end end -# source://rbs//lib/rbs/types.rb#1395 +# source://rbs//lib/rbs/types.rb#1397 class RBS::Types::Proc # @return [Proc] a new instance of Proc # - # source://rbs//lib/rbs/types.rb#1401 + # source://rbs//lib/rbs/types.rb#1403 def initialize(location:, type:, block:, self_type: T.unsafe(nil)); end - # source://rbs//lib/rbs/types.rb#1408 + # source://rbs//lib/rbs/types.rb#1410 def ==(other); end # Returns the value of attribute block. # - # source://rbs//lib/rbs/types.rb#1397 + # source://rbs//lib/rbs/types.rb#1399 def block; end - # source://rbs//lib/rbs/types.rb#1462 + # source://rbs//lib/rbs/types.rb#1464 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#1408 + # source://rbs//lib/rbs/types.rb#1414 def eql?(other); end - # source://rbs//lib/rbs/types.rb#1418 + # source://rbs//lib/rbs/types.rb#1420 def free_variables(set = T.unsafe(nil)); end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1501 + # source://rbs//lib/rbs/types.rb#1503 def has_classish_type?; end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1497 + # source://rbs//lib/rbs/types.rb#1499 def has_self_type?; end - # source://rbs//lib/rbs/types.rb#1414 + # source://rbs//lib/rbs/types.rb#1416 def hash; end # Returns the value of attribute location. # - # source://rbs//lib/rbs/types.rb#1399 + # source://rbs//lib/rbs/types.rb#1401 def location; end - # source://rbs//lib/rbs/types.rb#1484 + # source://rbs//lib/rbs/types.rb#1486 def map_type(&block); end - # source://rbs//lib/rbs/types.rb#1475 + # source://rbs//lib/rbs/types.rb#1477 def map_type_name(&block); end # Returns the value of attribute self_type. # - # source://rbs//lib/rbs/types.rb#1398 + # source://rbs//lib/rbs/types.rb#1400 def self_type; end - # source://rbs//lib/rbs/types.rb#1435 + # source://rbs//lib/rbs/types.rb#1437 def sub(s); end - # source://rbs//lib/rbs/types.rb#1425 + # source://rbs//lib/rbs/types.rb#1427 def to_json(state = T.unsafe(nil)); end - # source://rbs//lib/rbs/types.rb#1446 + # source://rbs//lib/rbs/types.rb#1448 def to_s(level = T.unsafe(nil)); end # Returns the value of attribute type. # - # source://rbs//lib/rbs/types.rb#1396 + # source://rbs//lib/rbs/types.rb#1398 def type; end # @return [Boolean] # - # source://rbs//lib/rbs/types.rb#1505 + # source://rbs//lib/rbs/types.rb#1507 def with_nonreturn_void?; end end @@ -6331,7 +7172,7 @@ class RBS::Types::Record # source://rbs//lib/rbs/types.rb#605 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#555 + # source://rbs//lib/rbs/types.rb#559 def eql?(other); end # Returns the value of attribute fields. @@ -6386,15 +7227,15 @@ class RBS::Types::Record def with_nonreturn_void?; end end -# source://rbs//lib/rbs/types.rb#1383 +# source://rbs//lib/rbs/types.rb#1385 module RBS::Types::SelfTypeBindingHelper private - # source://rbs//lib/rbs/types.rb#1386 + # source://rbs//lib/rbs/types.rb#1388 def self_type_binding_to_s(t); end class << self - # source://rbs//lib/rbs/types.rb#1386 + # source://rbs//lib/rbs/types.rb#1388 def self_type_binding_to_s(t); end end end @@ -6412,7 +7253,7 @@ class RBS::Types::Tuple # source://rbs//lib/rbs/types.rb#488 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#451 + # source://rbs//lib/rbs/types.rb#455 def eql?(other); end # source://rbs//lib/rbs/types.rb#461 @@ -6475,7 +7316,7 @@ class RBS::Types::Union # source://rbs//lib/rbs/types.rb#786 def each_type(&block); end - # source://rbs//lib/rbs/types.rb#740 + # source://rbs//lib/rbs/types.rb#744 def eql?(other); end # source://rbs//lib/rbs/types.rb#750 @@ -6546,7 +7387,7 @@ class RBS::Types::UntypedFunction # source://rbs//lib/rbs/types.rb#1302 def empty?; end - # source://rbs//lib/rbs/types.rb#1326 + # source://rbs//lib/rbs/types.rb#1330 def eql?(other); end # source://rbs//lib/rbs/types.rb#1248 @@ -6613,7 +7454,7 @@ class RBS::Types::Variable # source://rbs//lib/rbs/types.rb#144 def ==(other); end - # source://rbs//lib/rbs/types.rb#144 + # source://rbs//lib/rbs/types.rb#148 def eql?(other); end # source://rbs//lib/rbs/types.rb#154 @@ -6876,18 +7717,18 @@ class RBS::Vendorer def vendor_dir; end end -# source://rbs//lib/rbs/errors.rb#593 +# source://rbs//lib/rbs/errors.rb#594 class RBS::WillSyntaxError < ::RBS::DefinitionError include ::RBS::DetailedMessageable # @return [WillSyntaxError] a new instance of WillSyntaxError # - # source://rbs//lib/rbs/errors.rb#598 + # source://rbs//lib/rbs/errors.rb#599 def initialize(message, location:); end # Returns the value of attribute location. # - # source://rbs//lib/rbs/errors.rb#596 + # source://rbs//lib/rbs/errors.rb#597 def location; end end @@ -6970,9 +7811,3 @@ class RBS::Writer # source://rbs//lib/rbs/writer.rb#102 def write_use_directive(dir); end end - -# source://rbs//lib/rdoc/discover.rb#8 -class RDoc::Parser::RBS < ::RDoc::Parser - # source://rbs//lib/rdoc/discover.rb#10 - def scan; end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/require-hooks@0.2.2.rbi b/Library/Homebrew/sorbet/rbi/gems/require-hooks@0.2.2.rbi new file mode 100644 index 0000000000..b57a9a083c --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/require-hooks@0.2.2.rbi @@ -0,0 +1,113 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `require-hooks` gem. +# Please instead update this file by running `bin/tapioca gem require-hooks`. + + +# source://require-hooks//lib/require-hooks/api.rb#3 +module RequireHooks + class << self + # Define a block to wrap the code loading. + # The return value MUST be a result of calling the passed block. + # For example, you can use such hooks for instrumentation, debugging purposes. + # + # RequireHooks.around_load do |path, &block| + # puts "Loading #{path}" + # block.call.tap { puts "Loaded #{path}" } + # end + # + # source://require-hooks//lib/require-hooks/api.rb#71 + def around_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # source://require-hooks//lib/require-hooks/api.rb#107 + def context_for(path); end + + # This hook should be used to manually compile byte code to be loaded by the VM. + # The arguments are (path, source = nil), where source is only defined if transformations took place. + # Otherwise, you MUST read the source code from the file yourself. + # + # The return value MUST be either nil (continue to the next hook or default behavior) or a platform-specific bytecode object (e.g., RubyVM::InstructionSequence). + # + # RequireHooks.hijack_load do |path, source| + # source ||= File.read(path) + # if defined?(RubyVM::InstructionSequence) + # RubyVM::InstructionSequence.compile(source) + # elsif defined?(JRUBY_VERSION) + # JRuby.compile(source) + # end + # end + # + # source://require-hooks//lib/require-hooks/api.rb#103 + def hijack_load(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + + # Returns the value of attribute print_warnings. + # + # source://require-hooks//lib/require-hooks/api.rb#61 + def print_warnings; end + + # Sets the attribute print_warnings + # + # @param value the value to set the attribute print_warnings to. + # + # source://require-hooks//lib/require-hooks/api.rb#61 + def print_warnings=(_arg0); end + + # Define hooks to perform source-to-source transformations. + # The return value MUST be either String (new source code) or nil (indicating that no transformations were performed). + # + # NOTE: The second argument (`source`) MAY be nil, indicating that no transformer tried to transform the source code. + # + # + # RequireHooks.source_transform do |path, source| + # end + # + # source://require-hooks//lib/require-hooks/api.rb#85 + def source_transform(patterns: T.unsafe(nil), exclude_patterns: T.unsafe(nil), &block); end + end +end + +# source://require-hooks//lib/require-hooks/api.rb#8 +class RequireHooks::Context + # @return [Context] a new instance of Context + # + # source://require-hooks//lib/require-hooks/api.rb#9 + def initialize(around_load, source_transform, hijack_load); end + + # @return [Boolean] + # + # source://require-hooks//lib/require-hooks/api.rb#15 + def empty?; end + + # @return [Boolean] + # + # source://require-hooks//lib/require-hooks/api.rb#23 + def hijack?; end + + # source://require-hooks//lib/require-hooks/api.rb#37 + def perform_source_transform(path); end + + # source://require-hooks//lib/require-hooks/api.rb#27 + def run_around_load_callbacks(path); end + + # @return [Boolean] + # + # source://require-hooks//lib/require-hooks/api.rb#19 + def source_transform?; end + + # source://require-hooks//lib/require-hooks/api.rb#49 + def try_hijack_load(path, source); end +end + +# source://require-hooks//lib/require-hooks/mode/load_iseq.rb#4 +module RequireHooks::LoadIseq + # source://require-hooks//lib/require-hooks/mode/load_iseq.rb#5 + def load_iseq(path); end +end + +# source://require-hooks//lib/require-hooks/version.rb#4 +RequireHooks::VERSION = T.let(T.unsafe(nil), String) + +class RubyVM::InstructionSequence + extend ::RequireHooks::LoadIseq +end diff --git a/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.3.rbi b/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.5.rbi similarity index 93% rename from Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.3.rbi rename to Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.5.rbi index 3eee344b76..122793c61d 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.3.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rspec-core@3.13.5.rbi @@ -5,15 +5,7 @@ # Please instead update this file by running `bin/tapioca gem rspec-core`. -module ERB::Escape - private - - def html_escape(_arg0); end - - class << self - def html_escape(_arg0); end - end -end +module ERB::Escape; end # Namespace for all core RSpec code. # @@ -68,7 +60,7 @@ module RSpec # source://rspec-core//lib/rspec/core.rb#194 def const_missing(name); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def context(*args, &example_group_block); end # The example being executed. @@ -129,16 +121,16 @@ module RSpec # source://rspec-core//lib/rspec/core.rb#134 def current_scope=(scope); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def describe(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def example_group(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def fcontext(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def fdescribe(*args, &example_group_block); end # Used to ensure examples get reloaded and user configuration gets reset to @@ -151,13 +143,13 @@ module RSpec # source://rspec-core//lib/rspec/core.rb#58 def reset; end - # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 + # source://rspec-core//lib/rspec/core/shared_example_group.rb#113 def shared_context(name, *args, &block); end # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 def shared_examples(name, *args, &block); end - # source://rspec-core//lib/rspec/core/shared_example_group.rb#110 + # source://rspec-core//lib/rspec/core/shared_example_group.rb#114 def shared_examples_for(name, *args, &block); end # Internal container for global non-configuration data. @@ -174,10 +166,10 @@ module RSpec # source://rspec-core//lib/rspec/core.rb#49 def world=(_arg0); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def xcontext(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/dsl.rb#42 + # source://rspec-core//lib/rspec/core/example_group.rb#279 def xdescribe(*args, &example_group_block); end end end @@ -198,10 +190,10 @@ end # # @private # -# source://rspec-core//lib/rspec/core/example_group.rb#775 +# source://rspec-core//lib/rspec/core/example_group.rb#782 class RSpec::Core::AnonymousExampleGroup < ::RSpec::Core::ExampleGroup class << self - # source://rspec-core//lib/rspec/core/example_group.rb#776 + # source://rspec-core//lib/rspec/core/example_group.rb#783 def metadata; end end end @@ -497,7 +489,7 @@ class RSpec::Core::Configuration # in RSpec to define `it_should_behave_like` (for backward # compatibility), but we also add docs for that method. # - # source://rspec-core//lib/rspec/core/configuration.rb#1240 + # source://rspec-core//lib/rspec/core/configuration.rb#1243 def alias_it_should_behave_like_to(new_name, report_label = T.unsafe(nil)); end # Adds `block` to the end of the list of `after` blocks in the same @@ -529,7 +521,7 @@ class RSpec::Core::Configuration # @see #after # @see #append_after # - # source://rspec-core//lib/rspec/core/configuration.rb#1976 + # source://rspec-core//lib/rspec/core/configuration.rb#1990 def append_before(scope = T.unsafe(nil), *meta, &block); end # @private @@ -1211,7 +1203,7 @@ class RSpec::Core::Configuration # Returns the `inclusion_filter`. If none has been set, returns an empty # hash. # - # source://rspec-core//lib/rspec/core/configuration.rb#1313 + # source://rspec-core//lib/rspec/core/configuration.rb#1317 def filter; end # Clears and reassigns the `inclusion_filter`. Set to `nil` if you don't @@ -1222,7 +1214,7 @@ class RSpec::Core::Configuration # This overrides any inclusion filters/tags set on the command line or in # configuration files. # - # source://rspec-core//lib/rspec/core/configuration.rb#1304 + # source://rspec-core//lib/rspec/core/configuration.rb#1309 def filter=(filter); end # Adds {#backtrace_exclusion_patterns} that will filter lines from @@ -1284,7 +1276,7 @@ class RSpec::Core::Configuration # # filter_run_including :foo # same as filter_run_including :foo => true # - # source://rspec-core//lib/rspec/core/configuration.rb#1275 + # source://rspec-core//lib/rspec/core/configuration.rb#1280 def filter_run(*args); end # Adds key/value pairs to the `exclusion_filter`. If `args` @@ -1427,7 +1419,7 @@ class RSpec::Core::Configuration # the configured `output_stream` (`$stdout`, by default) will be used. # @see RSpec::Core::Formatters::Protocol # - # source://rspec-core//lib/rspec/core/configuration.rb#996 + # source://rspec-core//lib/rspec/core/configuration.rb#999 def formatter=(formatter, output = T.unsafe(nil)); end # @private @@ -1720,7 +1712,7 @@ class RSpec::Core::Configuration # Indicates if the `--only-failures` (or `--next-failure`) flag is being used. # - # source://rspec-core//lib/rspec/core/configuration.rb#66 + # source://rspec-core//lib/rspec/core/configuration.rb#200 def only_failures?; end # @private @@ -1868,7 +1860,7 @@ class RSpec::Core::Configuration # @see #before # @see #prepend_before # - # source://rspec-core//lib/rspec/core/configuration.rb#2031 + # source://rspec-core//lib/rspec/core/configuration.rb#2045 def prepend_after(scope = T.unsafe(nil), *meta, &block); end # Adds `block` to the start of the list of `before` blocks in the same @@ -2487,30 +2479,18 @@ RSpec::Core::Configuration::RAISE_ERROR_WARNING_NOTIFIER = T.let(T.unsafe(nil), # # source://rspec-core//lib/rspec/core/configuration.rb#53 module RSpec::Core::Configuration::Readers - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def clear_lets_on_failure; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def default_color; end # source://rspec-core//lib/rspec/core/configuration.rb#63 def default_path; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def default_retry_count; end - - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def default_sleep_interval; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def deprecation_stream; end # source://rspec-core//lib/rspec/core/configuration.rb#63 def detail_color; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def display_try_failure_messages; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def drb; end @@ -2529,18 +2509,9 @@ module RSpec::Core::Configuration::Readers # source://rspec-core//lib/rspec/core/configuration.rb#63 def example_status_persistence_file_path; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def exceptions_to_hard_fail; end - - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def exceptions_to_retry; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def exclude_pattern; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def exponential_backoff; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def fail_fast; end @@ -2586,12 +2557,6 @@ module RSpec::Core::Configuration::Readers # source://rspec-core//lib/rspec/core/configuration.rb#63 def requires; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def retry_callback; end - - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def retry_count_condition; end - # source://rspec-core//lib/rspec/core/configuration.rb#63 def run_all_when_everything_filtered; end @@ -2612,9 +2577,6 @@ module RSpec::Core::Configuration::Readers # source://rspec-core//lib/rspec/core/configuration.rb#63 def tty; end - - # source://rspec-core//lib/rspec/core/configuration.rb#63 - def verbose_retry; end end # @private @@ -2934,15 +2896,6 @@ class RSpec::Core::Example # source://rspec-core//lib/rspec/core/example.rb#186 def initialize(example_group_class, description, user_metadata, example_block = T.unsafe(nil)); end - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#4 - def attempts; end - - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#4 - def attempts=(_arg0); end - - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#6 - def clear_exception; end - # @attr # @private # @@ -3147,7 +3100,7 @@ class RSpec::Core::Example # Provide a human-readable representation of this class # - # source://rspec-core//lib/rspec/core/example.rb#220 + # source://rspec-core//lib/rspec/core/example.rb#223 def to_s; end # @private @@ -3244,22 +3197,22 @@ class RSpec::Core::Example::ExecutionResult # @return [Exception, nil] The failure, if there was one. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#563 def exception; end # @return [Exception, nil] The failure, if there was one. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#563 def exception=(_arg0); end # @return [Time] When the example finished. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#569 def finished_at; end # @return [Time] When the example finished. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#569 def finished_at=(_arg0); end # @return [Exception, nil] The exception triggered while @@ -3267,7 +3220,7 @@ class RSpec::Core::Example::ExecutionResult # it would no longer get a status of `:pending` unless it was # tagged with `:skip`. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#582 def pending_exception; end # @return [Exception, nil] The exception triggered while @@ -3275,19 +3228,19 @@ class RSpec::Core::Example::ExecutionResult # it would no longer get a status of `:pending` unless it was # tagged with `:skip`. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#582 def pending_exception=(_arg0); end # @return [Boolean] For examples tagged with `:pending`, # this indicates whether or not it now passes. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#586 def pending_fixed; end # @return [Boolean] For examples tagged with `:pending`, # this indicates whether or not it now passes. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#586 def pending_fixed=(_arg0); end # @return [Boolean] @@ -3298,13 +3251,13 @@ class RSpec::Core::Example::ExecutionResult # @return [String, nil] The reason the example was pending, # or nil if the example was not pending. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#576 def pending_message; end # @return [String, nil] The reason the example was pending, # or nil if the example was not pending. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#576 def pending_message=(_arg0); end # Records the finished status of the example. @@ -3316,32 +3269,32 @@ class RSpec::Core::Example::ExecutionResult # @return [Float] How long the example took in seconds. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#572 def run_time; end # @return [Float] How long the example took in seconds. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#572 def run_time=(_arg0); end # @return [Time] When the example started. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#566 def started_at; end # @return [Time] When the example started. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#566 def started_at=(_arg0); end # @return [Symbol] `:passed`, `:failed` or `:pending`. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#560 def status; end # @return [Symbol] `:passed`, `:failed` or `:pending`. # - # source://rspec-core//lib/rspec/core/metadata.rb#442 + # source://rspec-core//lib/rspec/core/example.rb#560 def status=(_arg0); end private @@ -3408,9 +3361,6 @@ class RSpec::Core::Example::Procsy # source://rspec-core//lib/rspec/core/example.rb#346 def arity(*a, &b); end - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#15 - def attempts; end - # source://rspec-core//lib/rspec/core/example.rb#346 def binding(*a, &b); end @@ -3519,12 +3469,9 @@ class RSpec::Core::Example::Procsy # Calls the proc and notes that the example has been executed. # - # source://rspec-core//lib/rspec/core/example.rb#350 + # source://rspec-core//lib/rspec/core/example.rb#354 def run(*args, &block); end - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#11 - def run_with_retry(opts = T.unsafe(nil)); end - # source://rspec-core//lib/rspec/core/example.rb#339 def skip(*a, &b); end @@ -3583,15 +3530,9 @@ class RSpec::Core::ExampleGroup extend ::RSpec::Core::MemoizedHelpers::ClassMethods extend ::RSpec::Core::SharedExampleGroup - # source://rspec-core//lib/rspec/core/example_group.rb#707 + # source://rspec-core//lib/rspec/core/example_group.rb#714 def initialize(inspect_output = T.unsafe(nil)); end - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#34 - def clear_lets; end - - # source://rspec-retry/0.6.2/lib/rspec_ext/rspec_ext.rb#26 - def clear_memoized; end - # Returns the class or module passed to the `describe` method (or alias). # Returns nil if the subject is not a class or module. # @@ -3605,31 +3546,67 @@ class RSpec::Core::ExampleGroup # source://rspec-core//lib/rspec/core/example_group.rb#99 def described_class; end - # source://rspec-core//lib/rspec/core/example_group.rb#713 + # source://rspec-core//lib/rspec/core/example_group.rb#720 def inspect; end private - # source://rspec-core//lib/rspec/core/example_group.rb#758 + # source://rspec-core//lib/rspec/core/example_group.rb#765 def method_missing(name, *args, **_arg2); end class << self # Adds an example to the example group # - # source://rspec-core//lib/rspec/core/example_group.rb#367 + # source://rspec-core//lib/rspec/core/example_group.rb#374 def add_example(example); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#529 + # source://rspec-core//lib/rspec/core/example_group.rb#536 def before_context_ivars; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#466 + # source://rspec-core//lib/rspec/core/example_group.rb#473 def children; end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # An alias of `example_group`. Generally used when grouping examples + # contextually (e.g. "with xyz", "when xyz" or "if xyz"). + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # context "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # context "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload context + # @overload context + # @overload context + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def context(*args, &example_group_block); end # Returns true if a `before(:context)` or `after(:context)` @@ -3637,18 +3614,18 @@ class RSpec::Core::ExampleGroup # # @return [Boolean] # - # source://rspec-core//lib/rspec/core/example_group.rb#542 + # source://rspec-core//lib/rspec/core/example_group.rb#549 def currently_executing_a_context_hook?; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#667 + # source://rspec-core//lib/rspec/core/example_group.rb#674 def declaration_locations; end # @private # @see DSL#describe # - # source://rspec-core//lib/rspec/core/example_group.rb#246 + # source://rspec-core//lib/rspec/core/example_group.rb#248 def define_example_group_method(name, metadata = T.unsafe(nil)); end # @example @@ -3662,7 +3639,7 @@ class RSpec::Core::ExampleGroup # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#317 + # source://rspec-core//lib/rspec/core/example_group.rb#324 def define_nested_shared_group_method(new_name, report_label = T.unsafe(nil)); end # @private @@ -3672,18 +3649,54 @@ class RSpec::Core::ExampleGroup # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#460 + # source://rspec-core//lib/rspec/core/example_group.rb#467 def descendant_filtered_examples; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#503 + # source://rspec-core//lib/rspec/core/example_group.rb#510 def descendants; end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # An alias of `example_group`. Generally used when grouping examples by a + # thing you are describing (e.g. an object, class or method). + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # describe "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # describe "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload describe + # @overload describe + # @overload describe + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def describe(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/example_group.rb#78 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def described_class; end # @return [String] the current example group description @@ -3693,12 +3706,12 @@ class RSpec::Core::ExampleGroup # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#700 + # source://rspec-core//lib/rspec/core/example_group.rb#707 def each_instance_variable_for_example(group); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#518 + # source://rspec-core//lib/rspec/core/example_group.rb#525 def ensure_example_groups_are_configured; end # Defines an example within a group. @@ -3725,21 +3738,124 @@ class RSpec::Core::ExampleGroup # @overload example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def example(*all_args, &block); end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # example_group "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # example_group "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload example_group + # @overload example_group + # @overload example_group + # @return [RSpec::Core::ExampleGroup] + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def example_group(*args, &example_group_block); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#450 + # source://rspec-core//lib/rspec/core/example_group.rb#457 def examples; end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # Shortcut to define an example group with `:focus => true`. + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # fcontext "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # fcontext "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload fcontext + # @overload fcontext + # @overload fcontext + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def fcontext(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # Shortcut to define an example group with `:focus => true`. + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # fdescribe "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # fdescribe "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload fdescribe + # @overload fdescribe + # @overload fdescribe + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def fdescribe(*args, &example_group_block); end # Shortcut to define an example with `:focus => true`. @@ -3767,20 +3883,20 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def fexample(*all_args, &block); end - # source://rspec-core//lib/rspec/core/example_group.rb#78 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def file_path; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#455 + # source://rspec-core//lib/rspec/core/example_group.rb#462 def filtered_examples; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#379 + # source://rspec-core//lib/rspec/core/example_group.rb#386 def find_and_eval_shared(label, name, inclusion_location, *args, &customization_block); end # Shortcut to define an example with `:focus => true`. @@ -3808,7 +3924,7 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def fit(*all_args, &block); end # Shortcut to define an example with `:focus => true`. @@ -3836,12 +3952,12 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def focus(*all_args, &block); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#655 + # source://rspec-core//lib/rspec/core/example_group.rb#662 def for_filtered_examples(reporter, &block); end # Shortcut to define an example with `:focus => true`. @@ -3869,13 +3985,13 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def fspecify(*all_args, &block); end # @return [String] the unique id of this example group. Pass # this at the command line to re-run this exact example group. # - # source://rspec-core//lib/rspec/core/example_group.rb#675 + # source://rspec-core//lib/rspec/core/example_group.rb#682 def id; end # Define a singleton method for the singleton class (remove the method if @@ -3893,7 +4009,7 @@ class RSpec::Core::ExampleGroup # # @see SharedExampleGroup # - # source://rspec-core//lib/rspec/core/example_group.rb#343 + # source://rspec-core//lib/rspec/core/example_group.rb#350 def include_context(name, *args, &block); end # Includes shared content mapped to `name` directly in the group in which @@ -3903,7 +4019,7 @@ class RSpec::Core::ExampleGroup # # @see SharedExampleGroup # - # source://rspec-core//lib/rspec/core/example_group.rb#353 + # source://rspec-core//lib/rspec/core/example_group.rb#360 def include_examples(name, *args, &block); end # Defines an example within a group. @@ -3931,16 +4047,26 @@ class RSpec::Core::ExampleGroup # @overload it # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def it(*all_args, &block); end - # source://rspec-core//lib/rspec/core/example_group.rb#318 + # @param name [String, Symbol] The name of the shared group to include. + # @param args [Array] Pass parameters to a shared example group + # @param block [Block] Additional context to pass to the shared group. + # @return [RSpec::Core::ExampleGroup] + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def it_behaves_like(name, *args, &customization_block); end - # source://rspec-core//lib/rspec/core/example_group.rb#318 + # @param name [String, Symbol] The name of the shared group to include. + # @param args [Array] Pass parameters to a shared example group + # @param block [Block] Additional context to pass to the shared group. + # @return [RSpec::Core::ExampleGroup] + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def it_should_behave_like(name, *args, &customization_block); end - # source://rspec-core//lib/rspec/core/example_group.rb#78 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def location; end # The [Metadata](Metadata) object associated with this group. @@ -3952,17 +4078,17 @@ class RSpec::Core::ExampleGroup # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#485 + # source://rspec-core//lib/rspec/core/example_group.rb#492 def next_runnable_index_for(file); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#625 + # source://rspec-core//lib/rspec/core/example_group.rb#632 def ordering_strategy; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#508 + # source://rspec-core//lib/rspec/core/example_group.rb#515 def parent_groups; end # Shortcut to define an example with `:pending => true` @@ -3990,49 +4116,49 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def pending(*all_args, &block); end # Removes an example from the example group # - # source://rspec-core//lib/rspec/core/example_group.rb#373 + # source://rspec-core//lib/rspec/core/example_group.rb#380 def remove_example(example); end # Clear memoized values when adding/removing examples # # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#359 + # source://rspec-core//lib/rspec/core/example_group.rb#366 def reset_memoized; end # Runs all the examples in this group. # - # source://rspec-core//lib/rspec/core/example_group.rb#599 + # source://rspec-core//lib/rspec/core/example_group.rb#606 def run(reporter = T.unsafe(nil)); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#585 + # source://rspec-core//lib/rspec/core/example_group.rb#592 def run_after_context_hooks(example_group_instance); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#547 + # source://rspec-core//lib/rspec/core/example_group.rb#554 def run_before_context_hooks(example_group_instance); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#641 + # source://rspec-core//lib/rspec/core/example_group.rb#648 def run_examples(reporter); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#410 + # source://rspec-core//lib/rspec/core/example_group.rb#417 def set_it_up(description, args, registration_collection, &example_group_block); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#685 + # source://rspec-core//lib/rspec/core/example_group.rb#692 def set_ivars(instance, ivars); end # Shortcut to define an example with `:skip => true` @@ -4060,7 +4186,7 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def skip(*all_args, &block); end # Defines an example within a group. @@ -4094,24 +4220,24 @@ class RSpec::Core::ExampleGroup # @overload specify # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def specify(*all_args, &block); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#534 + # source://rspec-core//lib/rspec/core/example_group.rb#541 def store_before_context_ivars(example_group_instance); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#395 + # source://rspec-core//lib/rspec/core/example_group.rb#402 def subclass(parent, description, args, registration_collection, &example_group_block); end # :nocov: # # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#562 + # source://rspec-core//lib/rspec/core/example_group.rb#569 def superclass_before_context_ivars; end # @private @@ -4123,12 +4249,12 @@ class RSpec::Core::ExampleGroup # @private # @return [Boolean] # - # source://rspec-core//lib/rspec/core/example_group.rb#513 + # source://rspec-core//lib/rspec/core/example_group.rb#520 def top_level?; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#680 + # source://rspec-core//lib/rspec/core/example_group.rb#687 def top_level_description; end # Traverses the tree of groups, starting with `self`, then the children, recursively. @@ -4139,12 +4265,12 @@ class RSpec::Core::ExampleGroup # # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#476 + # source://rspec-core//lib/rspec/core/example_group.rb#483 def traverse_tree_until(&block); end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#727 + # source://rspec-core//lib/rspec/core/example_group.rb#734 def update_inherited_metadata(updates); end # Temporarily replace the provided metadata. @@ -4158,10 +4284,80 @@ class RSpec::Core::ExampleGroup # source://rspec-core//lib/rspec/core/example_group.rb#61 def with_replaced_metadata(meta); end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # Shortcut to temporarily make an example group skipped. + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # xcontext "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # xcontext "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload xcontext + # @overload xcontext + # @overload xcontext + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def xcontext(*args, &example_group_block); end - # source://rspec-core//lib/rspec/core/example_group.rb#247 + # Shortcut to temporarily make an example group skipped. + # Generates a subclass of this example group which inherits + # everything except the examples themselves. + # + # @example + # + # RSpec.describe "something" do # << This describe method is defined in + # # << RSpec::Core::DSL, included in the + # # << global namespace (optional) + # before do + # do_something_before + # end + # + # before(:example, :clean_env) do + # env.clear! + # end + # + # let(:thing) { Thing.new } + # + # xdescribe "attribute (of something)" do + # # examples in the group get the before hook + # # declared above, and can access `thing` + # end + # + # xdescribe "needs additional setup", :clean_env, :implementation => JSON do + # # specifies that hooks with matching metadata + # # should be be run additionally + # end + # end + # @overload xdescribe + # @overload xdescribe + # @overload xdescribe + # @return [RSpec::Core::ExampleGroup] + # @see example_group + # + # source://rspec-core//lib/rspec/core/example_group.rb#43 def xdescribe(*args, &example_group_block); end # Shortcut to define an example with `:skip => 'Temporarily skipped with xexample'`. @@ -4189,7 +4385,7 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def xexample(*all_args, &block); end # Shortcut to define an example with `:skip => 'Temporarily skipped with xit'`. @@ -4217,7 +4413,7 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def xit(*all_args, &block); end # Shortcut to define an example with `:skip => 'Temporarily skipped with xspecify'`. @@ -4245,26 +4441,26 @@ class RSpec::Core::ExampleGroup # @see example # @yield [Example] the example object # - # source://rspec-core//lib/rspec/core/example_group.rb#146 + # source://rspec-core//lib/rspec/core/example_group.rb#43 def xspecify(*all_args, &block); end private - # source://rspec-core//lib/rspec/core/example_group.rb#742 + # source://rspec-core//lib/rspec/core/example_group.rb#749 def method_missing(name, *args); end end end # @private # -# source://rspec-core//lib/rspec/core/example_group.rb#696 +# source://rspec-core//lib/rspec/core/example_group.rb#703 RSpec::Core::ExampleGroup::INSTANCE_VARIABLE_TO_IGNORE = T.let(T.unsafe(nil), Symbol) # Raised when an RSpec API is called in the wrong scope, such as `before` # being called from within an example rather than from within an example # group block. # -# source://rspec-core//lib/rspec/core/example_group.rb#740 +# source://rspec-core//lib/rspec/core/example_group.rb#747 class RSpec::Core::ExampleGroup::WrongScopeError < ::NoMethodError; end # Dumps a list of hashes in a pretty, human readable format @@ -4637,7 +4833,7 @@ class RSpec::Core::FilterableItemRepository::QueryOptimized < ::RSpec::Core::Fil # source://rspec-core//lib/rspec/core/metadata_filter.rb#217 def applicable_metadata_from(metadata); end - # source://rspec-core//lib/rspec/core/metadata_filter.rb#118 + # source://rspec-core//lib/rspec/core/metadata_filter.rb#152 def find_items_for(request_meta); end # source://rspec-core//lib/rspec/core/metadata_filter.rb#211 @@ -4701,7 +4897,7 @@ module RSpec::Core::FlatMap class << self # :nocov: # - # source://rspec-core//lib/rspec/core/flat_map.rb#6 + # source://rspec-core//lib/rspec/core/flat_map.rb#17 def flat_map(array, &block); end end end @@ -5012,7 +5208,7 @@ class RSpec::Core::Formatters::DeprecationFormatter # Returns the value of attribute deprecation_stream. # - # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#10 + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#18 def output; end # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#20 @@ -5103,19 +5299,32 @@ class RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage # Returns the value of attribute type # # @return [Object] the current value of type + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def type; end # Sets the attribute type # # @param value [Object] the value to set the attribute type to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def type=(_); end class << self + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def inspect; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def members; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#94 def new(*_arg0); end end end @@ -5187,12 +5396,16 @@ class RSpec::Core::Formatters::DeprecationFormatter::SpecifiedDeprecationMessage # Returns the value of attribute type # # @return [Object] the current value of type + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def type; end # Sets the attribute type # # @param value [Object] the value to set the attribute type to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def type=(_); end private @@ -5204,10 +5417,19 @@ class RSpec::Core::Formatters::DeprecationFormatter::SpecifiedDeprecationMessage def output_formatted(str); end class << self + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def inspect; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def members; end + + # source://rspec-core//lib/rspec/core/formatters/deprecation_formatter.rb#66 def new(*_arg0); end end end @@ -5330,7 +5552,7 @@ class RSpec::Core::Formatters::ExceptionPresenter # :nocov: # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#286 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#287 def encoded_description(description); end # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#120 @@ -5341,7 +5563,7 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#116 def encoding_of(string); end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#298 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#299 def exception_backtrace; end # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#150 @@ -5375,7 +5597,7 @@ class RSpec::Core::Formatters::ExceptionPresenter # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#262 def find_failed_line; end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#277 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#278 def formatted_message_and_backtrace(colorizer); end # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#134 @@ -5397,49 +5619,49 @@ end # # @private # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#307 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#308 class RSpec::Core::Formatters::ExceptionPresenter::Factory # @return [Factory] a new instance of Factory # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#314 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#315 def initialize(example); end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#308 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#309 def build; end private - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#369 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#370 def multiple_exception_summarizer(exception, prior_detail_formatter, color); end # @return [Boolean] # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#365 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#366 def multiple_exceptions_error?(exception); end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#324 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#325 def options; end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#328 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#329 def pending_options; end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#390 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#391 def sub_failure_list_formatter(exception, message_color); end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#349 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#350 def with_multiple_error_options_as_needed(exception, options); end end # @private # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#423 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#424 class RSpec::Core::Formatters::ExceptionPresenter::Factory::CommonBacktraceTruncater # @return [CommonBacktraceTruncater] a new instance of CommonBacktraceTruncater # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#424 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#425 def initialize(parent); end - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#428 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#429 def with_truncated_backtrace(child); end end @@ -5448,17 +5670,17 @@ end # # @private # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#416 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#417 module RSpec::Core::Formatters::ExceptionPresenter::Factory::EmptyBacktraceFormatter class << self - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#417 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#418 def format_backtrace(*_arg0); end end end # @private # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#448 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#449 RSpec::Core::Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER = T.let(T.unsafe(nil), Proc) # @private @@ -6759,7 +6981,7 @@ module RSpec::Core::Hooks # @see SharedExampleGroup # @see Configuration # - # source://rspec-core//lib/rspec/core/hooks.rb#200 + # source://rspec-core//lib/rspec/core/hooks.rb#204 def append_before(*args, &block); end # Declare a block of code, parts of which will be run before and parts @@ -7039,7 +7261,7 @@ module RSpec::Core::Hooks # @see SharedExampleGroup # @see Configuration # - # source://rspec-core//lib/rspec/core/hooks.rb#277 + # source://rspec-core//lib/rspec/core/hooks.rb#281 def prepend_after(*args, &block); end # Adds `block` to the front of the list of `before` blocks in the same @@ -7095,30 +7317,47 @@ class RSpec::Core::Hooks::Hook < ::Struct # Returns the value of attribute block # # @return [Object] the current value of block + # + # source://rspec-core//lib/rspec/core/hooks.rb#360 def block; end # Sets the attribute block # # @param value [Object] the value to set the attribute block to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/hooks.rb#360 def block=(_); end # Returns the value of attribute options # # @return [Object] the current value of options + # + # source://rspec-core//lib/rspec/core/hooks.rb#360 def options; end # Sets the attribute options # # @param value [Object] the value to set the attribute options to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/hooks.rb#360 def options=(_); end class << self + # source://rspec-core//lib/rspec/core/hooks.rb#360 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/hooks.rb#360 def inspect; end + + # source://rspec-core//lib/rspec/core/hooks.rb#360 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/hooks.rb#360 def members; end + + # source://rspec-core//lib/rspec/core/hooks.rb#360 def new(*_arg0); end end end @@ -7303,30 +7542,47 @@ class RSpec::Core::Invocations::PrintHelp < ::Struct # Returns the value of attribute hidden_options # # @return [Object] the current value of hidden_options + # + # source://rspec-core//lib/rspec/core/invocations.rb#78 def hidden_options; end # Sets the attribute hidden_options # # @param value [Object] the value to set the attribute hidden_options to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/invocations.rb#78 def hidden_options=(_); end # Returns the value of attribute parser # # @return [Object] the current value of parser + # + # source://rspec-core//lib/rspec/core/invocations.rb#78 def parser; end # Sets the attribute parser # # @param value [Object] the value to set the attribute parser to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/invocations.rb#78 def parser=(_); end class << self + # source://rspec-core//lib/rspec/core/invocations.rb#78 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/invocations.rb#78 def inspect; end + + # source://rspec-core//lib/rspec/core/invocations.rb#78 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/invocations.rb#78 def members; end + + # source://rspec-core//lib/rspec/core/invocations.rb#78 def new(*_arg0); end end end @@ -8087,57 +8343,57 @@ end # individual spec has multiple exceptions, such as one in the `it` block # and one in an `after` block. # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#458 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#459 class RSpec::Core::MultipleExceptionError < ::StandardError include ::RSpec::Core::MultipleExceptionError::InterfaceTag # @param exceptions [Array] The initial list of exceptions. # @return [MultipleExceptionError] a new instance of MultipleExceptionError # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#519 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#520 def initialize(*exceptions); end # @return [nil] Provided only for interface compatibility with # `RSpec::Expectations::MultipleExpectationsNotMetError`. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#516 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#517 def aggregation_block_label; end # @return [Hash] Metadata used by RSpec for formatting purposes. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#512 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#513 def aggregation_metadata; end # @return [Array] The list of failures and other exceptions, combined. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#509 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#510 def all_exceptions; end # return [String] A description of the failure/error counts. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#544 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#545 def exception_count_description; end # @return [Array] The list of failures. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#503 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#504 def failures; end # @note RSpec does not actually use this -- instead it formats each exception # individually. # @return [String] Combines all the exception messages into a single string. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#534 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#535 def message; end # @return [Array] The list of other errors. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#506 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#507 def other_errors; end # @return [String] A summary of the failure, including the block label and a count of failures. # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#539 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#540 def summary; end end @@ -8148,14 +8404,14 @@ end # # @private # -# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#464 +# source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#465 module RSpec::Core::MultipleExceptionError::InterfaceTag # Appends the provided exception to the list. # # @param exception [Exception] Exception to append to the list. # @private # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#468 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#469 def add(exception); end class << self @@ -8165,7 +8421,7 @@ module RSpec::Core::MultipleExceptionError::InterfaceTag # # @private # - # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#494 + # source://rspec-core//lib/rspec/core/formatters/exception_presenter.rb#495 def for(ex); end end end @@ -8210,6 +8466,8 @@ class RSpec::Core::Notifications::DeprecationNotification < ::Struct # was issued # # @return [String] the current value of call_site + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def call_site; end # An optional call site from which the deprecation @@ -8217,12 +8475,16 @@ class RSpec::Core::Notifications::DeprecationNotification < ::Struct # # @param value [String] the value to set the attribute call_site to. # @return [String] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def call_site=(_); end # A custom message about the deprecation (alias of # message) # # @return [String] the current value of deprecated + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def deprecated; end # A custom message about the deprecation (alias of @@ -8230,31 +8492,42 @@ class RSpec::Core::Notifications::DeprecationNotification < ::Struct # # @param value [String] the value to set the attribute deprecated to. # @return [String] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def deprecated=(_); end # A custom message about the deprecation # # @return [String] the current value of message + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def message; end # A custom message about the deprecation # # @param value [String] the value to set the attribute message to. # @return [String] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def message=(_); end # An optional replacement for the deprecation # # @return [String] the current value of replacement + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def replacement; end # An optional replacement for the deprecation # # @param value [String] the value to set the attribute replacement to. # @return [String] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#493 def replacement=(_); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#493 def [](*_arg0); end # Convenience way to initialize the notification @@ -8264,12 +8537,18 @@ class RSpec::Core::Notifications::DeprecationNotification < ::Struct # source://rspec-core//lib/rspec/core/notifications.rb#499 def from_hash(data); end + # source://rspec-core//lib/rspec/core/notifications.rb#493 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#493 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#493 def members; end private + # source://rspec-core//lib/rspec/core/notifications.rb#493 def new(*_arg0); end end end @@ -8289,15 +8568,20 @@ class RSpec::Core::Notifications::ExampleNotification < ::Struct # the current example # # @return [RSpec::Core::Example] the current value of example + # + # source://rspec-core//lib/rspec/core/notifications.rb#38 def example; end # the current example # # @param value [RSpec::Core::Example] the value to set the attribute example to. # @return [RSpec::Core::Example] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#38 def example=(_); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#38 def [](*_arg0); end # @private @@ -8305,12 +8589,18 @@ class RSpec::Core::Notifications::ExampleNotification < ::Struct # source://rspec-core//lib/rspec/core/notifications.rb#41 def for(example); end + # source://rspec-core//lib/rspec/core/notifications.rb#38 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#38 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#38 def members; end private + # source://rspec-core//lib/rspec/core/notifications.rb#38 def new(*_arg0); end end end @@ -8454,6 +8744,7 @@ class RSpec::Core::Notifications::FailedExampleNotification < ::RSpec::Core::Not def message_lines; end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#157 def new(*_arg0); end end end @@ -8474,19 +8765,32 @@ class RSpec::Core::Notifications::GroupNotification < ::Struct # the current group # # @return [RSpec::Core::ExampleGroup] the current value of group + # + # source://rspec-core//lib/rspec/core/notifications.rb#258 def group; end # the current group # # @param value [RSpec::Core::ExampleGroup] the value to set the attribute group to. # @return [RSpec::Core::ExampleGroup] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#258 def group=(_); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#258 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/notifications.rb#258 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#258 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#258 def members; end + + # source://rspec-core//lib/rspec/core/notifications.rb#258 def new(*_arg0); end end end @@ -8501,19 +8805,32 @@ class RSpec::Core::Notifications::MessageNotification < ::Struct # the message # # @return [String] the current value of message + # + # source://rspec-core//lib/rspec/core/notifications.rb#264 def message; end # the message # # @param value [String] the value to set the attribute message to. # @return [String] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#264 def message=(_); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#264 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/notifications.rb#264 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#264 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#264 def members; end + + # source://rspec-core//lib/rspec/core/notifications.rb#264 def new(*_arg0); end end end @@ -8629,12 +8946,16 @@ class RSpec::Core::Notifications::SeedNotification < ::Struct # the seed used to randomize ordering # # @return [Fixnum] the current value of seed + # + # source://rspec-core//lib/rspec/core/notifications.rb#271 def seed; end # the seed used to randomize ordering # # @param value [Fixnum] the value to set the attribute seed to. # @return [Fixnum] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#271 def seed=(_); end # @api @@ -8647,6 +8968,8 @@ class RSpec::Core::Notifications::SeedNotification < ::Struct # # @param value [Boolean] the value to set the attribute used to. # @return [Boolean] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#271 def used=(_); end private @@ -8654,13 +8977,24 @@ class RSpec::Core::Notifications::SeedNotification < ::Struct # whether the seed has been used or not # # @return [Boolean] the current value of used + # + # source://rspec-core//lib/rspec/core/notifications.rb#271 def used; end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#271 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/notifications.rb#271 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#271 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#271 def members; end + + # source://rspec-core//lib/rspec/core/notifications.rb#271 def new(*_arg0); end end end @@ -8680,6 +9014,7 @@ class RSpec::Core::Notifications::SkippedExampleNotification < ::RSpec::Core::No def fully_formatted(pending_number, colorizer = T.unsafe(nil)); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#231 def new(*_arg0); end end end @@ -8697,18 +9032,24 @@ class RSpec::Core::Notifications::StartNotification < ::Struct # the number counted # # @return [Fixnum] the current value of count + # + # source://rspec-core//lib/rspec/core/notifications.rb#26 def count; end # the number counted # # @param value [Fixnum] the value to set the attribute count to. # @return [Fixnum] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#26 def count=(_); end # the number of seconds taken to boot RSpec # and load the spec files # # @return [Float] the current value of load_time + # + # source://rspec-core//lib/rspec/core/notifications.rb#26 def load_time; end # the number of seconds taken to boot RSpec @@ -8716,13 +9057,24 @@ class RSpec::Core::Notifications::StartNotification < ::Struct # # @param value [Float] the value to set the attribute load_time to. # @return [Float] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#26 def load_time=(_); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#26 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/notifications.rb#26 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#26 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#26 def members; end + + # source://rspec-core//lib/rspec/core/notifications.rb#26 def new(*_arg0); end end end @@ -8770,12 +9122,16 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # the time taken (in seconds) to run the suite # # @return [Float] the current value of duration + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def duration; end # the time taken (in seconds) to run the suite # # @param value [Float] the value to set the attribute duration to. # @return [Float] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def duration=(_); end # the number of errors that @@ -8783,6 +9139,8 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # the spec suite # # @return [Integer] the current value of errors_outside_of_examples_count + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def errors_outside_of_examples_count; end # the number of errors that @@ -8791,6 +9149,8 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # # @param value [Integer] the value to set the attribute errors_outside_of_examples_count to. # @return [Integer] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def errors_outside_of_examples_count=(_); end # @api @@ -8802,23 +9162,31 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # the examples run # # @return [Array] the current value of examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def examples; end # the examples run # # @param value [Array] the value to set the attribute examples to. # @return [Array] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def examples=(_); end # the failed examples # # @return [Array] the current value of failed_examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def failed_examples; end # the failed examples # # @param value [Array] the value to set the attribute failed_examples to. # @return [Array] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def failed_examples=(_); end # @api @@ -8849,6 +9217,8 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # and load the spec files # # @return [Float] the current value of load_time + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def load_time; end # the number of seconds taken to boot RSpec @@ -8856,6 +9226,8 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # # @param value [Float] the value to set the attribute load_time to. # @return [Float] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def load_time=(_); end # @api @@ -8867,12 +9239,16 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct # the pending examples # # @return [Array] the current value of pending_examples + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def pending_examples; end # the pending examples # # @param value [Array] the value to set the attribute pending_examples to. # @return [Array] the newly set value + # + # source://rspec-core//lib/rspec/core/notifications.rb#300 def pending_examples=(_); end # @api @@ -8890,10 +9266,19 @@ class RSpec::Core::Notifications::SummaryNotification < ::Struct def rerun_argument_for(example); end class << self + # source://rspec-core//lib/rspec/core/notifications.rb#300 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/notifications.rb#300 def inspect; end + + # source://rspec-core//lib/rspec/core/notifications.rb#300 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/notifications.rb#300 def members; end + + # source://rspec-core//lib/rspec/core/notifications.rb#300 def new(*_arg0); end end end @@ -9847,22 +10232,22 @@ module RSpec::Core::RubyProject def root; end class << self - # source://rspec-core//lib/rspec/core/ruby_project.rb#12 + # source://rspec-core//lib/rspec/core/ruby_project.rb#46 def add_dir_to_load_path(dir); end - # source://rspec-core//lib/rspec/core/ruby_project.rb#8 + # source://rspec-core//lib/rspec/core/ruby_project.rb#45 def add_to_load_path(*dirs); end - # source://rspec-core//lib/rspec/core/ruby_project.rb#28 + # source://rspec-core//lib/rspec/core/ruby_project.rb#50 def ascend_until; end - # source://rspec-core//lib/rspec/core/ruby_project.rb#20 + # source://rspec-core//lib/rspec/core/ruby_project.rb#48 def determine_root; end - # source://rspec-core//lib/rspec/core/ruby_project.rb#24 + # source://rspec-core//lib/rspec/core/ruby_project.rb#49 def find_first_parent_containing(dir); end - # source://rspec-core//lib/rspec/core/ruby_project.rb#16 + # source://rspec-core//lib/rspec/core/ruby_project.rb#47 def root; end end end @@ -10141,44 +10526,65 @@ class RSpec::Core::SharedContext::Recording < ::Struct # Returns the value of attribute args # # @return [Object] the current value of args + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def args; end # Sets the attribute args # # @param value [Object] the value to set the attribute args to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def args=(_); end # Returns the value of attribute block # # @return [Object] the current value of block + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def block; end # Sets the attribute block # # @param value [Object] the value to set the attribute block to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def block=(_); end # Returns the value of attribute method_name # # @return [Object] the current value of method_name + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def method_name; end # Sets the attribute method_name # # @param value [Object] the value to set the attribute method_name to. # @return [Object] the newly set value + # + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def method_name=(_); end # source://rspec-core//lib/rspec/core/shared_context.rb#34 def playback_onto(group); end class << self + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def [](*_arg0); end + + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def inspect; end + + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def keyword_init?; end + + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def members; end + + # source://rspec-core//lib/rspec/core/shared_context.rb#33 def new(*_arg0); end end end @@ -10221,7 +10627,7 @@ module RSpec::Core::SharedExampleGroup # @see ExampleGroup.include_examples # @see ExampleGroup.include_context # - # source://rspec-core//lib/rspec/core/shared_example_group.rb#90 + # source://rspec-core//lib/rspec/core/shared_example_group.rb#100 def shared_context(name, *args, &block); end # Stores the block for later use. The block will be evaluated @@ -10271,7 +10677,7 @@ module RSpec::Core::SharedExampleGroup # @see ExampleGroup.include_examples # @see ExampleGroup.include_context # - # source://rspec-core//lib/rspec/core/shared_example_group.rb#90 + # source://rspec-core//lib/rspec/core/shared_example_group.rb#101 def shared_examples_for(name, *args, &block); end end @@ -10355,49 +10761,49 @@ end # Contains information about the inclusion site of a shared example group. # -# source://rspec-core//lib/rspec/core/example_group.rb#782 +# source://rspec-core//lib/rspec/core/example_group.rb#789 class RSpec::Core::SharedExampleGroupInclusionStackFrame # @private # @return [SharedExampleGroupInclusionStackFrame] a new instance of SharedExampleGroupInclusionStackFrame # - # source://rspec-core//lib/rspec/core/example_group.rb#789 + # source://rspec-core//lib/rspec/core/example_group.rb#796 def initialize(shared_group_name, inclusion_location); end # @return [String] Description of this stack frame, in the form used by # RSpec's built-in formatters. # - # source://rspec-core//lib/rspec/core/example_group.rb#805 + # source://rspec-core//lib/rspec/core/example_group.rb#812 def description; end # @return [String] The {#inclusion_location}, formatted for display by a formatter. # - # source://rspec-core//lib/rspec/core/example_group.rb#795 + # source://rspec-core//lib/rspec/core/example_group.rb#802 def formatted_inclusion_location; end # @return [String] the location where the shared example was included # - # source://rspec-core//lib/rspec/core/example_group.rb#786 + # source://rspec-core//lib/rspec/core/example_group.rb#793 def inclusion_location; end # @return [String] the name of the shared example group # - # source://rspec-core//lib/rspec/core/example_group.rb#784 + # source://rspec-core//lib/rspec/core/example_group.rb#791 def shared_group_name; end class << self # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#811 + # source://rspec-core//lib/rspec/core/example_group.rb#818 def current_backtrace; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#829 + # source://rspec-core//lib/rspec/core/example_group.rb#836 def shared_example_group_inclusions; end # @private # - # source://rspec-core//lib/rspec/core/example_group.rb#816 + # source://rspec-core//lib/rspec/core/example_group.rb#823 def with_frame(name, location); end end end @@ -10438,7 +10844,7 @@ class RSpec::Core::SharedExampleGroupModule < ::Module # Provides a human-readable representation of this module. # - # source://rspec-core//lib/rspec/core/shared_example_group.rb#20 + # source://rspec-core//lib/rspec/core/shared_example_group.rb#23 def to_s; end end @@ -10515,6 +10921,7 @@ end # source://rspec-core//lib/rspec/core.rb#174 class RSpec::Core::Time class << self + # source://rspec-core//lib/rspec/core.rb#176 def now(in: T.unsafe(nil)); end end end @@ -10857,24 +11264,24 @@ end # # @private # -# source://rspec-core//lib/rspec/core/example_group.rb#839 +# source://rspec-core//lib/rspec/core/example_group.rb#846 module RSpec::ExampleGroups extend ::RSpec::Support::RecursiveConstMethods class << self - # source://rspec-core//lib/rspec/core/example_group.rb#842 + # source://rspec-core//lib/rspec/core/example_group.rb#849 def assign_const(group); end - # source://rspec-core//lib/rspec/core/example_group.rb#862 + # source://rspec-core//lib/rspec/core/example_group.rb#869 def base_name_for(group); end - # source://rspec-core//lib/rspec/core/example_group.rb#850 + # source://rspec-core//lib/rspec/core/example_group.rb#857 def constant_scope_for(group); end - # source://rspec-core//lib/rspec/core/example_group.rb#895 + # source://rspec-core//lib/rspec/core/example_group.rb#902 def disambiguate(name, const_scope); end - # source://rspec-core//lib/rspec/core/example_group.rb#856 + # source://rspec-core//lib/rspec/core/example_group.rb#863 def remove_all_constants; end end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.4.rbi b/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi similarity index 97% rename from Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.4.rbi rename to Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi index 370f5ae031..977e85a764 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.4.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi @@ -9,75 +9,7 @@ # in the `RSpec::Expectations` and `RSpec::Matchers` namespaces. # # source://rspec-expectations//lib/rspec/matchers/english_phrasing.rb#1 -module RSpec - class << self - # source://rspec-core/3.13.3/lib/rspec/core.rb#70 - def clear_examples; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#85 - def configuration; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#49 - def configuration=(_arg0); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#97 - def configure; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#194 - def const_missing(name); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def context(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#122 - def current_example; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#128 - def current_example=(example); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#154 - def current_scope; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#134 - def current_scope=(scope); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def describe(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def example_group(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def fcontext(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def fdescribe(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#58 - def reset; end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_context(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_examples(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_examples_for(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#160 - def world; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#49 - def world=(_arg0); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def xcontext(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def xdescribe(*args, &example_group_block); end - end -end +module RSpec; end # RSpec::Expectations provides a simple, readable API to express # the expected outcomes in a code example. To express an expected @@ -164,7 +96,7 @@ class RSpec::Expectations::BlockExpectationTarget < ::RSpec::Expectations::Expec # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#137 def to(matcher, message = T.unsafe(nil), &block); end - # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#142 + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#146 def to_not(matcher, message = T.unsafe(nil), &block); end private @@ -249,12 +181,16 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct # Returns the value of attribute beginning_line_number # # @return [Object] the current value of beginning_line_number + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def beginning_line_number; end # Sets the attribute beginning_line_number # # @param value [Object] the value to set the attribute beginning_line_number to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def beginning_line_number=(_); end # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#205 @@ -266,23 +202,31 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct # Returns the value of attribute method_name # # @return [Object] the current value of method_name + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def method_name; end # Sets the attribute method_name # # @param value [Object] the value to set the attribute method_name to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def method_name=(_); end # Returns the value of attribute source # # @return [Object] the current value of source + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def source; end # Sets the attribute source # # @param value [Object] the value to set the attribute source to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def source=(_); end private @@ -308,10 +252,19 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockLocator < ::Struct def method_ident_node?(node); end class << self + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def [](*_arg0); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def inspect; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def keyword_init?; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def members; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#200 def new(*_arg0); end end end @@ -331,12 +284,16 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct # Returns the value of attribute beginning_line_number # # @return [Object] the current value of beginning_line_number + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def beginning_line_number; end # Sets the attribute beginning_line_number # # @param value [Object] the value to set the attribute beginning_line_number to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def beginning_line_number=(_); end # Returns the value of attribute body_tokens. @@ -347,23 +304,31 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct # Returns the value of attribute method_name # # @return [Object] the current value of method_name + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def method_name; end # Sets the attribute method_name # # @param value [Object] the value to set the attribute method_name to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def method_name=(_); end # Returns the value of attribute source # # @return [Object] the current value of source + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def source; end # Sets the attribute source # # @param value [Object] the value to set the attribute source to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def source=(_); end # Returns the value of attribute state. @@ -434,10 +399,19 @@ class RSpec::Expectations::BlockSnippetExtractor::BlockTokenExtractor < ::Struct def pipe_token?(token); end class << self + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def [](*_arg0); end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def inspect; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def keyword_init?; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def members; end + + # source://rspec-expectations//lib/rspec/expectations/block_snippet_extractor.rb#77 def new(*_arg0); end end end @@ -773,7 +747,7 @@ module RSpec::Expectations::ExpectationTarget::InstanceMethods # @return [Boolean] false if the negative expectation succeeds (else raises) # @see RSpec::Matchers # - # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#76 + # source://rspec-expectations//lib/rspec/expectations/expectation_target.rb#80 def to_not(matcher = T.unsafe(nil), message = T.unsafe(nil), &block); end private @@ -1558,7 +1532,7 @@ module RSpec::Matchers # @param receiver [Object] # @param message [Symbol] the message to send the receiver # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_changing(*args, **_arg1, &block); end # With no arg, passes if the block outputs `to_stdout` or `to_stderr`. @@ -1591,7 +1565,7 @@ module RSpec::Matchers # @note `to_stdout_from_any_process` and `to_stderr_from_any_process` use Tempfiles, and # are thus significantly (~30x) slower than `to_stdout` and `to_stderr`. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_outputting(*args, **_arg1, &block); end # With no args, matches if any error is raised. @@ -1611,7 +1585,7 @@ module RSpec::Matchers # # expect { do_something_risky }.not_to raise_error # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_raising(*args, **_arg1, &block); end # Given no argument, matches if a proc throws any Symbol. @@ -1630,7 +1604,7 @@ module RSpec::Matchers # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_throwing(*args, **_arg1, &block); end # Passes if the method called in the expect block yields, regardless @@ -1642,7 +1616,7 @@ module RSpec::Matchers # @note Your expect block must accept a parameter and pass it on to # the method-under-test as a block. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_yielding_control(*args, **_arg1, &block); end # Designed for use with methods that repeatedly yield (such as @@ -1660,7 +1634,7 @@ module RSpec::Matchers # @note Your expect block must accept a parameter and pass it on to # the method-under-test as a block. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_yielding_successive_args(*args, **_arg1, &block); end # Given no arguments, matches if the method called in the expect @@ -1687,7 +1661,7 @@ module RSpec::Matchers # @note This matcher is not designed for use with methods that yield # multiple times. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_yielding_with_args(*args, **_arg1, &block); end # Passes if the method called in the expect block yields with @@ -1702,7 +1676,7 @@ module RSpec::Matchers # @note This matcher is not designed for use with methods that yield # multiple times. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_block_yielding_with_no_args(*args, **_arg1, &block); end # Passes if actual contains all of the expected regardless of order. @@ -1716,7 +1690,7 @@ module RSpec::Matchers # but `=~` is not supported with `expect`. # @see #match_array # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_collection_containing_exactly(*args, **_arg1, &block); end # Matches if the actual value ends with the expected value(s). In the case @@ -1729,7 +1703,7 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_collection_ending_with(*args, **_arg1, &block); end # Passes if actual includes expected. This works for @@ -1750,7 +1724,7 @@ module RSpec::Matchers # expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).not_to include(:a => 2) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_collection_including(*args, **_arg1, &block); end # Matches if the actual value starts with the expected value(s). In the @@ -1763,17 +1737,17 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 2, 3, 4, 4]).to start_with 0, 1 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_collection_starting_with(*args, **_arg1, &block); end # Passes if actual is falsey (false or nil) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_falsey_value(*args, **_arg1, &block); end # Passes if actual is falsey (false or nil) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_falsy_value(*args, **_arg1, &block); end # Passes if actual includes expected. This works for @@ -1794,7 +1768,7 @@ module RSpec::Matchers # expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).not_to include(:a => 2) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_hash_including(*args, **_arg1, &block); end # Passes if actual.kind_of?(expected) @@ -1804,12 +1778,12 @@ module RSpec::Matchers # expect(5).to be_a_kind_of(Numeric) # expect(5).not_to be_a_kind_of(Float) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_kind_of(*args, **_arg1, &block); end # Passes if actual is nil # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_nil_value(*args, **_arg1, &block); end # Passes if actual covers expected. This works for @@ -1825,7 +1799,7 @@ module RSpec::Matchers # expect(1..10).not_to cover(11) # expect(1..10).not_to cover(5) # fails # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_range_covering(*args, **_arg1, &block); end # Matches if the actual value ends with the expected value(s). In the case @@ -1838,7 +1812,7 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_string_ending_with(*args, **_arg1, &block); end # Passes if actual includes expected. This works for @@ -1859,7 +1833,7 @@ module RSpec::Matchers # expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).not_to include(:a => 2) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_string_including(*args, **_arg1, &block); end # Given a `Regexp` or `String`, passes if `actual.match(pattern)` @@ -1892,7 +1866,7 @@ module RSpec::Matchers # matchers (due to how the custom matcher DSL was evaluated in 2.x, # `match` could not be used there), but is no longer needed in 3.x. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_string_matching(*args, **_arg1, &block); end # Matches if the actual value starts with the expected value(s). In the @@ -1905,12 +1879,12 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 2, 3, 4, 4]).to start_with 0, 1 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_string_starting_with(*args, **_arg1, &block); end # Passes if actual is truthy (anything but false or nil) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_truthy_value(*args, **_arg1, &block); end # Given true, false, or nil, will pass if actual value is true, false or @@ -1934,7 +1908,7 @@ module RSpec::Matchers # expect(actual).not_to be_nil # expect(actual).not_to be_[arbitrary_predicate](*args) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_value(*args, **_arg1, &block); end # Passes if actual.between?(min, max). Works with any Comparable object, @@ -1949,7 +1923,7 @@ module RSpec::Matchers # expect(11).not_to be_between(1, 10) # expect(10).not_to be_between(1, 10).exclusive # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_value_between(*args, **_arg1, &block); end # Passes if actual == expected +/- delta @@ -1958,7 +1932,7 @@ module RSpec::Matchers # expect(result).to be_within(0.5).of(3.0) # expect(result).not_to be_within(0.5).of(3.0) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def a_value_within(*args, **_arg1, &block); end # Allows multiple expectations in the provided block to fail, and then @@ -2021,7 +1995,7 @@ module RSpec::Matchers # expect(results).to match_array([1, 2]) # @see #contain_exactly # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_array_matching(*args, **_arg1, &block); end # Passes if actual.instance_of?(expected) @@ -2031,7 +2005,7 @@ module RSpec::Matchers # expect(5).not_to be_an_instance_of(Numeric) # expect(5).not_to be_an_instance_of(Float) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_instance_of(*args, **_arg1, &block); end # Passes if actual == expected. @@ -2043,7 +2017,7 @@ module RSpec::Matchers # expect(5).to eq(5) # expect(5).not_to eq(3) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_eq_to(*args, **_arg1, &block); end # Passes if `actual.eql?(expected)` @@ -2055,7 +2029,7 @@ module RSpec::Matchers # expect(5).to eql(5) # expect(5).not_to eql(3) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_eql_to(*args, **_arg1, &block); end # Passes if actual.equal?(expected) (object identity). @@ -2067,7 +2041,7 @@ module RSpec::Matchers # expect(5).to equal(5) # Integers are equal # expect("5").not_to equal("5") # Strings that look the same are not the same object # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_equal_to(*args, **_arg1, &block); end # Passes if `actual.exist?` or `actual.exists?` @@ -2075,7 +2049,7 @@ module RSpec::Matchers # @example # expect(File).to exist("path/to/file") # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_existing(*args, **_arg1, &block); end # Passes if actual's attribute values match the expected attributes hash. @@ -2091,7 +2065,7 @@ module RSpec::Matchers # expect(person).to have_attributes(:color => "red") # @note It will fail if actual doesn't respond to any of the expected attributes. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_having_attributes(*args, **_arg1, &block); end # Given a `Regexp` or `String`, passes if `actual.match(pattern)` @@ -2124,7 +2098,7 @@ module RSpec::Matchers # matchers (due to how the custom matcher DSL was evaluated in 2.x, # `match` could not be used there), but is no longer needed in 3.x. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_matching(*args, **_arg1, &block); end # Matches if the target object responds to all of the names @@ -2133,7 +2107,7 @@ module RSpec::Matchers # @example # expect("string").to respond_to(:length) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_responding_to(*args, **_arg1, &block); end # Passes if the submitted block returns true. Yields target to the @@ -2151,7 +2125,7 @@ module RSpec::Matchers # expect(5).to satisfy("be greater than 3") { |n| n > 3 } # @param description [String] optional description to be used for this matcher. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def an_object_satisfying(*args, **_arg1, &block); end # Given true, false, or nil, will pass if actual value is true, false or @@ -2195,7 +2169,7 @@ module RSpec::Matchers # passes if target.kind_of?(klass) # - # source://rspec-expectations//lib/rspec/matchers.rb#355 + # source://rspec-expectations//lib/rspec/matchers.rb#358 def be_an(klass); end # Passes if actual.instance_of?(expected) @@ -2230,7 +2204,7 @@ module RSpec::Matchers # Passes if actual is falsey (false or nil) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def be_falsy(*args, **_arg1, &block); end # Passes if actual.instance_of?(expected) @@ -2240,7 +2214,7 @@ module RSpec::Matchers # expect(5).not_to be_an_instance_of(Numeric) # expect(5).not_to be_an_instance_of(Float) # - # source://rspec-expectations//lib/rspec/matchers.rb#366 + # source://rspec-expectations//lib/rspec/matchers.rb#369 def be_instance_of(expected); end # Passes if actual.kind_of?(expected) @@ -2250,7 +2224,7 @@ module RSpec::Matchers # expect(5).to be_a_kind_of(Numeric) # expect(5).not_to be_a_kind_of(Float) # - # source://rspec-expectations//lib/rspec/matchers.rb#378 + # source://rspec-expectations//lib/rspec/matchers.rb#381 def be_kind_of(expected); end # Passes if actual is nil @@ -2437,7 +2411,7 @@ module RSpec::Matchers # @param receiver [Object] # @param message [Symbol] the message to send the receiver # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def changing(*args, **_arg1, &block); end # Passes if actual contains all of the expected regardless of order. @@ -2465,7 +2439,7 @@ module RSpec::Matchers # but `=~` is not supported with `expect`. # @see #match_array # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def containing_exactly(*args, **_arg1, &block); end # Passes if actual covers expected. This works for @@ -2497,7 +2471,7 @@ module RSpec::Matchers # expect(1..10).not_to cover(11) # expect(1..10).not_to cover(5) # fails # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def covering(*args, **_arg1, &block); end # Matches if the actual value ends with the expected value(s). In the case @@ -2523,7 +2497,7 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to end_with 4 # expect([0, 2, 3, 4, 4]).to end_with 3, 4 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def ending_with(*args, **_arg1, &block); end # Passes if actual == expected. @@ -2547,7 +2521,7 @@ module RSpec::Matchers # expect(5).to eq(5) # expect(5).not_to eq(3) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def eq_to(*args, **_arg1, &block); end # Passes if `actual.eql?(expected)` @@ -2571,7 +2545,7 @@ module RSpec::Matchers # expect(5).to eql(5) # expect(5).not_to eql(3) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def eql_to(*args, **_arg1, &block); end # Passes if actual.equal?(expected) (object identity). @@ -2595,7 +2569,7 @@ module RSpec::Matchers # expect(5).to equal(5) # Integers are equal # expect("5").not_to equal("5") # Strings that look the same are not the same object # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def equal_to(*args, **_arg1, &block); end # Passes if `actual.exist?` or `actual.exists?` @@ -2611,7 +2585,7 @@ module RSpec::Matchers # @example # expect(File).to exist("path/to/file") # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def existing(*args, **_arg1, &block); end # Supports `expect(actual).to matcher` syntax by wrapping `actual` in an @@ -2624,7 +2598,7 @@ module RSpec::Matchers # @see Expectations::ExpectationTarget#to # @see Expectations::ExpectationTarget#not_to # - # source://rspec-expectations//lib/rspec/expectations/syntax.rb#72 + # source://rspec-expectations//lib/rspec/expectations/configuration.rb#48 def expect(value = T.unsafe(nil), &block); end # Passes if actual's attribute values match the expected attributes hash. @@ -2656,7 +2630,7 @@ module RSpec::Matchers # expect(person).to have_attributes(:color => "red") # @note It will fail if actual doesn't respond to any of the expected attributes. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def having_attributes(*args, **_arg1, &block); end # Passes if actual includes expected. This works for @@ -2698,7 +2672,7 @@ module RSpec::Matchers # expect(:a => 1, :b => 2).to include(:c) # fails # expect(:a => 1, :b => 2).not_to include(:a => 2) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def including(*args, **_arg1, &block); end # Given a `Regexp` or `String`, passes if `actual.match(pattern)` @@ -2777,7 +2751,7 @@ module RSpec::Matchers # matchers (due to how the custom matcher DSL was evaluated in 2.x, # `match` could not be used there), but is no longer needed in 3.x. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def match_regex(*args, **_arg1, &block); end # Given a `Regexp` or `String`, passes if `actual.match(pattern)` @@ -2810,7 +2784,7 @@ module RSpec::Matchers # matchers (due to how the custom matcher DSL was evaluated in 2.x, # `match` could not be used there), but is no longer needed in 3.x. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def matching(*args, **_arg1, &block); end # With no arg, passes if the block outputs `to_stdout` or `to_stderr`. @@ -2883,7 +2857,7 @@ module RSpec::Matchers # # expect { do_something_risky }.not_to raise_error # - # source://rspec-expectations//lib/rspec/matchers.rb#773 + # source://rspec-expectations//lib/rspec/matchers.rb#776 def raise_exception(error = T.unsafe(nil), message = T.unsafe(nil), &block); end # With no args, matches if any error is raised. @@ -2903,7 +2877,7 @@ module RSpec::Matchers # # expect { do_something_risky }.not_to raise_error # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def raising(*args, **_arg1, &block); end # Matches if the target object responds to all of the names @@ -2921,7 +2895,7 @@ module RSpec::Matchers # @example # expect("string").to respond_to(:length) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def responding_to(*args, **_arg1, &block); end # Passes if the submitted block returns true. Yields target to the @@ -2957,7 +2931,7 @@ module RSpec::Matchers # expect(5).to satisfy("be greater than 3") { |n| n > 3 } # @param description [String] optional description to be used for this matcher. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def satisfying(*args, **_arg1, &block); end # Matches if the actual value starts with the expected value(s). In the @@ -2983,7 +2957,7 @@ module RSpec::Matchers # expect([0, 1, 2, 3, 4]).to start_with 0 # expect([0, 2, 3, 4, 4]).to start_with 0, 1 # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def starting_with(*args, **_arg1, &block); end # Given no argument, matches if a proc throws any Symbol. @@ -3021,7 +2995,7 @@ module RSpec::Matchers # expect { do_something_risky }.not_to throw_symbol(:that_was_risky) # expect { do_something_risky }.not_to throw_symbol(:that_was_risky, 'culprit') # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def throwing(*args, **_arg1, &block); end # Passes if actual == expected +/- delta @@ -3030,7 +3004,7 @@ module RSpec::Matchers # expect(result).to be_within(0.5).of(3.0) # expect(result).not_to be_within(0.5).of(3.0) # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def within(*args, **_arg1, &block); end # Passes if the method called in the expect block yields, regardless @@ -3114,7 +3088,7 @@ module RSpec::Matchers # @note Your expect block must accept a parameter and pass it on to # the method-under-test as a block. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def yielding_control(*args, **_arg1, &block); end # Designed for use with methods that repeatedly yield (such as @@ -3132,7 +3106,7 @@ module RSpec::Matchers # @note Your expect block must accept a parameter and pass it on to # the method-under-test as a block. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def yielding_successive_args(*args, **_arg1, &block); end # Given no arguments, matches if the method called in the expect @@ -3159,7 +3133,7 @@ module RSpec::Matchers # @note This matcher is not designed for use with methods that yield # multiple times. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def yielding_with_args(*args, **_arg1, &block); end # Passes if the method called in the expect block yields with @@ -3174,7 +3148,7 @@ module RSpec::Matchers # @note This matcher is not designed for use with methods that yield # multiple times. # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#38 + # source://rspec-expectations//lib/rspec/matchers.rb#251 def yielding_with_no_args(*args, **_arg1, &block); end private @@ -3693,7 +3667,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting # # @api private # - # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#138 + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#141 def improve_hash_formatting(inspect_string); end end end @@ -3731,7 +3705,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting # @param _value [String] # @return [nil] nil as the curent Ruby version does not support String encoding # - # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#172 + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#186 def format_encoding(value); end # :nocov: @@ -3739,7 +3713,7 @@ module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting # @api private # @return [Boolean] False always as the curent Ruby version does not support String encoding # - # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#153 + # source://rspec-expectations//lib/rspec/matchers/built_in/base_matcher.rb#165 def string_encoding_differs?; end end end @@ -5074,45 +5048,61 @@ class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < :: # Returns the value of attribute indeterminate_actual_indexes # # @return [Object] the current value of indeterminate_actual_indexes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def indeterminate_actual_indexes; end # Sets the attribute indeterminate_actual_indexes # # @param value [Object] the value to set the attribute indeterminate_actual_indexes to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def indeterminate_actual_indexes=(_); end # Returns the value of attribute indeterminate_expected_indexes # # @return [Object] the current value of indeterminate_expected_indexes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def indeterminate_expected_indexes; end # Sets the attribute indeterminate_expected_indexes # # @param value [Object] the value to set the attribute indeterminate_expected_indexes to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def indeterminate_expected_indexes=(_); end # Returns the value of attribute unmatched_actual_indexes # # @return [Object] the current value of unmatched_actual_indexes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def unmatched_actual_indexes; end # Sets the attribute unmatched_actual_indexes # # @param value [Object] the value to set the attribute unmatched_actual_indexes to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def unmatched_actual_indexes=(_); end # Returns the value of attribute unmatched_expected_indexes # # @return [Object] the current value of unmatched_expected_indexes + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def unmatched_expected_indexes; end # Sets the attribute unmatched_expected_indexes # # @param value [Object] the value to set the attribute unmatched_expected_indexes to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def unmatched_expected_indexes=(_); end # @api private @@ -5127,10 +5117,19 @@ class RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer::Solution < :: def worse_than?(other); end class << self + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def [](*_arg0); end + + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def inspect; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def keyword_init?; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def members; end + + # source://rspec-expectations//lib/rspec/matchers/built_in/contain_exactly.rb#190 def new(*_arg0); end end end @@ -6510,7 +6509,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc # @example # expect(obj).to respond_to(:message).with_any_keywords # - # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#48 + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#52 def and_any_keywords; end # Specifies keyword arguments, if any. @@ -6521,7 +6520,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc # @example with an expected number of arguments # expect(obj).to respond_to(:message).with(3).arguments.and_keywords(:color, :shape) # - # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#36 + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#40 def and_keywords(*keywords); end # Specifies that the number of arguments has no upper limit, i.e. the @@ -6531,7 +6530,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc # @example # expect(obj).to respond_to(:message).with_unlimited_arguments # - # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#60 + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#64 def and_unlimited_arguments; end # No-op. Intended to be used as syntactic sugar when using `with`. @@ -6549,7 +6548,7 @@ class RSpec::Matchers::BuiltIn::RespondTo < ::RSpec::Matchers::BuiltIn::BaseMatc # @example # expect(obj).to respond_to(:message).with(3).arguments # - # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#71 + # source://rspec-expectations//lib/rspec/matchers/built_in/respond_to.rb#74 def arguments; end # @api private @@ -7372,7 +7371,7 @@ module RSpec::Matchers::Composable # @note The negative form (`expect(...).not_to matcher.and other`) # is not supported at this time. # - # source://rspec-expectations//lib/rspec/matchers/composable.rb#22 + # source://rspec-expectations//lib/rspec/matchers/composable.rb#25 def &(matcher); end # Delegates to `#matches?`. Allows matchers to be used in composable @@ -7425,7 +7424,7 @@ module RSpec::Matchers::Composable # @note The negative form (`expect(...).not_to matcher.or other`) # is not supported at this time. # - # source://rspec-expectations//lib/rspec/matchers/composable.rb#38 + # source://rspec-expectations//lib/rspec/matchers/composable.rb#41 def |(matcher); end private @@ -7522,7 +7521,7 @@ module RSpec::Matchers::Composable # @api private # @return [Boolean] # - # source://rspec-expectations//lib/rspec/matchers/composable.rb#142 + # source://rspec-expectations//lib/rspec/matchers/composable.rb#154 def should_enumerate?(item); end # Transforms the given data structure (typically a hash or array) @@ -7538,13 +7537,13 @@ module RSpec::Matchers::Composable # # @api public # - # source://rspec-expectations//lib/rspec/matchers/composable.rb#98 + # source://rspec-expectations//lib/rspec/matchers/composable.rb#154 def surface_descriptions_in(item); end # @api private # @return [Boolean] # - # source://rspec-expectations//lib/rspec/matchers/composable.rb#147 + # source://rspec-expectations//lib/rspec/matchers/composable.rb#154 def unreadable_io?(object); end end end @@ -7565,12 +7564,16 @@ class RSpec::Matchers::Composable::DescribableItem < ::Struct # Returns the value of attribute item # # @return [Object] the current value of item + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def item; end # Sets the attribute item # # @param value [Object] the value to set the attribute item to. # @return [Object] the newly set value + # + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def item=(_); end # A pretty printed version of the item description. @@ -7581,10 +7584,19 @@ class RSpec::Matchers::Composable::DescribableItem < ::Struct def pretty_print(pp); end class << self + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def [](*_arg0); end + + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def inspect; end + + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def keyword_init?; end + + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def members; end + + # source://rspec-expectations//lib/rspec/matchers/composable.rb#158 def new(*_arg0); end end end @@ -7659,7 +7671,7 @@ module RSpec::Matchers::DSL # When args are passed to your matcher, they will be yielded here, # usually representing the expected value(s). # - # source://rspec-expectations//lib/rspec/matchers/dsl.rb#73 + # source://rspec-expectations//lib/rspec/matchers/dsl.rb#79 def matcher(name, &declarations); end private diff --git a/Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.3.rbi b/Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.4.rbi similarity index 94% rename from Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.3.rbi rename to Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.4.rbi index 8fb5674cef..98420c388a 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.3.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rspec-support@3.13.4.rbi @@ -8,74 +8,6 @@ # source://rspec-support//lib/rspec/support.rb#3 module RSpec extend ::RSpec::Support::Warnings - - class << self - # source://rspec-core/3.13.3/lib/rspec/core.rb#70 - def clear_examples; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#85 - def configuration; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#49 - def configuration=(_arg0); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#97 - def configure; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#194 - def const_missing(name); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def context(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#122 - def current_example; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#128 - def current_example=(example); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#154 - def current_scope; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#134 - def current_scope=(scope); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def describe(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def example_group(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def fcontext(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def fdescribe(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#58 - def reset; end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_context(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_examples(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core/shared_example_group.rb#110 - def shared_examples_for(name, *args, &block); end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#160 - def world; end - - # source://rspec-core/3.13.3/lib/rspec/core.rb#49 - def world=(_arg0); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def xcontext(*args, &example_group_block); end - - # source://rspec-core/3.13.3/lib/rspec/core/dsl.rb#42 - def xdescribe(*args, &example_group_block); end - end end # Consistent implementation for "cleaning" the caller method to strip out @@ -185,18 +117,6 @@ module RSpec::Support # source://rspec-support//lib/rspec/support/matcher_definition.rb#16 def register_matcher_definition(&block); end - # source://rspec-support//lib/rspec/support.rb#25 - def require_rspec_core(f); end - - # source://rspec-support//lib/rspec/support.rb#25 - def require_rspec_expectations(f); end - - # source://rspec-support//lib/rspec/support.rb#25 - def require_rspec_matchers(f); end - - # source://rspec-support//lib/rspec/support.rb#25 - def require_rspec_mocks(f); end - # source://rspec-support//lib/rspec/support.rb#25 def require_rspec_support(f); end @@ -467,7 +387,7 @@ class RSpec::Support::EncodedString # source://rspec-support//lib/rspec/support/encoded_string.rb#46 def to_s; end - # source://rspec-support//lib/rspec/support/encoded_string.rb#46 + # source://rspec-support//lib/rspec/support/encoded_string.rb#49 def to_str; end private @@ -1055,12 +975,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct # Returns the value of attribute formatter # # @return [Object] the current value of formatter + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def formatter; end # Sets the attribute formatter # # @param value [Object] the value to set the attribute formatter to. # @return [Object] the newly set value + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def formatter=(_); end # @api private @@ -1072,12 +996,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct # Returns the value of attribute object # # @return [Object] the current value of object + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def object; end # Sets the attribute object # # @param value [Object] the value to set the attribute object to. # @return [Object] the newly set value + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def object=(_); end # @api private @@ -1086,6 +1014,7 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct def pretty_print(pp); end class << self + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def [](*_arg0); end # @api private @@ -1095,9 +1024,16 @@ class RSpec::Support::ObjectFormatter::BaseInspector < ::Struct # source://rspec-support//lib/rspec/support/object_formatter.rb#130 def can_inspect?(_object); end + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def inspect; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def keyword_init?; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def members; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#129 def new(*_arg0); end end end @@ -1209,19 +1145,32 @@ class RSpec::Support::ObjectFormatter::InspectableItem < ::Struct # Returns the value of attribute text # # @return [Object] the current value of text + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def text; end # Sets the attribute text # # @param value [Object] the value to set the attribute text to. # @return [Object] the newly set value + # + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def text=(_); end class << self + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def [](*_arg0); end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def inspect; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def keyword_init?; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def members; end + + # source://rspec-support//lib/rspec/support/object_formatter.rb#119 def new(*_arg0); end end end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.44.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi similarity index 83% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.44.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi index e8b0fcc6de..9557a9dc6c 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.44.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi @@ -192,7 +192,7 @@ class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node # # @return [Array] an array of value nodes # - # source://ast/2.4.3/lib/ast/node.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node/array_node.rb#18 def values; end end @@ -216,7 +216,7 @@ class RuboCop::AST::AsgnNode < ::RuboCop::AST::Node # # @return [Symbol] the name of the variable being assigned # - # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#12 + # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#15 def lhs; end # The name of the variable being assigned as a symbol. @@ -230,7 +230,7 @@ class RuboCop::AST::AsgnNode < ::RuboCop::AST::Node # # @return [Node] the expression being assigned. # - # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#20 + # source://rubocop-ast//lib/rubocop/ast/node/asgn_node.rb#23 def rhs; end end @@ -628,17 +628,17 @@ class RuboCop::AST::CasgnNode < ::RuboCop::AST::Node # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#17 def expression; end - # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#14 + # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#12 def lhs; end - # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#14 + # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#11 def name; end # The expression being assigned to the variable. # # @return [Node] the expression being assigned. # - # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#17 + # source://rubocop-ast//lib/rubocop/ast/node/casgn_node.rb#20 def rhs; end end @@ -676,412 +676,412 @@ end module RuboCop::AST::CollectionNode extend ::RuboCop::SimpleForwardable - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def &(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def *(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def +(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def -(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def <<(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def [](*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def []=(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def all?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def any?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def append(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def assoc(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def at(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def bsearch(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def bsearch_index(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def chain(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def chunk(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def chunk_while(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def clear(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def collect(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def collect!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def collect_concat(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def combination(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def compact(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def compact!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def concat(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def count(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def cycle(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def deconstruct(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def delete(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def delete_at(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def delete_if(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def detect(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def difference(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def dig(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def drop(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def drop_while(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_cons(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_entry(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_index(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_slice(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_with_index(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def each_with_object(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def empty?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def entries(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def fetch(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def fetch_values(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def fill(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def filter(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def filter!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def filter_map(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def find(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def find_all(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def find_index(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def first(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def flat_map(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def flatten(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def flatten!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def grep(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def grep_v(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def group_by(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def include?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def index(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def inject(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def insert(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def intersect?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def intersection(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def join(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def keep_if(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def last(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def lazy(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def length(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def map(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def map!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def max(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def max_by(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def member?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def min(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def min_by(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def minmax(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def minmax_by(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def none?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def one?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def pack(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def partition(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def permutation(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def place(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def pop(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def prepend(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def product(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def push(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def rassoc(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reduce(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reject(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reject!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def repeated_combination(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def repeated_permutation(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def replace(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reverse(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reverse!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def reverse_each(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def rindex(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def rotate(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def rotate!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sample(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def select(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def select!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def shelljoin(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def shift(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def shuffle(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def shuffle!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def size(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def slice(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def slice!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def slice_after(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def slice_before(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def slice_when(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sort(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sort!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sort_by(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sort_by!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def sum(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def take(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def take_while(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def tally(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def to_ary(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def to_h(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def to_set(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def transpose(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def union(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def uniq(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def uniq!(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def unshift(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def values_at(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def zip(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/collection_node.rb#13 def |(*_arg0, **_arg1, &_arg2); end end @@ -1150,7 +1150,7 @@ module RuboCop::AST::ConstantNode # Note: some classes might have uppercase in which case this method # returns false # - # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#21 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/constant_node.rb#24 def class_name?; end # Yield nodes for the namespace @@ -1271,7 +1271,7 @@ class RuboCop::AST::DefinedNode < ::RuboCop::AST::Node include ::RuboCop::AST::MethodIdentifierPredicates include ::RuboCop::AST::MethodDispatchNode - # source://ast/2.4.3/lib/ast/node.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node/defined_node.rb#16 def arguments; end # source://rubocop-ast//lib/rubocop/ast/node/defined_node.rb#12 @@ -2199,7 +2199,7 @@ class RuboCop::AST::MasgnNode < ::RuboCop::AST::Node # # @return [Node] the right hand side of a multiple assignment. # - # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#39 + # source://rubocop-ast//lib/rubocop/ast/node/masgn_node.rb#42 def rhs; end # In contrast to `expression`, `values` always returns a Ruby array @@ -2253,7 +2253,7 @@ module RuboCop::AST::MethodDispatchNode # # @return [Boolean] whether the dispatched method is a setter # - # source://rubocop-ast//lib/rubocop/ast/node/mixin/method_dispatch_node.rb#107 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/method_dispatch_node.rb#110 def assignment?; end # Checks whether the dispatched method is a bare access modifier that @@ -2741,19 +2741,19 @@ class RuboCop::AST::Node < ::Parser::AST::Node # @return [Node] a new instance of Node # @see https://www.rubydoc.info/gems/ast/AST/Node:initialize # - # source://rubocop-ast//lib/rubocop/ast/node.rb#145 + # source://rubocop-ast//lib/rubocop/ast/node.rb#148 def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def __ENCODING___type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def __FILE___type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def __LINE___type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def alias_type?; end # Returns an array of ancestor nodes. @@ -2761,183 +2761,188 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array] an array of ancestor nodes # - # source://rubocop-ast//lib/rubocop/ast/node.rb#310 + # source://rubocop-ast//lib/rubocop/ast/node.rb#313 def ancestors; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def and_asgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def and_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#539 + # source://rubocop-ast//lib/rubocop/ast/node.rb#542 def any_block_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#519 + # source://rubocop-ast//lib/rubocop/ast/node.rb#522 def any_def_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # @return [Boolean] + # + # source://rubocop-ast//lib/rubocop/ast/node.rb#546 + def any_match_pattern_type?; end + + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def arg_expr_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def arg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def args_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#515 + # source://rubocop-ast//lib/rubocop/ast/node.rb#518 def argument?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#523 + # source://rubocop-ast//lib/rubocop/ast/node.rb#526 def argument_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def array_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def array_pattern_with_tail_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def array_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#467 + # source://rubocop-ast//lib/rubocop/ast/node.rb#470 def assignment?; end # Some cops treat the shovel operator as a kind of assignment. # - # source://rubocop-ast//lib/rubocop/ast/node.rb#417 + # source://rubocop-ast//lib/rubocop/ast/node.rb#420 def assignment_or_similar?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def back_ref_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#471 + # source://rubocop-ast//lib/rubocop/ast/node.rb#474 def basic_conditional?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#425 + # source://rubocop-ast//lib/rubocop/ast/node.rb#428 def basic_literal?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def begin_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def block_pass_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def block_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def blockarg_expr_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def blockarg_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#527 + # source://rubocop-ast//lib/rubocop/ast/node.rb#530 def boolean_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def break_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#507 + # source://rubocop-ast//lib/rubocop/ast/node.rb#510 def call_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def case_match_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def case_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def casgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def cbase_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#511 + # source://rubocop-ast//lib/rubocop/ast/node.rb#514 def chained?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#587 + # source://rubocop-ast//lib/rubocop/ast/node.rb#594 def class_constructor?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#605 + # source://rubocop-ast//lib/rubocop/ast/node.rb#612 def class_definition?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def class_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#207 + # source://rubocop-ast//lib/rubocop/ast/node.rb#210 def complete!; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#212 + # source://rubocop-ast//lib/rubocop/ast/node.rb#215 def complete?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def complex_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#475 + # source://rubocop-ast//lib/rubocop/ast/node.rb#478 def conditional?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#356 + # source://rubocop-ast//lib/rubocop/ast/node.rb#359 def const_name; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def const_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def const_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def csend_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def cvar_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def cvasgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def def_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#376 + # source://rubocop-ast//lib/rubocop/ast/node.rb#379 def defined_module; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#381 + # source://rubocop-ast//lib/rubocop/ast/node.rb#384 def defined_module_name; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def defined_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def defs_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def dstr_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def dsym_type?; end # Calls the given block for each ancestor node from parent to root. @@ -2950,169 +2955,169 @@ class RuboCop::AST::Node < ::Parser::AST::Node # @return [Enumerator] if no block is given # @yieldparam node [Node] each ancestor node # - # source://rubocop-ast//lib/rubocop/ast/node.rb#298 + # source://rubocop-ast//lib/rubocop/ast/node.rb#301 def each_ancestor(*types, &block); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def eflipflop_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def empty_else_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#411 + # source://rubocop-ast//lib/rubocop/ast/node.rb#414 def empty_source?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def ensure_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#459 + # source://rubocop-ast//lib/rubocop/ast/node.rb#462 def equals_asgn?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def erange_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def false_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#433 + # source://rubocop-ast//lib/rubocop/ast/node.rb#436 def falsey_literal?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def find_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#324 + # source://rubocop-ast//lib/rubocop/ast/node.rb#327 def first_line; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def float_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def for_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def forward_arg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def forward_args_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def forwarded_args_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def forwarded_kwrestarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def forwarded_restarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#584 + # source://rubocop-ast//lib/rubocop/ast/node.rb#591 def global_const?(param0 = T.unsafe(nil), param1); end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#543 + # source://rubocop-ast//lib/rubocop/ast/node.rb#550 def guard_clause?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def gvar_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def gvasgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def hash_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def hash_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def ident_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def if_guard_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def if_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def iflipflop_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#441 + # source://rubocop-ast//lib/rubocop/ast/node.rb#444 def immutable_literal?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def in_match_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def in_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def index_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def indexasgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def int_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def irange_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def itarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def itblock_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def ivar_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def ivasgn_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#488 + # source://rubocop-ast//lib/rubocop/ast/node.rb#491 def keyword?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwargs_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwbegin_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwnilarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwoptarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwrestarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def kwsplat_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#578 + # source://rubocop-ast//lib/rubocop/ast/node.rb#585 def lambda?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#581 + # source://rubocop-ast//lib/rubocop/ast/node.rb#588 def lambda_or_proc?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def lambda_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#328 + # source://rubocop-ast//lib/rubocop/ast/node.rb#331 def last_line; end # Use is discouraged, this is a potentially slow method and can lead @@ -3120,7 +3125,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Node, nil] the left (aka previous) sibling # - # source://rubocop-ast//lib/rubocop/ast/node.rb#250 + # source://rubocop-ast//lib/rubocop/ast/node.rb#253 def left_sibling; end # Use is discouraged, this is a potentially slow method and can lead @@ -3128,22 +3133,22 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array] the left (aka previous) siblings # - # source://rubocop-ast//lib/rubocop/ast/node.rb#260 + # source://rubocop-ast//lib/rubocop/ast/node.rb#263 def left_siblings; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#332 + # source://rubocop-ast//lib/rubocop/ast/node.rb#335 def line_count; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#421 + # source://rubocop-ast//lib/rubocop/ast/node.rb#424 def literal?; end # Shortcut to safely check if a location is present # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#551 + # source://rubocop-ast//lib/rubocop/ast/node.rb#558 def loc?(which_loc); end # Shortcut to safely test a particular location, even if @@ -3151,86 +3156,86 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#559 + # source://rubocop-ast//lib/rubocop/ast/node.rb#566 def loc_is?(which_loc, str); end # NOTE: `loop { }` is a normal method call and thus not a loop keyword. # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#484 + # source://rubocop-ast//lib/rubocop/ast/node.rb#487 def loop_keyword?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def lvar_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def lvasgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def masgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_alt_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_as_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_current_line_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#566 + # source://rubocop-ast//lib/rubocop/ast/node.rb#573 def match_guard_clause?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_nil_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_pattern_p_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_pattern_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_rest_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_var_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_with_lvasgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def match_with_trailing_comma_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def mlhs_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#612 + # source://rubocop-ast//lib/rubocop/ast/node.rb#619 def module_definition?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def module_type?; end # Predicates # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#403 + # source://rubocop-ast//lib/rubocop/ast/node.rb#406 def multiline?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#437 + # source://rubocop-ast//lib/rubocop/ast/node.rb#440 def mutable_literal?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#743 + # source://rubocop-ast//lib/rubocop/ast/node.rb#750 def new_class_or_module_block?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def next_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def nil_type?; end # Common destructuring method. This can be used to normalize @@ -3240,98 +3245,98 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array] the different parts of the ndde # - # source://ast/2.4.3/lib/ast/node.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node.rb#284 def node_parts; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#338 + # source://rubocop-ast//lib/rubocop/ast/node.rb#341 def nonempty_line_count; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def not_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def nth_ref_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def numargs_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def numblock_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#531 + # source://rubocop-ast//lib/rubocop/ast/node.rb#534 def numeric_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def objc_kwarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def objc_restarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def objc_varargs_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def op_asgn_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#499 + # source://rubocop-ast//lib/rubocop/ast/node.rb#502 def operator_keyword?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def optarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def or_asgn_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def or_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def pair_type?; end # Returns the parent node, or `nil` if the receiver is a root node. # # @return [Node, nil] the parent node or `nil` # - # source://rubocop-ast//lib/rubocop/ast/node.rb#189 + # source://rubocop-ast//lib/rubocop/ast/node.rb#192 def parent; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#198 + # source://rubocop-ast//lib/rubocop/ast/node.rb#201 def parent?; end # Searching the AST # - # source://rubocop-ast//lib/rubocop/ast/node.rb#387 + # source://rubocop-ast//lib/rubocop/ast/node.rb#390 def parent_module_name; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#503 + # source://rubocop-ast//lib/rubocop/ast/node.rb#506 def parenthesized_call?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def pin_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#479 + # source://rubocop-ast//lib/rubocop/ast/node.rb#482 def post_condition_loop?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def postexe_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def preexe_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#571 + # source://rubocop-ast//lib/rubocop/ast/node.rb#578 def proc?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def procarg0_type?; end # Some expressions are evaluated for their value, some for their side @@ -3344,60 +3349,60 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#655 + # source://rubocop-ast//lib/rubocop/ast/node.rb#662 def pure?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#535 + # source://rubocop-ast//lib/rubocop/ast/node.rb#538 def range_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def rational_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#349 + # source://rubocop-ast//lib/rubocop/ast/node.rb#352 def receiver(param0 = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#129 + # source://rubocop-ast//lib/rubocop/ast/node.rb#131 def recursive_basic_literal?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#129 + # source://rubocop-ast//lib/rubocop/ast/node.rb#131 def recursive_literal?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def redo_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#455 + # source://rubocop-ast//lib/rubocop/ast/node.rb#458 def reference?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def regexp_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def regopt_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def resbody_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def rescue_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def restarg_expr_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def restarg_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def retry_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def return_type?; end # Use is discouraged, this is a potentially slow method and can lead @@ -3405,7 +3410,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Node, nil] the right (aka next) sibling # - # source://rubocop-ast//lib/rubocop/ast/node.rb#241 + # source://rubocop-ast//lib/rubocop/ast/node.rb#244 def right_sibling; end # Use is discouraged, this is a potentially slow method and can lead @@ -3413,18 +3418,18 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array] the right (aka next) siblings # - # source://rubocop-ast//lib/rubocop/ast/node.rb#269 + # source://rubocop-ast//lib/rubocop/ast/node.rb#272 def right_siblings; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#203 + # source://rubocop-ast//lib/rubocop/ast/node.rb#206 def root?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def sclass_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def self_type?; end # Most nodes are of 'send' type, so this method is defined @@ -3432,15 +3437,15 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#182 + # source://rubocop-ast//lib/rubocop/ast/node.rb#185 def send_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def shadowarg_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#463 + # source://rubocop-ast//lib/rubocop/ast/node.rb#466 def shorthand_asgn?; end # Returns the index of the receiver node in its siblings. (Sibling index @@ -3449,58 +3454,58 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Integer, nil] the index of the receiver node in its siblings # - # source://rubocop-ast//lib/rubocop/ast/node.rb#234 + # source://rubocop-ast//lib/rubocop/ast/node.rb#237 def sibling_index; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#407 + # source://rubocop-ast//lib/rubocop/ast/node.rb#410 def single_line?; end # NOTE: Some rare nodes may have no source, like `s(:args)` in `foo {}` # # @return [String, nil] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#316 + # source://rubocop-ast//lib/rubocop/ast/node.rb#319 def source; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#342 + # source://rubocop-ast//lib/rubocop/ast/node.rb#345 def source_length; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#320 + # source://rubocop-ast//lib/rubocop/ast/node.rb#323 def source_range; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#495 + # source://rubocop-ast//lib/rubocop/ast/node.rb#498 def special_keyword?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def splat_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#354 + # source://rubocop-ast//lib/rubocop/ast/node.rb#357 def str_content(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def str_type?; end # @deprecated Use `:class_constructor?` # - # source://rubocop-ast//lib/rubocop/ast/node.rb#600 + # source://rubocop-ast//lib/rubocop/ast/node.rb#607 def struct_constructor?(param0 = T.unsafe(nil)); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def super_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def sym_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def true_type?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#429 + # source://rubocop-ast//lib/rubocop/ast/node.rb#432 def truthy_literal?; end # Determine if the node is one of several node types in a single query @@ -3509,19 +3514,19 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#164 + # source://rubocop-ast//lib/rubocop/ast/node.rb#167 def type?(*types); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def undef_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def unless_guard_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def until_post_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def until_type?; end # Override `AST::Node#updated` so that `AST::Processor` does not try to @@ -3530,7 +3535,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # identical subtrees. Rather, the entire AST must be copied any time any # part of it is changed. # - # source://rubocop-ast//lib/rubocop/ast/node.rb#223 + # source://rubocop-ast//lib/rubocop/ast/node.rb#226 def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end # Some expressions are evaluated for their value, some for their side @@ -3543,78 +3548,78 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#625 + # source://rubocop-ast//lib/rubocop/ast/node.rb#632 def value_used?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#451 + # source://rubocop-ast//lib/rubocop/ast/node.rb#454 def variable?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def when_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def while_post_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def while_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def xstr_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def yield_type?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#174 + # source://rubocop-ast//lib/rubocop/ast/node.rb#176 def zsuper_type?; end protected - # source://rubocop-ast//lib/rubocop/ast/node.rb#193 + # source://rubocop-ast//lib/rubocop/ast/node.rb#196 def parent=(node); end private # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#682 + # source://rubocop-ast//lib/rubocop/ast/node.rb#689 def begin_value_used?; end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#693 + # source://rubocop-ast//lib/rubocop/ast/node.rb#700 def case_if_value_used?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#367 + # source://rubocop-ast//lib/rubocop/ast/node.rb#370 def defined_module0(param0 = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#687 + # source://rubocop-ast//lib/rubocop/ast/node.rb#694 def for_value_used?; end - # source://rubocop-ast//lib/rubocop/ast/node.rb#729 + # source://rubocop-ast//lib/rubocop/ast/node.rb#736 def parent_module_name_for_block(ancestor); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#717 + # source://rubocop-ast//lib/rubocop/ast/node.rb#724 def parent_module_name_for_sclass(sclass_node); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#704 + # source://rubocop-ast//lib/rubocop/ast/node.rb#711 def parent_module_name_part(node); end - # source://rubocop-ast//lib/rubocop/ast/node.rb#673 + # source://rubocop-ast//lib/rubocop/ast/node.rb#680 def visit_ancestors(types); end # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node.rb#699 + # source://rubocop-ast//lib/rubocop/ast/node.rb#706 def while_until_value_used?; end class << self private - # source://rubocop-ast//lib/rubocop/ast/node.rb#124 + # source://rubocop-ast//lib/rubocop/ast/node.rb#127 def def_recursive_literal_predicate(kind); end end end @@ -3778,13 +3783,13 @@ class RuboCop::AST::NodePattern # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73 def ast; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#75 def captures(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#111 def encode_with(coder); end - # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#90 + # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#93 def eql?(other); end # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#119 @@ -3807,7 +3812,7 @@ class RuboCop::AST::NodePattern # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73 def match_code; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#75 def named_parameters(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute pattern. @@ -3815,7 +3820,7 @@ class RuboCop::AST::NodePattern # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#73 def pattern; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#75 def positional_parameters(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast//lib/rubocop/ast/node_pattern.rb#95 @@ -3899,7 +3904,7 @@ class RuboCop::AST::NodePattern::Comment # Returns the value of attribute location. # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/comment.rb#8 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/comment.rb#9 def loc; end # Returns the value of attribute location. @@ -3928,7 +3933,7 @@ class RuboCop::AST::NodePattern::Compiler # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler.rb#15 def initialize; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler.rb#24 def bind(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute binding. @@ -4011,7 +4016,7 @@ class RuboCop::AST::NodePattern::Compiler::AtomSubcompiler < ::RuboCop::AST::Nod # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#32 def visit_named_parameter; end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#21 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#24 def visit_number; end # Assumes other types are node patterns. @@ -4022,13 +4027,13 @@ class RuboCop::AST::NodePattern::Compiler::AtomSubcompiler < ::RuboCop::AST::Nod # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#36 def visit_positional_parameter; end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#21 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#26 def visit_regexp; end # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#40 def visit_set; end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#21 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#25 def visit_string; end # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb#21 @@ -4072,74 +4077,74 @@ end class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern::Compiler # @return [Debug] a new instance of Debug # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#116 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#118 def initialize; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#131 def comments(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#121 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#123 def named_parameters; end # Returns the value of attribute node_ids. # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#33 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#35 def node_ids; end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#125 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#127 def parser; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#131 def tokens(*_arg0, **_arg1, &_arg2); end end # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#36 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#38 class RuboCop::AST::NodePattern::Compiler::Debug::Colorizer # @api private # @return [Colorizer] a new instance of Colorizer # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#96 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#98 def initialize(pattern, compiler: T.unsafe(nil)); end # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#94 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#96 def compiler; end # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#94 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#96 def node_pattern; end # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#94 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#96 def pattern; end # @api private # @return [Node] the Ruby AST # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#103 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#105 def test(ruby, trace: T.unsafe(nil)); end private # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#111 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#113 def ruby_ast(ruby); end end # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#37 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#39 RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::COLOR_SCHEME = T.let(T.unsafe(nil), Hash) # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#92 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#94 RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::Compiler = RuboCop::AST::NodePattern::Compiler::Debug # Result of a NodePattern run against a particular AST @@ -4147,129 +4152,154 @@ RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::Compiler = RuboCop::AST:: # # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#46 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 class RuboCop::AST::NodePattern::Compiler::Debug::Colorizer::Result < ::Struct # @api private # @return [Hash] a map for {character_position => color} # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#58 def color_map(color_scheme = T.unsafe(nil)); end # @api private # @return [String] a Rainbow colorized version of ruby # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#50 def colorize(color_scheme = T.unsafe(nil)); end # Returns the value of attribute colorizer # # @return [Object] the current value of colorizer + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def colorizer; end # Sets the attribute colorizer # # @param value [Object] the value to set the attribute colorizer to. # @return [Object] the newly set value + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def colorizer=(_); end # @api private # @return [Hash] a map for {node => matched?}, depth-first # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#66 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#68 def match_map; end # @api private # @return [Boolean] a value of `Trace#matched?` or `:not_visitable` # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#74 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#76 def matched?(node); end # Returns the value of attribute returned # # @return [Object] the current value of returned + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def returned; end # Sets the attribute returned # # @param value [Object] the value to set the attribute returned to. # @return [Object] the newly set value + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def returned=(_); end # Returns the value of attribute ruby_ast # # @return [Object] the current value of ruby_ast + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def ruby_ast; end # Sets the attribute ruby_ast # # @param value [Object] the value to set the attribute ruby_ast to. # @return [Object] the newly set value + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def ruby_ast=(_); end # Returns the value of attribute trace # # @return [Object] the current value of trace + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def trace; end # Sets the attribute trace # # @param value [Object] the value to set the attribute trace to. # @return [Object] the newly set value + # + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def trace=(_); end private # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#87 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#89 def ast; end # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#81 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#83 def color_map_for(node, color); end class << self + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def [](*_arg0); end + + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def inspect; end + + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def keyword_init?; end + + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def members; end + + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#48 def new(*_arg0); end end end # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#132 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#134 module RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#133 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#135 def do_compile; end private # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#143 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#145 def node_id; end # @api private # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#139 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#141 def tracer(kind); end end # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#149 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#151 class RuboCop::AST::NodePattern::Compiler::Debug::NodePatternSubcompiler < ::RuboCop::AST::NodePattern::Compiler::NodePatternSubcompiler include ::RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler end # @api private # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#154 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#156 class RuboCop::AST::NodePattern::Compiler::Debug::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler include ::RuboCop::AST::NodePattern::Compiler::Debug::InstrumentationSubcompiler end @@ -4284,17 +4314,17 @@ class RuboCop::AST::NodePattern::Compiler::Debug::Trace # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#14 def initialize; end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#18 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#19 def enter(node_id); end # return nil (not visited), false (not matched) or true (matched) # # @return [Boolean] # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#28 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#30 def matched?(node_id); end - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#23 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/debug.rb#25 def success(node_id); end end @@ -4400,7 +4430,7 @@ end # Doc on how this fits in the compiling process: # /docs/modules/ROOT/pages/node_pattern.adoc # -# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#16 +# source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#17 class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler # Calls `compile_sequence`; the actual `compile` method # will be used for the different terms of the sequence. @@ -4438,7 +4468,7 @@ class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST: private - # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/subcompiler.rb#20 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#59 def compile(node); end # Compilation helpers @@ -4692,7 +4722,7 @@ class RuboCop::AST::NodePattern::LexerRex # The StringScanner for this lexer. # - # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#48 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/lexer.rex.rb#55 def match; end # The match groups for the current scan. @@ -4954,7 +4984,7 @@ RuboCop::AST::NodePattern::Node::AnyOrder::ARITIES = T.let(T.unsafe(nil), Hash) # # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#96 class RuboCop::AST::NodePattern::Node::Capture < ::RuboCop::AST::NodePattern::Node - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#98 def arity(*_arg0, **_arg1, &_arg2); end # @return [Boolean] @@ -4968,7 +4998,7 @@ class RuboCop::AST::NodePattern::Node::Capture < ::RuboCop::AST::NodePattern::No # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#104 def nb_captures; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/node.rb#98 def rest?(*_arg0, **_arg1, &_arg2); end end @@ -5209,28 +5239,28 @@ class RuboCop::AST::NodePattern::Parser < ::Racc::Parser # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.racc.rb#465 def _reduce_none(val, _values); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_atom(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_call(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_capture(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_list(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_unary_op(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#46 def emit_union(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#40 def inspect; end - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 + # source://rubocop-ast//lib/rubocop/ast/node_pattern/parser.rb#48 def next_token(*_arg0, **_arg1, &_arg2); end # (Similar API to `parser` gem) @@ -5543,6 +5573,9 @@ RuboCop::AST::NodePattern::Sets::SET_INTEGER_BIGDECIMAL_COMPLEX_RATIONAL = T.let # source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_IO_FILE = T.let(T.unsafe(nil), Set) +# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 +RuboCop::AST::NodePattern::Sets::SET_IS_A_KIND_OF = T.let(T.unsafe(nil), Set) + # source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_IS_EXPECTED_SHOULD_SHOULD_NOT = T.let(T.unsafe(nil), Set) @@ -5645,6 +5678,9 @@ RuboCop::AST::NodePattern::Sets::SET_REJECT_REJECT = T.let(T.unsafe(nil), Set) # source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(nil), Set) +# source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 +RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER = T.let(T.unsafe(nil), Set) + # source://rubocop-ast//lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER_FIND_ALL = T.let(T.unsafe(nil), Set) @@ -5830,7 +5866,7 @@ class RuboCop::AST::OpAsgnNode < ::RuboCop::AST::Node # @return [AsgnNode] the assignment node # - # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#10 + # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#13 def lhs; end # The name of the variable being assigned as a symbol. @@ -5851,7 +5887,7 @@ class RuboCop::AST::OpAsgnNode < ::RuboCop::AST::Node # # @return [Node] the expression being assigned. # - # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#32 + # source://rubocop-ast//lib/rubocop/ast/node/op_asgn_node.rb#35 def rhs; end end @@ -6015,7 +6051,7 @@ module RuboCop::AST::ParameterizedNode # # @return [Boolean] whether the node is a splat argument # - # source://rubocop-ast//lib/rubocop/ast/node/mixin/parameterized_node.rb#48 + # source://rubocop-ast//lib/rubocop/ast/node/mixin/parameterized_node.rb#52 def rest_argument?; end # Checks whether any argument of the node is a splat @@ -6207,7 +6243,7 @@ class RuboCop::AST::ProcessedSource # @deprecated use contains_comment? # @return [Boolean] if any of the lines in the given `source_range` has a comment. # - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#157 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#161 def commented?(source_range); end # Returns the value of attribute comments. @@ -6288,7 +6324,7 @@ class RuboCop::AST::ProcessedSource # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#77 def lines; end - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#85 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#224 def parse(src, *args); end # Returns the value of attribute parser_engine. @@ -6346,35 +6382,35 @@ class RuboCop::AST::ProcessedSource private - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#327 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#329 def builder_class(parser_engine); end # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#218 def comment_index; end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#337 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#339 def create_parser(ruby_version, parser_engine, prism_result); end # The Parser gem does not support Ruby 3.5 or later. # It is also not fully compatible with Ruby 3.4 but for # now respects using parser for backwards compatibility. # - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#383 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#385 def default_parser_engine(ruby_version); end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#391 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#393 def first_token_index(range_or_node); end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#396 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#398 def last_token_index(range_or_node); end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#366 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#368 def normalize_parser_engine(parser_engine, ruby_version); end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#259 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#260 def parser_class(ruby_version, parser_engine); end - # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#401 + # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#403 def source_range(range_or_node); end # source://rubocop-ast//lib/rubocop/ast/processed_source.rb#243 @@ -6732,7 +6768,7 @@ class RuboCop::AST::SuperNode < ::RuboCop::AST::Node include ::RuboCop::AST::MethodIdentifierPredicates include ::RuboCop::AST::MethodDispatchNode - # source://ast/2.4.3/lib/ast/node.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node/super_node.rb#20 def arguments; end # Custom destructuring method. This can be used to normalize @@ -6919,397 +6955,397 @@ RuboCop::AST::Token::LEFT_PAREN_TYPES = T.let(T.unsafe(nil), Array) module RuboCop::AST::Traversal extend ::RuboCop::AST::Traversal::CallbackCompiler - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#183 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on___ENCODING__(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on___FILE__(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on___LINE__(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_alias(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_and(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_and_asgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_arg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_arg_expr(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_args(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_array(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_array_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_array_pattern_with_tail(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_back_ref(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_begin(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#160 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_block(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#138 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_block_pass(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_blockarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_break(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_case(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_case_match(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#155 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_casgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_cbase(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#156 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_class(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_complex(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#154 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_const(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_const_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#165 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_csend(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_cvar(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#140 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_cvasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#157 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_def(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_defined?(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#163 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_defs(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_dstr(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_dsym(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_eflipflop(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_empty_else(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_ensure(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_erange(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_false(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_find_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_float(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_for(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_forward_arg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_forward_args(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_forwarded_args(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_forwarded_kwrestarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_forwarded_restarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_gvar(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#140 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_gvasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_hash(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_hash_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#159 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_if(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_if_guard(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_iflipflop(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_in_match(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_in_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_index(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_indexasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_int(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_irange(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#162 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_itblock(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_ivar(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#140 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_ivasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwargs(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwbegin(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwnilarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#141 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwoptarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#133 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwrestarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#134 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_kwsplat(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_lambda(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_lvar(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#140 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_lvasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_masgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_alt(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_as(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_current_line(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_nil_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_pattern(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_pattern_p(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#134 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_rest(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_var(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_with_lvasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_match_with_trailing_comma(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_mlhs(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#142 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_module(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_mrasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_next(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_nil(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_not(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_nth_ref(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#161 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_numblock(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#158 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_op_asgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#141 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_optarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_or(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_or_asgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_pair(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_pin(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#138 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_postexe(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#138 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_preexe(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_procarg0(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_rasgn(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_rational(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_redo(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_regexp(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#144 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_regopt(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_resbody(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_rescue(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#133 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_restarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_retry(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_return(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#142 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_sclass(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_self(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#165 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_send(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_shadowarg(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#134 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_splat(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_str(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_super(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#136 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_sym(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_true(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_undef(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#137 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_unless_guard(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#142 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_until(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_until_post(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#148 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_when(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#142 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#43 def on_while(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_while_post(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_xstr(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#145 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_yield(node); end - # source://rubocop-ast//lib/rubocop/ast/traversal.rb#132 + # source://rubocop-ast//lib/rubocop/ast/traversal.rb#50 def on_zsuper(node); end # source://rubocop-ast//lib/rubocop/ast/traversal.rb#17 @@ -7495,7 +7531,7 @@ class RuboCop::AST::YieldNode < ::RuboCop::AST::Node include ::RuboCop::AST::MethodIdentifierPredicates include ::RuboCop::AST::MethodDispatchNode - # source://ast/2.4.3/lib/ast/node.rb#56 + # source://rubocop-ast//lib/rubocop/ast/node/yield_node.rb#20 def arguments; end # Custom destructuring method. This can be used to normalize @@ -7507,343 +7543,9 @@ class RuboCop::AST::YieldNode < ::RuboCop::AST::Node def node_parts; end end -class RuboCop::CommentConfig - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#34 - def initialize(processed_source); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#63 - def comment_only_line?(line_number); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def config(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#51 - def cop_disabled_line_ranges; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#39 - def cop_enabled_at_line?(cop, line_number); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#47 - def cop_opted_in?(cop); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#55 - def extra_enabled_comments; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#30 - def processed_source; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def registry(*_arg0, **_arg1, &_arg2); end - - private - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#96 - def analyze; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#124 - def analyze_cop(analysis, directive); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#144 - def analyze_disabled(analysis, directive); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#155 - def analyze_rest(analysis, directive); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#135 - def analyze_single_line(analysis, directive); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#164 - def cop_line_ranges(analysis); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#170 - def each_directive; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#69 - def extra_enabled_comments_with_names(extras:, names:); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#190 - def handle_enable_all(directive, names, extras); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#204 - def handle_switch(directive, names, extras); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#115 - def inject_disabled_cops_directives(analyses); end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#183 - def non_comment_token_line_numbers; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#83 - def opt_in_cops; end - - # source://rubocop/1.75.2/lib/rubocop/comment_config.rb#179 - def qualified_cop_name(cop_name); end -end - -class RuboCop::Config - # source://rubocop/1.75.2/lib/rubocop/config.rb#31 - def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def [](*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def []=(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#212 - def active_support_extensions_enabled?; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#127 - def add_excludes_from_higher_level(highest_config); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#239 - def allowed_camel_case_file?(file); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#283 - def base_dir_for_path_parameters; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#313 - def bundler_lock_file_path; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#85 - def check; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#180 - def clusivity_config_for_badge?(badge); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#200 - def cop_enabled?(name); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def delete(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#139 - def deprecation_check; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def dig(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#204 - def disabled_new_cops?; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def each(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def each_key(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#208 - def enabled_new_cops?; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def fetch(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#261 - def file_to_exclude?(file); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#220 - def file_to_include?(file); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#196 - def for_all_cops; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#166 - def for_badge(badge); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#153 - def for_cop(cop); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#191 - def for_department(department_name); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#160 - def for_enabled_cop(cop); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#338 - def gem_versions_in_target; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#342 - def inspect; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#110 - def internal?; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def key?(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def keys(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#81 - def loaded_features; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#21 - def loaded_path; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#77 - def loaded_plugins; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#115 - def make_excludes_absolute; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def map(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def merge(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#293 - def parser_engine; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#274 - def path_relative_to_config(path); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#270 - def patterns_to_exclude; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#266 - def patterns_to_include; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#324 - def pending_cops; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#253 - def possibly_include_hidden?; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def replace(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#105 - def signature; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#308 - def smart_loaded_path; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#216 - def string_literals_frozen_by_default?; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#297 - def target_rails_version; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def target_ruby_version(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def to_h(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def to_hash(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#101 - def to_s; end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def transform_values(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def validate(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#92 - def validate_after_resolution; end - - private - - # source://rubocop/1.75.2/lib/rubocop/config.rb#392 - def department_of(qualified_cop_name); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#380 - def enable_cop?(qualified_cop_name, cop_options); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#367 - def gem_version_to_major_minor_float(gem_version); end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#373 - def read_gem_versions_from_target_lockfile; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#354 - def read_rails_version_from_bundler_lock_file; end - - # source://rubocop/1.75.2/lib/rubocop/config.rb#349 - def target_rails_version_from_bundler_lock_file; end - - class << self - # source://rubocop/1.75.2/lib/rubocop/config.rb#23 - def create(hash, path, check: T.unsafe(nil)); end - end -end - -class RuboCop::ConfigValidator - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#28 - def initialize(config); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def for_all_cops(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast//lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def smart_loaded_path(*_arg0, **_arg1, &_arg2); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#65 - def target_ruby_version; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#34 - def validate; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#61 - def validate_after_resolution; end - - private - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#100 - def alert_about_unrecognized_cops(invalid_cop_names); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#264 - def check_cop_config_value(hash, parent = T.unsafe(nil)); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#73 - def check_obsoletions; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#80 - def check_target_ruby; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#205 - def each_invalid_parameter(cop_name); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#116 - def list_unknown_cops(invalid_cop_names); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#284 - def param_error_message(parent, key, value, supposed_values); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#252 - def reject_conflicting_safe_settings; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#243 - def reject_mutually_exclusive_defaults; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#139 - def suggestion(name); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#71 - def target_ruby; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#217 - def validate_enforced_styles(valid_cop_names); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#166 - def validate_new_cops_parameter; end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#191 - def validate_parameter_names(valid_cop_names); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#177 - def validate_parameter_shape(valid_cop_names); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#237 - def validate_support_and_has_list(name, formats, valid); end - - # source://rubocop/1.75.2/lib/rubocop/config_validator.rb#155 - def validate_syntax_cop; end -end +class RuboCop::CommentConfig; end +class RuboCop::Config; end +class RuboCop::ConfigValidator; end # Similar to `Forwardable#def_delegators`, but simpler & faster # diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@3.6.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@3.6.0.rbi index ccfc0ed34a..3652ece013 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@3.6.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@3.6.0.rbi @@ -4046,7 +4046,7 @@ class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#86 def expect?(param0 = T.unsafe(nil)); end - # source://rubocop/1.75.2/lib/rubocop/cop/exclude_limit.rb#11 + # source://rubocop/1.75.6/lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_expectations.rb#93 @@ -4161,7 +4161,7 @@ RuboCop::Cop::RSpec::MultipleExpectations::TRUE_NODE = T.let(T.unsafe(nil), Proc class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base include ::RuboCop::Cop::RSpec::Variable - # source://rubocop/1.75.2/lib/rubocop/cop/exclude_limit.rb#11 + # source://rubocop/1.75.6/lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end # source://rubocop-rspec//lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#91 @@ -4503,7 +4503,7 @@ end class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base include ::RuboCop::Cop::RSpec::TopLevelGroup - # source://rubocop/1.75.2/lib/rubocop/cop/exclude_limit.rb#11 + # source://rubocop/1.75.6/lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end # source://rubocop-rspec//lib/rubocop/cop/rspec/nested_groups.rb#107 diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.75.6.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.75.6.rbi deleted file mode 100644 index 7f307d4617..0000000000 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.75.6.rbi +++ /dev/null @@ -1,62330 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rubocop` gem. -# Please instead update this file by running `bin/tapioca gem rubocop`. - - -class Parser::Source::Comment - include ::RuboCop::Ext::Comment -end - -class Parser::Source::Range - include ::RuboCop::Ext::Range -end - -class Regexp::Expression::Base - include ::RuboCop::Ext::RegexpParser::Expression::Base -end - -class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression - include ::RuboCop::Ext::RegexpParser::Expression::CharacterSet -end - -class Regexp::Expression::Quantifier - include ::RuboCop::Ext::RegexpParser::Expression::Base -end - -# source://rubocop//lib/rubocop/version.rb#3 -module RuboCop; end - -class RuboCop::AST::ProcessedSource - include ::RuboCop::Ext::ProcessedSource -end - -class RuboCop::AST::RegexpNode < ::RuboCop::AST::Node - include ::RuboCop::Ext::RegexpNode -end - -# This is a class that reads optional command line arguments to rubocop from environment variable. -# -# @api private -# -# source://rubocop//lib/rubocop/arguments_env.rb#6 -class RuboCop::ArgumentsEnv - class << self - # @api private - # - # source://rubocop//lib/rubocop/arguments_env.rb#7 - def read_as_arguments; end - end -end - -# This is a class that reads optional command line arguments to rubocop from .rubocop file. -# -# @api private -# -# source://rubocop//lib/rubocop/arguments_file.rb#6 -class RuboCop::ArgumentsFile - class << self - # @api private - # - # source://rubocop//lib/rubocop/arguments_file.rb#7 - def read_as_arguments; end - end -end - -# The CLI is a class responsible of handling all the command line interface -# logic. -# -# source://rubocop//lib/rubocop/cli.rb#8 -class RuboCop::CLI - # @return [CLI] a new instance of CLI - # - # source://rubocop//lib/rubocop/cli.rb#24 - def initialize; end - - # Returns the value of attribute config_store. - # - # source://rubocop//lib/rubocop/cli.rb#22 - def config_store; end - - # Returns the value of attribute options. - # - # source://rubocop//lib/rubocop/cli.rb#22 - def options; end - - # Entry point for the application logic. Here we - # do the command line arguments processing and inspect - # the target files. - # - # - # @api public - # @param args [Array] command line arguments - # @return [Integer] UNIX exit code - # - # source://rubocop//lib/rubocop/cli.rb#39 - def run(args = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cli.rb#156 - def act_on_options; end - - # source://rubocop//lib/rubocop/cli.rb#198 - def apply_default_formatter; end - - # source://rubocop//lib/rubocop/cli.rb#125 - def execute_runners; end - - # source://rubocop//lib/rubocop/cli.rb#182 - def handle_editor_mode; end - - # @raise [Finished] - # - # source://rubocop//lib/rubocop/cli.rb#187 - def handle_exiting_options; end - - # source://rubocop//lib/rubocop/cli.rb#144 - def parallel_by_default!; end - - # source://rubocop//lib/rubocop/cli.rb#80 - def profile_if_needed; end - - # source://rubocop//lib/rubocop/cli.rb#113 - def require_gem(name); end - - # source://rubocop//lib/rubocop/cli.rb#121 - def run_command(name); end - - # source://rubocop//lib/rubocop/cli.rb#174 - def set_options_to_config_loader; end - - # source://rubocop//lib/rubocop/cli.rb#133 - def suggest_extensions; end - - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/cli.rb#137 - def validate_options_vs_config; end -end - -# Home of subcommands in the CLI. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command.rb#7 -module RuboCop::CLI::Command - class << self - # Find the command with a given name and run it in an environment. - # - # @api private - # - # source://rubocop//lib/rubocop/cli/command.rb#10 - def run(env, name); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command.rb#16 - def class_for(name); end - end -end - -# Generate a configuration file acting as a TODO list. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#8 -class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#25 - def run; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#107 - def add_formatter; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#115 - def add_inheritance_from_auto_generated_file(config_file); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#111 - def execute_runner; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#136 - def existing_configuration(config_file); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#65 - def line_length_cop(config); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#53 - def line_length_enabled?(config); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#61 - def max_line_length(config); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#34 - def maybe_run_line_length_cop; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#73 - def only_exclude?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#69 - def options_has_only_flag?; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#153 - def relative_path_to_todo_from_options_config; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#100 - def reset_config_and_auto_gen_file; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#91 - def run_all_cops(line_length_contents); end - - # Do an initial run with only Layout/LineLength so that cops that - # depend on Layout/LineLength:Max get the correct value for that - # parameter. - # - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#80 - def run_line_length_cop; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#57 - def same_max_line_length?(config1, config2); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#48 - def skip_line_length_cop(reason); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#142 - def write_config_file(file_name, file_string, rubocop_yml_contents); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#11 -RuboCop::CLI::Command::AutoGenerateConfig::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#15 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1 = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#19 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_DISABLED = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#18 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_OVERRIDDEN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#20 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_COPS = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#22 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_EXCLUDE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#16 -RuboCop::CLI::Command::AutoGenerateConfig::PHASE_2 = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#13 -RuboCop::CLI::Command::AutoGenerateConfig::PLACEHOLDER = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#12 -RuboCop::CLI::Command::AutoGenerateConfig::YAML_OPTIONAL_DOC_START = T.let(T.unsafe(nil), Regexp) - -# A subcommand in the CLI. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/base.rb#8 -class RuboCop::CLI::Command::Base - # @api private - # @return [Base] a new instance of Base - # - # source://rubocop//lib/rubocop/cli/command/base.rb#26 - def initialize(env); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/base.rb#9 - def env; end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/cli/command/base.rb#21 - def by_command_name(name); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/base.rb#14 - def command_name; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/base.rb#14 - def command_name=(_arg0); end - - # @api private - # @private - # - # source://rubocop//lib/rubocop/cli/command/base.rb#16 - def inherited(subclass); end - end -end - -# Run all the selected cops and report the result. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/execute_runner.rb#8 -class RuboCop::CLI::Command::ExecuteRunner < ::RuboCop::CLI::Command::Base - include ::RuboCop::Formatter::TextUtil - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#16 - def run; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#85 - def bug_tracker_uri; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#69 - def display_error_summary(errors); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#56 - def display_summary(runner); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#61 - def display_warning_summary(warnings); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#22 - def execute_runner(paths); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#91 - def maybe_print_corrected_source; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#42 - def with_redirect; end -end - -# Combination of short and long formatter names. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/execute_runner.rb#12 -RuboCop::CLI::Command::ExecuteRunner::INTEGRATION_FORMATTERS = T.let(T.unsafe(nil), Array) - -# Generate a .rubocop.yml file in the current directory. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#8 -class RuboCop::CLI::Command::InitDotfile < ::RuboCop::CLI::Command::Base - # @api private - # - # source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#13 - def run; end -end - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#9 -RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String) - -# Start Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/lsp.rb#8 -class RuboCop::CLI::Command::LSP < ::RuboCop::CLI::Command::Base - # @api private - # - # source://rubocop//lib/rubocop/cli/command/lsp.rb#11 - def run; end -end - -# Shows the given cops, or all cops by default, and their configurations -# for the current directory. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/show_cops.rb#9 -class RuboCop::CLI::Command::ShowCops < ::RuboCop::CLI::Command::Base - # @api private - # @return [ShowCops] a new instance of ShowCops - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#24 - def initialize(env); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#39 - def run; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#89 - def config_lines(cop); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#85 - def cops_of_department(cops, department); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#45 - def print_available_cops; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#68 - def print_cop_details(cops); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#56 - def print_cops_of_department(registry, department, show_all); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#77 - def selected_cops_of_department(cops, department); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 -class RuboCop::CLI::Command::ShowCops::ExactMatcher < ::Struct - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#13 - def match?(name); end - - # Returns the value of attribute pattern - # - # @return [Object] the current value of pattern - def pattern; end - - # Sets the attribute pattern - # - # @param value [Object] the value to set the attribute pattern to. - # @return [Object] the newly set value - def pattern=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 -class RuboCop::CLI::Command::ShowCops::WildcardMatcher < ::Struct - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/show_cops.rb#19 - def match?(name); end - - # Returns the value of attribute pattern - # - # @return [Object] the current value of pattern - def pattern; end - - # Sets the attribute pattern - # - # @param value [Object] the value to set the attribute pattern to. - # @return [Object] the newly set value - def pattern=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Prints out url to documentation of provided cops -# or documentation base url by default. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#9 -class RuboCop::CLI::Command::ShowDocsUrl < ::RuboCop::CLI::Command::Base - # @api private - # @return [ShowDocsUrl] a new instance of ShowDocsUrl - # - # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#12 - def initialize(env); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#18 - def run; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#38 - def cops_array; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#24 - def print_documentation_url; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#42 - def registry_hash; end -end - -# Suggest RuboCop extensions to install based on Gemfile dependencies. -# Only primary dependencies are evaluated, so if a dependency depends on a -# gem with an extension, it is not suggested. However, if an extension is -# a transitive dependency, it will not be suggested. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#11 -class RuboCop::CLI::Command::SuggestExtensions < ::RuboCop::CLI::Command::Base - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#17 - def run; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#73 - def all_extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#69 - def current_formatter; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#117 - def dependent_gems; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#87 - def extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#109 - def installed_and_not_loaded_extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#91 - def installed_extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#121 - def installed_gems; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#99 - def loaded_extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#113 - def lockfile; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#95 - def not_installed_extensions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#41 - def print_install_suggestions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#51 - def print_load_suggestions; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#60 - def print_opt_out_instruction; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#125 - def puts(*args); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#30 - def skip?; end -end - -# Combination of short and long formatter names. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#13 -RuboCop::CLI::Command::SuggestExtensions::INCLUDED_FORMATTERS = T.let(T.unsafe(nil), Array) - -# Display version. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/command/version.rb#8 -class RuboCop::CLI::Command::Version < ::RuboCop::CLI::Command::Base - # @api private - # - # source://rubocop//lib/rubocop/cli/command/version.rb#11 - def run; end -end - -# source://rubocop//lib/rubocop/cli.rb#13 -RuboCop::CLI::DEFAULT_PARALLEL_OPTIONS = T.let(T.unsafe(nil), Array) - -# Execution environment for a CLI command. -# -# @api private -# -# source://rubocop//lib/rubocop/cli/environment.rb#7 -class RuboCop::CLI::Environment - # @api private - # @return [Environment] a new instance of Environment - # - # source://rubocop//lib/rubocop/cli/environment.rb#10 - def initialize(options, config_store, paths); end - - # @api private - # - # source://rubocop//lib/rubocop/cli/environment.rb#8 - def config_store; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/environment.rb#8 - def options; end - - # @api private - # - # source://rubocop//lib/rubocop/cli/environment.rb#8 - def paths; end - - # Run a command in this environment. - # - # @api private - # - # source://rubocop//lib/rubocop/cli/environment.rb#17 - def run(name); end -end - -# source://rubocop//lib/rubocop/cli.rb#20 -class RuboCop::CLI::Finished < ::StandardError; end - -# source://rubocop//lib/rubocop/cli.rb#11 -RuboCop::CLI::STATUS_ERROR = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cli.rb#12 -RuboCop::CLI::STATUS_INTERRUPTED = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cli.rb#10 -RuboCop::CLI::STATUS_OFFENSES = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cli.rb#9 -RuboCop::CLI::STATUS_SUCCESS = T.let(T.unsafe(nil), Integer) - -# This class represents the cache config of the caching RuboCop runs. -# -# @api private -# -# source://rubocop//lib/rubocop/cache_config.rb#6 -class RuboCop::CacheConfig - class << self - # @api private - # - # source://rubocop//lib/rubocop/cache_config.rb#7 - def root_dir; end - end -end - -# Converts RuboCop objects to and from the serialization format JSON. -# -# @api private -# -# source://rubocop//lib/rubocop/cached_data.rb#8 -class RuboCop::CachedData - # @api private - # @return [CachedData] a new instance of CachedData - # - # source://rubocop//lib/rubocop/cached_data.rb#9 - def initialize(filename); end - - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#13 - def from_json(text); end - - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#17 - def to_json(offenses); end - - private - - # Restore an offense object loaded from a JSON file. - # - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#47 - def deserialize_offenses(offenses); end - - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#54 - def location_from_source_buffer(offense); end - - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#40 - def message(offense); end - - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#23 - def serialize_offense(offense); end - - # Delay creation until needed. Some type of offenses will have no buffer associated with them - # and be global only. For these, trying to create the buffer will likely fail, for example - # because of unknown encoding comments. - # - # @api private - # - # source://rubocop//lib/rubocop/cached_data.rb#67 - def source_buffer; end -end - -# and provides a way to check if each cop is enabled at arbitrary line. -# -# source://rubocop//lib/rubocop/comment_config.rb#6 -class RuboCop::CommentConfig - extend ::RuboCop::SimpleForwardable - - # @return [CommentConfig] a new instance of CommentConfig - # - # source://rubocop//lib/rubocop/comment_config.rb#34 - def initialize(processed_source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/comment_config.rb#63 - def comment_only_line?(line_number); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def config(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/comment_config.rb#51 - def cop_disabled_line_ranges; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/comment_config.rb#39 - def cop_enabled_at_line?(cop, line_number); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/comment_config.rb#47 - def cop_opted_in?(cop); end - - # source://rubocop//lib/rubocop/comment_config.rb#55 - def extra_enabled_comments; end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/comment_config.rb#30 - def processed_source; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def registry(*_arg0, **_arg1, &_arg2); end - - private - - # source://rubocop//lib/rubocop/comment_config.rb#96 - def analyze; end - - # source://rubocop//lib/rubocop/comment_config.rb#124 - def analyze_cop(analysis, directive); end - - # source://rubocop//lib/rubocop/comment_config.rb#144 - def analyze_disabled(analysis, directive); end - - # source://rubocop//lib/rubocop/comment_config.rb#155 - def analyze_rest(analysis, directive); end - - # source://rubocop//lib/rubocop/comment_config.rb#135 - def analyze_single_line(analysis, directive); end - - # source://rubocop//lib/rubocop/comment_config.rb#164 - def cop_line_ranges(analysis); end - - # source://rubocop//lib/rubocop/comment_config.rb#170 - def each_directive; end - - # source://rubocop//lib/rubocop/comment_config.rb#69 - def extra_enabled_comments_with_names(extras:, names:); end - - # source://rubocop//lib/rubocop/comment_config.rb#190 - def handle_enable_all(directive, names, extras); end - - # Collect cops that have been disabled or enabled by name in a directive comment - # so that `Lint/RedundantCopEnableDirective` can register offenses correctly. - # - # source://rubocop//lib/rubocop/comment_config.rb#204 - def handle_switch(directive, names, extras); end - - # source://rubocop//lib/rubocop/comment_config.rb#115 - def inject_disabled_cops_directives(analyses); end - - # source://rubocop//lib/rubocop/comment_config.rb#183 - def non_comment_token_line_numbers; end - - # source://rubocop//lib/rubocop/comment_config.rb#83 - def opt_in_cops; end - - # source://rubocop//lib/rubocop/comment_config.rb#179 - def qualified_cop_name(cop_name); end -end - -# source://rubocop//lib/rubocop/comment_config.rb#9 -RuboCop::CommentConfig::CONFIG_DISABLED_LINE_RANGE_MIN = T.let(T.unsafe(nil), Float) - -# This class provides an API compatible with RuboCop::DirectiveComment -# to be used for cops that are disabled in the config file -# -# source://rubocop//lib/rubocop/comment_config.rb#13 -class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment - include ::RuboCop::Ext::Comment - - # @return [ConfigDisabledCopDirectiveComment] a new instance of ConfigDisabledCopDirectiveComment - # - # source://rubocop//lib/rubocop/comment_config.rb#21 - def initialize(cop_name); end - - # Returns the value of attribute line_number. - # - # source://rubocop//lib/rubocop/comment_config.rb#16 - def line_number; end - - # Returns the value of attribute loc. - # - # source://rubocop//lib/rubocop/comment_config.rb#16 - def loc; end - - # Returns the value of attribute text. - # - # source://rubocop//lib/rubocop/comment_config.rb#16 - def text; end -end - -# source://rubocop//lib/rubocop/comment_config.rb#19 -class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment::Expression < ::Struct - # Returns the value of attribute line - # - # @return [Object] the current value of line - def line; end - - # Sets the attribute line - # - # @param value [Object] the value to set the attribute line to. - # @return [Object] the newly set value - def line=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/comment_config.rb#18 -class RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment::Loc < ::Struct - # Returns the value of attribute expression - # - # @return [Object] the current value of expression - def expression; end - - # Sets the attribute expression - # - # @param value [Object] the value to set the attribute expression to. - # @return [Object] the newly set value - def expression=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/comment_config.rb#28 -class RuboCop::CommentConfig::CopAnalysis < ::Struct - # Returns the value of attribute line_ranges - # - # @return [Object] the current value of line_ranges - def line_ranges; end - - # Sets the attribute line_ranges - # - # @param value [Object] the value to set the attribute line_ranges to. - # @return [Object] the newly set value - def line_ranges=(_); end - - # Returns the value of attribute start_line_number - # - # @return [Object] the current value of start_line_number - def start_line_number; end - - # Sets the attribute start_line_number - # - # @param value [Object] the value to set the attribute start_line_number to. - # @return [Object] the newly set value - def start_line_number=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# This class represents the configuration of the RuboCop application -# and all its cops. A Config is associated with a YAML configuration -# file from which it was read. Several different Configs can be used -# during a run of the rubocop program, if files in several -# directories are inspected. -# -# source://rubocop//lib/rubocop/config.rb#12 -class RuboCop::Config - include ::RuboCop::PathUtil - include ::RuboCop::FileFinder - extend ::RuboCop::SimpleForwardable - - # @return [Config] a new instance of Config - # - # source://rubocop//lib/rubocop/config.rb#31 - def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def [](*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def []=(*_arg0, **_arg1, &_arg2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#212 - def active_support_extensions_enabled?; end - - # source://rubocop//lib/rubocop/config.rb#127 - def add_excludes_from_higher_level(highest_config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#239 - def allowed_camel_case_file?(file); end - - # Paths specified in configuration files starting with .rubocop are - # relative to the directory where that file is. Paths in other config files - # are relative to the current directory. This is so that paths in - # config/default.yml, for example, are not relative to RuboCop's config - # directory since that wouldn't work. - # - # source://rubocop//lib/rubocop/config.rb#283 - def base_dir_for_path_parameters; end - - # @return [String, nil] - # - # source://rubocop//lib/rubocop/config.rb#313 - def bundler_lock_file_path; end - - # source://rubocop//lib/rubocop/config.rb#85 - def check; end - - # @api private - # @return [Boolean] whether config for this badge has 'Include' or 'Exclude' keys - # - # source://rubocop//lib/rubocop/config.rb#180 - def clusivity_config_for_badge?(badge); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#200 - def cop_enabled?(name); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def delete(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#139 - def deprecation_check; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def dig(*_arg0, **_arg1, &_arg2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#204 - def disabled_new_cops?; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def each(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def each_key(*_arg0, **_arg1, &_arg2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#208 - def enabled_new_cops?; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def fetch(*_arg0, **_arg1, &_arg2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#261 - def file_to_exclude?(file); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#220 - def file_to_include?(file); end - - # source://rubocop//lib/rubocop/config.rb#196 - def for_all_cops; end - - # Note: the 'Enabled' attribute is same as that returned by `for_cop` - # - # @return [Config] for the given cop merged with that of its department (if any) - # - # source://rubocop//lib/rubocop/config.rb#166 - def for_badge(badge); end - - # Note: the 'Enabled' attribute is calculated according to the department's - # and 'AllCops' configuration; other attributes are not inherited. - # - # @return [Config] for the given cop / cop name. - # - # source://rubocop//lib/rubocop/config.rb#153 - def for_cop(cop); end - - # Note: the 'Enabled' attribute will be present only if specified - # at the department's level - # - # @return [Config] for the given department name. - # - # source://rubocop//lib/rubocop/config.rb#191 - def for_department(department_name); end - - # If the given cop is enabled, returns its configuration hash. - # Otherwise, returns an empty hash. - # - # @return [Config, Hash] for the given cop / cop name. - # - # source://rubocop//lib/rubocop/config.rb#160 - def for_enabled_cop(cop); end - - # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) - # - # source://rubocop//lib/rubocop/config.rb#338 - def gem_versions_in_target; end - - # source://rubocop//lib/rubocop/config.rb#342 - def inspect; end - - # True if this is a config file that is shipped with RuboCop - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#110 - def internal?; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def key?(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def keys(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#81 - def loaded_features; end - - # Returns the value of attribute loaded_path. - # - # source://rubocop//lib/rubocop/config.rb#21 - def loaded_path; end - - # source://rubocop//lib/rubocop/config.rb#77 - def loaded_plugins; end - - # source://rubocop//lib/rubocop/config.rb#115 - def make_excludes_absolute; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def map(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def merge(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#293 - def parser_engine; end - - # source://rubocop//lib/rubocop/config.rb#274 - def path_relative_to_config(path); end - - # source://rubocop//lib/rubocop/config.rb#270 - def patterns_to_exclude; end - - # source://rubocop//lib/rubocop/config.rb#266 - def patterns_to_include; end - - # source://rubocop//lib/rubocop/config.rb#324 - def pending_cops; end - - # Returns true if there's a chance that an Include pattern matches hidden - # files, false if that's definitely not possible. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#253 - def possibly_include_hidden?; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def replace(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#105 - def signature; end - - # source://rubocop//lib/rubocop/config.rb#308 - def smart_loaded_path; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#216 - def string_literals_frozen_by_default?; end - - # source://rubocop//lib/rubocop/config.rb#297 - def target_rails_version; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def target_ruby_version(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def to_h(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def to_hash(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#101 - def to_s; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def transform_values(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def validate(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config.rb#92 - def validate_after_resolution; end - - private - - # source://rubocop//lib/rubocop/config.rb#392 - def department_of(qualified_cop_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config.rb#380 - def enable_cop?(qualified_cop_name, cop_options); end - - # @param gem_version [Gem::Version] an object like `Gem::Version.new("7.1.2.3")` - # @return [Float] The major and minor version, like `7.1` - # - # source://rubocop//lib/rubocop/config.rb#367 - def gem_version_to_major_minor_float(gem_version); end - - # source://rubocop//lib/rubocop/config.rb#373 - def read_gem_versions_from_target_lockfile; end - - # @return [Float, nil] The Rails version as a `major.minor` Float. - # - # source://rubocop//lib/rubocop/config.rb#354 - def read_rails_version_from_bundler_lock_file; end - - # @return [Float, nil] The Rails version as a `major.minor` Float. - # - # source://rubocop//lib/rubocop/config.rb#349 - def target_rails_version_from_bundler_lock_file; end - - class << self - # source://rubocop//lib/rubocop/config.rb#23 - def create(hash, path, check: T.unsafe(nil)); end - end -end - -# source://rubocop//lib/rubocop/config.rb#17 -class RuboCop::Config::CopConfig < ::Struct - # Returns the value of attribute metadata - # - # @return [Object] the current value of metadata - def metadata; end - - # Sets the attribute metadata - # - # @param value [Object] the value to set the attribute metadata to. - # @return [Object] the newly set value - def metadata=(_); end - - # Returns the value of attribute name - # - # @return [Object] the current value of name - def name; end - - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value - def name=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/config.rb#20 -RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) - -# source://rubocop//lib/rubocop/config.rb#19 -RuboCop::Config::EMPTY_CONFIG = T.let(T.unsafe(nil), Hash) - -# This class has methods related to finding configuration path. -# -# @api private -# -# source://rubocop//lib/rubocop/config_finder.rb#8 -class RuboCop::ConfigFinder - extend ::RuboCop::FileFinder - - class << self - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#19 - def find_config_path(target_dir); end - - # Returns the path RuboCop inferred as the root of the project. No file - # searches will go past this directory. - # - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#26 - def project_root; end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#17 - def project_root=(_arg0); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#69 - def expand_path(path); end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#40 - def find_project_dotfile(target_dir); end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#32 - def find_project_root; end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#44 - def find_project_root_dot_config; end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#54 - def find_user_dotfile; end - - # @api private - # - # source://rubocop//lib/rubocop/config_finder.rb#62 - def find_user_xdg_config; end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_finder.rb#12 -RuboCop::ConfigFinder::DEFAULT_FILE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/config_finder.rb#9 -RuboCop::ConfigFinder::DOTFILE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/config_finder.rb#11 -RuboCop::ConfigFinder::RUBOCOP_HOME = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/config_finder.rb#10 -RuboCop::ConfigFinder::XDG_CONFIG = T.let(T.unsafe(nil), String) - -# This class represents the configuration of the RuboCop application -# and all its cops. A Config is associated with a YAML configuration -# file from which it was read. Several different Configs can be used -# during a run of the rubocop program, if files in several -# directories are inspected. -# -# source://rubocop//lib/rubocop/config_loader.rb#17 -class RuboCop::ConfigLoader - extend ::RuboCop::FileFinder - - class << self - # source://rubocop//lib/rubocop/config_loader.rb#152 - def add_excludes_from_files(config, config_file); end - - # Used to add features that were required inside a config or from - # the CLI using `--require`. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader.rb#241 - def add_loaded_features(loaded_features); end - - # Used to add plugins that were required inside a config or from - # the CLI using `--plugin`. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader.rb#234 - def add_loaded_plugins(loaded_plugins); end - - # source://rubocop//lib/rubocop/config_loader.rb#91 - def add_missing_namespaces(path, hash); end - - # source://rubocop//lib/rubocop/config_loader.rb#41 - def clear_options; end - - # Returns the path of .rubocop.yml searching upwards in the - # directory structure starting at the given directory where the - # inspected file is. If no .rubocop.yml is found there, the - # user's home directory is checked. If there's no .rubocop.yml - # there either, the path to the default file is returned. - # - # source://rubocop//lib/rubocop/config_loader.rb#119 - def configuration_file_for(target_dir); end - - # source://rubocop//lib/rubocop/config_loader.rb#123 - def configuration_from_file(config_file, check: T.unsafe(nil)); end - - # Returns the value of attribute debug. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def debug; end - - # Sets the attribute debug - # - # @param value the value to set the attribute debug to. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def debug=(_arg0); end - - # Returns the value of attribute debug. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def debug?; end - - # source://rubocop//lib/rubocop/config_loader.rb#162 - def default_configuration; end - - # Sets the attribute default_configuration - # - # @param value the value to set the attribute default_configuration to. - # - # source://rubocop//lib/rubocop/config_loader.rb#35 - def default_configuration=(_arg0); end - - # Returns the value of attribute disable_pending_cops. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def disable_pending_cops; end - - # Sets the attribute disable_pending_cops - # - # @param value the value to set the attribute disable_pending_cops to. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def disable_pending_cops=(_arg0); end - - # Returns the value of attribute enable_pending_cops. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def enable_pending_cops; end - - # Sets the attribute enable_pending_cops - # - # @param value the value to set the attribute enable_pending_cops to. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def enable_pending_cops=(_arg0); end - - # Returns the value of attribute ignore_parent_exclusion. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def ignore_parent_exclusion; end - - # Sets the attribute ignore_parent_exclusion - # - # @param value the value to set the attribute ignore_parent_exclusion to. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def ignore_parent_exclusion=(_arg0); end - - # Returns the value of attribute ignore_parent_exclusion. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def ignore_parent_exclusion?; end - - # Returns the value of attribute ignore_unrecognized_cops. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def ignore_unrecognized_cops; end - - # Sets the attribute ignore_unrecognized_cops - # - # @param value the value to set the attribute ignore_unrecognized_cops to. - # - # source://rubocop//lib/rubocop/config_loader.rb#33 - def ignore_unrecognized_cops=(_arg0); end - - # This API is primarily intended for testing and documenting plugins. - # When testing a plugin using `rubocop/rspec/support`, the plugin is loaded automatically, - # so this API is usually not needed. It is intended to be used only when implementing tests - # that do not use `rubocop/rspec/support`. - # - # source://rubocop//lib/rubocop/config_loader.rb#174 - def inject_defaults!(config_yml_path); end - - # source://rubocop//lib/rubocop/config_loader.rb#53 - def load_file(file, check: T.unsafe(nil)); end - - # @raise [TypeError] - # - # source://rubocop//lib/rubocop/config_loader.rb#78 - def load_yaml_configuration(absolute_path); end - - # Returns the value of attribute loaded_features. - # - # source://rubocop//lib/rubocop/config_loader.rb#36 - def loaded_features; end - - # Returns the value of attribute loaded_plugins. - # - # source://rubocop//lib/rubocop/config_loader.rb#36 - def loaded_plugins; end - - # Return a recursive merge of two hashes. That is, a normal hash merge, - # with the addition that any value that is a hash, and occurs in both - # arguments, will also be merged. And so on. - # - # source://rubocop//lib/rubocop/config_loader.rb#110 - def merge(base_hash, derived_hash); end - - # Merges the given configuration with the default one. - # - # source://rubocop//lib/rubocop/config_loader.rb#227 - def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/config_loader.rb#143 - def pending_cops_only_qualified(pending_cops); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader.rb#147 - def possible_new_cops?(config); end - - # Returns the path RuboCop inferred as the root of the project. No file - # searches will go past this directory. - # - # @deprecated Use `RuboCop::ConfigFinder.project_root` instead. - # - # source://rubocop//lib/rubocop/config_loader.rb#202 - def project_root; end - - # source://rubocop//lib/rubocop/config_loader.rb#211 - def warn_on_pending_cops(pending_cops); end - - # source://rubocop//lib/rubocop/config_loader.rb#219 - def warn_pending_cop(cop); end - - private - - # source://rubocop//lib/rubocop/config_loader.rb#255 - def check_duplication(yaml_code, absolute_path); end - - # source://rubocop//lib/rubocop/config_loader.rb#247 - def file_path(file); end - - # Read the specified file, or exit with a friendly, concise message on - # stderr. Care is taken to use the standard OS exit code for a "file not - # found" error. - # - # source://rubocop//lib/rubocop/config_loader.rb#275 - def read_file(absolute_path); end - - # source://rubocop//lib/rubocop/config_loader.rb#251 - def resolver; end - - # source://rubocop//lib/rubocop/config_loader.rb#281 - def yaml_tree_to_hash(yaml_tree); end - - # source://rubocop//lib/rubocop/config_loader.rb#291 - def yaml_tree_to_hash!(yaml_tree); end - end -end - -# source://rubocop//lib/rubocop/config_loader.rb#20 -RuboCop::ConfigLoader::DEFAULT_FILE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/config_loader.rb#18 -RuboCop::ConfigLoader::DOTFILE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/config_loader.rb#19 -RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String) - -# A help class for ConfigLoader that handles configuration resolution. -# -# @api private -# -# source://rubocop//lib/rubocop/config_loader_resolver.rb#10 -class RuboCop::ConfigLoaderResolver - # When one .rubocop.yml file inherits from another .rubocop.yml file, the Include paths in the - # base configuration are relative to the directory where the base configuration file is. For the - # derived configuration, we need to make those paths relative to where the derived configuration - # file is. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#64 - def fix_include_paths(base_config_path, hash, path, key, value); end - - # Return a recursive merge of two hashes. That is, a normal hash merge, - # with the addition that any value that is a hash, and occurs in both - # arguments, will also be merged. And so on. - # - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#118 - def merge(base_hash, derived_hash, **opts); end - - # Merges the given configuration with the default one. If - # AllCops:DisabledByDefault is true, it changes the Enabled params so that - # only cops from user configuration are enabled. If - # AllCops:EnabledByDefault is true, it changes the Enabled params so that - # only cops explicitly disabled in user configuration are disabled. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#94 - def merge_with_default(config, config_file, unset_nil:); end - - # An `Enabled: true` setting in user configuration for a cop overrides an - # `Enabled: false` setting for its department. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#138 - def override_department_setting_for_cops(base_hash, derived_hash); end - - # If a cop was previously explicitly enabled, but then superseded by the - # department being disabled, disable it. - # - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#155 - def override_enabled_for_disabled_departments(base_hash, derived_hash); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#38 - def resolve_inheritance(path, hash, file, debug); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#74 - def resolve_inheritance_from_gems(hash); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#11 - def resolve_plugins(rubocop_config, plugins); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#18 - def resolve_requires(path, hash); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#234 - def base_configs(path, inherit_from, file); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#202 - def determine_inherit_mode(hash, key); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#171 - def disabled?(hash, department); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#175 - def duplicate_setting?(base_hash, derived_hash, key, inherited_file); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#196 - def duplicate_setting_warning(opts, key); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#293 - def gem_config_path(gem_name, relative_config_path); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#271 - def handle_disabled_by_default(config, new_default_configuration); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#246 - def inherited_file(path, inherit_from, file); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#230 - def merge_hashes?(base_hash, derived_hash, key); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#267 - def remote_config?(file); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#222 - def should_merge?(mode, key); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#226 - def should_override?(mode, key); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#208 - def should_union?(derived_hash, base_hash, root_mode, key); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#289 - def transform(config, &block); end - - # @api private - # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#184 - def warn_on_duplicate_setting(base_hash, derived_hash, key, **opts); end -end - -# Raised when a RuboCop configuration file is not found. -# -# source://rubocop//lib/rubocop/config_loader.rb#9 -class RuboCop::ConfigNotFoundError < ::RuboCop::Error; end - -# This class handles obsolete configuration. -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/rule.rb#4 -class RuboCop::ConfigObsoletion - # @api private - # @return [ConfigObsoletion] a new instance of ConfigObsoletion - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#66 - def initialize(config); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#84 - def deprecated_cop_name?(name); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#79 - def legacy_cop_names; end - - # @api private - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#72 - def reject_obsolete!; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#21 - def rules; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#21 - def warnings; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#151 - def cop_rules; end - - # Cop rules are keyed by the name of the original cop - # - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#112 - def load_cop_rules(rules); end - - # Parameter rules may apply to multiple cops and multiple parameters - # and are given as an array. Each combination is turned into a separate - # rule object. - # - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#125 - def load_parameter_rules(rules); end - - # Default rules for obsoletions are in config/obsoletion.yml - # Additional rules files can be added with `RuboCop::ConfigObsoletion.files << filename` - # - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#92 - def load_rules; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#138 - def obsoletions; end - - class << self - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#45 - def deprecated_cop_name?(name); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#49 - def deprecated_names_for(cop); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#24 - def files; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#24 - def files=(_arg0); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#26 - def global; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#40 - def legacy_cop_names; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#30 - def reset!; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion.rb#36 - def rules_cache_key; end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion.rb#8 -RuboCop::ConfigObsoletion::COP_RULE_CLASSES = T.let(T.unsafe(nil), Hash) - -# Encapsulation of a ConfigObsoletion rule for changing a parameter -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#7 -class RuboCop::ConfigObsoletion::ChangedEnforcedStyles < ::RuboCop::ConfigObsoletion::ParameterRule - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#14 - def message; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#10 - def violated?; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#28 - def value; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#8 -RuboCop::ConfigObsoletion::ChangedEnforcedStyles::BASE_MESSAGE = T.let(T.unsafe(nil), String) - -# Encapsulation of a ConfigObsoletion rule for changing a parameter -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/changed_parameter.rb#7 -class RuboCop::ConfigObsoletion::ChangedParameter < ::RuboCop::ConfigObsoletion::ParameterRule - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/changed_parameter.rb#10 - def message; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/changed_parameter.rb#8 -RuboCop::ConfigObsoletion::ChangedParameter::BASE_MESSAGE = T.let(T.unsafe(nil), String) - -# Base class for ConfigObsoletion rules relating to cops -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#7 -class RuboCop::ConfigObsoletion::CopRule < ::RuboCop::ConfigObsoletion::Rule - # @api private - # @return [CopRule] a new instance of CopRule - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#10 - def initialize(config, old_name); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#15 - def cop_rule?; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#19 - def message; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#8 - def old_name; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#28 - def violated?; end - - # Cop rules currently can only be failures, not warnings - # - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#24 - def warning?; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion.rb#7 -RuboCop::ConfigObsoletion::DEFAULT_RULES_FILE = T.let(T.unsafe(nil), String) - -# Encapsulation of a ConfigObsoletion rule for splitting a cop's -# functionality into multiple new cops. -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#8 -class RuboCop::ConfigObsoletion::ExtractedCop < ::RuboCop::ConfigObsoletion::CopRule - # @api private - # @return [ExtractedCop] a new instance of ExtractedCop - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#11 - def initialize(config, old_name, gem); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#9 - def department; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#9 - def gem; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#23 - def rule_message; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#17 - def violated?; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#32 - def affected_cops; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#41 - def plugin_loaded?; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion.rb#18 -RuboCop::ConfigObsoletion::LOAD_RULES_CACHE = T.let(T.unsafe(nil), Hash) - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion.rb#14 -RuboCop::ConfigObsoletion::PARAMETER_RULE_CLASSES = T.let(T.unsafe(nil), Hash) - -# Base class for ConfigObsoletion rules relating to parameters -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#7 -class RuboCop::ConfigObsoletion::ParameterRule < ::RuboCop::ConfigObsoletion::Rule - # @api private - # @return [ParameterRule] a new instance of ParameterRule - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#10 - def initialize(config, cop, parameter, metadata); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 - def cop; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 - def metadata; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 - def parameter; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#17 - def parameter_rule?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#21 - def violated?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#25 - def warning?; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#39 - def alternative; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#43 - def alternatives; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#31 - def applies_to_current_ruby_version?; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#47 - def reason; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#51 - def severity; end -end - -# Encapsulation of a ConfigObsoletion rule for removing -# a previously defined cop. -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#8 -class RuboCop::ConfigObsoletion::RemovedCop < ::RuboCop::ConfigObsoletion::CopRule - # @api private - # @return [RemovedCop] a new instance of RemovedCop - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#13 - def initialize(config, old_name, metadata); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#9 - def metadata; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#9 - def old_name; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#18 - def rule_message; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#36 - def alternatives; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#32 - def reason; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#11 -RuboCop::ConfigObsoletion::RemovedCop::BASE_MESSAGE = T.let(T.unsafe(nil), String) - -# Encapsulation of a ConfigObsoletion rule for renaming -# a cop or moving it to a new department. -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#8 -class RuboCop::ConfigObsoletion::RenamedCop < ::RuboCop::ConfigObsoletion::CopRule - # @api private - # @return [RenamedCop] a new instance of RenamedCop - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#11 - def initialize(config, old_name, name_or_hash); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#9 - def metadata; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#9 - def new_name; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#23 - def rule_message; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#27 - def warning?; end - - private - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#33 - def moved?; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#44 - def severity; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#40 - def verb; end -end - -# Abstract base class for ConfigObsoletion rules -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/rule.rb#7 -class RuboCop::ConfigObsoletion::Rule - # @api private - # @return [Rule] a new instance of Rule - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#8 - def initialize(config); end - - # Does this rule relate to cops? - # - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#13 - def cop_rule?; end - - # Does this rule relate to parameters? - # - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#18 - def parameter_rule?; end - - # @api private - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#22 - def violated?; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#28 - def config; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#36 - def smart_loaded_path; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#30 - def to_sentence(collection, connector: T.unsafe(nil)); end -end - -# Encapsulation of a ConfigObsoletion rule for splitting a cop's -# functionality into multiple new cops. -# -# @api private -# -# source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#8 -class RuboCop::ConfigObsoletion::SplitCop < ::RuboCop::ConfigObsoletion::CopRule - # @api private - # @return [SplitCop] a new instance of SplitCop - # - # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#11 - def initialize(config, old_name, metadata); end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#9 - def metadata; end - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#16 - def rule_message; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#22 - def alternatives; end -end - -# This class handles collecting the options for regenerating a TODO file. -# -# @api private -# -# source://rubocop//lib/rubocop/config_regeneration.rb#6 -class RuboCop::ConfigRegeneration - # Get options from the comment in the TODO file, and parse them as options - # - # @api private - # - # source://rubocop//lib/rubocop/config_regeneration.rb#12 - def options; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/config_regeneration.rb#29 - def generation_command; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/config_regeneration.rb#25 - def todo_exists?; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_regeneration.rb#7 -RuboCop::ConfigRegeneration::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/config_regeneration.rb#8 -RuboCop::ConfigRegeneration::COMMAND_REGEX = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/config_regeneration.rb#9 -RuboCop::ConfigRegeneration::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) - -# Handles caching of configurations and association of inspected -# ruby files to configurations. -# -# source://rubocop//lib/rubocop/config_store.rb#6 -class RuboCop::ConfigStore - # @return [ConfigStore] a new instance of ConfigStore - # - # source://rubocop//lib/rubocop/config_store.rb#10 - def initialize; end - - # If type (file/dir) is known beforehand, - # prefer using #for_file or #for_dir for improved performance - # - # source://rubocop//lib/rubocop/config_store.rb#52 - def for(file_or_dir); end - - # source://rubocop//lib/rubocop/config_store.rb#61 - def for_dir(dir); end - - # source://rubocop//lib/rubocop/config_store.rb#42 - def for_file(file); end - - # source://rubocop//lib/rubocop/config_store.rb#46 - def for_pwd; end - - # source://rubocop//lib/rubocop/config_store.rb#33 - def force_default_config!; end - - # source://rubocop//lib/rubocop/config_store.rb#28 - def options_config=(options_config); end - - # source://rubocop//lib/rubocop/config_store.rb#37 - def unvalidated; end - - # Returns the value of attribute validated. - # - # source://rubocop//lib/rubocop/config_store.rb#7 - def validated; end - - # Returns the value of attribute validated. - # - # source://rubocop//lib/rubocop/config_store.rb#7 - def validated?; end -end - -# Handles validation of configuration, for example cop names, parameter -# names, and Ruby versions. -# -# source://rubocop//lib/rubocop/config_validator.rb#7 -class RuboCop::ConfigValidator - extend ::RuboCop::SimpleForwardable - - # @return [ConfigValidator] a new instance of ConfigValidator - # - # source://rubocop//lib/rubocop/config_validator.rb#28 - def initialize(config); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def for_all_cops(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def smart_loaded_path(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/config_validator.rb#65 - def target_ruby_version; end - - # source://rubocop//lib/rubocop/config_validator.rb#34 - def validate; end - - # Validations that should only be run after all config resolving has - # taken place: - # * The target ruby version is only checked once the entire inheritance - # chain has been loaded so that only the final value is validated, and - # any obsolete but overridden values are ignored. - # - # source://rubocop//lib/rubocop/config_validator.rb#61 - def validate_after_resolution; end - - private - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#100 - def alert_about_unrecognized_cops(invalid_cop_names); end - - # source://rubocop//lib/rubocop/config_validator.rb#263 - def check_cop_config_value(hash, parent = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/config_validator.rb#73 - def check_obsoletions; end - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#80 - def check_target_ruby; end - - # source://rubocop//lib/rubocop/config_validator.rb#205 - def each_invalid_parameter(cop_name); end - - # source://rubocop//lib/rubocop/config_validator.rb#116 - def list_unknown_cops(invalid_cop_names); end - - # FIXME: Handling colors in exception messages like this is ugly. - # - # source://rubocop//lib/rubocop/config_validator.rb#284 - def param_error_message(parent, key, value, supposed_values); end - - # source://rubocop//lib/rubocop/config_validator.rb#252 - def reject_conflicting_safe_settings; end - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#243 - def reject_mutually_exclusive_defaults; end - - # source://rubocop//lib/rubocop/config_validator.rb#139 - def suggestion(name); end - - # Returns the value of attribute target_ruby. - # - # source://rubocop//lib/rubocop/config_validator.rb#71 - def target_ruby; end - - # source://rubocop//lib/rubocop/config_validator.rb#217 - def validate_enforced_styles(valid_cop_names); end - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#166 - def validate_new_cops_parameter; end - - # source://rubocop//lib/rubocop/config_validator.rb#191 - def validate_parameter_names(valid_cop_names); end - - # source://rubocop//lib/rubocop/config_validator.rb#177 - def validate_parameter_shape(valid_cop_names); end - - # source://rubocop//lib/rubocop/config_validator.rb#237 - def validate_support_and_has_list(name, formats, valid); end - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#155 - def validate_syntax_cop; end -end - -# @api private -# -# source://rubocop//lib/rubocop/config_validator.rb#11 -RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/config_validator.rb#23 -RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/config_validator.rb#22 -RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/config_validator.rb#21 -RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) - -# @api private -# -# source://rubocop//lib/rubocop/config_validator.rb#14 -RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/config_validator.rb#18 -RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/util.rb#4 -module RuboCop::Cop; end - -# This module checks for nodes that should be aligned to the left or right. -# This amount is determined by the instance variable @column_delta. -# -# source://rubocop//lib/rubocop/cop/mixin/alignment.rb#7 -module RuboCop::Cop::Alignment - private - - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#26 - def check_alignment(items, base_column = T.unsafe(nil)); end - - # Returns the value of attribute column_delta. - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#12 - def column_delta; end - - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#14 - def configured_indentation_width; end - - # @api public - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#58 - def display_column(range); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#45 - def each_bad_alignment(items, base_column); end - - # @deprecated Use processed_source.line_with_comment?(line) - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#69 - def end_of_line_comment(line); end - - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#18 - def indentation(node); end - - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#22 - def offset(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#78 - def register_offense(offense_node, message_node); end - - # @api public - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#64 - def within?(inner, outer); end -end - -# source://rubocop//lib/rubocop/cop/mixin/alignment.rb#8 -RuboCop::Cop::Alignment::SPACE = T.let(T.unsafe(nil), String) - -# This class does autocorrection of nodes that should just be moved to -# the left or to the right, amount being determined by the instance -# variable column_delta. -# -# source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#8 -class RuboCop::Cop::AlignmentCorrector - extend ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::Alignment - - class << self - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#29 - def align_end(corrector, processed_source, node, align_to); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#15 - def correct(corrector, processed_source, node, column_delta); end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#13 - def processed_source; end - - private - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#113 - def alignment_column(align_to); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#40 - def autocorrect_line(corrector, line_begin_pos, expr, column_delta, taboo_ranges); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#81 - def block_comment_within?(expr); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#87 - def calculate_range(expr, line_begin_pos, column_delta); end - - # Some special kinds of string literals are not composed of literal - # characters between two delimiters: - # - The source map of `?a` responds to :begin and :end but its end is - # nil. - # - The source map of `__FILE__` responds to neither :begin nor :end. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#75 - def delimited_string_literal?(node); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#99 - def each_line(expr); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#60 - def inside_string_range(node); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#54 - def inside_string_ranges(node); end - - # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#107 - def whitespace_range(node); end - end -end - -# This module encapsulates the ability to allow certain identifiers in a cop. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_identifiers.rb#6 -module RuboCop::Cop::AllowedIdentifiers - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_identifiers.rb#9 - def allowed_identifier?(name); end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_identifiers.rb#13 - def allowed_identifiers; end -end - -# if a variable starts with a sigil it will be removed -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_identifiers.rb#7 -RuboCop::Cop::AllowedIdentifiers::SIGILS = T.let(T.unsafe(nil), String) - -# This module encapsulates the ability to allow certain methods when -# parsing. Even if the code is in offense, if it contains methods -# that are allowed. This module is equivalent to the IgnoredMethods module, -# which will be deprecated in RuboCop 2.0. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#9 -module RuboCop::Cop::AllowedMethods - private - - # @api public - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#13 - def allowed_method?(name); end - - # @api public - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#27 - def allowed_methods; end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#35 - def cop_config_allowed_methods; end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#39 - def cop_config_deprecated_values; end - - # @deprecated Use allowed_method? instead - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#18 - def ignored_method?; end -end - -# This module encapsulates the ability to ignore certain lines when -# parsing. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#7 -module RuboCop::Cop::AllowedPattern - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#10 - def allowed_line?(line); end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#42 - def allowed_patterns; end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#58 - def cop_config_deprecated_methods_values; end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#52 - def cop_config_patterns_values; end - - # @deprecated Use allowed_line? instead - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#21 - def ignored_line?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#29 - def matches_allowed_pattern?(line); end - - # @deprecated Use matches_allowed_pattern? instead - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#34 - def matches_ignored_pattern?(line); end -end - -# This module encapsulates the ability to allow certain receivers in a cop. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_receivers.rb#6 -module RuboCop::Cop::AllowedReceivers - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/allowed_receivers.rb#7 - def allowed_receiver?(receiver); end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_receivers.rb#29 - def allowed_receivers; end - - # source://rubocop//lib/rubocop/cop/mixin/allowed_receivers.rb#13 - def receiver_name(receiver); end -end - -# Error raised when an unqualified cop name is used that could -# refer to two or more cops under different departments -# -# source://rubocop//lib/rubocop/cop/registry.rb#7 -class RuboCop::Cop::AmbiguousCopName < ::RuboCop::Error - # @return [AmbiguousCopName] a new instance of AmbiguousCopName - # - # source://rubocop//lib/rubocop/cop/registry.rb#11 - def initialize(name, origin, badges); end -end - -# source://rubocop//lib/rubocop/cop/registry.rb#8 -RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) - -# Representation of an annotation comment in source code (eg. `# TODO: blah blah blah`). -# -# source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#6 -class RuboCop::Cop::AnnotationComment - # @param comment [Parser::Source::Comment] - # @param keywords [Array] - # @return [AnnotationComment] a new instance of AnnotationComment - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#11 - def initialize(comment, keywords); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#17 - def annotation?; end - - # Returns the range bounds for just the annotation - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#29 - def bounds; end - - # Returns the value of attribute colon. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def colon; end - - # Returns the value of attribute comment. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def comment; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#21 - def correct?(colon:); end - - # Returns the value of attribute keyword. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def keyword; end - - # Returns the value of attribute margin. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def margin; end - - # Returns the value of attribute note. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def note; end - - # Returns the value of attribute space. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 - def space; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#65 - def just_keyword_of_sentence?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#61 - def keyword_appearance?; end - - # Returns the value of attribute keywords. - # - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#37 - def keywords; end - - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#51 - def regex; end - - # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#39 - def split_comment(comment); end -end - -# source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#48 -RuboCop::Cop::AnnotationComment::KEYWORDS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) - -# Handles the `MinSize` configuration option for array-based cops -# `Style/SymbolArray` and `Style/WordArray`, which check for use of the -# relevant percent literal syntax such as `%i[...]` and `%w[...]` -# -# source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#8 -module RuboCop::Cop::ArrayMinSize - private - - # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#19 - def array_style_detected(style, ary_size); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#11 - def below_array_length?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#38 - def largest_brackets_size(style, ary_size); end - - # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#15 - def min_size_config; end - - # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#48 - def smallest_percent_size(style, ary_size); end -end - -# Common code for ordinary arrays with [] that can be written with % -# syntax. -# -# source://rubocop//lib/rubocop/cop/mixin/array_syntax.rb#7 -module RuboCop::Cop::ArraySyntax - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/array_syntax.rb#10 - def bracketed_array_of?(element_type, node); end -end - -# extend this module to signal autocorrection support -# -# source://rubocop//lib/rubocop/cop/mixin/auto_corrector.rb#6 -module RuboCop::Cop::AutoCorrector - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/auto_corrector.rb#7 - def support_autocorrect?; end -end - -# This module encapsulates the logic for autocorrect behavior for a cop. -# -# source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#6 -module RuboCop::Cop::AutocorrectLogic - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#7 - def autocorrect?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#31 - def autocorrect_enabled?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#15 - def autocorrect_requested?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#11 - def autocorrect_with_disable_uncorrectable?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#19 - def correctable?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#23 - def disable_uncorrectable?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#27 - def safe_autocorrect?; end - - private - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#51 - def disable_offense(offense_range); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#135 - def disable_offense_at_end_of_line(range, eol_comment); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#139 - def disable_offense_before_and_after(range_by_lines); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#77 - def disable_offense_with_eol_or_surround_comment(range); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#96 - def heredoc_range(node); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#131 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63 - def multiline_ranges(offense_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#108 - def multiline_string?(node); end - - # Expand the given range to include all of any lines it covers. Does not - # include newline at end of the last line. - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#121 - def range_by_lines(range); end - - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#112 - def range_of_first_line(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#88 - def range_overlaps_offense?(offense_range, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#104 - def string_continuation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#92 - def surrounding_heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#100 - def surrounding_percent_array?(node); end -end - -# Identifier of all cops containing a department and cop name. -# -# All cops are identified by their badge. For example, the badge for -# `RuboCop::Cop::Layout::IndentationStyle` is `Layout/IndentationStyle`. -# Badges can be parsed as either `Department/CopName` or just `CopName` to -# allow for badge references in source files that omit the department for -# RuboCop to infer. -# -# source://rubocop//lib/rubocop/cop/badge.rb#12 -class RuboCop::Cop::Badge - # @return [Badge] a new instance of Badge - # - # source://rubocop//lib/rubocop/cop/badge.rb#34 - def initialize(class_name_parts); end - - # source://rubocop//lib/rubocop/cop/badge.rb#41 - def ==(other); end - - # Returns the value of attribute cop_name. - # - # source://rubocop//lib/rubocop/cop/badge.rb#13 - def cop_name; end - - # Returns the value of attribute department. - # - # source://rubocop//lib/rubocop/cop/badge.rb#13 - def department; end - - # Returns the value of attribute department_name. - # - # source://rubocop//lib/rubocop/cop/badge.rb#13 - def department_name; end - - # source://rubocop//lib/rubocop/cop/badge.rb#41 - def eql?(other); end - - # source://rubocop//lib/rubocop/cop/badge.rb#46 - def hash; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/badge.rb#51 - def match?(other); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/badge.rb#59 - def qualified?; end - - # source://rubocop//lib/rubocop/cop/badge.rb#55 - def to_s; end - - # source://rubocop//lib/rubocop/cop/badge.rb#63 - def with_department(department); end - - class << self - # source://rubocop//lib/rubocop/cop/badge.rb#27 - def camel_case(name_part); end - - # source://rubocop//lib/rubocop/cop/badge.rb#15 - def for(class_name); end - - # source://rubocop//lib/rubocop/cop/badge.rb#23 - def parse(identifier); end - end -end - -# A scaffold for concrete cops. -# -# The Cop::Base class is meant to be extended. -# -# Cops track offenses and can autocorrect them on the fly. -# -# A commissioner object is responsible for traversing the AST and invoking -# the specific callbacks on each cop. -# -# First the callback `on_new_investigation` is called; -# if a cop needs to do its own processing of the AST or depends on -# something else. -# -# Then callbacks like `on_def`, `on_send` (see AST::Traversal) are called -# with their respective nodes. -# -# Finally the callback `on_investigation_end` is called. -# -# Within these callbacks, cops are meant to call `add_offense` or -# `add_global_offense`. Use the `processed_source` method to -# get the currently processed source being investigated. -# -# In case of invalid syntax / unparsable content, -# the callback `on_other_file` is called instead of all the other -# `on_...` callbacks. -# -# Private methods are not meant for custom cops consumption, -# nor are any instance variables. -# -# source://rubocop//lib/rubocop/cop/base.rb#34 -class RuboCop::Cop::Base - include ::RuboCop::AST::Sexp - include ::RuboCop::PathUtil - include ::RuboCop::Cop::Util - include ::RuboCop::Cop::IgnoredNode - include ::RuboCop::Cop::AutocorrectLogic - extend ::RuboCop::AST::Sexp - extend ::RuboCop::AST::NodePattern::Macros - extend ::RuboCop::ExcludeLimit - - # @return [Base] a new instance of Base - # - # source://rubocop//lib/rubocop/cop/base.rb#156 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#278 - def active_support_extensions_enabled?; end - - # Adds an offense that has no particular location. - # No correction can be applied to global offenses - # - # source://rubocop//lib/rubocop/cop/base.rb#189 - def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end - - # Adds an offense on the specified range (or node with an expression) - # Unless that offense is disabled for this range, a corrector will be yielded - # to provide the cop the opportunity to autocorrect the offense. - # If message is not specified, the method `message` will be called. - # - # source://rubocop//lib/rubocop/cop/base.rb#201 - def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#357 - def always_autocorrect?; end - - # Called before any investigation - # - # @api private - # - # source://rubocop//lib/rubocop/cop/base.rb#343 - def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/base.rb#324 - def callbacks_needed; end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/cop/base.rb#43 - def config; end - - # source://rubocop//lib/rubocop/cop/base.rb#252 - def config_to_allow_offenses; end - - # source://rubocop//lib/rubocop/cop/base.rb#256 - def config_to_allow_offenses=(hash); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#363 - def contextual_autocorrect?; end - - # Configuration Helpers - # - # source://rubocop//lib/rubocop/cop/base.rb#246 - def cop_config; end - - # source://rubocop//lib/rubocop/cop/base.rb#238 - def cop_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#295 - def excluded_file?(file); end - - # This method should be overridden when a cop's behavior depends - # on state that lives outside of these locations: - # - # (1) the file under inspection - # (2) the cop's source code - # (3) the config (eg a .rubocop.yml file) - # - # For example, some cops may want to look at other parts of - # the codebase being inspected to find violations. A cop may - # use the presence or absence of file `foo.rb` to determine - # whether a certain violation exists in `bar.rb`. - # - # Overriding this method allows the cop to indicate to RuboCop's - # ResultCache system when those external dependencies change, - # ie when the ResultCache should be invalidated. - # - # source://rubocop//lib/rubocop/cop/base.rb#234 - def external_dependency_checksum; end - - # source://rubocop//lib/rubocop/cop/base.rb#367 - def inspect; end - - # Gets called if no message is specified when calling `add_offense` or - # `add_global_offense` - # Cops are discouraged to override this; instead pass your message directly - # - # source://rubocop//lib/rubocop/cop/base.rb#183 - def message(_range = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/base.rb#238 - def name; end - - # @deprecated Make potential errors with previous API more obvious - # - # source://rubocop//lib/rubocop/cop/base.rb#315 - def offenses; end - - # Called after all on_... have been called - # When refining this method, always call `super` - # - # source://rubocop//lib/rubocop/cop/base.rb#170 - def on_investigation_end; end - - # Called before all on_... have been called - # When refining this method, always call `super` - # - # source://rubocop//lib/rubocop/cop/base.rb#164 - def on_new_investigation; end - - # Called instead of all on_... callbacks for unrecognized files / syntax errors - # When refining this method, always call `super` - # - # source://rubocop//lib/rubocop/cop/base.rb#176 - def on_other_file; end - - # There should be very limited reasons for a Cop to do it's own parsing - # - # source://rubocop//lib/rubocop/cop/base.rb#300 - def parse(source, path = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/base.rb#270 - def parser_engine; end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/base.rb#43 - def processed_source; end - - # Called between investigations - # - # @api private - # - # source://rubocop//lib/rubocop/cop/base.rb#306 - def ready; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#286 - def relevant_file?(file); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#282 - def string_literals_frozen_by_default?; end - - # Returns a gems locked versions (i.e. from Gemfile.lock or gems.locked) - # - # source://rubocop//lib/rubocop/cop/base.rb#266 - def target_gem_version(gem_name); end - - # source://rubocop//lib/rubocop/cop/base.rb#274 - def target_rails_version; end - - # source://rubocop//lib/rubocop/cop/base.rb#260 - def target_ruby_version; end - - private - - # source://rubocop//lib/rubocop/cop/base.rb#485 - def annotate(message); end - - # source://rubocop//lib/rubocop/cop/base.rb#379 - def apply_correction(corrector); end - - # @return [Symbol] offense status - # - # source://rubocop//lib/rubocop/cop/base.rb#449 - def attempt_correction(range, corrector); end - - # Reserved for Cop::Cop - # - # source://rubocop//lib/rubocop/cop/base.rb#375 - def callback_argument(range); end - - # Called to complete an investigation - # - # source://rubocop//lib/rubocop/cop/base.rb#408 - def complete_investigation; end - - # @return [Symbol, Corrector] offense status - # - # source://rubocop//lib/rubocop/cop/base.rb#423 - def correct(range); end - - # source://rubocop//lib/rubocop/cop/base.rb#393 - def current_corrector; end - - # Reserved for Commissioner: - # - # source://rubocop//lib/rubocop/cop/base.rb#385 - def current_offense_locations; end - - # source://rubocop//lib/rubocop/cop/base.rb#397 - def current_offenses; end - - # source://rubocop//lib/rubocop/cop/base.rb#389 - def currently_disabled_lines; end - - # source://rubocop//lib/rubocop/cop/base.rb#513 - def custom_severity; end - - # source://rubocop//lib/rubocop/cop/base.rb#509 - def default_severity; end - - # source://rubocop//lib/rubocop/cop/base.rb#463 - def disable_uncorrectable(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#499 - def enabled_line?(line_number); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#491 - def file_name_matches_any?(file, parameter, default_result); end - - # source://rubocop//lib/rubocop/cop/base.rb#481 - def find_message(range, message); end - - # source://rubocop//lib/rubocop/cop/base.rb#505 - def find_severity(_range, severity); end - - # source://rubocop//lib/rubocop/cop/base.rb#526 - def range_for_original(range); end - - # source://rubocop//lib/rubocop/cop/base.rb#470 - def range_from_node_or_range(node_or_range); end - - # Actually private methods - # - # source://rubocop//lib/rubocop/cop/base.rb#418 - def reset_investigation; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#534 - def target_satisfies_all_gem_version_requirements?; end - - # @return [Symbol] offense status - # - # source://rubocop//lib/rubocop/cop/base.rb#438 - def use_corrector(range, corrector); end - - class << self - # List of cops that should not try to autocorrect at the same - # time as this cop - # - # @api public - # @return [Array] - # - # source://rubocop//lib/rubocop/cop/base.rb#59 - def autocorrect_incompatible_with; end - - # Naming - # - # source://rubocop//lib/rubocop/cop/base.rb#93 - def badge; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/base.rb#329 - def callbacks_needed; end - - # source://rubocop//lib/rubocop/cop/base.rb#97 - def cop_name; end - - # source://rubocop//lib/rubocop/cop/base.rb#101 - def department; end - - # Returns a url to view this cops documentation online. - # Requires 'DocumentationBaseURL' to be set for your department. - # Will follow the convention of RuboCops own documentation structure, - # overwrite this method to accommodate your custom layout. - # - # @api public - # @return [String, nil] - # - # source://rubocop//lib/rubocop/cop/base.rb#70 - def documentation_url(config = T.unsafe(nil)); end - - # Call for abstract Cop classes - # - # source://rubocop//lib/rubocop/cop/base.rb#81 - def exclude_from_registry; end - - # Returns the value of attribute gem_requirements. - # - # source://rubocop//lib/rubocop/cop/base.rb#138 - def gem_requirements; end - - # @private - # - # source://rubocop//lib/rubocop/cop/base.rb#74 - def inherited(subclass); end - - # Override and return the Force class(es) you need to join - # - # source://rubocop//lib/rubocop/cop/base.rb#118 - def joining_forces; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#105 - def lint?; end - - # Returns true if the cop name or the cop namespace matches any of the - # given names. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#111 - def match?(given_names); end - - # Register a version requirement for the given gem name. - # This cop will be skipped unless the target satisfies *all* requirements. - # - # @api public - # @param gem_name [String] - # @param version_requirements [Array] The version requirements, - # using the same syntax as a Gemfile, e.g. ">= 1.2.3" - # - # If omitted, any version of the gem will be accepted. - # - # https://guides.rubygems.org/patterns/#declaring-dependencies - # - # source://rubocop//lib/rubocop/cop/base.rb#151 - def requires_gem(gem_name, *version_requirements); end - - # Returns if class supports autocorrect. - # It is recommended to extend AutoCorrector instead of overriding - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#87 - def support_autocorrect?; end - - # Override if your cop should be called repeatedly for multiple investigations - # Between calls to `on_new_investigation` and `on_investigation_end`, - # the result of `processed_source` will remain constant. - # You should invalidate any caches that depend on the current `processed_source` - # in the `on_new_investigation` callback. - # If your cop does autocorrections, be aware that your instance may be called - # multiple times with the same `processed_source.path` but different content. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/base.rb#129 - def support_multiple_source?; end - - private - - # source://rubocop//lib/rubocop/cop/base.rb#401 - def restrict_on_send; end - end -end - -# source://rubocop//lib/rubocop/cop/base.rb#405 -RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) - -# Reports of an investigation. -# Immutable -# Consider creation API private -# -# source://rubocop//lib/rubocop/cop/base.rb#48 -class RuboCop::Cop::Base::InvestigationReport < ::Struct - # Returns the value of attribute cop - # - # @return [Object] the current value of cop - def cop; end - - # Sets the attribute cop - # - # @param value [Object] the value to set the attribute cop to. - # @return [Object] the newly set value - def cop=(_); end - - # Returns the value of attribute corrector - # - # @return [Object] the current value of corrector - def corrector; end - - # Sets the attribute corrector - # - # @param value [Object] the value to set the attribute corrector to. - # @return [Object] the newly set value - def corrector=(_); end - - # Returns the value of attribute offenses - # - # @return [Object] the current value of offenses - def offenses; end - - # Sets the attribute offenses - # - # @param value [Object] the value to set the attribute offenses to. - # @return [Object] the newly set value - def offenses=(_); end - - # Returns the value of attribute processed_source - # - # @return [Object] the current value of processed_source - def processed_source; end - - # Sets the attribute processed_source - # - # @param value [Object] the value to set the attribute processed_source to. - # @return [Object] the newly set value - def processed_source=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# List of methods names to restrict calls for `on_send` / `on_csend` -# -# source://rubocop//lib/rubocop/cop/base.rb#51 -RuboCop::Cop::Base::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#5 -module RuboCop::Cop::Bundler; end - -# A Gem's requirements should be listed only once in a Gemfile. -# -# @example -# # bad -# gem 'rubocop' -# gem 'rubocop' -# -# # bad -# group :development do -# gem 'rubocop' -# end -# -# group :test do -# gem 'rubocop' -# end -# -# # good -# group :development, :test do -# gem 'rubocop' -# end -# -# # good -# gem 'rubocop', groups: [:development, :test] -# -# # good - conditional declaration -# if Dir.exist?(local) -# gem 'rubocop', path: local -# elsif ENV['RUBOCOP_VERSION'] == 'master' -# gem 'rubocop', git: 'https://github.com/rubocop/rubocop.git' -# else -# gem 'rubocop', '~> 0.90.0' -# end -# -# source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#39 -class RuboCop::Cop::Bundler::DuplicatedGem < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#58 - def gem_declarations(param0); end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#45 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#67 - def conditional_declaration?(nodes); end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#60 - def duplicated_gem_nodes; end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#81 - def register_offense(node, gem_name, line_of_first_occurrence); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#75 - def within_conditional?(node, conditional_node); end -end - -# source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#42 -RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String) - -# A Gem group, or a set of groups, should be listed only once in a Gemfile. -# -# For example, if the values of `source`, `git`, `platforms`, or `path` -# surrounding `group` are different, no offense will be registered: -# -# [source,ruby] -# ----- -# platforms :ruby do -# group :default do -# gem 'openssl' -# end -# end -# -# platforms :jruby do -# group :default do -# gem 'jruby-openssl' -# end -# end -# ----- -# -# @example -# # bad -# group :development do -# gem 'rubocop' -# end -# -# group :development do -# gem 'rubocop-rails' -# end -# -# # bad (same set of groups declared twice) -# group :development, :test do -# gem 'rubocop' -# end -# -# group :test, :development do -# gem 'rspec' -# end -# -# # good -# group :development do -# gem 'rubocop' -# end -# -# group :development, :test do -# gem 'rspec' -# end -# -# # good -# gem 'rubocop', groups: [:development, :test] -# gem 'rspec', groups: [:development, :test] -# -# source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#58 -class RuboCop::Cop::Bundler::DuplicatedGroup < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#66 - def group_declarations(param0); end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#68 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#82 - def duplicated_group_nodes; end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#105 - def find_source_key(node); end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#115 - def group_attributes(node); end - - # source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#94 - def register_offense(node, group_name, line_of_first_occurrence); end -end - -# source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#61 -RuboCop::Cop::Bundler::DuplicatedGroup::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/duplicated_group.rb#63 -RuboCop::Cop::Bundler::DuplicatedGroup::SOURCE_BLOCK_NAMES = T.let(T.unsafe(nil), Array) - -# Each gem in the Gemfile should have a comment explaining -# its purpose in the project, or the reason for its version -# or source. -# -# The optional "OnlyFor" configuration array -# can be used to only register offenses when the gems -# use certain options or have version specifiers. -# -# When "version_specifiers" is included, a comment -# will be enforced if the gem has any version specifier. -# -# When "restrictive_version_specifiers" is included, a comment -# will be enforced if the gem has a version specifier that -# holds back the version of the gem. -# -# For any other value in the array, a comment will be enforced for -# a gem if an option by the same name is present. -# A useful use case is to enforce a comment when using -# options that change the source of a gem: -# -# - `bitbucket` -# - `gist` -# - `git` -# - `github` -# - `source` -# -# For a full list of options supported by bundler, -# see https://bundler.io/man/gemfile.5.html -# . -# -# @example OnlyFor: [] (default) -# # bad -# -# gem 'foo' -# -# # good -# -# # Helpers for the foo things. -# gem 'foo' -# @example OnlyFor: ['version_specifiers'] -# # bad -# -# gem 'foo', '< 2.1' -# -# # good -# -# # Version 2.1 introduces breaking change baz -# gem 'foo', '< 2.1' -# @example OnlyFor: ['restrictive_version_specifiers'] -# # bad -# -# gem 'foo', '< 2.1' -# -# # good -# -# gem 'foo', '>= 1.0' -# -# # Version 2.1 introduces breaking change baz -# gem 'foo', '< 2.1' -# @example OnlyFor: ['version_specifiers', 'github'] -# # bad -# -# gem 'foo', github: 'some_account/some_fork_of_foo' -# -# gem 'bar', '< 2.1' -# -# # good -# -# # Using this fork because baz -# gem 'foo', github: 'some_account/some_fork_of_foo' -# -# # Version 2.1 introduces breaking change baz -# gem 'bar', '< 2.1' -# -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#83 -class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::VisibilityHelp - include ::RuboCop::Cop::DefNode - include ::RuboCop::Cop::GemDeclaration - - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#94 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#135 - def checked_options_present?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#109 - def commented?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#105 - def commented_any_descendant?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#159 - def contains_checked_options?(node); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#163 - def gem_options(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#130 - def ignored_gem?(node); end - - # The args node1 & node2 may represent a RuboCop::AST::Node - # or a Parser::Source::Comment. Both respond to #loc. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#116 - def precede?(node1, node2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#126 - def preceding_comment?(node1, node2); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#120 - def preceding_lines(node); end - - # Version specifications that restrict all updates going forward. This excludes versions - # like ">= 1.0" or "!= 2.0.3". - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#152 - def restrictive_version_specified_gem?(node); end - - # Besides the gem name, all other *positional* arguments to `gem` are version specifiers, - # as long as it has one we know there's at least one version specifier. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#145 - def version_specified_gem?(node); end -end - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#88 -RuboCop::Cop::Bundler::GemComment::CHECKED_OPTIONS_CONFIG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#87 -RuboCop::Cop::Bundler::GemComment::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#91 -RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#90 -RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#92 -RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#89 -RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) - -# Verifies that a project contains Gemfile or gems.rb file and correct -# associated lock file based on the configuration. -# -# @example EnforcedStyle: Gemfile (default) -# # bad -# Project contains gems.rb and gems.locked files -# -# # bad -# Project contains Gemfile and gems.locked file -# -# # good -# Project contains Gemfile and Gemfile.lock -# @example EnforcedStyle: gems.rb -# # bad -# Project contains Gemfile and Gemfile.lock files -# -# # bad -# Project contains gems.rb and Gemfile.lock file -# -# # good -# Project contains gems.rb and gems.locked files -# -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#28 -class RuboCop::Cop::Bundler::GemFilename < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#42 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#87 - def expected_gemfile?(basename); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#79 - def gemfile_offense?(basename); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#92 - def gemfile_required?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#83 - def gems_rb_offense?(basename); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#96 - def gems_rb_required?; end - - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#57 - def register_gemfile_offense(file_path, basename); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#68 - def register_gems_rb_offense(file_path, basename); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#52 - def register_offense(file_path, basename); end -end - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#39 -RuboCop::Cop::Bundler::GemFilename::GEMFILE_FILES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#40 -RuboCop::Cop::Bundler::GemFilename::GEMS_RB_FILES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#35 -RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_MISMATCHED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#31 -RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_REQUIRED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#37 -RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_MISMATCHED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_filename.rb#33 -RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_REQUIRED = T.let(T.unsafe(nil), String) - -# Enforce that Gem version specifications or a commit reference (branch, -# ref, or tag) are either required or forbidden. -# -# @example EnforcedStyle: required (default) -# # bad -# gem 'rubocop' -# -# # good -# gem 'rubocop', '~> 1.12' -# -# # good -# gem 'rubocop', '>= 1.10.0' -# -# # good -# gem 'rubocop', '>= 1.5.0', '< 1.10.0' -# -# # good -# gem 'rubocop', branch: 'feature-branch' -# -# # good -# gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b' -# -# # good -# gem 'rubocop', tag: 'v1.17.0' -# @example EnforcedStyle: forbidden -# # good -# gem 'rubocop' -# -# # bad -# gem 'rubocop', '~> 1.12' -# -# # bad -# gem 'rubocop', '>= 1.10.0' -# -# # bad -# gem 'rubocop', '>= 1.5.0', '< 1.10.0' -# -# # bad -# gem 'rubocop', branch: 'feature-branch' -# -# # bad -# gem 'rubocop', ref: '74b5bfbb2c4b6fd6cdbbc7254bd7084b36e0c85b' -# -# # bad -# gem 'rubocop', tag: 'v1.17.0' -# -# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#53 -class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::GemDeclaration - - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#68 - def includes_commit_reference?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#63 - def includes_version_specification?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#72 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#86 - def allowed_gem?(node); end - - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#90 - def allowed_gems; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#112 - def forbidden_offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#118 - def forbidden_style?; end - - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#94 - def message(_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#102 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#106 - def required_offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#122 - def required_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#126 - def version_specification?(expression); end -end - -# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#58 -RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#57 -RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#59 -RuboCop::Cop::Bundler::GemVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/bundler/gem_version.rb#60 -RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) - -# Passing symbol arguments to `source` (e.g. `source :rubygems`) is -# deprecated because they default to using HTTP requests. Instead, specify -# `'https://rubygems.org'` if possible, or `'http://rubygems.org'` if not. -# -# When autocorrecting, this cop will replace symbol arguments with -# `'https://rubygems.org'`. -# -# This cop will not replace existing sources that use `http://`. This may -# be necessary where HTTPS is not available. For example, where using an -# internal gem server via an intranet, or where HTTPS is prohibited. -# However, you should strongly prefer `https://` where possible, as it is -# more secure. -# -# If you don't allow `http://`, please set `false` to `AllowHttpProtocol`. -# This option is `true` by default for safe autocorrection. -# -# @example -# # bad -# source :gemcutter -# source :rubygems -# source :rubyforge -# -# # good -# source 'https://rubygems.org' # strongly recommended -# @example AllowHttpProtocol: true (default) -# -# # good -# source 'http://rubygems.org' # use only if HTTPS is unavailable -# @example AllowHttpProtocol: false -# -# # bad -# source 'http://rubygems.org' -# -# source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#41 -class RuboCop::Cop::Bundler::InsecureProtocolSource < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#53 - def insecure_protocol_source?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#58 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#79 - def allow_http_protocol?; end -end - -# source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#44 -RuboCop::Cop::Bundler::InsecureProtocolSource::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#48 -RuboCop::Cop::Bundler::InsecureProtocolSource::MSG_HTTP_PROTOCOL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#50 -RuboCop::Cop::Bundler::InsecureProtocolSource::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Gems should be alphabetically sorted within groups. -# -# @example -# # bad -# gem 'rubocop' -# gem 'rspec' -# -# # good -# gem 'rspec' -# gem 'rubocop' -# -# # good -# gem 'rubocop' -# -# gem 'rspec' -# @example TreatCommentsAsGroupSeparators: true (default) -# # good -# # For code quality -# gem 'rubocop' -# # For tests -# gem 'rspec' -# @example TreatCommentsAsGroupSeparators: false -# # bad -# # For code quality -# gem 'rubocop' -# # For tests -# gem 'rspec' -# -# source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#35 -class RuboCop::Cop::Bundler::OrderedGems < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OrderedGemNode - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#64 - def gem_declarations(param0); end - - # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#43 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#57 - def previous_declaration(node); end -end - -# source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#39 -RuboCop::Cop::Bundler::OrderedGems::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for checking assignment nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#6 -module RuboCop::Cop::CheckAssignment - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#19 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#27 - def extract_rhs(node); end - - class << self - # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#27 - def extract_rhs(node); end - end -end - -# This mixin detects collections that are safe to "break" -# by inserting new lines. This is useful for breaking -# up long lines. -# -# Let's look at hashes as an example: -# -# We know hash keys are safe to break across lines. We can add -# linebreaks into hashes on lines longer than the specified maximum. -# Then in further passes cops can clean up the multi-line hash. -# For example, say the maximum line length is as indicated below: -# -# | -# v -# {foo: "0000000000", bar: "0000000000", baz: "0000000000"} -# -# In a LineLength autocorrection pass, a line is added before -# the first key that exceeds the column limit: -# -# {foo: "0000000000", bar: "0000000000", -# baz: "0000000000"} -# -# In a MultilineHashKeyLineBreaks pass, lines are inserted -# before all keys: -# -# {foo: "0000000000", -# bar: "0000000000", -# baz: "0000000000"} -# -# Then in future passes FirstHashElementLineBreak, -# MultilineHashBraceLayout, and TrailingCommaInHashLiteral will -# manipulate as well until we get: -# -# { -# foo: "0000000000", -# bar: "0000000000", -# baz: "0000000000", -# } -# -# (Note: Passes may not happen exactly in this sequence.) -# -# source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#44 -module RuboCop::Cop::CheckLineBreakable - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#45 - def extract_breakable_node(node, max); end - - private - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#202 - def all_on_same_line?(nodes); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#222 - def already_on_multiple_lines?(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#135 - def breakable_collection?(node, elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#228 - def chained_to_heredoc?(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#189 - def children_could_be_broken_up?(children); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#152 - def contained_by_breakable_collection_on_same_line?(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#172 - def contained_by_multiline_collection_that_could_be_broken_up?(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#62 - def extract_breakable_node_from_elements(node, elements, max); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#74 - def extract_first_element_over_column_limit(node, elements, max); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#94 - def first_argument_is_heredoc?(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#209 - def process_args(args); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#119 - def safe_to_ignore?(node); end - - # If a `send` or `csend` node contains a heredoc argument, splitting cannot happen - # after the heredoc or else it will cause a syntax error. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#103 - def shift_elements_for_heredoc_arg(node, elements, index); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#114 - def within_column_limit?(element, max, line); end -end - -# Checks for code on multiple lines that could be rewritten on a single line -# without changing semantics or exceeding the `Max` parameter of `Layout/LineLength`. -# -# source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#7 -module RuboCop::Cop::CheckSingleLineSuitability - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#8 - def suitable_as_single_line?(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#34 - def comment_within?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#30 - def max_line_length; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#42 - def safe_to_split?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#21 - def to_single_line(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/check_single_line_suitability.rb#16 - def too_long?(node); end -end - -# Common functionality for checking length of code segments. -# -# source://rubocop//lib/rubocop/cop/mixin/code_length.rb#6 -module RuboCop::Cop::CodeLength - extend ::RuboCop::ExcludeLimit - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#49 - def build_code_length_calculator(node); end - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#31 - def check_code_length(node); end - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#27 - def count_as_one; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#23 - def count_comments?; end - - # Returns true for lines that shall not be included in the count. - # - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#45 - def irrelevant_line(source_line); end - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#58 - def location(node); end - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#19 - def max_length; end - - # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#15 - def message(length, max_length); end -end - -# source://rubocop//lib/rubocop/cop/mixin/code_length.rb#9 -RuboCop::Cop::CodeLength::MSG = T.let(T.unsafe(nil), String) - -# Help methods for working with nodes containing comments. -# -# source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#6 -module RuboCop::Cop::CommentsHelp - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#27 - def comments_contain_disables?(node, cop_name); end - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#18 - def comments_in_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#14 - def contains_comments?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#7 - def source_range_with_comment(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#46 - def begin_pos_with_comment(node); end - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#60 - def buffer; end - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#41 - def end_position_for(node); end - - # Returns the end line of a node, which might be a comment and not part of the AST - # End line is considered either the line at which another node starts, or - # the line at which the parent node ends. - # - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#68 - def find_end_line(node); end - - # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#56 - def start_line_position(node); end -end - -# Commissioner class is responsible for processing the AST and delegating -# work to the specified cops. -# -# source://rubocop//lib/rubocop/cop/commissioner.rb#7 -class RuboCop::Cop::Commissioner - include ::RuboCop::AST::Traversal - - # @return [Commissioner] a new instance of Commissioner - # - # source://rubocop//lib/rubocop/cop/commissioner.rb#44 - def initialize(cops, forces = T.unsafe(nil), options = T.unsafe(nil)); end - - # Returns the value of attribute errors. - # - # source://rubocop//lib/rubocop/cop/commissioner.rb#42 - def errors; end - - # @return [InvestigationReport] - # - # source://rubocop//lib/rubocop/cop/commissioner.rb#79 - def investigate(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on___ENCODING__(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on___FILE__(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on___LINE__(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_alias(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_arg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_arg_expr(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_args(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_array_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_array_pattern_with_tail(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_back_ref(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_block_pass(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_blockarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_break(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_cbase(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_complex(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_const(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_const_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_cvar(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_defined?(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_dsym(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_eflipflop(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_empty_else(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_ensure(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_erange(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_false(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_find_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_float(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_forward_arg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_forward_args(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_forwarded_args(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_forwarded_kwrestarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_forwarded_restarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_gvar(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_hash_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_if_guard(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_iflipflop(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_in_match(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_in_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_index(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_indexasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_int(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_irange(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_ivar(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwargs(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwnilarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwoptarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwrestarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_kwsplat(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_lambda(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_lvar(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_alt(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_as(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_current_line(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_nil_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_pattern(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_pattern_p(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_rest(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_var(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_with_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_match_with_trailing_comma(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_mlhs(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_next(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_nil(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_not(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_nth_ref(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_optarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_pair(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_pin(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_postexe(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_preexe(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_procarg0(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_rational(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_redo(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_regexp(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_regopt(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_rescue(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_restarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_retry(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_return(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_self(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_shadowarg(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_splat(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_str(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_super(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_sym(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_true(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_undef(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_unless_guard(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_when(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_while_post(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_xstr(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_yield(node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#68 - def on_zsuper(node); end - - private - - # source://rubocop//lib/rubocop/cop/commissioner.rb#98 - def begin_investigation(processed_source, offset:, original:); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#121 - def build_callbacks(cops); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#116 - def initialize_callbacks; end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#159 - def invoke(callback, cops); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#163 - def invoke_with_argument(callback, cops, arg); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#112 - def reset; end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#131 - def restrict_callbacks(callbacks); end - - # NOTE: mutates `callbacks` in place - # - # source://rubocop//lib/rubocop/cop/commissioner.rb#149 - def restricted_map(callbacks); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#104 - def trigger_responding_cops(callback, node); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#139 - def trigger_restricted_cops(event, node); end - - # Allow blind rescues here, since we're absorbing and packaging or - # re-raising exceptions that can be raised from within the individual - # cops' `#investigate` methods. - # - # source://rubocop//lib/rubocop/cop/commissioner.rb#170 - def with_cop_error_handling(cop, node = T.unsafe(nil)); end -end - -# How a Commissioner returns the results of the investigation -# as a list of Cop::InvestigationReport and any errors caught -# during the investigation. -# Immutable -# Consider creation API private -# -# source://rubocop//lib/rubocop/cop/commissioner.rb#18 -class RuboCop::Cop::Commissioner::InvestigationReport < ::Struct - # Returns the value of attribute cop_reports - # - # @return [Object] the current value of cop_reports - def cop_reports; end - - # Sets the attribute cop_reports - # - # @param value [Object] the value to set the attribute cop_reports to. - # @return [Object] the newly set value - def cop_reports=(_); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#19 - def cops; end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#27 - def correctors; end - - # Returns the value of attribute errors - # - # @return [Object] the current value of errors - def errors; end - - # Sets the attribute errors - # - # @param value [Object] the value to set the attribute errors to. - # @return [Object] the newly set value - def errors=(_); end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#35 - def merge(investigation); end - - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#64 - def offenses; end - - # source://rubocop//lib/rubocop/cop/commissioner.rb#23 - def offenses_per_cop; end - - # Returns the value of attribute processed_source - # - # @return [Object] the current value of processed_source - def processed_source; end - - # Sets the attribute processed_source - # - # @param value [Object] the value to set the attribute processed_source to. - # @return [Object] the newly set value - def processed_source=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/cop/commissioner.rb#10 -RuboCop::Cop::Commissioner::RESTRICTED_CALLBACKS = T.let(T.unsafe(nil), Array) - -# This class does condition autocorrection -# -# source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#6 -class RuboCop::Cop::ConditionCorrector - class << self - # source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#8 - def correct_negative_condition(corrector, node); end - - private - - # source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#17 - def negated_condition(node); end - end -end - -# Handles `EnforcedStyle` configuration parameters. -# -# source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#6 -module RuboCop::Cop::ConfigurableEnforcedStyle - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#88 - def alternative_style; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#96 - def alternative_styles; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#19 - def ambiguous_style_detected(*possibilities); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#60 - def conflicting_styles_detected; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#11 - def correct_style_detected; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#64 - def detected_style; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#68 - def detected_style=(style); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#60 - def no_acceptable_style!; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#56 - def no_acceptable_style?; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#7 - def opposite_style_detected; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#79 - def style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#75 - def style_configured?; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#29 - def style_detected(detected); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#107 - def style_parameter_name; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#100 - def supported_styles; end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#15 - def unexpected_style_detected(unexpected); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#60 - def unrecognized_style_detected; end -end - -# source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#23 -RuboCop::Cop::ConfigurableEnforcedStyle::SYMBOL_TO_STRING_CACHE = T.let(T.unsafe(nil), Hash) - -# Shared functionality between mixins that enforce naming conventions -# -# source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#6 -module RuboCop::Cop::ConfigurableFormatting - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#9 - def check_name(node, name, name_range); end - - # A class emitter method is a singleton method in a class/module, where - # the method has the same name as a class defined in the class/module. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#30 - def class_emitter_method?(node, name); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#17 - def report_opposing_styles(node, name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#24 - def valid_name?(node, name, given_style = T.unsafe(nil)); end -end - -# Handles `Max` configuration parameters, especially setting them to an -# appropriate value with --auto-gen-config. -# -# @deprecated Use `exclude_limit ` instead. -# -# source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#8 -module RuboCop::Cop::ConfigurableMax - private - - # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#11 - def max=(value); end - - # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#23 - def max_parameter_name; end -end - -# This module provides functionality for checking if names match the -# configured EnforcedStyle. -# -# source://rubocop//lib/rubocop/cop/mixin/configurable_naming.rb#7 -module RuboCop::Cop::ConfigurableNaming - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::ConfigurableFormatting -end - -# source://rubocop//lib/rubocop/cop/mixin/configurable_naming.rb#10 -RuboCop::Cop::ConfigurableNaming::FORMATS = T.let(T.unsafe(nil), Hash) - -# This module provides functionality for checking if numbering match the -# configured EnforcedStyle. -# -# source://rubocop//lib/rubocop/cop/mixin/configurable_numbering.rb#7 -module RuboCop::Cop::ConfigurableNumbering - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::ConfigurableFormatting -end - -# source://rubocop//lib/rubocop/cop/mixin/configurable_numbering.rb#11 -RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash) - -# Monkey-patch Cop for tests to provide easy access to messages and -# highlights. -# -# source://rubocop//lib/rubocop/cop/cop.rb#11 -class RuboCop::Cop::Cop < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/cop.rb#73 - def add_offense(node_or_range, location: T.unsafe(nil), message: T.unsafe(nil), severity: T.unsafe(nil), &block); end - - # Called before any investigation - # - # @api private - # - # source://rubocop//lib/rubocop/cop/cop.rb#129 - def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end - - # @deprecated - # - # source://rubocop//lib/rubocop/cop/cop.rb#105 - def corrections; end - - # source://rubocop//lib/rubocop/cop/cop.rb#90 - def find_location(node, loc); end - - # Returns the value of attribute offenses. - # - # source://rubocop//lib/rubocop/cop/cop.rb#12 - def offenses; end - - # Called after all on_... have been called - # - # source://rubocop//lib/rubocop/cop/cop.rb#122 - def on_investigation_end; end - - # Called before all on_... have been called - # - # source://rubocop//lib/rubocop/cop/cop.rb#116 - def on_new_investigation; end - - # @deprecated Use class method - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/cop.rb#96 - def support_autocorrect?; end - - private - - # source://rubocop//lib/rubocop/cop/cop.rb#147 - def apply_correction(corrector); end - - # Override Base - # - # source://rubocop//lib/rubocop/cop/cop.rb#143 - def callback_argument(_range); end - - # source://rubocop//lib/rubocop/cop/cop.rb#164 - def correction_lambda; end - - # source://rubocop//lib/rubocop/cop/cop.rb#170 - def dedupe_on_node(node); end - - # Just for legacy - # - # @yield [corrector] - # - # source://rubocop//lib/rubocop/cop/cop.rb#152 - def emulate_v0_callsequence(corrector); end - - # source://rubocop//lib/rubocop/cop/cop.rb#183 - def range_for_original(range); end - - # source://rubocop//lib/rubocop/cop/cop.rb#177 - def suppress_clobbering; end - - class << self - # @deprecated Use Registry.all - # - # source://rubocop//lib/rubocop/cop/cop.rb#56 - def all; end - - # @private - # - # source://rubocop//lib/rubocop/cop/cop.rb#25 - def inherited(_subclass); end - - # source://rubocop//lib/rubocop/cop/cop.rb#37 - def joining_forces; end - - # @deprecated Use Registry.qualified_cop_name - # - # source://rubocop//lib/rubocop/cop/cop.rb#65 - def qualified_cop_name(name, origin); end - - # @deprecated Use Registry.global - # - # source://rubocop//lib/rubocop/cop/cop.rb#47 - def registry; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/cop.rb#33 - def support_autocorrect?; end - end -end - -# @deprecated -# -# source://rubocop//lib/rubocop/cop/cop.rb#17 -class RuboCop::Cop::Cop::Correction < ::Struct - # source://rubocop//lib/rubocop/cop/cop.rb#18 - def call(corrector); end - - # Returns the value of attribute cop - # - # @return [Object] the current value of cop - def cop; end - - # Sets the attribute cop - # - # @param value [Object] the value to set the attribute cop to. - # @return [Object] the newly set value - def cop=(_); end - - # Returns the value of attribute lambda - # - # @return [Object] the current value of lambda - def lambda; end - - # Sets the attribute lambda - # - # @param value [Object] the value to set the attribute lambda to. - # @return [Object] the newly set value - def lambda=(_); end - - # Returns the value of attribute node - # - # @return [Object] the current value of node - def node; end - - # Sets the attribute node - # - # @param value [Object] the value to set the attribute node to. - # @return [Object] the newly set value - def node=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# This class takes a source buffer and rewrite its source -# based on the different correction rules supplied. -# -# Important! -# The nodes modified by the corrections should be part of the -# AST of the source_buffer. -# -# source://rubocop//lib/rubocop/cop/corrector.rb#11 -class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter - # corrector = Corrector.new(cop) - # - # @param source [Parser::Source::Buffer, or anything - # leading to one via `(processed_source.)buffer`] - # @return [Corrector] a new instance of Corrector - # - # source://rubocop//lib/rubocop/cop/corrector.rb#32 - def initialize(source); end - - # Removes `size` characters from the beginning of the given range. - # If `size` is greater than the size of `range`, the removed region can - # overrun the end of `range`. - # - # @param range [Parser::Source::Range, RuboCop::AST::Node] or node - # @param size [Integer] - # - # source://rubocop//lib/rubocop/cop/corrector.rb#63 - def remove_leading(node_or_range, size); end - - # Removes `size` characters prior to the source range. - # - # @param range [Parser::Source::Range, RuboCop::AST::Node] or node - # @param size [Integer] - # - # source://rubocop//lib/rubocop/cop/corrector.rb#51 - def remove_preceding(node_or_range, size); end - - # Removes `size` characters from the end of the given range. - # If `size` is greater than the size of `range`, the removed region can - # overrun the beginning of `range`. - # - # @param range [Parser::Source::Range, RuboCop::AST::Node] or node - # @param size [Integer] - # - # source://rubocop//lib/rubocop/cop/corrector.rb#75 - def remove_trailing(node_or_range, size); end - - # Legacy - # - # source://parser/3.3.8.0/lib/parser/source/tree_rewriter.rb#252 - def rewrite; end - - # Swaps sources at the given ranges. - # - # @param node_or_range1 [Parser::Source::Range, RuboCop::AST::Node] - # @param node_or_range2 [Parser::Source::Range, RuboCop::AST::Node] - # - # source://rubocop//lib/rubocop/cop/corrector.rb#85 - def swap(node_or_range1, node_or_range2); end - - private - - # source://rubocop//lib/rubocop/cop/corrector.rb#119 - def check_range_validity(node_or_range); end - - # source://rubocop//lib/rubocop/cop/corrector.rb#104 - def to_range(node_or_range); end - - # source://rubocop//lib/rubocop/cop/corrector.rb#123 - def validate_buffer(buffer); end - - class << self - # Duck typing for get to a ::Parser::Source::Buffer - # - # source://rubocop//lib/rubocop/cop/corrector.rb#15 - def source_buffer(source); end - end -end - -# noop -# -# source://rubocop//lib/rubocop/cop/corrector.rb#12 -RuboCop::Cop::Corrector::NOOP_CONSUMER = T.let(T.unsafe(nil), Proc) - -# Common functionality for checking def nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/def_node.rb#6 -module RuboCop::Cop::DefNode - include ::RuboCop::Cop::VisibilityHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#21 - def non_public_modifier?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#12 - def non_public?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#16 - def preceding_non_public_modifier?(node); end -end - -# Help methods for working with `Enumerable#dig` in cops. -# Used by `Style::DigChain` and `Style::SingleArgumentDig` -# -# source://rubocop//lib/rubocop/cop/mixin/dig_help.rb#7 -module RuboCop::Cop::DigHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/dig_help.rb#11 - def dig?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/dig_help.rb#16 - def single_argument_dig?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/dig_help.rb#22 - def dig_chain_enabled?; end -end - -# Helpers for builtin documentation -# -# source://rubocop//lib/rubocop/cop/documentation.rb#6 -module RuboCop::Cop::Documentation - private - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#25 - def base_url_for(cop_class, config); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#57 - def builtin?(cop_class); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#47 - def default_base_url; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#52 - def default_extension; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#10 - def department_to_basename(department); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#36 - def extension_for(cop_class, config); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#15 - def url_for(cop_class, config = T.unsafe(nil)); end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#25 - def base_url_for(cop_class, config); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/documentation.rb#57 - def builtin?(cop_class); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#47 - def default_base_url; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#52 - def default_extension; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#10 - def department_to_basename(department); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#36 - def extension_for(cop_class, config); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/documentation.rb#15 - def url_for(cop_class, config = T.unsafe(nil)); end - end -end - -# Common functionality for checking documentation. -# -# source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#6 -module RuboCop::Cop::DocumentationComment - extend ::RuboCop::AST::NodePattern::Macros - - private - - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#47 - def annotation_keywords; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#11 - def documentation_comment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#39 - def interpreter_directive_comment?(comment); end - - # The args node1 & node2 may represent a RuboCop::AST::Node - # or a Parser::Source::Comment. Both respond to #loc. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#31 - def precede?(node1, node2); end - - # The args node1 & node2 may represent a RuboCop::AST::Node - # or a Parser::Source::Comment. Both respond to #loc. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#25 - def preceding_comment?(node1, node2); end - - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#35 - def preceding_lines(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#43 - def rubocop_directive_comment?(comment); end -end - -# Common functionality for dealing with duplication. -# -# source://rubocop//lib/rubocop/cop/mixin/duplication.rb#6 -module RuboCop::Cop::Duplication - private - - # Returns the consecutive duplicates, leaving out the first instance of - # the duplicated elements. - # - # @param collection [Array] an array to return consecutive duplicates for - # @return [Array] the consecutive duplicates - # - # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#31 - def consecutive_duplicates(collection); end - - # Returns all duplicates, including the first instance of the duplicated - # elements. - # - # @param collection [Array] an array to return duplicates for - # @return [Array] all the duplicates - # - # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#22 - def duplicates(collection); end - - # Whether the `collection` contains any duplicates. - # - # @param collection [Array] an array to check for duplicates - # @return [Boolean] whether the array contains any duplicates - # - # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#13 - def duplicates?(collection); end - - # Returns a hash of grouped duplicates. The key will be the first - # instance of the element, and the value an `array` of the initial - # element and all duplicate instances. - # - # @param collection [Array] an array to group duplicates for - # @return [Array] the grouped duplicates - # - # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#41 - def grouped_duplicates(collection); end -end - -# This class autocorrects `#each` enumeration to `for` iteration. -# -# source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#6 -class RuboCop::Cop::EachToForCorrector - extend ::RuboCop::AST::NodePattern::Macros - - # @return [EachToForCorrector] a new instance of EachToForCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#12 - def initialize(block_node); end - - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#18 - def call(corrector); end - - private - - # Returns the value of attribute argument_node. - # - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#24 - def argument_node; end - - # Returns the value of attribute block_node. - # - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#24 - def block_node; end - - # Returns the value of attribute collection_node. - # - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#24 - def collection_node; end - - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#26 - def correction; end - - # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#36 - def offending_range; end -end - -# source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#10 -RuboCop::Cop::EachToForCorrector::CORRECTION_WITHOUT_ARGUMENTS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#9 -RuboCop::Cop::EachToForCorrector::CORRECTION_WITH_ARGUMENTS = T.let(T.unsafe(nil), String) - -# This class does empty line autocorrection -# -# source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#6 -class RuboCop::Cop::EmptyLineCorrector - class << self - # source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#8 - def correct(corrector, node); end - - # source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#19 - def insert_before(corrector, node); end - end -end - -# Common code for empty parameter cops. -# -# source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#6 -module RuboCop::Cop::EmptyParameter - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#12 - def empty_arguments?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#16 - def check(node); end -end - -# Functions for checking the alignment of the `end` keyword. -# -# source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#6 -module RuboCop::Cop::EndKeywordAlignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#60 - def accept_end_kw_alignment?(end_loc); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#50 - def add_offense_for_misalignment(node, align_with); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#19 - def check_end_kw_alignment(node, align_ranges); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#15 - def check_end_kw_in_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#75 - def line_break_before_keyword?(whole_expression, rhs); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#35 - def matching_ranges(end_loc, align_ranges); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#41 - def start_line_range(node); end - - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#65 - def style_parameter_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#69 - def variable_alignment?(whole_expression, rhs, end_alignment_style); end -end - -# source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#10 -RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for rewriting endless methods to normal method definitions -# -# source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#6 -module RuboCop::Cop::EndlessMethodRewriter - # source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#7 - def correct_to_multiline(corrector, node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/endless_method_rewriter.rb#19 - def arguments(node, missing = T.unsafe(nil)); end -end - -# Common functionality for enforcing a specific superclass. -# -# IMPORTANT: RuboCop core depended on this module when it supported Rails department. -# Rails department has been extracted to RuboCop Rails gem. -# -# It will not be updated to `RuboCop::Cop::Base` v1 API to maintain compatibility -# with existing RuboCop Rails 2.8 or lower. -# -# @api private -# @deprecated This module is deprecated and will be removed by RuboCop 2.0. -# -# source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#15 -module RuboCop::Cop::EnforceSuperclass - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#35 - def on_class(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#39 - def on_send(node); end - - class << self - # @api private - # @private - # - # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#16 - def included(base); end - end -end - -# Common functionality for checking for a line break before the first -# element in a multi-line collection. -# -# source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#7 -module RuboCop::Cop::FirstElementLineBreak - private - - # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#23 - def check_children_line_break(node, children, start = T.unsafe(nil), ignore_last: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#10 - def check_method_line_break(node, children, ignore_last: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#37 - def first_by_line(nodes); end - - # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#41 - def last_line(nodes, ignore_last:); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#18 - def method_uses_parens?(node, limit); end -end - -# This class autocorrects `for` iteration to `#each` enumeration. -# -# source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#6 -class RuboCop::Cop::ForToEachCorrector - extend ::RuboCop::AST::NodePattern::Macros - - # @return [ForToEachCorrector] a new instance of ForToEachCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#11 - def initialize(for_node); end - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#17 - def call(corrector); end - - private - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#57 - def collection_end; end - - # Returns the value of attribute collection_node. - # - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#25 - def collection_node; end - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#31 - def collection_source; end - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#27 - def correction; end - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#45 - def end_range; end - - # Returns the value of attribute for_node. - # - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#25 - def for_node; end - - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#53 - def keyword_begin; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#39 - def requires_parentheses?; end - - # Returns the value of attribute variable_node. - # - # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#25 - def variable_node; end -end - -# source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#9 -RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String) - -# This module encapsulates the ability to forbid certain identifiers in a cop. -# -# source://rubocop//lib/rubocop/cop/mixin/forbidden_identifiers.rb#6 -module RuboCop::Cop::ForbiddenIdentifiers - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/forbidden_identifiers.rb#9 - def forbidden_identifier?(name); end - - # source://rubocop//lib/rubocop/cop/mixin/forbidden_identifiers.rb#15 - def forbidden_identifiers; end -end - -# if a variable starts with a sigil it will be removed -# -# source://rubocop//lib/rubocop/cop/mixin/forbidden_identifiers.rb#7 -RuboCop::Cop::ForbiddenIdentifiers::SIGILS = T.let(T.unsafe(nil), String) - -# This module encapsulates the ability to forbid certain patterns in a cop. -# -# source://rubocop//lib/rubocop/cop/mixin/forbidden_pattern.rb#6 -module RuboCop::Cop::ForbiddenPattern - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/forbidden_pattern.rb#7 - def forbidden_pattern?(name); end - - # source://rubocop//lib/rubocop/cop/mixin/forbidden_pattern.rb#11 - def forbidden_patterns; end -end - -# A scaffold for concrete forces. -# -# source://rubocop//lib/rubocop/cop/force.rb#6 -class RuboCop::Cop::Force - # @return [Force] a new instance of Force - # - # source://rubocop//lib/rubocop/cop/force.rb#32 - def initialize(cops); end - - # Returns the value of attribute cops. - # - # source://rubocop//lib/rubocop/cop/force.rb#17 - def cops; end - - # source://rubocop//lib/rubocop/cop/force.rb#50 - def investigate(_processed_source); end - - # source://rubocop//lib/rubocop/cop/force.rb#36 - def name; end - - # source://rubocop//lib/rubocop/cop/force.rb#40 - def run_hook(method_name, *args); end - - class << self - # source://rubocop//lib/rubocop/cop/force.rb#19 - def all; end - - # source://rubocop//lib/rubocop/cop/force.rb#28 - def force_name; end - - # @private - # - # source://rubocop//lib/rubocop/cop/force.rb#23 - def inherited(subclass); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/force.rb#8 -class RuboCop::Cop::Force::HookError < ::StandardError - # @api private - # @return [HookError] a new instance of HookError - # - # source://rubocop//lib/rubocop/cop/force.rb#11 - def initialize(joining_cop); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/force.rb#9 - def joining_cop; end -end - -# Common functionality for dealing with frozen string literals. -# -# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#6 -module RuboCop::Cop::FrozenStringLiteral - private - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#36 - def frozen_heredoc?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#20 - def frozen_string_literal?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#14 - def frozen_string_literal_comment_exists?; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#77 - def frozen_string_literal_specified?; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#71 - def frozen_string_literals_disabled?; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#43 - def frozen_string_literals_enabled?; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#87 - def leading_comment_lines; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#83 - def leading_magic_comments; end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#36 - def uninterpolated_heredoc?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#30 - def uninterpolated_string?(node); end - - class << self - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#14 - def frozen_string_literal_comment_exists?; end - end -end - -# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#9 -RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#10 -RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES_RUBY27 = T.let(T.unsafe(nil), Array) - -# Common functionality for checking gem declarations. -# -# source://rubocop//lib/rubocop/cop/mixin/gem_declaration.rb#6 -module RuboCop::Cop::GemDeclaration - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/gem_declaration.rb#10 - def gem_declaration?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#5 -module RuboCop::Cop::Gemspec; end - -# Prefer `add_dependency` over `add_runtime_dependency` as the latter is -# considered soft-deprecated. -# -# @example -# -# # bad -# Gem::Specification.new do |spec| -# spec.add_runtime_dependency('rubocop') -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_dependency('rubocop') -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#21 -class RuboCop::Cop::Gemspec::AddRuntimeDependency < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#28 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#24 -RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/add_runtime_dependency.rb#26 -RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforce that gem dependency version specifications or a commit reference (branch, -# ref, or tag) are either required or forbidden. -# -# @example EnforcedStyle: required (default) -# -# # bad -# Gem::Specification.new do |spec| -# spec.add_dependency 'parser' -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.add_development_dependency 'parser' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0' -# end -# @example EnforcedStyle: forbidden -# -# # bad -# Gem::Specification.new do |spec| -# spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0' -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_dependency 'parser' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_development_dependency 'parser' -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#53 -class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::GemspecHelp - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#67 - def add_dependency_method_declaration?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#78 - def includes_commit_reference?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#73 - def includes_version_specification?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#82 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#118 - def add_dependency_method?(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#96 - def allowed_gem?(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#100 - def allowed_gems; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#132 - def forbidden_offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#138 - def forbidden_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#112 - def match_block_variable_name?(receiver_name); end - - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#104 - def message(_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#122 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#126 - def required_offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#142 - def required_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#146 - def version_specification?(expression); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#61 -RuboCop::Cop::Gemspec::DependencyVersion::ADD_DEPENDENCY_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#58 -RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#57 -RuboCop::Cop::Gemspec::DependencyVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#64 -RuboCop::Cop::Gemspec::DependencyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/gemspec/dependency_version.rb#59 -RuboCop::Cop::Gemspec::DependencyVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) - -# Checks that deprecated attributes are not set in a gemspec file. -# Removing deprecated attributes allows the user to receive smaller packed gems. -# -# @example -# -# # bad -# Gem::Specification.new do |spec| -# spec.name = 'your_cool_gem_name' -# spec.test_files = Dir.glob('test/**/*') -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.name = 'your_cool_gem_name' -# spec.test_files += Dir.glob('test/**/*') -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.name = 'your_cool_gem_name' -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#28 -class RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#35 - def gem_specification(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#43 - def on_block(block_node); end - - private - - # source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#85 - def format_message_from; end - - # source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#63 - def node_and_method_name(node, attribute); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#71 - def use_deprecated_attributes?(node, block_parameter); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb#32 -RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment::MSG = T.let(T.unsafe(nil), String) - -# Enforce that development dependencies for a gem are specified in -# `Gemfile`, rather than in the `gemspec` using -# `add_development_dependency`. Alternatively, using `EnforcedStyle: -# gemspec`, enforce that all dependencies are specified in `gemspec`, -# rather than in `Gemfile`. -# -# @example EnforcedStyle: Gemfile (default) -# # Specify runtime dependencies in your gemspec, -# # but all other dependencies in your Gemfile. -# -# # bad -# # example.gemspec -# s.add_development_dependency "foo" -# -# # good -# # Gemfile -# gem "foo" -# -# # good -# # gems.rb -# gem "foo" -# -# # good (with AllowedGems: ["bar"]) -# # example.gemspec -# s.add_development_dependency "bar" -# @example EnforcedStyle: gems.rb -# # Specify runtime dependencies in your gemspec, -# # but all other dependencies in your Gemfile. -# # -# # Identical to `EnforcedStyle: Gemfile`, but with a different error message. -# # Rely on Bundler/GemFilename to enforce the use of `Gemfile` vs `gems.rb`. -# -# # bad -# # example.gemspec -# s.add_development_dependency "foo" -# -# # good -# # Gemfile -# gem "foo" -# -# # good -# # gems.rb -# gem "foo" -# -# # good (with AllowedGems: ["bar"]) -# # example.gemspec -# s.add_development_dependency "bar" -# @example EnforcedStyle: gemspec -# # Specify all dependencies in your gemspec. -# -# # bad -# # Gemfile -# gem "foo" -# -# # good -# # example.gemspec -# s.add_development_dependency "foo" -# -# # good (with AllowedGems: ["bar"]) -# # Gemfile -# gem "bar" -# -# source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#70 -class RuboCop::Cop::Gemspec::DevelopmentDependencies < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - # source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#77 - def add_development_dependency?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#82 - def gem?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#86 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#97 - def forbidden_gem?(gem_name); end - - # source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#101 - def message(_range); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#73 -RuboCop::Cop::Gemspec::DevelopmentDependencies::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/development_dependencies.rb#74 -RuboCop::Cop::Gemspec::DevelopmentDependencies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# An attribute assignment method calls should be listed only once -# in a gemspec. -# -# Assigning to an attribute with the same name using `spec.foo =` will be -# an unintended usage. On the other hand, duplication of methods such -# as `spec.requirements`, `spec.add_runtime_dependency`, and others are -# permitted because it is the intended use of appending values. -# -# @example -# # bad -# Gem::Specification.new do |spec| -# spec.name = 'rubocop' -# spec.name = 'rubocop2' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.name = 'rubocop' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.requirements << 'libmagick, v6.0' -# spec.requirements << 'A good graphics card' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_dependency('parallel', '~> 1.10') -# spec.add_dependency('parser', '>= 2.3.3.1', '< 3.0') -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#37 -class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::GemspecHelp - - # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#45 - def assignment_method_declarations(param0); end - - # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#50 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#68 - def duplicated_assignment_method_nodes; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#62 - def match_block_variable_name?(receiver_name); end - - # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#76 - def register_offense(node, assignment, line_of_first_occurrence); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#41 -RuboCop::Cop::Gemspec::DuplicatedAssignment::MSG = T.let(T.unsafe(nil), String) - -# Dependencies in the gemspec should be alphabetically sorted. -# -# @example -# # bad -# spec.add_dependency 'rubocop' -# spec.add_dependency 'rspec' -# -# # good -# spec.add_dependency 'rspec' -# spec.add_dependency 'rubocop' -# -# # good -# spec.add_dependency 'rubocop' -# -# spec.add_dependency 'rspec' -# -# # bad -# spec.add_development_dependency 'rubocop' -# spec.add_development_dependency 'rspec' -# -# # good -# spec.add_development_dependency 'rspec' -# spec.add_development_dependency 'rubocop' -# -# # good -# spec.add_development_dependency 'rubocop' -# -# spec.add_development_dependency 'rspec' -# -# # bad -# spec.add_runtime_dependency 'rubocop' -# spec.add_runtime_dependency 'rspec' -# -# # good -# spec.add_runtime_dependency 'rspec' -# spec.add_runtime_dependency 'rubocop' -# -# # good -# spec.add_runtime_dependency 'rubocop' -# -# spec.add_runtime_dependency 'rspec' -# @example TreatCommentsAsGroupSeparators: true (default) -# # good -# # For code quality -# spec.add_dependency 'rubocop' -# # For tests -# spec.add_dependency 'rspec' -# @example TreatCommentsAsGroupSeparators: false -# # bad -# # For code quality -# spec.add_dependency 'rubocop' -# # For tests -# spec.add_dependency 'rspec' -# -# source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#61 -class RuboCop::Cop::Gemspec::OrderedDependencies < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OrderedGemNode - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#95 - def dependency_declarations(param0); end - - # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#69 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#90 - def get_dependency_name(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#84 - def previous_declaration(node); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#65 -RuboCop::Cop::Gemspec::OrderedDependencies::MSG = T.let(T.unsafe(nil), String) - -# Requires a gemspec to have `rubygems_mfa_required` metadata set. -# -# This setting tells RubyGems that MFA (Multi-Factor Authentication) is -# required for accounts to be able perform privileged operations, such as -# (see RubyGems' documentation for the full list of privileged -# operations): -# -# * `gem push` -# * `gem yank` -# * `gem owner --add/remove` -# * adding or removing owners using gem ownership page -# -# This helps make your gem more secure, as users can be more -# confident that gem updates were pushed by maintainers. -# -# @example -# # bad -# Gem::Specification.new do |spec| -# # no `rubygems_mfa_required` metadata specified -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.metadata = { -# 'rubygems_mfa_required' => 'true' -# } -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.metadata['rubygems_mfa_required'] = 'true' -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.metadata = { -# 'rubygems_mfa_required' => 'false' -# } -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.metadata = { -# 'rubygems_mfa_required' => 'true' -# } -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.metadata['rubygems_mfa_required'] = 'false' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.metadata['rubygems_mfa_required'] = 'true' -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#63 -class RuboCop::Cop::Gemspec::RequireMFA < ::RuboCop::Cop::Base - include ::RuboCop::Cop::GemspecHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#70 - def metadata(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#87 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#78 - def rubygems_mfa_required(param0); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#83 - def true_string?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#115 - def autocorrect(corrector, node, block_var, metadata); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#139 - def change_value(corrector, value); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#125 - def correct_metadata(corrector, metadata); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#133 - def insert_mfa_required(corrector, node, block_var); end - - # source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#108 - def mfa_value(metadata_value); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/require_mfa.rb#67 -RuboCop::Cop::Gemspec::RequireMFA::MSG = T.let(T.unsafe(nil), String) - -# Checks that `required_ruby_version` in a gemspec file is set to a valid -# value (non-blank) and matches `TargetRubyVersion` as set in RuboCop's -# configuration for the gem. -# -# This ensures that RuboCop is using the same Ruby version as the gem. -# -# @example -# # When `TargetRubyVersion` of .rubocop.yml is `2.5`. -# -# # bad -# Gem::Specification.new do |spec| -# # no `required_ruby_version` specified -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '>= 2.4.0' -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '>= 2.6.0' -# end -# -# # bad -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '>= 2.5.0' -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '>= 2.5' -# end -# -# # accepted but not recommended -# Gem::Specification.new do |spec| -# spec.required_ruby_version = ['>= 2.5.0', '< 2.7.0'] -# end -# -# # accepted but not recommended, since -# # Ruby does not really follow semantic versioning -# Gem::Specification.new do |spec| -# spec.required_ruby_version = '~> 2.5' -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#55 -class RuboCop::Cop::Gemspec::RequiredRubyVersion < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#68 - def defined_ruby_version(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#76 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#82 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#63 - def required_ruby_version?(param0); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#94 - def dynamic_version?(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#100 - def extract_ruby_version(required_ruby_version); end - - # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#118 - def not_equal_message(required_ruby_version, target_ruby_version); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#60 -RuboCop::Cop::Gemspec::RequiredRubyVersion::MISSING_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#57 -RuboCop::Cop::Gemspec::RequiredRubyVersion::NOT_EQUAL_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#56 -RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks that `RUBY_VERSION` constant is not used in gemspec. -# Using `RUBY_VERSION` is dangerous because value of the -# constant is determined by `rake release`. -# It's possible to have dependency based on ruby version used -# to execute `rake release` and not user's ruby version. -# -# @example -# -# # bad -# Gem::Specification.new do |spec| -# if RUBY_VERSION >= '3.0' -# spec.add_dependency 'gem_a' -# else -# spec.add_dependency 'gem_b' -# end -# end -# -# # good -# Gem::Specification.new do |spec| -# spec.add_dependency 'gem_a' -# end -# -# source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#28 -class RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage < ::RuboCop::Cop::Base - include ::RuboCop::Cop::GemspecHelp - - # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#36 - def on_const(node); end - - # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#34 - def ruby_version?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#44 - def gem_spec_with_ruby_version?(node); end -end - -# source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#31 -RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for checking gem declarations. -# -# source://rubocop//lib/rubocop/cop/mixin/gemspec_help.rb#6 -module RuboCop::Cop::GemspecHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/gemspec_help.rb#20 - def gem_specification(param0); end - - # source://rubocop//lib/rubocop/cop/mixin/gemspec_help.rb#10 - def gem_specification?(param0 = T.unsafe(nil)); end -end - -# Source and spec generator for new cops -# -# This generator will take a cop name and generate a source file -# and spec file when given a valid qualified cop name. -# -# @api private -# -# source://rubocop//lib/rubocop/cop/generator.rb#10 -class RuboCop::Cop::Generator - # @api private - # @raise [ArgumentError] - # @return [Generator] a new instance of Generator - # - # source://rubocop//lib/rubocop/cop/generator.rb#119 - def initialize(name, output: T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#139 - def inject_config(config_file_path: T.unsafe(nil), version_added: T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#135 - def inject_require(root_file_path: T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#152 - def todo; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#127 - def write_source; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#131 - def write_spec; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#166 - def badge; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#189 - def generate(template); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#181 - def generated_source; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#185 - def generated_spec; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#166 - def output; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#214 - def snake_case(camel_case_string); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#204 - def source_path; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#194 - def spec_path; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/generator.rb#168 - def write_unless_file_exists(path, contents); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/generator.rb#115 -RuboCop::Cop::Generator::CONFIGURATION_ADDED_MESSAGE = T.let(T.unsafe(nil), String) - -# A class that injects a require directive into the root RuboCop file. -# It looks for other directives that require files in the same (cop) -# namespace and injects the provided one in alpha -# -# source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#9 -class RuboCop::Cop::Generator::ConfigurationInjector - # @return [ConfigurationInjector] a new instance of ConfigurationInjector - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#17 - def initialize(configuration_file_path:, badge:, version_added: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#24 - def inject; end - - private - - # Returns the value of attribute badge. - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#39 - def badge; end - - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#41 - def configuration_entries; end - - # Returns the value of attribute configuration_file_path. - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#39 - def configuration_file_path; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#59 - def cop_name_line?(yaml); end - - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#49 - def find_target_line; end - - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#45 - def new_configuration_entry; end - - # Returns the value of attribute output. - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#39 - def output; end - - # Returns the value of attribute version_added. - # - # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#39 - def version_added; end -end - -# source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#10 -RuboCop::Cop::Generator::ConfigurationInjector::TEMPLATE = T.let(T.unsafe(nil), String) - -# A class that injects a require directive into the root RuboCop file. -# It looks for other directives that require files in the same (cop) -# namespace and injects the provided one in alpha -# -# source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#9 -class RuboCop::Cop::Generator::RequireFileInjector - # @return [RequireFileInjector] a new instance of RequireFileInjector - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#12 - def initialize(source_path:, root_file_path:, output: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#19 - def inject; end - - private - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#64 - def injectable_require_directive; end - - # Returns the value of attribute output. - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 - def output; end - - # Returns the value of attribute require_entries. - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 - def require_entries; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#31 - def require_exists?; end - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#68 - def require_path; end - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#58 - def require_path_fragments(require_directive); end - - # Returns the value of attribute root_file_path. - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 - def root_file_path; end - - # Returns the value of attribute source_path. - # - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 - def source_path; end - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#39 - def target_line; end - - # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#35 - def updated_directives; end -end - -# source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#10 -RuboCop::Cop::Generator::RequireFileInjector::REQUIRE_PATH = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/cop/generator.rb#11 -RuboCop::Cop::Generator::SOURCE_TEMPLATE = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/cop/generator.rb#91 -RuboCop::Cop::Generator::SPEC_TEMPLATE = T.let(T.unsafe(nil), String) - -# Common functionality for checking hash alignment. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#6 -module RuboCop::Cop::HashAlignmentStyles; end - -# Handles calculation of deltas when the enforced style is 'key'. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#8 -class RuboCop::Cop::HashAlignmentStyles::KeyAlignment - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#9 - def checkable_layout?(_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#20 - def deltas(first_pair, current_pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#13 - def deltas_for_first_pair(first_pair); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#34 - def separator_delta(pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#45 - def value_delta(pair); end -end - -# Handles calculation of deltas for `kwsplat` nodes. -# This is a special case that just ensures the kwsplat is aligned with the rest of the hash -# since a `kwsplat` does not have a key, separator or value. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#146 -class RuboCop::Cop::HashAlignmentStyles::KeywordSplatAlignment - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#147 - def deltas(first_pair, current_pair); end -end - -# Handles calculation of deltas when the enforced style is 'separator'. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#121 -class RuboCop::Cop::HashAlignmentStyles::SeparatorAlignment - include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#124 - def deltas_for_first_pair(_first_pair); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#134 - def hash_rocket_delta(first_pair, current_pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#130 - def key_delta(first_pair, current_pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#138 - def value_delta(first_pair, current_pair); end -end - -# Handles calculation of deltas when the enforced style is 'table'. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#81 -class RuboCop::Cop::HashAlignmentStyles::TableAlignment - include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#84 - def deltas_for_first_pair(first_pair); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#98 - def hash_rocket_delta(first_pair, current_pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#94 - def key_delta(first_pair, current_pair); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#115 - def max_delimiter_width(hash_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#111 - def max_key_width(hash_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#103 - def value_delta(first_pair, current_pair); end -end - -# Common functionality for checking alignment of hash values. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#56 -module RuboCop::Cop::HashAlignmentStyles::ValueAlignment - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#57 - def checkable_layout?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#61 - def deltas(first_pair, current_pair); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#71 - def separator_delta(first_pair, current_pair, key_delta); end -end - -# This module checks for Ruby 3.1's hash value omission syntax. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#7 -module RuboCop::Cop::HashShorthandSyntax - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#32 - def on_hash_for_mixed_shorthand(hash_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#44 - def on_pair(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#144 - def brackets?(method_dispatch_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#174 - def breakdown_value_types_of_hash(hash_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#121 - def def_node_that_require_parentheses(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#203 - def each_omittable_value_pair(hash_value_type_breakdown, &block); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#199 - def each_omitted_value_pair(hash_value_type_breakdown, &block); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#99 - def enforced_shorthand_syntax; end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#136 - def find_ancestor_method_dispatch_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#186 - def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#190 - def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#194 - def ignore_explicit_omissible_hash_shorthand_syntax?(hash_value_type_breakdown); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#93 - def ignore_hash_shorthand_syntax?(pair_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#87 - def ignore_mixed_hash_shorthand_syntax?(hash_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#159 - def last_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#167 - def method_dispatch_as_argument?(method_dispatch_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#207 - def mixed_shorthand_syntax_check(hash_value_type_breakdown); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#223 - def no_mixed_shorthand_syntax_check(hash_value_type_breakdown); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#67 - def register_offense(node, message, replacement); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#103 - def require_hash_value?(hash_key_source, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#112 - def require_hash_value_for_around_hash_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#148 - def use_element_of_hash_literal_as_receiver?(ancestor, parent); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#153 - def use_modifier_form_without_parenthesized_method_call?(ancestor); end -end - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#12 -RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_EXPLICIT_VALUE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#10 -RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_MSG_PREFIX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#11 -RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_OMIT_VALUE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#14 -class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#23 - def first_argument; end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#27 - def last_argument; end - - # Returns the value of attribute node - # - # @return [Object] the current value of node - def node; end - - # Sets the attribute node - # - # @param value [Object] the value to set the attribute node to. - # @return [Object] the newly set value - def node=(_); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#15 - def selector; end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#9 -RuboCop::Cop::HashShorthandSyntax::EXPLICIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#8 -RuboCop::Cop::HashShorthandSyntax::OMIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) - -# Common functionality for Style/HashExcept and Style/HashSlice cops. -# It registers an offense on methods with blocks that are equivalent -# to Hash#except or Hash#slice. -# -# source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#9 -module RuboCop::Cop::HashSubset - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#21 - def block_with_first_arg_check?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#36 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#36 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#181 - def decorate_source(value); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#189 - def except_key(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#168 - def except_key_source(key); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#160 - def extract_body_if_negated(body); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#59 - def extract_offense(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#69 - def extracts_hash_subset?(block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#138 - def included?(body, negated); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#146 - def not_included?(body, negated); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#197 - def offense_range(node); end - - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#55 - def preferred_method_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#95 - def range_include?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#150 - def safe_to_register_offense?(block, except_key); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#123 - def semantically_except_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#134 - def semantically_slice_method?(node); end - - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#51 - def semantically_subset_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#88 - def slices_key?(send_node, method, key_arg, value_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#115 - def supported_subset_method?(method); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#107 - def using_value_variable?(send_node, value_arg); end -end - -# source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#16 -RuboCop::Cop::HashSubset::ACTIVE_SUPPORT_SUBSET_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#18 -RuboCop::Cop::HashSubset::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#13 -RuboCop::Cop::HashSubset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/mixin/hash_subset.rb#15 -RuboCop::Cop::HashSubset::SUBSET_METHODS = T.let(T.unsafe(nil), Array) - -# Common functionality for Style/HashTransformKeys and -# Style/HashTransformValues -# -# source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#7 -module RuboCop::Cop::HashTransformMethod - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#87 - def array_receiver?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#91 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#108 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#101 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#182 - def execute_correction(corrector, node, correction); end - - # @abstract - # @raise [NotImplementedError] - # @return [Captures] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#157 - def extract_captures(_match); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#134 - def handle_possible_offense(node, match, match_desc); end - - # @abstract - # @raise [NotImplementedError] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#164 - def new_method_name; end - - # @abstract Implemented with `def_node_matcher` - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#115 - def on_bad_each_with_object(_node); end - - # @abstract Implemented with `def_node_matcher` - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#120 - def on_bad_hash_brackets_map(_node); end - - # @abstract Implemented with `def_node_matcher` - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#125 - def on_bad_map_to_h(_node); end - - # @abstract Implemented with `def_node_matcher` - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#130 - def on_bad_to_h(_node); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#168 - def prepare_correction(node); end -end - -# Internal helper class to hold autocorrect data -# -# source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#31 -class RuboCop::Cop::HashTransformMethod::Autocorrection < ::Struct - # Returns the value of attribute block_node - # - # @return [Object] the current value of block_node - def block_node; end - - # Sets the attribute block_node - # - # @param value [Object] the value to set the attribute block_node to. - # @return [Object] the newly set value - def block_node=(_); end - - # Returns the value of attribute leading - # - # @return [Object] the current value of leading - def leading; end - - # Sets the attribute leading - # - # @param value [Object] the value to set the attribute leading to. - # @return [Object] the newly set value - def leading=(_); end - - # Returns the value of attribute match - # - # @return [Object] the current value of match - def match; end - - # Sets the attribute match - # - # @param value [Object] the value to set the attribute match to. - # @return [Object] the newly set value - def match=(_); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#72 - def set_new_arg_name(transformed_argname, corrector); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#76 - def set_new_body_expression(transforming_body_expr, corrector); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#62 - def set_new_method_name(new_method_name, corrector); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#56 - def strip_prefix_and_suffix(node, corrector); end - - # Returns the value of attribute trailing - # - # @return [Object] the current value of trailing - def trailing; end - - # Sets the attribute trailing - # - # @param value [Object] the value to set the attribute trailing to. - # @return [Object] the newly set value - def trailing=(_); end - - class << self - def [](*_arg0); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#32 - def from_each_with_object(node, match); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#36 - def from_hash_brackets_map(node, match); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#40 - def from_map_to_h(node, match); end - - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#52 - def from_to_h(node, match); end - - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Internal helper class to hold match data -# -# source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#13 -class RuboCop::Cop::HashTransformMethod::Captures < ::Struct - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#14 - def noop_transformation?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#19 - def transformation_uses_both_args?; end - - # Returns the value of attribute transformed_argname - # - # @return [Object] the current value of transformed_argname - def transformed_argname; end - - # Sets the attribute transformed_argname - # - # @param value [Object] the value to set the attribute transformed_argname to. - # @return [Object] the newly set value - def transformed_argname=(_); end - - # Returns the value of attribute transforming_body_expr - # - # @return [Object] the current value of transforming_body_expr - def transforming_body_expr; end - - # Sets the attribute transforming_body_expr - # - # @param value [Object] the value to set the attribute transforming_body_expr to. - # @return [Object] the newly set value - def transforming_body_expr=(_); end - - # Returns the value of attribute unchanged_body_expr - # - # @return [Object] the current value of unchanged_body_expr - def unchanged_body_expr; end - - # Sets the attribute unchanged_body_expr - # - # @param value [Object] the value to set the attribute unchanged_body_expr to. - # @return [Object] the newly set value - def unchanged_body_expr=(_); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#23 - def use_transformed_argname?; end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#10 -RuboCop::Cop::HashTransformMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Common functionality for working with heredoc strings. -# -# source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#6 -module RuboCop::Cop::Heredoc - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 - def on_dstr(node); end - - # @raise [NotImplementedError] - # - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#17 - def on_heredoc(_node); end - - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 - def on_str(node); end - - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 - def on_xstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#28 - def delimiter_string(node); end - - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#34 - def heredoc_type(node); end - - # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#23 - def indent_level(str); end -end - -# source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#7 -RuboCop::Cop::Heredoc::OPENING_DELIMITER = T.let(T.unsafe(nil), Regexp) - -# This class autocorrects `if...then` structures to a multiline `if` statement -# -# source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#6 -class RuboCop::Cop::IfThenCorrector - # @return [IfThenCorrector] a new instance of IfThenCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#9 - def initialize(if_node, indentation: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#14 - def call(corrector); end - - private - - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#50 - def branch_body_indentation; end - - # Returns the value of attribute if_node. - # - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#20 - def if_node; end - - # Returns the value of attribute indentation. - # - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#20 - def indentation; end - - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#22 - def replacement(node = T.unsafe(nil), indentation = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#36 - def rewrite_else_branch(else_branch, indentation); end -end - -# source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb#7 -RuboCop::Cop::IfThenCorrector::DEFAULT_INDENTATION_WIDTH = T.let(T.unsafe(nil), Integer) - -# @deprecated IgnoredMethods class has been replaced with AllowedMethods. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#46 -RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods - -# Handles adding and checking ignored nodes. -# -# source://rubocop//lib/rubocop/cop/ignored_node.rb#6 -module RuboCop::Cop::IgnoredNode - # source://rubocop//lib/rubocop/cop/ignored_node.rb#7 - def ignore_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/ignored_node.rb#24 - def ignored_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/ignored_node.rb#11 - def part_of_ignored_node?(node); end - - private - - # source://rubocop//lib/rubocop/cop/ignored_node.rb#31 - def ignored_nodes; end -end - -# @deprecated IgnoredPattern class has been replaced with AllowedPattern. -# -# source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#66 -RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern - -# Common functionality for checking integer nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/integer_node.rb#6 -module RuboCop::Cop::IntegerNode - private - - # source://rubocop//lib/rubocop/cop/mixin/integer_node.rb#9 - def integer_part(node); end -end - -# Common functionality for working with string interpolations. -# -# @abstract Subclasses are expected to implement {#on_interpolation}. -# -# source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#8 -module RuboCop::Cop::Interpolation - # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 - def on_dsym(node); end - - # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#17 - def on_node_with_interpolations(node); end - - # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 - def on_regexp(node); end - - # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 - def on_xstr(node); end -end - -# This class autocorrects lambda literal to method notation. -# -# source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#6 -class RuboCop::Cop::LambdaLiteralToMethodCorrector - # @return [LambdaLiteralToMethodCorrector] a new instance of LambdaLiteralToMethodCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#7 - def initialize(block_node); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#13 - def call(corrector); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#118 - def arg_to_unparenthesized_call?; end - - # Returns the value of attribute arguments. - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#34 - def arguments; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#102 - def arguments_begin_pos; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#98 - def arguments_end_pos; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#110 - def block_begin; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#106 - def block_end; end - - # Returns the value of attribute block_node. - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#34 - def block_node; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#59 - def insert_arguments(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#43 - def insert_separating_space(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#88 - def lambda_arg_string; end - - # Returns the value of attribute method. - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#34 - def method; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#92 - def needs_separating_space?; end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#53 - def remove_arguments(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#66 - def remove_leading_whitespace(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#74 - def remove_trailing_whitespace(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#36 - def remove_unparenthesized_whitespace(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#79 - def replace_delimiters(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#49 - def replace_selector(corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#114 - def selector_end; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#134 - def separating_space?; end -end - -# source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#5 -module RuboCop::Cop::Layout; end - -# Bare access modifiers (those not applying to specific methods) should be -# indented as deep as method definitions, or as deep as the `class`/`module` -# keyword, depending on configuration. -# -# @example EnforcedStyle: indent (default) -# # bad -# class Plumbus -# private -# def smooth; end -# end -# -# # good -# class Plumbus -# private -# def smooth; end -# end -# @example EnforcedStyle: outdent -# # bad -# class Plumbus -# private -# def smooth; end -# end -# -# # good -# class Plumbus -# private -# def smooth; end -# end -# -# source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#35 -class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#43 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#43 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#43 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#43 - def on_sclass(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#54 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#58 - def check_body(body, node); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#69 - def check_modifier(send_node, end_range); end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#92 - def expected_indent_offset; end - - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#88 - def message(range); end - - # An offset that is not expected, but correct if the configuration is - # changed. - # - # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#98 - def unexpected_indent_offset; end -end - -# source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#41 -RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String) - -# Check that the arguments on a multi-line method call are aligned. -# -# @example EnforcedStyle: with_first_argument (default) -# # good -# -# foo :bar, -# :baz, -# key: value -# -# foo( -# :bar, -# :baz, -# key: value -# ) -# -# # bad -# -# foo :bar, -# :baz, -# key: value -# -# foo( -# :bar, -# :baz, -# key: value -# ) -# @example EnforcedStyle: with_fixed_indentation -# # good -# -# foo :bar, -# :baz, -# key: value -# -# # bad -# -# foo :bar, -# :baz, -# key: value -# -# source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#45 -class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#54 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#54 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#91 - def arguments_or_first_arg_pairs(node); end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#79 - def arguments_with_last_arg_pairs(node); end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#107 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#67 - def autocorrect_incompatible_with_other_cops?; end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#123 - def base_column(node, first_argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#143 - def enforce_hash_argument_with_separator?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#115 - def fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#71 - def flattened_arguments(node); end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#111 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#100 - def multiple_arguments?(node); end - - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#134 - def target_method_lineno(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#119 - def with_first_argument_style?; end -end - -# source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#49 -RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#51 -RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) - -# Check that the elements of a multi-line array literal are -# aligned. -# -# @example EnforcedStyle: with_first_element (default) -# # good -# -# array = [1, 2, 3, -# 4, 5, 6] -# array = ['run', -# 'forrest', -# 'run'] -# -# # bad -# -# array = [1, 2, 3, -# 4, 5, 6] -# array = ['run', -# 'forrest', -# 'run'] -# @example EnforcedStyle: with_fixed_indentation -# # good -# -# array = [1, 2, 3, -# 4, 5, 6] -# -# # bad -# -# array = [1, 2, 3, -# 4, 5, 6] -# -# source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#36 -class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#46 - def on_array(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#55 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#67 - def base_column(node, args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#63 - def fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#59 - def message(_range); end - - # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#78 - def target_method_lineno(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#40 -RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#43 -RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the first line of the -# right-hand-side of a multi-line assignment. -# -# The indentation of the remaining lines can be corrected with -# other cops such as `Layout/IndentationConsistency` and `Layout/EndAlignment`. -# -# @example -# # bad -# value = -# if foo -# 'bar' -# end -# -# # good -# value = -# if foo -# 'bar' -# end -# -# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#25 -class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - private - - # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#43 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#34 - def check_assignment(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#47 - def leftmost_multiple_assignment(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#30 -RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the end keyword of `begin` is aligned properly. -# -# Two modes are supported through the `EnforcedStyleAlignWith` configuration -# parameter. If it's set to `start_of_line` (which is the default), the -# `end` shall be aligned with the start of the line where the `begin` -# keyword is. If it's set to `begin`, the `end` shall be aligned with the -# `begin` keyword. -# -# `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) -# by default. On the other hand, `||= begin` that this cop targets tends to -# align with the start of the line, it defaults to `EnforcedStyleAlignWith: start_of_line`. -# These style can be configured by each cop. -# -# @example EnforcedStyleAlignWith: start_of_line (default) -# # bad -# foo ||= begin -# do_something -# end -# -# # good -# foo ||= begin -# do_something -# end -# @example EnforcedStyleAlignWith: begin -# # bad -# foo ||= begin -# do_something -# end -# -# # good -# foo ||= begin -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#41 -class RuboCop::Cop::Layout::BeginEndAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#47 - def on_kwbegin(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#62 - def alignment_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#58 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#53 - def check_begin_alignment(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#45 -RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the end keywords are aligned properly for do -# end blocks. -# -# Three modes are supported through the `EnforcedStyleAlignWith` -# configuration parameter: -# -# `start_of_block` : the `end` shall be aligned with the -# start of the line where the `do` appeared. -# -# `start_of_line` : the `end` shall be aligned with the -# start of the line where the expression started. -# -# `either` (which is the default) : the `end` is allowed to be in either -# location. The autocorrect will default to `start_of_line`. -# -# @example EnforcedStyleAlignWith: either (default) -# # bad -# -# foo.bar -# .each do -# baz -# end -# -# # good -# -# foo.bar -# .each do -# baz -# end -# @example EnforcedStyleAlignWith: start_of_block -# # bad -# -# foo.bar -# .each do -# baz -# end -# -# # good -# -# foo.bar -# .each do -# baz -# end -# @example EnforcedStyleAlignWith: start_of_line -# # bad -# -# foo.bar -# .each do -# baz -# end -# -# # good -# -# foo.bar -# .each do -# baz -# end -# -# source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#66 -class RuboCop::Cop::Layout::BlockAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#74 - def block_end_align_target?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#84 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#84 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#84 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#91 - def style_parameter_name; end - - private - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#247 - def add_space_before(corrector, loc, delta); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#224 - def alt_start_msg(start_loc, source_line_column); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#146 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#97 - def block_end_align_target(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#115 - def check_block_alignment(start_node, block_node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#197 - def compute_do_source_line_column(node, end_loc); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#239 - def compute_start_col(ancestor_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#111 - def disqualified_parent?(parent, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#107 - def end_align_target?(node, parent); end - - # In offense message, we want to show the assignment LHS rather than - # the entire assignment. - # - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#192 - def find_lhs_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#163 - def format_message(start_loc, end_loc, do_source_line_column, error_source_line_column); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#234 - def format_source_line_column(source_line_column); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#216 - def loc_to_source_line_column(loc); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#128 - def register_offense(block_node, start_loc, end_loc, do_source_line_column); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#251 - def remove_space_before(corrector, end_pos, delta); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#173 - def start_for_block_node(block_node); end - - # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#180 - def start_for_line_node(block_node); end -end - -# source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#71 -RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the end statement of a do..end block -# is on its own line. -# -# @example -# # bad -# blah do |i| -# foo(i) end -# -# # good -# blah do |i| -# foo(i) -# end -# -# # bad -# blah { |i| -# foo(i) } -# -# # good -# blah { |i| -# foo(i) -# } -# -# source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#27 -class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#33 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#33 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#33 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#67 - def last_heredoc_argument(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#63 - def message(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#77 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#50 - def register_offense(node, offense_range); end -end - -# source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#31 -RuboCop::Cop::Layout::BlockEndNewline::MSG = T.let(T.unsafe(nil), String) - -# Checks how the `when` and ``in``s of a `case` expression -# are indented in relation to its `case` or `end` keyword. -# -# It will register a separate offense for each misaligned `when` and `in`. -# -# @example -# # If Layout/EndAlignment is set to keyword style (default) -# # *case* and *end* should always be aligned to same depth, -# # and therefore *when* should always be aligned to both - -# # regardless of configuration. -# -# # bad for all styles -# case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# -# # good for all styles -# case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# @example EnforcedStyle: case (default) -# # if EndAlignment is set to other style such as -# # start_of_line (as shown below), then *when* alignment -# # configuration does have an effect. -# -# # bad -# a = case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# a = case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# -# # good -# a = case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# a = case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# @example EnforcedStyle: end -# # bad -# a = case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# a = case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# -# # good -# a = case n -# when 0 -# x * 2 -# else -# y / 3 -# end -# -# a = case n -# in pattern -# x * 2 -# else -# y / 3 -# end -# -# source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#112 -class RuboCop::Cop::Layout::CaseIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#120 - def on_case(case_node); end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#127 - def on_case_match(case_match_node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#193 - def base_column(case_node, base); end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#150 - def check_when(when_node, branch_type); end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#182 - def detect_incorrect_style(when_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#136 - def end_and_last_conditional_same_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#146 - def enforced_style_end?; end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#169 - def incorrect_style(when_node, branch_type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#161 - def indent_one_step?; end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#165 - def indentation_width; end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#207 - def replacement(node); end - - # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#200 - def whitespace_range(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#118 -RuboCop::Cop::Layout::CaseIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks if the code style follows the `ExpectedOrder` configuration: -# -# `Categories` allows us to map macro names into a category. -# -# Consider an example of code style that covers the following order: -# -# * Module inclusion (`include`, `prepend`, `extend`) -# * Constants -# * Associations (`has_one`, `has_many`) -# * Public attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) -# * Other macros (`validates`, `validate`) -# * Public class methods -# * Initializer -# * Public instance methods -# * Protected attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) -# * Protected instance methods -# * Private attribute macros (`attr_accessor`, `attr_writer`, `attr_reader`) -# * Private instance methods -# -# You can configure the following order: -# -# [source,yaml] -# ---- -# Layout/ClassStructure: -# ExpectedOrder: -# - module_inclusion -# - constants -# - association -# - public_attribute_macros -# - public_delegate -# - macros -# - public_class_methods -# - initializer -# - public_methods -# - protected_attribute_macros -# - protected_methods -# - private_attribute_macros -# - private_delegate -# - private_methods -# ---- -# -# Instead of putting all literals in the expected order, is also -# possible to group categories of macros. Visibility levels are handled -# automatically. -# -# [source,yaml] -# ---- -# Layout/ClassStructure: -# Categories: -# association: -# - has_many -# - has_one -# attribute_macros: -# - attr_accessor -# - attr_reader -# - attr_writer -# macros: -# - validates -# - validate -# module_inclusion: -# - include -# - prepend -# - extend -# ---- -# -# @example -# # bad -# # Expect extend be before constant -# class Person < ApplicationRecord -# has_many :orders -# ANSWER = 42 -# -# extend SomeModule -# include AnotherModule -# end -# -# # good -# class Person -# # extend and include go first -# extend SomeModule -# include AnotherModule -# -# # inner classes -# CustomError = Class.new(StandardError) -# -# # constants are next -# SOME_CONSTANT = 20 -# -# # afterwards we have public attribute macros -# attr_reader :name -# -# # followed by other macros (if any) -# validates :name -# -# # then we have public delegate macros -# delegate :to_s, to: :name -# -# # public class methods are next in line -# def self.some_method -# end -# -# # initialization goes between class methods and instance methods -# def initialize -# end -# -# # followed by other public instance methods -# def some_method -# end -# -# # protected attribute macros and methods go next -# protected -# -# attr_reader :protected_name -# -# def some_protected_method -# end -# -# # private attribute macros, delegate macros and methods -# # are grouped near the end -# private -# -# attr_reader :private_name -# -# delegate :some_private_delegate, to: :name -# -# def some_private_method -# end -# end -# -# source://rubocop//lib/rubocop/cop/layout/class_structure.rb#142 -class RuboCop::Cop::Layout::ClassStructure < ::RuboCop::Cop::Base - include ::RuboCop::Cop::VisibilityHelp - include ::RuboCop::Cop::CommentsHelp - extend ::RuboCop::Cop::AutoCorrector - - # Validates code style on class declaration. - # Add offense when find a node out of expected order. - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#158 - def on_class(class_node); end - - # Validates code style on class declaration. - # Add offense when find a node out of expected order. - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#158 - def on_sclass(class_node); end - - private - - # Autocorrect by swapping between two nodes autocorrecting them - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#174 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#305 - def begin_pos_with_comment(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#328 - def buffer; end - - # Setting categories hash allow you to group methods in group to match - # in the {expected_order}. - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#340 - def categories; end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#234 - def class_elements(class_node); end - - # Classifies a node to match with something in the {expected_order} - # - # @param node to be analysed - # @return String when the node type is a `:block` then - # {classify} recursively with the first children - # @return String when the node type is a `:send` then {find_category} - # by method name - # @return String otherwise trying to {humanize_node} of the current node - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#194 - def classify(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#271 - def dynamic_constant?(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#295 - def end_position_for(node); end - - # Load expected order from `ExpectedOrder` config. - # Define new terms in the expected order by adding new {categories}. - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#334 - def expected_order; end - - # Categorize a node according to the {expected_order} - # Try to match {categories} values against the node's method_name given - # also its visibility. - # - # @param node to be analysed. - # @return [String] with the key category or the `method_name` as string - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#212 - def find_category(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#324 - def find_heredoc(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#262 - def humanize_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#246 - def ignore?(node, classification); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#253 - def ignore_for_autocorrect?(node, sibling); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#289 - def marked_as_private_constant?(node, name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#279 - def private_constant?(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#320 - def start_line_position(node); end - - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#225 - def walk_over_nested_class_definition(class_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#316 - def whole_line_comment_at_line?(line); end -end - -# source://rubocop//lib/rubocop/cop/layout/class_structure.rb#147 -RuboCop::Cop::Layout::ClassStructure::HUMANIZED_NODE_TYPE = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/layout/class_structure.rb#154 -RuboCop::Cop::Layout::ClassStructure::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of here document closings. -# -# @example -# -# # bad -# class Foo -# def bar -# <<~SQL -# 'Hi' -# SQL -# end -# end -# -# # good -# class Foo -# def bar -# <<~SQL -# 'Hi' -# SQL -# end -# end -# -# # bad -# -# # heredoc contents is before closing heredoc. -# foo arg, -# <<~EOS -# Hi -# EOS -# -# # good -# foo arg, -# <<~EOS -# Hi -# EOS -# -# # good -# foo arg, -# <<~EOS -# Hi -# EOS -# -# source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#48 -class RuboCop::Cop::Layout::ClosingHeredocIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Heredoc - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#57 - def on_heredoc(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#74 - def argument_indentation_correct?(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#82 - def closing_indentation(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#101 - def find_node_used_heredoc_argument(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#90 - def heredoc_closing(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#86 - def heredoc_opening(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#117 - def indent_level(source_line); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#94 - def indented_end(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#109 - def message(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#70 - def opening_indentation(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#53 -RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#54 -RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#52 -RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String) - -# Checks the indentation of hanging closing parentheses in -# method calls, method definitions, and grouped expressions. A hanging -# closing parenthesis means `)` preceded by a line break. -# -# @example -# -# # bad -# some_method( -# a, -# b -# ) -# -# some_method( -# a, b -# ) -# -# some_method(a, b, c -# ) -# -# some_method(a, -# b, -# c -# ) -# -# some_method(a, -# x: 1, -# y: 2 -# ) -# -# # Scenario 1: When First Parameter Is On Its Own Line -# -# # good: when first param is on a new line, right paren is *always* -# # outdented by IndentationWidth -# some_method( -# a, -# b -# ) -# -# # good -# some_method( -# a, b -# ) -# -# # Scenario 2: When First Parameter Is On The Same Line -# -# # good: when all other params are also on the same line, outdent -# # right paren by IndentationWidth -# some_method(a, b, c -# ) -# -# # good: when all other params are on multiple lines, but are lined -# # up, align right paren with left paren -# some_method(a, -# b, -# c -# ) -# -# # good: when other params are not lined up on multiple lines, outdent -# # right paren by IndentationWidth -# some_method(a, -# x: 1, -# y: 2 -# ) -# -# source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#71 -class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#84 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#79 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#88 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#88 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#79 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#157 - def all_elements_aligned?(elements); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#95 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#99 - def check(node, elements); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#107 - def check_for_elements(node, elements); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#125 - def check_for_no_elements(node); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#171 - def correct_column_candidates(node, left_paren); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#144 - def expected_column(left_paren, elements); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#167 - def first_argument_line(elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#187 - def line_break_after_left_paren?(left_paren, elements); end - - # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#179 - def message(correct_column, left_paren, right_paren); end -end - -# source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#77 -RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#75 -RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) - -# Checks the indentation of comments. -# -# @example -# # bad -# # comment here -# def method_name -# end -# -# # comment here -# a = 'hello' -# -# # yet another comment -# if true -# true -# end -# -# # good -# # comment here -# def method_name -# end -# -# # comment here -# a = 'hello' -# -# # yet another comment -# if true -# true -# end -# @example AllowForAlignment: false (default) -# # bad -# a = 1 # A really long comment -# # spanning two lines. -# -# # good -# # A really long comment spanning one line. -# a = 1 -# @example AllowForAlignment: true -# # good -# a = 1 # A really long comment -# # spanning two lines. -# -# source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#48 -class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#55 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#61 - def autocorrect(corrector, comment); end - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#88 - def autocorrect_one(corrector, comment); end - - # Corrects all comment lines that occur immediately before the given - # comment and have the same indentation. This is to avoid a long chain - # of correcting, saving the file, parsing and inspecting again, and - # then correcting one more line, and so on. - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#71 - def autocorrect_preceding_comments(corrector, comment); end - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#92 - def check(comment, comment_index); end - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#145 - def correct_indentation(next_line); end - - # Returns true if: - # a) the cop is configured to allow extra indentation for alignment, and - # b) the currently inspected comment is aligned with the nearest preceding end-of-line - # comment. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#121 - def correctly_aligned_with_preceding_comment?(comment_index, column); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#156 - def less_indented?(line); end - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#140 - def line_after_comment(comment); end - - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#131 - def message(column, correct_comment_indentation); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#135 - def own_line_comment?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#82 - def should_correct?(preceding_comment, reference_comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#162 - def two_alternatives?(line); end -end - -# source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#52 -RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks for conditions that are not on the same line as -# if/while/until. -# -# @example -# -# # bad -# if -# some_condition -# do_something -# end -# -# # good -# if some_condition -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#21 -class RuboCop::Cop::Layout::ConditionPosition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#27 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#33 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#33 - def on_while(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#40 - def check(node); end - - # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#54 - def message(condition); end -end - -# source://rubocop//lib/rubocop/cop/layout/condition_position.rb#25 -RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the end keywords of method definitions are -# aligned properly. -# -# Two modes are supported through the EnforcedStyleAlignWith configuration -# parameter. If it's set to `start_of_line` (which is the default), the -# `end` shall be aligned with the start of the line where the `def` -# keyword is. If it's set to `def`, the `end` shall be aligned with the -# `def` keyword. -# -# @example EnforcedStyleAlignWith: start_of_line (default) -# # bad -# -# private def foo -# end -# -# # good -# -# private def foo -# end -# @example EnforcedStyleAlignWith: def -# # bad -# -# private def foo -# end -# -# # good -# -# private def foo -# end -# -# source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#36 -class RuboCop::Cop::Layout::DefEndAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#43 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#43 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#48 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#63 - def autocorrect(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#41 -RuboCop::Cop::Layout::DefEndAlignment::MSG = T.let(T.unsafe(nil), String) - -# Checks the . position in multi-line method calls. -# -# @example EnforcedStyle: leading (default) -# # bad -# something. -# method -# -# # good -# something -# .method -# @example EnforcedStyle: trailing -# # bad -# something -# .method -# -# # good -# something. -# method -# -# source://rubocop//lib/rubocop/cop/layout/dot_position.rb#25 -class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#34 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#34 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#49 - def autocorrect(corrector, dot, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#99 - def correct_dot_position_style?(dot_line, selector_line); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#126 - def end_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#122 - def heredoc?(node); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#114 - def last_heredoc_line(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#95 - def line_between?(first_line, second_line); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#64 - def message(dot); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#74 - def proper_dot_position?(node); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#106 - def receiver_end_line(node); end - - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#130 - def selector_range(node); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#30 - def autocorrect_incompatible_with; end - end -end - -# Checks the alignment of else keywords. Normally they should -# be aligned with an if/unless/while/until/begin/def/rescue keyword, but there -# are special cases when they should follow the same rules as the -# alignment of end. -# -# @example -# # bad -# if something -# code -# else -# code -# end -# -# # bad -# if something -# code -# elsif something -# code -# end -# -# # good -# if something -# code -# else -# code -# end -# -# source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#32 -class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::CheckAssignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#57 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#63 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#40 - def on_if(node, base = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#51 - def on_rescue(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#147 - def assignment_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#71 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#106 - def base_for_method_definition(node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#80 - def base_range_of_if(node, base); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#89 - def base_range_of_rescue(node); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#131 - def check_alignment(base_range, else_range); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#115 - def check_assignment(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#75 - def check_nested(node, base); end -end - -# source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#38 -RuboCop::Cop::Layout::ElseAlignment::MSG = T.let(T.unsafe(nil), String) - -# Checks empty comment. -# -# @example -# # bad -# -# # -# class Foo -# end -# -# # good -# -# # -# # Description of `Foo` class. -# # -# class Foo -# end -# @example AllowBorderComment: true (default) -# # good -# -# def foo -# end -# -# ################# -# -# def bar -# end -# @example AllowBorderComment: false -# # bad -# -# def foo -# end -# -# ################# -# -# def bar -# end -# @example AllowMarginComment: true (default) -# # good -# -# # -# # Description of `Foo` class. -# # -# class Foo -# end -# @example AllowMarginComment: false -# # bad -# -# # -# # Description of `Foo` class. -# # -# class Foo -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#63 -class RuboCop::Cop::Layout::EmptyComment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#69 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#133 - def allow_border_comment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#137 - def allow_margin_comment?; end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#97 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#129 - def comment_text(comment); end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#108 - def concat_consecutive_comments(comments); end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#141 - def current_token(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#119 - def empty_comment_only?(comment_text); end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#85 - def investigate(comments); end - - # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#145 - def previous_token(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#67 -RuboCop::Cop::Layout::EmptyComment::MSG = T.let(T.unsafe(nil), String) - -# Enforces empty line after guard clause. -# -# This cop allows `# :nocov:` directive after guard clause because -# SimpleCov excludes code from the coverage report by wrapping it in `# :nocov:`: -# -# [source,ruby] -# ---- -# def foo -# # :nocov: -# return if condition -# # :nocov: -# bar -# end -# ---- -# -# Refer to SimpleCov's documentation for more details: -# https://github.com/simplecov-ruby/simplecov#ignoringskipping-code -# -# @example -# -# # bad -# def foo -# return if need_return? -# bar -# end -# -# # good -# def foo -# return if need_return? -# -# bar -# end -# -# # good -# def foo -# return if something? -# return if something_different? -# -# bar -# end -# -# # also good -# def foo -# if something? -# do_something -# return if need_return? -# end -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#54 -class RuboCop::Cop::Layout::EmptyLineAfterGuardClause < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::PathUtil - extend ::RuboCop::Cop::Util - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#63 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#84 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#106 - def contains_guard_clause?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#99 - def correct_style?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#181 - def heredoc?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#174 - def heredoc_line(node, heredoc_node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#148 - def last_heredoc_argument(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#162 - def last_heredoc_argument_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#199 - def multiple_statements_on_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#121 - def next_line_allowed_directive_comment?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#117 - def next_line_empty?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#110 - def next_line_empty_or_allowed_directive_comment?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#127 - def next_line_rescue_or_ensure?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#141 - def next_sibling_empty_or_guard_clause?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#132 - def next_sibling_parent_empty_or_else?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#191 - def offense_location(node); end - - # SimpleCov excludes code from the coverage report by wrapping it in `# :nocov:`: - # https://github.com/simplecov-ruby/simplecov#ignoringskipping-code - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#208 - def simplecov_directive_comment?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#185 - def use_heredoc_in_condition?(condition); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#60 -RuboCop::Cop::Layout::EmptyLineAfterGuardClause::END_OF_HEREDOC_LINE = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#59 -RuboCop::Cop::Layout::EmptyLineAfterGuardClause::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#61 -RuboCop::Cop::Layout::EmptyLineAfterGuardClause::SIMPLE_DIRECTIVE_COMMENT_PATTERN = T.let(T.unsafe(nil), Regexp) - -# Checks for a newline after the final magic comment. -# -# @example -# # good -# # frozen_string_literal: true -# -# # Some documentation for Person -# class Person -# # Some code -# end -# -# # bad -# # frozen_string_literal: true -# # Some documentation for Person -# class Person -# # Some code -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#23 -class RuboCop::Cop::Layout::EmptyLineAfterMagicComment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#29 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#61 - def comments_before_code(source); end - - # Find the last magic comment in the source file. - # - # Take all comments that precede the first line of code (or just take - # them all in the case when there is no code), select the - # magic comments, and return the last magic comment in the file. - # - # @return [Parser::Source::Comment] if magic comments exist before code - # @return [nil] otherwise - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#55 - def last_magic_comment(source); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#43 - def offending_range(last_magic_comment); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#27 -RuboCop::Cop::Layout::EmptyLineAfterMagicComment::MSG = T.let(T.unsafe(nil), String) - -# Enforces empty line after multiline condition. -# -# @example -# # bad -# if multiline && -# condition -# do_something -# end -# -# # good -# if multiline && -# condition -# -# do_something -# end -# -# # bad -# case x -# when foo, -# bar -# do_something -# end -# -# # good -# case x -# when foo, -# bar -# -# do_something -# end -# -# # bad -# begin -# do_something -# rescue FooError, -# BarError -# handle_error -# end -# -# # good -# begin -# do_something -# rescue FooError, -# BarError -# -# handle_error -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#54 -class RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#82 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#60 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#93 - def on_rescue(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#70 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#75 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#70 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#75 - def on_while_post(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#127 - def autocorrect(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#105 - def check_condition(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#120 - def multiline_rescue_exceptions?(exception_nodes); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#116 - def multiline_when_condition?(when_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#112 - def next_line_empty?(line); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#58 -RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks whether class/module/method definitions are -# separated by one or more empty lines. -# -# `NumberOfEmptyLines` can be an integer (default is 1) or -# an array (e.g. [1, 2]) to specify a minimum and maximum -# number of empty lines permitted. -# -# `AllowAdjacentOneLineDefs` configures whether adjacent -# one-line definitions are considered an offense. -# -# @example EmptyLineBetweenMethodDefs: true (default) -# # checks for empty lines between method definitions. -# -# # bad -# def a -# end -# def b -# end -# -# # good -# def a -# end -# -# def b -# end -# @example EmptyLineBetweenClassDefs: true (default) -# # checks for empty lines between class definitions. -# -# # bad -# class A -# end -# class B -# end -# def b -# end -# -# # good -# class A -# end -# -# class B -# end -# -# def b -# end -# @example EmptyLineBetweenModuleDefs: true (default) -# # checks for empty lines between module definitions. -# -# # bad -# module A -# end -# module B -# end -# def b -# end -# -# # good -# module A -# end -# -# module B -# end -# -# def b -# end -# @example AllowAdjacentOneLineDefs: true (default) -# -# # good -# class ErrorA < BaseError; end -# class ErrorB < BaseError; end -# class ErrorC < BaseError; end -# -# # good -# class ErrorA < BaseError; end -# -# class ErrorB < BaseError; end -# -# class ErrorC < BaseError; end -# @example AllowAdjacentOneLineDefs: false -# -# # bad -# class ErrorA < BaseError; end -# class ErrorB < BaseError; end -# class ErrorC < BaseError; end -# -# # good -# class ErrorA < BaseError; end -# -# class ErrorB < BaseError; end -# -# class ErrorC < BaseError; end -# -# source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#102 -class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#139 - def autocorrect(corrector, prev_def, node, count); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#124 - def check_defs(nodes); end - - # We operate on `begin` nodes, instead of using `OnMethodDef`, - # so that we can walk over pairs of consecutive nodes and - # efficiently access a node's predecessor; #prev_node ends up - # doing a linear scan over siblings, so we don't want to call - # it on each def. - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#117 - def on_begin(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#287 - def allowance_range?; end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#269 - def autocorrect_insert_lines(corrector, newline_pos, count); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#262 - def autocorrect_remove_lines(corrector, newline_pos, count); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#222 - def blank_lines_count_between(first_def_node, second_def_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#166 - def candidate?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#186 - def class_candidate?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#250 - def def_end(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#158 - def def_location(correction_node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#242 - def def_start(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#173 - def empty_line_between_macros; end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#254 - def end_loc(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#200 - def expected_lines; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#218 - def line_count_allowed?(count); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#234 - def lines_between_defs(first_def_node, second_def_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#177 - def macro_candidate?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#230 - def maximum_empty_lines; end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#194 - def message(node, count: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#182 - def method_candidate?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#226 - def minimum_empty_lines; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#190 - def module_candidate?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#209 - def multiple_blank_lines_groups?(first_def_node, second_def_node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#276 - def node_type(node); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#108 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#106 -RuboCop::Cop::Layout::EmptyLineBetweenDefs::MSG = T.let(T.unsafe(nil), String) - -# Checks for two or more consecutive blank lines. -# -# @example -# -# # bad - It has two empty lines. -# some_method -# # one empty line -# # two empty lines -# some_method -# -# # good -# some_method -# # one empty line -# some_method -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#21 -class RuboCop::Cop::Layout::EmptyLines < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#28 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#45 - def each_extra_empty_line(lines); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#63 - def exceeds_line_offset?(line_diff); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#67 - def previous_and_current_lines_empty?(line); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#26 -RuboCop::Cop::Layout::EmptyLines::LINE_OFFSET = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#25 -RuboCop::Cop::Layout::EmptyLines::MSG = T.let(T.unsafe(nil), String) - -# Access modifiers should be surrounded by blank lines. -# -# @example EnforcedStyle: around (default) -# -# # bad -# class Foo -# def bar; end -# private -# def baz; end -# end -# -# # good -# class Foo -# def bar; end -# -# private -# -# def baz; end -# end -# @example EnforcedStyle: only_before -# -# # bad -# class Foo -# def bar; end -# private -# def baz; end -# end -# -# # good -# class Foo -# def bar; end -# -# private -# def baz; end -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#43 -class RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # @return [EmptyLinesAroundAccessModifier] a new instance of EmptyLinesAroundAccessModifier - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#56 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#81 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#62 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#81 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#71 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#81 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#76 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#88 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#116 - def allowed_only_before_style?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#167 - def block_start?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#173 - def body_end?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#161 - def class_def?(line); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#125 - def correct_next_line_if_denied_style(corrector, node, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#157 - def empty_lines_around?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#105 - def expected_empty_lines?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#226 - def inside_block?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#183 - def message(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#192 - def message_for_around_style(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#202 - def message_for_only_before_style(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#179 - def next_empty_line_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#151 - def next_line_empty?(last_send_line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#230 - def no_empty_lines_around_block_body?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#144 - def previous_line_empty?(send_line); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#140 - def previous_line_ignoring_comments(processed_source, send_line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#220 - def should_insert_line_after?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#212 - def should_insert_line_before?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#48 -RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#52 -RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#49 -RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_AND_AFTER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#51 -RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#54 -RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks if empty lines exist around the arguments -# of a method invocation. -# -# @example -# # bad -# do_something( -# foo -# -# ) -# -# process(bar, -# -# baz: qux, -# thud: fred) -# -# some_method( -# -# [1,2,3], -# x: y -# ) -# -# # good -# do_something( -# foo -# ) -# -# process(bar, -# baz: qux, -# thud: fred) -# -# some_method( -# [1,2,3], -# x: y -# ) -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#41 -class RuboCop::Cop::Layout::EmptyLinesAroundArguments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#47 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#47 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#65 - def empty_lines(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#71 - def extra_lines(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#93 - def inner_lines(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#84 - def line_numbers(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#97 - def outer_lines(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#78 - def processed_lines(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#61 - def receiver_and_method_call_on_different_lines?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#45 -RuboCop::Cop::Layout::EmptyLinesAroundArguments::MSG = T.let(T.unsafe(nil), String) - -# Checks for a newline after an attribute accessor or a group of them. -# `alias` syntax and `alias_method`, `public`, `protected`, and `private` methods are allowed -# by default. These are customizable with `AllowAliasSyntax` and `AllowedMethods` options. -# -# @example -# # bad -# attr_accessor :foo -# def do_something -# end -# -# # good -# attr_accessor :foo -# -# def do_something -# end -# -# # good -# attr_accessor :foo -# attr_reader :bar -# attr_writer :baz -# attr :qux -# -# def do_something -# end -# @example AllowAliasSyntax: true (default) -# # good -# attr_accessor :foo -# alias :foo? :foo -# -# def do_something -# end -# @example AllowAliasSyntax: false -# # bad -# attr_accessor :foo -# alias :foo? :foo -# -# def do_something -# end -# -# # good -# attr_accessor :foo -# -# alias :foo? :foo -# -# def do_something -# end -# @example AllowedMethods: ['private'] -# # good -# attr_accessor :foo -# private :foo -# -# def do_something -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#63 -class RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#70 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#123 - def allow_alias?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#133 - def allow_alias_syntax?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#127 - def attribute_or_allowed_method?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#83 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#107 - def next_line_empty?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#94 - def next_line_empty_or_enable_directive_comment?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#101 - def next_line_enable_directive_comment?(line); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#117 - def next_line_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#111 - def require_empty_line?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#68 -RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor::MSG = T.let(T.unsafe(nil), String) - -# Checks if empty lines exist around the bodies of begin-end -# blocks. -# -# @example -# -# # bad -# begin -# -# # ... -# -# end -# -# # good -# begin -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#23 -class RuboCop::Cop::Layout::EmptyLinesAroundBeginBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#29 - def on_kwbegin(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#35 - def style; end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#27 -RuboCop::Cop::Layout::EmptyLinesAroundBeginBody::KIND = T.let(T.unsafe(nil), String) - -# Checks if empty lines around the bodies of blocks match -# the configuration. -# -# @example EnforcedStyle: no_empty_lines (default) -# # good -# -# foo do |bar| -# # ... -# end -# @example EnforcedStyle: empty_lines -# # good -# -# foo do |bar| -# -# # ... -# -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#24 -class RuboCop::Cop::Layout::EmptyLinesAroundBlockBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#30 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#30 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#30 - def on_numblock(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#28 -RuboCop::Cop::Layout::EmptyLinesAroundBlockBody::KIND = T.let(T.unsafe(nil), String) - -# Common functionality for checking if presence/absence of empty lines -# around some kind of body matches the configuration. -# -# source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#8 -module RuboCop::Cop::Layout::EmptyLinesAroundBody - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#20 - def constant_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#23 - def empty_line_required?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#26 - def check(node, body, adjusted_first_line: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#81 - def check_beginning(style, first_line); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#67 - def check_both(style, first_line, last_line); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#108 - def check_deferred_empty_line(body); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#43 - def check_empty_lines_except_namespace(body, first_line, last_line); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#51 - def check_empty_lines_special(body, first_line, last_line); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#85 - def check_ending(style, last_line); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#98 - def check_line(style, line, msg); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#89 - def check_source(style, line_no, desc); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#159 - def deferred_message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#132 - def first_child_requires_empty_line?(body); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#140 - def first_empty_line_required_child(body); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#155 - def message(type, desc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#122 - def namespace?(body, with_one_child: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#148 - def previous_line_ignoring_comments(send_line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#163 - def valid_body_style?(body); end -end - -# source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#15 -RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_DEFERRED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#13 -RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_EXTRA = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#14 -RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_MISSING = T.let(T.unsafe(nil), String) - -# Checks if empty lines around the bodies of classes match -# the configuration. -# -# @example EnforcedStyle: no_empty_lines (default) -# # good -# -# class Foo -# def bar -# # ... -# end -# end -# @example EnforcedStyle: empty_lines -# # good -# -# class Foo -# -# def bar -# # ... -# end -# -# end -# @example EnforcedStyle: empty_lines_except_namespace -# # good -# -# class Foo -# class Bar -# -# # ... -# -# end -# end -# @example EnforcedStyle: empty_lines_special -# # good -# class Foo -# -# def bar; end -# -# end -# @example EnforcedStyle: beginning_only -# # good -# -# class Foo -# -# def bar -# # ... -# end -# end -# @example EnforcedStyle: ending_only -# # good -# -# class Foo -# def bar -# # ... -# end -# -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#67 -class RuboCop::Cop::Layout::EmptyLinesAroundClassBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#73 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#79 - def on_sclass(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#71 -RuboCop::Cop::Layout::EmptyLinesAroundClassBody::KIND = T.let(T.unsafe(nil), String) - -# Checks if empty lines exist around the bodies of `begin` -# sections. This cop doesn't check empty lines at `begin` body -# beginning/end and around method definition body. -# `Layout/EmptyLinesAroundBeginBody` or `Layout/EmptyLinesAroundMethodBody` -# can be used for this purpose. -# -# @example -# -# # good -# -# begin -# do_something -# rescue -# do_something2 -# else -# do_something3 -# ensure -# do_something4 -# end -# -# # good -# -# def foo -# do_something -# rescue -# do_something2 -# end -# -# # bad -# -# begin -# do_something -# -# rescue -# -# do_something2 -# -# else -# -# do_something3 -# -# ensure -# -# do_something4 -# end -# -# # bad -# -# def foo -# do_something -# -# rescue -# -# do_something2 -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#61 -class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#74 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#80 - def check_body(body, line_of_def_or_kwbegin); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#112 - def keyword_locations(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#129 - def keyword_locations_in_ensure(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#125 - def keyword_locations_in_rescue(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#95 - def last_body_and_end_on_same_line?(body); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#104 - def message(location, keyword); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#108 - def style; end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#65 -RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords::MSG = T.let(T.unsafe(nil), String) - -# Checks if empty lines exist around the bodies of methods. -# -# @example -# -# # good -# -# def foo -# # ... -# end -# -# # bad -# -# def bar -# -# # ... -# -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#23 -class RuboCop::Cop::Layout::EmptyLinesAroundMethodBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#29 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#29 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#47 - def offending_endless_method?(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#52 - def register_offense_for_endless_method(node); end - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#43 - def style; end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#27 -RuboCop::Cop::Layout::EmptyLinesAroundMethodBody::KIND = T.let(T.unsafe(nil), String) - -# Checks if empty lines around the bodies of modules match -# the configuration. -# -# @example EnforcedStyle: no_empty_lines (default) -# # good -# -# module Foo -# def bar -# # ... -# end -# end -# @example EnforcedStyle: empty_lines -# # good -# -# module Foo -# -# def bar -# # ... -# end -# -# end -# @example EnforcedStyle: empty_lines_except_namespace -# # good -# -# module Foo -# module Bar -# -# # ... -# -# end -# end -# @example EnforcedStyle: empty_lines_special -# # good -# module Foo -# -# def bar; end -# -# end -# -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#47 -class RuboCop::Cop::Layout::EmptyLinesAroundModuleBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Layout::EmptyLinesAroundBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#53 - def on_module(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#51 -RuboCop::Cop::Layout::EmptyLinesAroundModuleBody::KIND = T.let(T.unsafe(nil), String) - -# Checks whether the end keywords are aligned properly. -# -# Three modes are supported through the `EnforcedStyleAlignWith` -# configuration parameter: -# -# If it's set to `keyword` (which is the default), the `end` -# shall be aligned with the start of the keyword (if, class, etc.). -# -# If it's set to `variable` the `end` shall be aligned with the -# left-hand-side of the variable assignment, if there is one. -# -# If it's set to `start_of_line`, the `end` shall be aligned with the -# start of the line where the matching keyword appears. -# -# This `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) -# by default. On the other hand, `Layout/BeginEndAlignment` cop aligns with -# `EnforcedStyleAlignWith: start_of_line` by default due to `||= begin` tends -# to align with the start of the line. `Layout/DefEndAlignment` cop also aligns with -# `EnforcedStyleAlignWith: start_of_line` by default. -# These style can be configured by each cop. -# -# @example EnforcedStyleAlignWith: keyword (default) -# # bad -# -# variable = if true -# end -# -# # good -# -# variable = if true -# end -# -# variable = -# if true -# end -# @example EnforcedStyleAlignWith: variable -# # bad -# -# variable = if true -# end -# -# # good -# -# variable = if true -# end -# -# variable = -# if true -# end -# @example EnforcedStyleAlignWith: start_of_line -# # bad -# -# variable = if true -# end -# -# puts(if true -# end) -# -# # good -# -# variable = if true -# end -# -# puts(if true -# end) -# -# variable = -# if true -# end -# -# source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#77 -class RuboCop::Cop::Layout::EndAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#111 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#111 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#83 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#99 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#95 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#87 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#107 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#103 - def on_while(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#167 - def alignment_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#184 - def alignment_node_for_variable_style(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#148 - def asgn_variable_align_with(outer_node, inner_node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#202 - def assignment_or_operator_method(node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#122 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#137 - def check_asgn_alignment(outer_node, inner_node); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#126 - def check_assignment(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#158 - def check_other_alignment(node); end -end - -# Checks for Windows-style line endings in the source code. -# -# @example EnforcedStyle: native (default) -# # The `native` style means that CR+LF (Carriage Return + Line Feed) is -# # enforced on Windows, and LF is enforced on other platforms. -# -# # bad -# puts 'Hello' # Return character is LF on Windows. -# puts 'Hello' # Return character is CR+LF on other than Windows. -# -# # good -# puts 'Hello' # Return character is CR+LF on Windows. -# puts 'Hello' # Return character is LF on other than Windows. -# @example EnforcedStyle: lf -# # The `lf` style means that LF (Line Feed) is enforced on -# # all platforms. -# -# # bad -# puts 'Hello' # Return character is CR+LF on all platforms. -# -# # good -# puts 'Hello' # Return character is LF on all platforms. -# @example EnforcedStyle: crlf -# # The `crlf` style means that CR+LF (Carriage Return + Line Feed) is -# # enforced on all platforms. -# -# # bad -# puts 'Hello' # Return character is LF on all platforms. -# -# # good -# puts 'Hello' # Return character is CR+LF on all platforms. -# -# source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#40 -class RuboCop::Cop::Layout::EndOfLine < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#71 - def offense_message(line); end - - # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#47 - def on_new_investigation; end - - # If there is no LF on the last line, we don't care if there's no CR. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#67 - def unimportant_missing_cr?(index, last_line, line); end - - private - - # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#85 - def last_line(processed_source); end -end - -# source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#44 -RuboCop::Cop::Layout::EndOfLine::MSG_DETECTED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#45 -RuboCop::Cop::Layout::EndOfLine::MSG_MISSING = T.let(T.unsafe(nil), String) - -# Checks for extra/unnecessary whitespace. -# -# @example -# -# # good if AllowForAlignment is true -# name = "RuboCop" -# # Some comment and an empty line -# -# website += "/rubocop/rubocop" unless cond -# puts "rubocop" if debug -# -# # bad for any configuration -# set_app("RuboCop") -# website = "https://github.com/rubocop/rubocop" -# -# # good only if AllowBeforeTrailingComments is true -# object.method(arg) # this is a comment -# -# # good even if AllowBeforeTrailingComments is false or not set -# object.method(arg) # this is a comment -# -# # good with either AllowBeforeTrailingComments or AllowForAlignment -# object.method(arg) # this is a comment -# another_object.method(arg) # this is another comment -# some_object.method(arg) # this is some comment -# -# source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#31 -class RuboCop::Cop::Layout::ExtraSpacing < ::RuboCop::Cop::Base - include ::RuboCop::Cop::PrecedingFollowingAlignment - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#39 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#170 - def align_column(asgn_token); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#147 - def align_equal_sign(corrector, token, align_to); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#137 - def align_equal_signs(range, corrector); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#52 - def aligned_locations(locs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#103 - def aligned_tok?(token); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#159 - def all_relevant_assignment_lines(line_number); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#179 - def allow_for_trailing_comments?; end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#72 - def check_assignment(token); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#81 - def check_other(token1, token2, ast); end - - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#62 - def check_tokens(ast, token1, token2); end - - # @yield [range_between(start_pos, end_pos)] - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#91 - def extra_space_range(token1, token2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#133 - def force_equal_sign_alignment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#111 - def ignored_range?(ast, start_pos); end - - # Returns an array of ranges that should not be reported. It's the - # extra spaces between the keys and values in a multiline hash, - # since those are handled by the Layout/HashAlignment cop. - # - # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#118 - def ignored_ranges(ast); end -end - -# source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#37 -RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#36 -RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) - -# Checks the indentation of the first argument in a method call. -# Arguments after the first one are checked by `Layout/ArgumentAlignment`, -# not by this cop. -# -# For indenting the first parameter of method _definitions_, check out -# `Layout/FirstParameterIndentation`. -# -# This cop will respect `Layout/ArgumentAlignment` and will not work when -# `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`. -# -# @example -# -# # bad -# some_method( -# first_param, -# second_param) -# -# foo = some_method( -# first_param, -# second_param) -# -# foo = some_method(nested_call( -# nested_first_param), -# second_param) -# -# foo = some_method( -# nested_call( -# nested_first_param), -# second_param) -# -# some_method nested_call( -# nested_first_param), -# second_param -# @example EnforcedStyle: special_for_inner_method_call_in_parentheses (default) -# # Same as `special_for_inner_method_call` except that the special rule -# # only applies if the outer method call encloses its arguments in -# # parentheses. -# -# # good -# some_method( -# first_param, -# second_param) -# -# foo = some_method( -# first_param, -# second_param) -# -# foo = some_method(nested_call( -# nested_first_param), -# second_param) -# -# foo = some_method( -# nested_call( -# nested_first_param), -# second_param) -# -# some_method nested_call( -# nested_first_param), -# second_param -# @example EnforcedStyle: consistent -# # The first argument should always be indented one step more than the -# # preceding line. -# -# # good -# some_method( -# first_param, -# second_param) -# -# foo = some_method( -# first_param, -# second_param) -# -# foo = some_method(nested_call( -# nested_first_param), -# second_param) -# -# foo = some_method( -# nested_call( -# nested_first_param), -# second_param) -# -# some_method nested_call( -# nested_first_param), -# second_param -# @example EnforcedStyle: consistent_relative_to_receiver -# # The first argument should always be indented one level relative to -# # the parent that is receiving the argument -# -# # good -# some_method( -# first_param, -# second_param) -# -# foo = some_method( -# first_param, -# second_param) -# -# foo = some_method(nested_call( -# nested_first_param), -# second_param) -# -# foo = some_method( -# nested_call( -# nested_first_param), -# second_param) -# -# some_method nested_call( -# nested_first_param), -# second_params -# @example EnforcedStyle: special_for_inner_method_call -# # The first argument should normally be indented one step more than -# # the preceding line, but if it's an argument for a method call that -# # is itself an argument in a method call, then the inner argument -# # should be indented relative to the inner method. -# -# # good -# some_method( -# first_param, -# second_param) -# -# foo = some_method( -# first_param, -# second_param) -# -# foo = some_method(nested_call( -# nested_first_param), -# second_param) -# -# foo = some_method( -# nested_call( -# nested_first_param), -# second_param) -# -# some_method nested_call( -# nested_first_param), -# second_param -# -# source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#147 -class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#222 - def eligible_method_call?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#155 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#155 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#155 - def on_super(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#174 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#178 - def bare_operator?(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#198 - def base_indentation(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#226 - def base_range(send_node, arg_node); end - - # Returns the column of the given range. For single line ranges, this - # is simple. For ranges with line breaks, we look a the last code line. - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#238 - def column_of(range); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#259 - def comment_lines; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#276 - def enable_layout_first_method_argument_line_break?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#271 - def enforce_first_argument_with_fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#182 - def message(arg_node); end - - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#267 - def on_new_investigation; end - - # Takes the line number of a given code line and returns a string - # containing the previous line that's not a comment line or a blank - # line. - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#250 - def previous_code_line(line_number); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#170 - def should_check?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#206 - def special_inner_call_indentation?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#153 -RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the first element in an array literal -# where the opening bracket and the first element are on separate lines. -# The other elements' indentations are handled by `Layout/ArrayAlignment` cop. -# -# This cop will respect `Layout/ArrayAlignment` and will not work when -# `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArrayAlignment`. -# -# By default, array literals that are arguments in a method call with -# parentheses, and where the opening square bracket of the array is on the -# same line as the opening parenthesis of the method call, shall have -# their first element indented one step (two spaces) more than the -# position inside the opening parenthesis. -# -# Other array literals shall have their first element indented one step -# more than the start of the line where the opening square bracket is. -# -# This default style is called 'special_inside_parentheses'. Alternative -# styles are 'consistent' and 'align_brackets'. Here are examples: -# -# @example EnforcedStyle: special_inside_parentheses (default) -# # The `special_inside_parentheses` style enforces that the first -# # element in an array literal where the opening bracket and first -# # element are on separate lines is indented one step (two spaces) more -# # than the position inside the opening parenthesis. -# -# # bad -# array = [ -# :value -# ] -# and_in_a_method_call([ -# :no_difference -# ]) -# -# # good -# array = [ -# :value -# ] -# but_in_a_method_call([ -# :its_like_this -# ]) -# @example EnforcedStyle: consistent -# # The `consistent` style enforces that the first element in an array -# # literal where the opening bracket and the first element are on -# # separate lines is indented the same as an array literal which is not -# # defined inside a method call. -# -# # bad -# array = [ -# :value -# ] -# but_in_a_method_call([ -# :its_like_this -# ]) -# -# # good -# array = [ -# :value -# ] -# and_in_a_method_call([ -# :no_difference -# ]) -# @example EnforcedStyle: align_brackets -# # The `align_brackets` style enforces that the opening and closing -# # brackets are indented to the same position. -# -# # bad -# and_now_for_something = [ -# :completely_different -# ] -# -# # good -# and_now_for_something = [ -# :completely_different -# ] -# -# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#82 -class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineElementIndentation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#91 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#97 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#97 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#108 - def autocorrect(corrector, node); end - - # Returns the description of what the correct indentation is based on. - # - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#146 - def base_description(indent_base_type); end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#112 - def brace_alignment_style; end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#116 - def check(array_node, left_parenthesis); end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#130 - def check_right_bracket(right_bracket, first_elem, left_bracket, left_parenthesis); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#182 - def enforce_first_argument_with_fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#159 - def message(base_description); end - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#167 - def message_for_right_bracket(indent_base_type); end -end - -# source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#88 -RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks for a line break before the first element in a -# multi-line array. -# -# @example -# -# # bad -# [ :a, -# :b] -# -# # good -# [ -# :a, -# :b] -# -# # good -# [:a, :b] -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# [ :a, { -# :b => :c -# }] -# -# # good -# [ -# :a, { -# :b => :c -# }] -# @example AllowMultilineFinalElement: true -# -# # good -# [:a, { -# :b => :c -# }] -# -# source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#43 -class RuboCop::Cop::Layout::FirstArrayElementLineBreak < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FirstElementLineBreak - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#49 - def on_array(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#57 - def assignment_on_same_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#62 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#47 -RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the first key in a hash literal -# where the opening brace and the first key are on separate lines. The -# other keys' indentations are handled by the HashAlignment cop. -# -# By default, `Hash` literals that are arguments in a method call with -# parentheses, and where the opening curly brace of the hash is on the -# same line as the opening parenthesis of the method call, shall have -# their first key indented one step (two spaces) more than the position -# inside the opening parenthesis. -# -# Other hash literals shall have their first key indented one step more -# than the start of the line where the opening curly brace is. -# -# This default style is called 'special_inside_parentheses'. Alternative -# styles are 'consistent' and 'align_braces'. Here are examples: -# -# @example EnforcedStyle: special_inside_parentheses (default) -# # The `special_inside_parentheses` style enforces that the first key -# # in a hash literal where the opening brace and the first key are on -# # separate lines is indented one step (two spaces) more than the -# # position inside the opening parentheses. -# -# # bad -# hash = { -# key: :value -# } -# and_in_a_method_call({ -# no: :difference -# }) -# takes_multi_pairs_hash(x: { -# a: 1, -# b: 2 -# }, -# y: { -# c: 1, -# d: 2 -# }) -# -# # good -# special_inside_parentheses -# hash = { -# key: :value -# } -# but_in_a_method_call({ -# its_like: :this -# }) -# takes_multi_pairs_hash(x: { -# a: 1, -# b: 2 -# }, -# y: { -# c: 1, -# d: 2 -# }) -# @example EnforcedStyle: consistent -# # The `consistent` style enforces that the first key in a hash -# # literal where the opening brace and the first key are on -# # separate lines is indented the same as a hash literal which is not -# # defined inside a method call. -# -# # bad -# hash = { -# key: :value -# } -# but_in_a_method_call({ -# its_like: :this -# }) -# -# # good -# hash = { -# key: :value -# } -# and_in_a_method_call({ -# no: :difference -# }) -# @example EnforcedStyle: align_braces -# # The `align_brackets` style enforces that the opening and closing -# # braces are indented to the same position. -# -# # bad -# and_now_for_something = { -# completely: :different -# } -# takes_multi_pairs_hash(x: { -# a: 1, -# b: 2 -# }, -# y: { -# c: 1, -# d: 2 -# }) -# -# # good -# and_now_for_something = { -# completely: :different -# } -# takes_multi_pairs_hash(x: { -# a: 1, -# b: 2 -# }, -# y: { -# c: 1, -# d: 2 -# }) -# -# source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#113 -class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineElementIndentation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#126 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#122 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#126 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#137 - def autocorrect(corrector, node); end - - # Returns the description of what the correct indentation is based on. - # - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#191 - def base_description(indent_base_type); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#141 - def brace_alignment_style; end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#145 - def check(hash_node, left_parenthesis); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#184 - def check_based_on_longest_key(hash_node, left_brace, left_parenthesis); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#164 - def check_right_brace(right_brace, first_pair, left_brace, left_parenthesis); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#227 - def enforce_first_argument_with_fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#204 - def message(base_description); end - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#212 - def message_for_right_brace(indent_base_type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#178 - def separator_style?(first_pair); end -end - -# source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#119 -RuboCop::Cop::Layout::FirstHashElementIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks for a line break before the first element in a -# multi-line hash. -# -# @example -# -# # bad -# { a: 1, -# b: 2} -# -# # good -# { -# a: 1, -# b: 2 } -# -# # good -# { -# a: 1, b: { -# c: 3 -# }} -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# { a: 1, b: { -# c: 3 -# }} -# @example AllowMultilineFinalElement: true -# -# # bad -# { a: 1, -# b: { -# c: 3 -# }} -# -# # good -# { a: 1, b: { -# c: 3 -# }} -# -# source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#46 -class RuboCop::Cop::Layout::FirstHashElementLineBreak < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FirstElementLineBreak - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#52 - def on_hash(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#62 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#50 -RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), String) - -# Checks for a line break before the first argument in a -# multi-line method call. -# -# @example -# -# # bad -# method(foo, bar, -# baz) -# -# # good -# method( -# foo, bar, -# baz) -# -# # ignored -# method foo, bar, -# baz -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# method(foo, bar, { -# baz: "a", -# qux: "b", -# }) -# -# # good -# method( -# foo, bar, { -# baz: "a", -# qux: "b", -# }) -# @example AllowMultilineFinalElement: true -# -# # bad -# method(foo, -# bar, -# { -# baz: "a", -# qux: "b", -# } -# ) -# -# # good -# method(foo, bar, { -# baz: "a", -# qux: "b", -# }) -# -# # good -# method( -# foo, -# bar, -# { -# baz: "a", -# qux: "b", -# } -# ) -# @example AllowedMethods: ['some_method'] -# -# # good -# some_method(foo, bar, -# baz) -# -# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#71 -class RuboCop::Cop::Layout::FirstMethodArgumentLineBreak < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FirstElementLineBreak - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 - def on_super(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#99 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#76 -RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String) - -# Checks for a line break before the first parameter in a -# multi-line method parameter definition. -# -# @example -# -# # bad -# def method(foo, bar, -# baz) -# do_something -# end -# -# # good -# def method( -# foo, bar, -# baz) -# do_something -# end -# -# # ignored -# def method foo, -# bar -# do_something -# end -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# def method(foo, bar, baz = { -# :a => "b", -# }) -# do_something -# end -# -# # good -# def method( -# foo, bar, baz = { -# :a => "b", -# }) -# do_something -# end -# @example AllowMultilineFinalElement: true -# -# # good -# def method(foo, bar, baz = { -# :a => "b", -# }) -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#56 -class RuboCop::Cop::Layout::FirstMethodParameterLineBreak < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FirstElementLineBreak - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#62 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#62 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#69 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#60 -RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the first parameter in a method -# definition. Parameters after the first one are checked by -# `Layout/ParameterAlignment`, not by this cop. -# -# For indenting the first argument of method _calls_, check out -# `Layout/FirstArgumentIndentation`, which supports options related to -# nesting that are irrelevant for method _definitions_. -# -# @example -# -# # bad -# def some_method( -# first_param, -# second_param) -# 123 -# end -# @example EnforcedStyle: consistent (default) -# # The first parameter should always be indented one step more than the -# # preceding line. -# -# # good -# def some_method( -# first_param, -# second_param) -# 123 -# end -# @example EnforcedStyle: align_parentheses -# # The first parameter should always be indented one step more than the -# # opening parenthesis. -# -# # good -# def some_method( -# first_param, -# second_param) -# 123 -# end -# -# source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#44 -class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineElementIndentation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#53 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#53 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#63 - def autocorrect(corrector, node); end - - # Returns the description of what the correct indentation is based on. - # - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#83 - def base_description(_); end - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#67 - def brace_alignment_style; end - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#71 - def check(def_node); end - - # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#91 - def message(base_description); end -end - -# source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#50 -RuboCop::Cop::Layout::FirstParameterIndentation::MSG = T.let(T.unsafe(nil), String) - -# Check that the keys, separators, and values of a multi-line hash -# literal are aligned according to configuration. The configuration -# options are: -# -# * key (left align keys, one space before hash rockets and values) -# * separator (align hash rockets and colons, right align keys) -# * table (left align keys, hash rockets, and values) -# -# The treatment of hashes passed as the last argument to a method call -# can also be configured. The options are: -# -# * always_inspect -# * always_ignore -# * ignore_implicit (without curly braces) -# -# Alternatively you can specify multiple allowed styles. That's done by -# passing a list of styles to EnforcedHashRocketStyle and EnforcedColonStyle. -# -# @example EnforcedLastArgumentHashStyle: ignore_explicit -# # Ignore only explicit hashes. -# -# # bad -# do_something(foo: 1, -# bar: 2) -# -# # good -# do_something({foo: 1, -# bar: 2}) -# @example EnforcedHashRocketStyle: separator -# # bad -# { -# :foo => bar, -# :ba => baz -# } -# { -# :foo => bar, -# :ba => baz -# } -# -# # good -# { -# :foo => bar, -# :ba => baz -# } -# @example EnforcedHashRocketStyle: table -# # bad -# { -# :foo => bar, -# :ba => baz -# } -# -# # good -# { -# :foo => bar, -# :ba => baz -# } -# @example EnforcedColonStyle: key (default) -# # bad -# { -# foo: bar, -# ba: baz -# } -# { -# foo: bar, -# ba: baz -# } -# -# # good -# { -# foo: bar, -# ba: baz -# } -# @example EnforcedColonStyle: separator -# # bad -# { -# foo: bar, -# ba: baz -# } -# -# # good -# { -# foo: bar, -# ba: baz -# } -# @example EnforcedColonStyle: table -# # bad -# { -# foo: bar, -# ba: baz -# } -# -# # good -# { -# foo: bar, -# ba: baz -# } -# @example EnforcedLastArgumentHashStyle: always_inspect (default) -# # Inspect both implicit and explicit hashes. -# -# # bad -# do_something(foo: 1, -# bar: 2) -# -# # bad -# do_something({foo: 1, -# bar: 2}) -# -# # good -# do_something(foo: 1, -# bar: 2) -# -# # good -# do_something( -# foo: 1, -# bar: 2 -# ) -# -# # good -# do_something({foo: 1, -# bar: 2}) -# -# # good -# do_something({ -# foo: 1, -# bar: 2 -# }) -# @example EnforcedLastArgumentHashStyle: always_ignore -# # Ignore both implicit and explicit hashes. -# -# # good -# do_something(foo: 1, -# bar: 2) -# -# # good -# do_something({foo: 1, -# bar: 2}) -# @example EnforcedLastArgumentHashStyle: ignore_implicit -# # Ignore only implicit hashes. -# -# # bad -# do_something({foo: 1, -# bar: 2}) -# -# # good -# do_something(foo: 1, -# bar: 2) -# @example EnforcedHashRocketStyle: key (default) -# # bad -# { -# :foo => bar, -# :ba => baz -# } -# { -# :foo => bar, -# :ba => baz -# } -# -# # good -# { -# :foo => bar, -# :ba => baz -# } -# -# source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#178 -class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::HashAlignmentStyles - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # Returns the value of attribute column_deltas. - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 - def column_deltas; end - - # Sets the attribute column_deltas - # - # @param value the value to set the attribute column_deltas to. - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 - def column_deltas=(_arg0); end - - # Returns the value of attribute offenses_by. - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 - def offenses_by; end - - # Sets the attribute offenses_by - # - # @param value the value to set the attribute offenses_by to. - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 - def offenses_by=(_arg0); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#209 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 - def on_super(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 - def on_yield(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#267 - def add_offenses; end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#373 - def adjust(corrector, delta, range); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#302 - def alignment_for(pair); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#316 - def alignment_for_colons; end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#312 - def alignment_for_hash_rockets; end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#235 - def argument_before_hash(hash_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#223 - def autocorrect_incompatible_with_other_cops?(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#285 - def check_delta(delta, node:, alignment:); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#248 - def check_pairs(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#339 - def correct_key_value(corrector, delta, key, value, separator); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#335 - def correct_no_value(corrector, key_delta, key); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#320 - def correct_node(corrector, node, delta); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#244 - def double_splat?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#386 - def enforce_first_argument_with_fixed_indentation?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#382 - def good_alignment?(column_deltas); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#293 - def ignore_hash_argument?(node); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#355 - def new_alignment(key); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#275 - def register_offenses_with_format(offenses, format); end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#239 - def reset!; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#391 - def same_line?(node1, node2); end -end - -# source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#183 -RuboCop::Cop::Layout::HashAlignment::MESSAGES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#193 -RuboCop::Cop::Layout::HashAlignment::SEPARATOR_ALIGNMENT_STYLES = T.let(T.unsafe(nil), Array) - -# Checks for the placement of the closing parenthesis -# in a method call that passes a HEREDOC string as an argument. -# It should be placed at the end of the line containing the -# opening HEREDOC tag. -# -# @example -# # bad -# -# foo(<<-SQL -# bar -# SQL -# ) -# -# foo(<<-SQL, 123, <<-NOSQL, -# bar -# SQL -# baz -# NOSQL -# ) -# -# foo( -# bar(<<-SQL -# baz -# SQL -# ), -# 123, -# ) -# -# # good -# -# foo(<<-SQL) -# bar -# SQL -# -# foo(<<-SQL, 123, <<-NOSQL) -# bar -# SQL -# baz -# NOSQL -# -# foo( -# bar(<<-SQL), -# baz -# SQL -# 123, -# ) -# -# source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#53 -class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#64 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#64 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#185 - def add_correct_closing_paren(node, corrector); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#272 - def add_correct_external_trailing_comma(node, corrector); end - - # Autocorrection note: - # - # Commas are a bit tricky to handle when the method call is - # embedded in another expression. Here's an example: - # - # [ - # first_array_value, - # foo(<<-SQL, 123, 456, - # SELECT * FROM db - # SQL - # ), - # third_array_value, - # ] - # - # The "internal" trailing comma is after `456`. - # The "external" trailing comma is after `)`. - # - # To autocorrect, we remove the latter, and move the former up: - # - # [ - # first_array_value, - # foo(<<-SQL, 123, 456), - # SELECT * FROM db - # SQL - # third_array_value, - # ] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#108 - def autocorrect(corrector, node); end - - # Closing parenthesis helpers. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#163 - def end_keyword_before_closing_parenthesis?(parenthesized_send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#223 - def exist_argument_between_heredoc_end_and_closing_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#290 - def external_trailing_comma?(node); end - - # Returns nil if no trailing external comma. - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#295 - def external_trailing_comma_offset_from_loc_end(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#138 - def extract_heredoc(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#134 - def extract_heredoc_argument(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#231 - def find_most_bottom_of_heredoc_end(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#180 - def fix_closing_parenthesis(node, corrector); end - - # External trailing comma helpers. - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#267 - def fix_external_trailing_comma(node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#150 - def heredoc_node?(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#198 - def incorrect_parenthesis_removal_begin(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#214 - def incorrect_parenthesis_removal_end(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#245 - def internal_trailing_comma?(node); end - - # Returns nil if no trailing internal comma. - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#250 - def internal_trailing_comma_offset_from_last_arg(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#116 - def outermost_send_on_same_line(heredoc); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#189 - def remove_incorrect_closing_paren(node, corrector); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#278 - def remove_incorrect_external_trailing_comma(node, corrector); end - - # Internal trailing comma helpers. - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#239 - def remove_internal_trailing_comma(node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#208 - def safe_to_remove_line_containing_closing_paren?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#127 - def send_missing_closing_parens?(parent, child, heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#154 - def single_line_send_with_heredoc_receiver?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#306 - def space?(pos); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#169 - def subsequent_closing_parentheses_in_same_line?(outermost_send); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#60 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#57 -RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the here document bodies. The bodies -# are indented one step. -# -# NOTE: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default), -# this cop does not add any offenses for long here documents to -# avoid ``Layout/LineLength``'s offenses. -# -# @example -# # bad -# <<-RUBY -# something -# RUBY -# -# # good -# <<~RUBY -# something -# RUBY -# -# source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#24 -class RuboCop::Cop::Layout::HeredocIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::Heredoc - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#36 - def on_heredoc(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#120 - def adjust_minus(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#115 - def adjust_squiggly(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#144 - def base_indent_level(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#155 - def heredoc_body(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#159 - def heredoc_end(node); end - - # Returns '~', '-' or nil - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#151 - def heredoc_indent_type(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#126 - def indented_body(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#133 - def indented_end(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#91 - def line_too_long?(node); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#103 - def longest_line(lines); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#111 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#69 - def message(heredoc_indent_type); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#57 - def register_offense(node, heredoc_indent_type); end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#79 - def type_message(indentation_width, current_indent_type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#107 - def unlimited_heredoc_length?; end - - # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#87 - def width_message(indentation_width); end -end - -# source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#32 -RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#34 -RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String) - -# Checks for inconsistent indentation. -# -# The difference between `indented_internal_methods` and `normal` is -# that the `indented_internal_methods` style prescribes that in -# classes and modules the `protected` and `private` modifier keywords -# shall be indented the same as public methods and that protected and -# private members shall be indented one step more than the modifiers. -# Other than that, both styles mean that entities on the same logical -# depth shall have the same indentation. -# -# @example EnforcedStyle: normal (default) -# # bad -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# end -# -# # bad -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# -# protected -# -# def foo -# end -# -# private -# -# def bar -# end -# end -# -# # good -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# end -# -# # good -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# -# protected -# -# def foo -# end -# -# private -# -# def bar -# end -# end -# @example EnforcedStyle: indented_internal_methods -# # bad -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# end -# -# # bad -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# -# protected -# -# def foo -# end -# -# private -# -# def bar -# end -# end -# -# # good -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# end -# -# # good -# class A -# def test -# puts 'hello' -# puts 'world' -# end -# -# protected -# -# def foo -# end -# -# private -# -# def bar -# end -# end -# -# source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#121 -class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#128 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#132 - def on_kwbegin(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#138 - def autocorrect(corrector, node); end - - # Not all nodes define `bare_access_modifier?` (for example, - # `RuboCop::AST::DefNode` does not), so we must check `send_type?` first - # to avoid a NoMethodError. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#145 - def bare_access_modifier?(node); end - - # Returns an integer representing the correct indentation, or nil to - # indicate that the correct indentation is that of the first child that - # is not an access modifier. - # - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#152 - def base_column_for_normal_style(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#172 - def check(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#187 - def check_indented_internal_methods_style(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#180 - def check_normal_style(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#126 -RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String) - -# Checks that the indentation method is consistent. -# Either tabs only or spaces only are used for indentation. -# -# @example EnforcedStyle: spaces (default) -# # bad -# # This example uses a tab to indent bar. -# def foo -# bar -# end -# -# # good -# # This example uses spaces to indent bar. -# def foo -# bar -# end -# @example EnforcedStyle: tabs -# # bad -# # This example uses spaces to indent bar. -# def foo -# bar -# end -# -# # good -# # This example uses a tab to indent bar. -# def foo -# bar -# end -# -# source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#34 -class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#42 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#58 - def autocorrect(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#82 - def autocorrect_lambda_for_spaces(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#77 - def autocorrect_lambda_for_tabs(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#66 - def find_offense(line, lineno); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#88 - def in_string_literal?(ranges, tabs_range); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#109 - def message(_node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#92 - def string_literal_ranges(ast); end -end - -# source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#40 -RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) - -# Checks for indentation that doesn't use the specified number of spaces. -# The indentation width can be configured using the `Width` setting. The default width is 2. -# -# See also the `Layout/IndentationConsistency` cop which is the companion to this one. -# -# @example Width: 2 (default) -# # bad -# class A -# def test -# puts 'hello' -# end -# end -# -# # good -# class A -# def test -# puts 'hello' -# end -# end -# @example AllowedPatterns: ['^\s*module'] -# # bad -# module A -# class B -# def test -# puts 'hello' -# end -# end -# end -# -# # good -# module A -# class B -# def test -# puts 'hello' -# end -# end -# end -# -# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#44 -class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#56 - def access_modifier?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#81 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#139 - def on_case(case_node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#147 - def on_case_match(case_match); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#96 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#105 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#122 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#122 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#69 - def on_ensure(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#64 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#157 - def on_if(node, base = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#81 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#73 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#96 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#81 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#64 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#60 - def on_rescue(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#96 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#105 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#129 - def on_until(node, base = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#129 - def on_while(node, base = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#228 - def access_modifier_indentation_style; end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#166 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#236 - def check_assignment(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#256 - def check_if(node, body, else_clause, base_loc); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#269 - def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#170 - def check_members(base, members); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#194 - def check_members_for_indented_internal_methods_style(members); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#200 - def check_members_for_normal_style(base, members); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#341 - def check_rescue?(rescue_node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#377 - def configured_indentation_width; end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#208 - def each_member(members); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#232 - def indentation_consistency_style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#324 - def indentation_to_check?(base_loc, body_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#220 - def indented_internal_methods_style?; end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#381 - def leftmost_modifier_of(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#303 - def message(configured_indentation_width, indentation, name); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#360 - def offending_range(body_node, indentation); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#279 - def offense(body_node, indentation, style); end - - # Returns true if the given node is within another node that has - # already been marked for autocorrection by this cop. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#314 - def other_offense_in_same_range?(node); end - - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#182 - def select_check_member(member); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#345 - def skip_check?(base_loc, body_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#224 - def special_modifier?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#368 - def starts_with_access_modifier?(body_node); end -end - -# source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#52 -RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String) - -# Checks for indentation of the first non-blank non-comment -# line in a file. -# -# @example -# # bad -# class A -# def foo; end -# end -# -# # good -# class A -# def foo; end -# end -# -# source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#20 -class RuboCop::Cop::Layout::InitialIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#26 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#36 - def first_token; end - - # @yield [range_between(space_range.begin_pos, token.begin_pos)] - # - # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#40 - def space_before(token); end -end - -# source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#24 -RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) - -# Checks whether comments have a leading space after the -# `#` denoting the start of the comment. The leading space is not -# required for some RDoc special syntax, like `#++`, `#--`, -# `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives, -# or rackup options. -# -# @example AllowSteepAnnotation: true -# -# # good -# -# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] -# list << n -# end -# -# name = 'John' #: String -# @example AllowDoxygenCommentStyle: false (default) -# -# # bad -# -# #** -# # Some comment -# # Another line of comment -# #* -# @example AllowDoxygenCommentStyle: true -# -# # good -# -# #** -# # Some comment -# # Another line of comment -# #* -# @example AllowGemfileRubyComment: false (default) -# -# # bad -# -# #ruby=2.7.0 -# #ruby-gemset=myproject -# @example AllowGemfileRubyComment: true -# -# # good -# -# #ruby=2.7.0 -# #ruby-gemset=myproject -# @example AllowRBSInlineAnnotation: false (default) -# -# # bad -# -# include Enumerable #[Integer] -# -# attr_reader :name #: String -# attr_reader :age #: Integer? -# -# #: ( -# #| Integer, -# #| String -# #| ) -> void -# def foo; end -# @example AllowRBSInlineAnnotation: true -# -# # good -# -# include Enumerable #[Integer] -# -# attr_reader :name #: String -# attr_reader :age #: Integer? -# -# #: ( -# #| Integer, -# #| String -# #| ) -> void -# def foo; end -# @example AllowSteepAnnotation: false (default) -# -# # bad -# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] -# list << n -# end -# -# name = 'John' #: String -# @example -# -# # bad -# #Some comment -# -# # good -# # Some comment -# -# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#101 -class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#107 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#161 - def allow_doxygen_comment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#169 - def allow_gemfile_ruby_comment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#185 - def allow_rbs_inline_annotation?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#193 - def allow_steep_annotation?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#131 - def allowed_on_first_line?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#165 - def doxygen_comment_style?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#173 - def gemfile?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#181 - def gemfile_ruby_comment?(comment); end - - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#127 - def hash_mark(expr); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#157 - def rackup_config_file?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#153 - def rackup_options?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#189 - def rbs_inline_annotation?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#177 - def ruby_comment_in_gemfile?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#135 - def shebang?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#139 - def shebang_continuation?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#197 - def steep_annotation?(comment); end -end - -# source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#105 -RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) - -# Checks for unnecessary leading blank lines at the beginning -# of a file. -# -# @example -# -# # bad -# # (start of file) -# -# class Foo -# end -# -# # bad -# # (start of file) -# -# # a comment -# -# # good -# # (start of file) -# class Foo -# end -# -# # good -# # (start of file) -# # a comment -# -# source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#30 -class RuboCop::Cop::Layout::LeadingEmptyLines < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#35 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#33 -RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String) - -# Checks that strings broken over multiple lines (by a backslash) contain -# trailing spaces instead of leading spaces (default) or leading spaces -# instead of trailing spaces. -# -# @example EnforcedStyle: trailing (default) -# # bad -# 'this text contains a lot of' \ -# ' spaces' -# -# # good -# 'this text contains a lot of ' \ -# 'spaces' -# -# # bad -# 'this text is too' \ -# ' long' -# -# # good -# 'this text is too ' \ -# 'long' -# @example EnforcedStyle: leading -# # bad -# 'this text contains a lot of ' \ -# 'spaces' -# -# # good -# 'this text contains a lot of' \ -# ' spaces' -# -# # bad -# 'this text is too ' \ -# 'long' -# -# # good -# 'this text is too' \ -# ' long' -# -# source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#43 -class RuboCop::Cop::Layout::LineContinuationLeadingSpace < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#63 - def on_dstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#122 - def autocorrect(corrector, offense_range, insert_pos, spaces); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#115 - def continuation?(line, line_num, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#147 - def enforced_style_leading?; end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#85 - def investigate(first_line, second_line, end_of_first_line); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#93 - def investigate_leading_style(first_line, second_line, end_of_first_line); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#104 - def investigate_trailing_style(first_line, second_line, end_of_first_line); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#127 - def leading_offense_range(end_of_first_line, matches); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#139 - def message(_range); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#81 - def raw_lines(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#133 - def trailing_offense_range(end_of_first_line, matches); end - - class << self - # When both cops are activated and run in the same iteration of the correction loop, - # `Style/StringLiterals` undoes the moving of spaces that - # `Layout/LineContinuationLeadingSpace` performs. This is because `Style/StringLiterals` - # takes the original string content and transforms it, rather than just modifying the - # delimiters, in order to handle escaping for quotes within the string. - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#59 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#49 -RuboCop::Cop::Layout::LineContinuationLeadingSpace::LEADING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#47 -RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_1_ENDING = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#48 -RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_2_BEGINNING = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/layout/line_continuation_leading_space.rb#50 -RuboCop::Cop::Layout::LineContinuationLeadingSpace::TRAILING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) - -# Checks that the backslash of a line continuation is separated from -# preceding text by exactly one space (default) or zero spaces. -# -# @example EnforcedStyle: space (default) -# # bad -# 'a'\ -# 'b' \ -# 'c' -# -# # good -# 'a' \ -# 'b' \ -# 'c' -# @example EnforcedStyle: no_space -# # bad -# 'a' \ -# 'b' \ -# 'c' -# -# # good -# 'a'\ -# 'b'\ -# 'c' -# -# source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#30 -class RuboCop::Cop::Layout::LineContinuationSpacing < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#34 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#81 - def autocorrect(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#111 - def comment_ranges(comments); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#65 - def find_offensive_spacing(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#121 - def ignore_range?(backtick_range); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#91 - def ignored_literal_ranges(ast); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#130 - def ignored_parent?(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#125 - def ignored_ranges; end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#49 - def investigate(line, line_number); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#115 - def last_line(processed_source); end - - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#73 - def message(_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#136 - def no_space_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#140 - def space_style?; end -end - -# Checks the indentation of the next line after a line that ends with a string -# literal and a backslash. -# -# If `EnforcedStyle: aligned` is set, the concatenated string parts shall be aligned with the -# first part. There are some exceptions, such as implicit return values, where the -# concatenated string parts shall be indented regardless of `EnforcedStyle` configuration. -# -# If `EnforcedStyle: indented` is set, it's the second line that shall be indented one step -# more than the first line. Lines 3 and forward shall be aligned with line 2. -# -# @example -# # bad -# def some_method -# 'x' \ -# 'y' \ -# 'z' -# end -# -# my_hash = { -# first: 'a message' \ -# 'in two parts' -# } -# -# # good -# def some_method -# 'x' \ -# 'y' \ -# 'z' -# end -# @example EnforcedStyle: aligned (default) -# # bad -# puts 'x' \ -# 'y' -# -# my_hash = { -# first: 'a message' \ -# 'in two parts' -# } -# -# # good -# puts 'x' \ -# 'y' -# -# my_hash = { -# first: 'a message' \ -# 'in two parts' -# } -# @example EnforcedStyle: indented -# # bad -# result = 'x' \ -# 'y' -# -# my_hash = { -# first: 'a message' \ -# 'in two parts' -# } -# -# # good -# result = 'x' \ -# 'y' -# -# my_hash = { -# first: 'a message' \ -# 'in two parts' -# } -# -# source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#74 -class RuboCop::Cop::Layout::LineEndStringConcatenationIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#97 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#83 - def on_dstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#137 - def add_offense_and_correction(node, message); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#109 - def always_indented?(dstr_node); end - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#128 - def base_column(child); end - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#113 - def check_aligned(children, start_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#122 - def check_indented(children); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#103 - def strings_concatenated_with_backslash?(dstr_node); end -end - -# source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#79 -RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#80 -RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb#81 -RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_INDENTED = T.let(T.unsafe(nil), Array) - -# Checks the length of lines in the source code. -# The maximum length is configurable. -# The tab size is configured in the `IndentationWidth` -# of the `Layout/IndentationStyle` cop. -# It also ignores a shebang line by default. -# -# This cop has some autocorrection capabilities. -# It can programmatically shorten certain long lines by -# inserting line breaks into expressions that can be safely -# split across lines. These include arrays, hashes, and -# method calls with argument lists. -# -# If autocorrection is enabled, the following cops -# are recommended to further format the broken lines. -# (Many of these are enabled by default.) -# -# * `Layout/ArgumentAlignment` -# * `Layout/ArrayAlignment` -# * `Layout/BlockAlignment` -# * `Layout/BlockEndNewline` -# * `Layout/ClosingParenthesisIndentation` -# * `Layout/FirstArgumentIndentation` -# * `Layout/FirstArrayElementIndentation` -# * `Layout/FirstHashElementIndentation` -# * `Layout/FirstParameterIndentation` -# * `Layout/HashAlignment` -# * `Layout/IndentationWidth` -# * `Layout/MultilineArrayLineBreaks` -# * `Layout/MultilineBlockLayout` -# * `Layout/MultilineHashBraceLayout` -# * `Layout/MultilineHashKeyLineBreaks` -# * `Layout/MultilineMethodArgumentLineBreaks` -# * `Layout/MultilineMethodParameterLineBreaks` -# * `Layout/ParameterAlignment` -# * `Style/BlockDelimiters` -# -# Together, these cops will pretty print hashes, arrays, -# method calls, etc. For example, let's say the max columns -# is 25: -# -# @example -# -# # bad -# {foo: "0000000000", bar: "0000000000", baz: "0000000000"} -# -# # good -# {foo: "0000000000", -# bar: "0000000000", baz: "0000000000"} -# -# # good (with recommended cops enabled) -# { -# foo: "0000000000", -# bar: "0000000000", -# baz: "0000000000", -# } -# -# source://rubocop//lib/rubocop/cop/layout/line_length.rb#63 -class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckLineBreakable - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#84 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#104 - def on_investigation_end; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#98 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_potential_breakable_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#88 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#80 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#309 - def allow_heredoc?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#317 - def allow_string_split?; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#313 - def allowed_heredoc; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#266 - def allowed_line?(line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#181 - def breakable_block_range(block_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#368 - def breakable_dstr?(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#230 - def breakable_dstr_begin_position(node); end - - # Returns the value of attribute breakable_range. - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#112 - def breakable_range; end - - # Sets the attribute breakable_range - # - # @param value the value to set the attribute breakable_range to. - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#112 - def breakable_range=(_arg0); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#189 - def breakable_range_after_semicolon(semicolon_token); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#235 - def breakable_range_by_line_index; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#172 - def breakable_string?(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#239 - def breakable_string_delimiters; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#202 - def breakable_string_position(node); end - - # Locate where to break a string that is too long, ensuring that escape characters - # are not bisected. - # If the string contains spaces, use them to determine a place for a clean break; - # otherwise, the string will be broken at the line length limit. - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#214 - def breakable_string_range(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#344 - def check_directive_line(line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#135 - def check_for_breakable_block(block_node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#157 - def check_for_breakable_dstr(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#114 - def check_for_breakable_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#127 - def check_for_breakable_semicolons(processed_source); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#145 - def check_for_breakable_str(node); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#254 - def check_line(line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#361 - def check_uri_line(line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#294 - def excess_range(uri_range, line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#321 - def extract_heredocs(ast); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#243 - def heredocs; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#247 - def highlight_start(line); end - - # Find the largest possible substring of a string node to retain before a break - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#384 - def largest_possible_string(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#340 - def line_in_heredoc?(line_number); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#331 - def line_in_permitted_heredoc?(line_number); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#305 - def max; end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#276 - def register_offense(loc, line, line_index, length: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#272 - def shebang?(line, line_index); end - - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#373 - def string_delimiter(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/line_length.rb#72 -RuboCop::Cop::Layout::LineLength::MSG = T.let(T.unsafe(nil), String) - -# Checks that the closing brace in an array literal is either -# on the same line as the last array element or on a new line. -# -# When using the `symmetrical` (default) style: -# -# If an array's opening brace is on the same line as the first element -# of the array, then the closing brace should be on the same line as -# the last element of the array. -# -# If an array's opening brace is on the line above the first element -# of the array, then the closing brace should be on the line below -# the last element of the array. -# -# When using the `new_line` style: -# -# The closing brace of a multi-line array literal must be on the line -# after the last element of the array. -# -# When using the `same_line` style: -# -# The closing brace of a multi-line array literal must be on the same -# line as the last element of the array. -# -# @example EnforcedStyle: symmetrical (default) -# # bad -# [ :a, -# :b -# ] -# -# # bad -# [ -# :a, -# :b ] -# -# # good -# [ :a, -# :b ] -# -# # good -# [ -# :a, -# :b -# ] -# @example EnforcedStyle: new_line -# # bad -# [ -# :a, -# :b ] -# -# # bad -# [ :a, -# :b ] -# -# # good -# [ :a, -# :b -# ] -# -# # good -# [ -# :a, -# :b -# ] -# @example EnforcedStyle: same_line -# # bad -# [ :a, -# :b -# ] -# -# # bad -# [ -# :a, -# :b -# ] -# -# # good -# [ -# :a, -# :b ] -# -# # good -# [ :a, -# :b ] -# -# source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#91 -class RuboCop::Cop::Layout::MultilineArrayBraceLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineLiteralBraceLayout - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#109 - def on_array(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#103 -RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#106 -RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#99 -RuboCop::Cop::Layout::MultilineArrayBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#95 -RuboCop::Cop::Layout::MultilineArrayBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# Ensures that each item in a multi-line array -# starts on a separate line. -# -# @example -# -# # bad -# [ -# a, b, -# c -# ] -# -# # good -# [ -# a, -# b, -# c -# ] -# -# # good -# [ -# a, -# b, -# foo( -# bar -# ) -# ] -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# [a, b, foo( -# bar -# )] -# @example AllowMultilineFinalElement: true -# -# # good -# [a, b, foo( -# bar -# )] -# -# source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#47 -class RuboCop::Cop::Layout::MultilineArrayLineBreaks < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MultilineElementLineBreaks - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#53 - def on_array(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#59 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#51 -RuboCop::Cop::Layout::MultilineArrayLineBreaks::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the multiline assignments have a newline -# after the assignment operator. -# -# @example EnforcedStyle: new_line (default) -# # bad -# foo = if expression -# 'bar' -# end -# -# # good -# foo = -# if expression -# 'bar' -# end -# -# # good -# foo = -# begin -# compute -# rescue => e -# nil -# end -# @example EnforcedStyle: same_line -# # good -# foo = if expression -# 'bar' -# end -# @example SupportedTypes: ['block', 'case', 'class', 'if', 'kwbegin', 'module'] (default) -# # good -# foo = -# if expression -# 'bar' -# end -# -# # good -# foo = -# [1].map do |i| -# i + 1 -# end -# @example SupportedTypes: ['block'] -# # good -# foo = if expression -# 'bar' -# end -# -# # good -# foo = -# [1].map do |i| -# 'bar' * i -# end -# -# source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#60 -class RuboCop::Cop::Layout::MultilineAssignmentLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#72 - def check_assignment(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#81 - def check_by_enforced_style(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#90 - def check_new_line_offense(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#98 - def check_same_line_offense(node, rhs); end - - private - - # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#111 - def supported_types; end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#66 -RuboCop::Cop::Layout::MultilineAssignmentLayout::NEW_LINE_OFFENSE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#69 -RuboCop::Cop::Layout::MultilineAssignmentLayout::SAME_LINE_OFFENSE = T.let(T.unsafe(nil), String) - -# Checks whether the multiline do end blocks have a newline -# after the start of the block. Additionally, it checks whether the block -# arguments, if any, are on the same line as the start of the -# block. Putting block arguments on separate lines, because the whole -# line would otherwise be too long, is accepted. -# -# @example -# # bad -# blah do |i| foo(i) -# bar(i) -# end -# -# # bad -# blah do -# |i| foo(i) -# bar(i) -# end -# -# # good -# blah do |i| -# foo(i) -# bar(i) -# end -# -# # bad -# blah { |i| foo(i) -# bar(i) -# } -# -# # good -# blah { |i| -# foo(i) -# bar(i) -# } -# -# # good -# blah { | -# long_list, -# of_parameters, -# that_would_not, -# fit_on_one_line -# | -# foo(i) -# bar(i) -# } -# -# source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#51 -class RuboCop::Cop::Layout::MultilineBlockLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#59 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#59 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#59 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#99 - def add_offense_for_expression(node, expr, msg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#76 - def args_on_beginning_line?(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#106 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#121 - def autocorrect_arguments(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#131 - def autocorrect_body(corrector, node, block_body); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#143 - def block_arg_string(node, args); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#91 - def characters_needed_for_space_and_pipes(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#155 - def include_trailing_comma?(args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#80 - def line_break_necessary_in_args?(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#84 - def needed_length_for_args(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#56 -RuboCop::Cop::Layout::MultilineBlockLayout::ARG_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#55 -RuboCop::Cop::Layout::MultilineBlockLayout::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#57 -RuboCop::Cop::Layout::MultilineBlockLayout::PIPE_SIZE = T.let(T.unsafe(nil), Integer) - -# Checks that the closing brace in a hash literal is either -# on the same line as the last hash element, or a new line. -# -# When using the `symmetrical` (default) style: -# -# If a hash's opening brace is on the same line as the first element -# of the hash, then the closing brace should be on the same line as -# the last element of the hash. -# -# If a hash's opening brace is on the line above the first element -# of the hash, then the closing brace should be on the line below -# the last element of the hash. -# -# When using the `new_line` style: -# -# The closing brace of a multi-line hash literal must be on the line -# after the last element of the hash. -# -# When using the `same_line` style: -# -# The closing brace of a multi-line hash literal must be on the same -# line as the last element of the hash. -# -# @example EnforcedStyle: symmetrical (default) -# -# # bad -# { a: 1, -# b: 2 -# } -# # bad -# { -# a: 1, -# b: 2 } -# -# # good -# { a: 1, -# b: 2 } -# -# # good -# { -# a: 1, -# b: 2 -# } -# @example EnforcedStyle: new_line -# # bad -# { -# a: 1, -# b: 2 } -# -# # bad -# { a: 1, -# b: 2 } -# -# # good -# { a: 1, -# b: 2 -# } -# -# # good -# { -# a: 1, -# b: 2 -# } -# @example EnforcedStyle: same_line -# # bad -# { a: 1, -# b: 2 -# } -# -# # bad -# { -# a: 1, -# b: 2 -# } -# -# # good -# { -# a: 1, -# b: 2 } -# -# # good -# { a: 1, -# b: 2 } -# -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#91 -class RuboCop::Cop::Layout::MultilineHashBraceLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineLiteralBraceLayout - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#109 - def on_hash(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#103 -RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#106 -RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#99 -RuboCop::Cop::Layout::MultilineHashBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#95 -RuboCop::Cop::Layout::MultilineHashBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# Ensures that each key in a multi-line hash -# starts on a separate line. -# -# @example -# -# # bad -# { -# a: 1, b: 2, -# c: 3 -# } -# -# # good -# { -# a: 1, -# b: 2, -# c: 3 -# } -# -# # good -# { -# a: 1, -# b: { -# c: 3, -# } -# } -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# { a: 1, b: { -# c: 3, -# }} -# @example AllowMultilineFinalElement: true -# -# # good -# { a: 1, b: { -# c: 3, -# }} -# -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#46 -class RuboCop::Cop::Layout::MultilineHashKeyLineBreaks < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MultilineElementLineBreaks - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#52 - def on_hash(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#68 - def ignore_last_element?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#64 - def starts_with_curly_brace?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#50 -RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), String) - -# Ensures that each argument in a multi-line method call -# starts on a separate line. -# -# NOTE: This cop does not move the first argument, if you want that to -# be on a separate line, see `Layout/FirstMethodArgumentLineBreak`. -# -# @example -# -# # bad -# foo(a, b, -# c -# ) -# -# # bad -# foo(a, b, { -# foo: "bar", -# }) -# -# # good -# foo( -# a, -# b, -# c -# ) -# -# # good -# foo(a, b, c) -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# foo(a, b, -# c -# ) -# -# # bad -# foo( -# a, b, { -# foo: "bar", -# } -# ) -# -# # good -# foo( -# a, -# b, -# { -# foo: "bar", -# } -# ) -# @example AllowMultilineFinalElement: true -# -# # bad -# foo(a, b, -# c -# ) -# -# # good -# foo( -# a, b, { -# foo: "bar", -# } -# ) -# -# # good -# foo( -# a, -# b, -# { -# foo: "bar", -# } -# ) -# -# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#80 -class RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MultilineElementLineBreaks - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#86 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#86 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#106 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#84 -RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks::MSG = T.let(T.unsafe(nil), String) - -# Checks that the closing brace in a method call is either -# on the same line as the last method argument, or a new line. -# -# When using the `symmetrical` (default) style: -# -# If a method call's opening brace is on the same line as the first -# argument of the call, then the closing brace should be on the same -# line as the last argument of the call. -# -# If a method call's opening brace is on the line above the first -# argument of the call, then the closing brace should be on the line -# below the last argument of the call. -# -# When using the `new_line` style: -# -# The closing brace of a multi-line method call must be on the line -# after the last argument of the call. -# -# When using the `same_line` style: -# -# The closing brace of a multi-line method call must be on the same -# line as the last argument of the call. -# -# @example EnforcedStyle: symmetrical (default) -# # bad -# foo(a, -# b -# ) -# -# # bad -# foo( -# a, -# b) -# -# # good -# foo(a, -# b) -# -# # good -# foo( -# a, -# b -# ) -# @example EnforcedStyle: new_line -# # bad -# foo( -# a, -# b) -# -# # bad -# foo(a, -# b) -# -# # good -# foo(a, -# b -# ) -# -# # good -# foo( -# a, -# b -# ) -# @example EnforcedStyle: same_line -# # bad -# foo(a, -# b -# ) -# -# # bad -# foo( -# a, -# b -# ) -# -# # good -# foo( -# a, -# b) -# -# # good -# foo(a, -# b) -# -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#91 -class RuboCop::Cop::Layout::MultilineMethodCallBraceLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineLiteralBraceLayout - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#109 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#109 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#116 - def children(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#120 - def ignored_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#124 - def single_line_ignoring_receiver?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#103 -RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#106 -RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#99 -RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#95 -RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# Checks the indentation of the method name part in method calls -# that span more than one line. -# -# @example EnforcedStyle: aligned (default) -# # bad -# while myvariable -# .b -# # do something -# end -# -# # good -# while myvariable -# .b -# # do something -# end -# -# # good -# Thing.a -# .b -# .c -# @example EnforcedStyle: indented -# # good -# while myvariable -# .b -# -# # do something -# end -# @example EnforcedStyle: indented_relative_to_receiver -# # good -# while myvariable -# .a -# .b -# -# # do something -# end -# -# # good -# myvariable = Thing -# .a -# .b -# .c -# -# source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#49 -class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::MultilineExpressionIndentation - extend ::RuboCop::Cop::AutoCorrector - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#55 - def validate_config; end - - private - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#136 - def align_with_base_message(rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#152 - def alignment_base(node, rhs, given_style); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#67 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#140 - def base_source; end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#101 - def extra_indentation(given_style, parent); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#226 - def find_multiline_block_chain_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#237 - def first_call_has_a_dot(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#217 - def get_dot_right_above(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#113 - def message(node, lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#144 - def no_base_message(lhs, rhs, node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#87 - def offending_range(node, lhs, rhs, given_style); end - - # @yield [operation_rhs.first_argument] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#247 - def operation_rhs(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#257 - def operator_rhs?(node, receiver); end - - # a - # .b - # .c - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#193 - def receiver_alignment_base(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#131 - def relative_to_receiver_message(rhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#71 - def relevant_node?(send_node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#75 - def right_hand_side(send_node); end - - # a.b - # .c - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#181 - def semantic_alignment_base(node, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#201 - def semantic_alignment_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#127 - def should_align_with_base?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#123 - def should_indent_relative_to_receiver?; end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#163 - def syntactic_alignment_base(lhs, rhs); end -end - -# Checks that the closing brace in a method definition is either -# on the same line as the last method parameter, or a new line. -# -# When using the `symmetrical` (default) style: -# -# If a method definition's opening brace is on the same line as the -# first parameter of the definition, then the closing brace should be -# on the same line as the last parameter of the definition. -# -# If a method definition's opening brace is on the line above the first -# parameter of the definition, then the closing brace should be on the -# line below the last parameter of the definition. -# -# When using the `new_line` style: -# -# The closing brace of a multi-line method definition must be on the line -# after the last parameter of the definition. -# -# When using the `same_line` style: -# -# The closing brace of a multi-line method definition must be on the same -# line as the last parameter of the definition. -# -# @example EnforcedStyle: symmetrical (default) -# # bad -# def foo(a, -# b -# ) -# end -# -# # bad -# def foo( -# a, -# b) -# end -# -# # good -# def foo(a, -# b) -# end -# -# # good -# def foo( -# a, -# b -# ) -# end -# @example EnforcedStyle: new_line -# # bad -# def foo( -# a, -# b) -# end -# -# # bad -# def foo(a, -# b) -# end -# -# # good -# def foo(a, -# b -# ) -# end -# -# # good -# def foo( -# a, -# b -# ) -# end -# @example EnforcedStyle: same_line -# # bad -# def foo(a, -# b -# ) -# end -# -# # bad -# def foo( -# a, -# b -# ) -# end -# -# # good -# def foo( -# a, -# b) -# end -# -# # good -# def foo(a, -# b) -# end -# -# source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#103 -class RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineLiteralBraceLayout - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#121 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#121 - def on_defs(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#115 -RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#118 -RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#111 -RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#107 -RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) - -# Ensures that each parameter in a multi-line method definition -# starts on a separate line. -# -# NOTE: This cop does not move the first argument, if you want that to -# be on a separate line, see `Layout/FirstMethodParameterLineBreak`. -# -# @example -# -# # bad -# def foo(a, b, -# c -# ) -# end -# -# # good -# def foo( -# a, -# b, -# c -# ) -# end -# -# # good -# def foo( -# a, -# b = { -# foo: "bar", -# } -# ) -# end -# -# # good -# def foo(a, b, c) -# end -# @example AllowMultilineFinalElement: false (default) -# -# # bad -# def foo(a, b = { -# foo: "bar", -# }) -# end -# @example AllowMultilineFinalElement: true -# -# # good -# def foo(a, b = { -# foo: "bar", -# }) -# end -# -# source://rubocop//lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb#57 -class RuboCop::Cop::Layout::MultilineMethodParameterLineBreaks < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MultilineElementLineBreaks - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb#63 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb#63 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb#72 - def ignore_last_element?; end -end - -# source://rubocop//lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb#61 -RuboCop::Cop::Layout::MultilineMethodParameterLineBreaks::MSG = T.let(T.unsafe(nil), String) - -# Checks the indentation of the right hand side operand in binary operations that -# span more than one line. -# -# The `aligned` style checks that operators are aligned if they are part of an `if` or `while` -# condition, an explicit `return` statement, etc. In other contexts, the second operand should -# be indented regardless of enforced style. -# -# @example EnforcedStyle: aligned (default) -# # bad -# if a + -# b -# something && -# something_else -# end -# -# # good -# if a + -# b -# something && -# something_else -# end -# @example EnforcedStyle: indented -# # bad -# if a + -# b -# something && -# something_else -# end -# -# # good -# if a + -# b -# something && -# something_else -# end -# -# source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#43 -class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::MultilineExpressionIndentation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#49 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#53 - def on_or(node); end - - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#57 - def validate_config; end - - private - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#68 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#78 - def check_and_or(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#109 - def message(node, lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#83 - def offending_range(node, lhs, rhs, given_style); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#72 - def relevant_node?(node); end - - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#120 - def right_hand_side(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#96 - def should_align?(node, rhs, given_style); end -end - -# Check that the parameters on a multi-line method call or definition are aligned. -# -# To set the alignment of the first argument, use the -# `Layout/FirstParameterIndentation` cop. -# -# @example EnforcedStyle: with_first_parameter (default) -# # good -# -# def foo(bar, -# baz) -# 123 -# end -# -# def foo( -# bar, -# baz -# ) -# 123 -# end -# -# # bad -# -# def foo(bar, -# baz) -# 123 -# end -# -# # bad -# -# def foo( -# bar, -# baz) -# 123 -# end -# @example EnforcedStyle: with_fixed_indentation -# # good -# -# def foo(bar, -# baz) -# 123 -# end -# -# def foo( -# bar, -# baz -# ) -# 123 -# end -# -# # bad -# -# def foo(bar, -# baz) -# 123 -# end -# -# # bad -# -# def foo( -# bar, -# baz) -# 123 -# end -# -# source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#70 -class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#80 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#80 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#89 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#101 - def base_column(node, args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#97 - def fixed_indentation?; end - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#93 - def message(_node); end - - # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#112 - def target_method_lineno(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#74 -RuboCop::Cop::Layout::ParameterAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#77 -RuboCop::Cop::Layout::ParameterAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) - -# Checks whether certain expressions, e.g. method calls, that could fit -# completely on a single line, are broken up into multiple lines unnecessarily. -# -# @example -# # bad -# foo( -# a, -# b -# ) -# -# # good -# foo(a, b) -# -# # bad -# puts 'string that fits on ' \ -# 'a single line' -# -# # good -# puts 'string that fits on a single line' -# -# # bad -# things -# .select { |thing| thing.cond? } -# .join('-') -# -# # good -# things.select { |thing| thing.cond? }.join('-') -# @example InspectBlocks: false (default) -# # good -# foo(a) do |x| -# puts x -# end -# @example InspectBlocks: true -# # bad -# foo(a) do |x| -# puts x -# end -# -# # good -# foo(a) { |x| puts x } -# -# source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#49 -class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::CheckSingleLineSuitability - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#60 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#56 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#60 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#78 - def check_assignment(node, _rhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#108 - def configured_to_not_be_inspected?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#125 - def convertible_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#74 - def end_with_percent_blank_string?(processed_source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#102 - def index_access_call_chained?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#91 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#115 - def other_cop_takes_precedence?(node); end - - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#84 - def register_offense(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#98 - def require_backslash?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#121 - def single_line_block_chain_enabled?; end -end - -# source://rubocop//lib/rubocop/cop/layout/redundant_line_break.rb#54 -RuboCop::Cop::Layout::RedundantLineBreak::MSG = T.let(T.unsafe(nil), String) - -# Checks whether the rescue and ensure keywords are aligned -# properly. -# -# @example -# -# # bad -# begin -# something -# rescue -# puts 'error' -# end -# -# # good -# begin -# something -# rescue -# puts 'error' -# end -# -# source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#24 -class RuboCop::Cop::Layout::RescueEnsureAlignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::EndKeywordAlignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#39 - def on_ensure(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#43 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#35 - def on_resbody(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#185 - def access_modifier?(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#163 - def access_modifier_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#149 - def aligned_with_leading_dot?(do_keyword_line, send_node_loc, rescue_keyword_column); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#136 - def aligned_with_line_break_method?(ancestor_node, node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#194 - def alignment_location(alignment_node); end - - # We will use ancestor or wrapper with access modifier. - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#116 - def alignment_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#95 - def alignment_source(node, starting_loc); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#132 - def ancestor_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#155 - def assignment_node(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#72 - def autocorrect(corrector, node, alignment_location); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#202 - def begin_end_alignment_style; end - - # Check alignment of node with rescue or ensure modifiers. - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#56 - def check(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#82 - def format_message(alignment_node, alignment_loc, kw_loc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#172 - def modifier?(node); end - - # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#178 - def whitespace_range(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#33 -RuboCop::Cop::Layout::RescueEnsureAlignment::ALTERNATIVE_ACCESS_MODIFIERS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#32 -RuboCop::Cop::Layout::RescueEnsureAlignment::ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#29 -RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String) - -# Checks if method calls are chained onto single line blocks. It considers that a -# line break before the dot improves the readability of the code. -# -# @example -# # bad -# example.select { |item| item.cond? }.join('-') -# -# # good -# example.select { |item| item.cond? } -# .join('-') -# -# # good (not a concern for this cop) -# example.select do |item| -# item.cond? -# end.join('-') -# -# source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#22 -class RuboCop::Cop::Layout::SingleLineBlockChain < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#32 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#32 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#56 - def call_method_after_block?(node, dot_range, closing_block_delimiter_line_num); end - - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#40 - def offending_range(node); end - - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#62 - def selector_range(node); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#28 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/single_line_block_chain.rb#26 -RuboCop::Cop::Layout::SingleLineBlockChain::MSG = T.let(T.unsafe(nil), String) - -# Checks for colon (`:`) not followed by some kind of space. -# N.B. this cop does not handle spaces after a ternary operator, which are -# instead handled by `Layout/SpaceAroundOperators`. -# -# @example -# # bad -# def f(a:, b:2); {a:3}; end -# -# # good -# def f(a:, b: 2); {a: 3}; end -# -# source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#16 -class RuboCop::Cop::Layout::SpaceAfterColon < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#29 - def on_kwoptarg(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#21 - def on_pair(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#43 - def followed_by_space?(colon); end - - # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#39 - def register_offense(colon); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#19 -RuboCop::Cop::Layout::SpaceAfterColon::MSG = T.let(T.unsafe(nil), String) - -# Checks for comma (`,`) not followed by some kind of space. -# -# @example -# -# # bad -# [1,2] -# { foo:bar,} -# -# # good -# [1, 2] -# { foo:bar, } -# -# source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#17 -class RuboCop::Cop::Layout::SpaceAfterComma < ::RuboCop::Cop::Base - include ::RuboCop::Cop::SpaceAfterPunctuation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#26 - def kind(token); end - - # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#21 - def space_style_before_rcurly; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#32 - def before_semicolon?(token); end -end - -# Checks for space between a method name and a left parenthesis in defs. -# -# @example -# -# # bad -# def func (x) end -# def method= (y) end -# -# # good -# def func(x) end -# def method=(y) end -# -# source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#17 -class RuboCop::Cop::Layout::SpaceAfterMethodName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#23 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#23 - def on_defs(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#21 -RuboCop::Cop::Layout::SpaceAfterMethodName::MSG = T.let(T.unsafe(nil), String) - -# Checks for space after `!`. -# -# @example -# # bad -# ! something -# -# # good -# !something -# -# source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#14 -class RuboCop::Cop::Layout::SpaceAfterNot < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#21 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#33 - def whitespace_after_operator?(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#18 -RuboCop::Cop::Layout::SpaceAfterNot::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#19 -RuboCop::Cop::Layout::SpaceAfterNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for semicolon (`;`) not followed by some kind of space. -# -# @example -# # bad -# x = 1;y = 2 -# -# # good -# x = 1; y = 2 -# -# source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#14 -class RuboCop::Cop::Layout::SpaceAfterSemicolon < ::RuboCop::Cop::Base - include ::RuboCop::Cop::SpaceAfterPunctuation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#23 - def kind(token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#27 - def space_missing?(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#18 - def space_style_before_rcurly; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#33 - def semicolon_sequence?(token, next_token); end -end - -# Checks the spacing inside and after block parameters pipes. Line breaks -# inside parameter pipes are checked by `Layout/MultilineBlockLayout` and -# not by this cop. -# -# @example EnforcedStyleInsidePipes: no_space (default) -# # bad -# {}.each { | x, y |puts x } -# ->( x, y ) { puts x } -# -# # good -# {}.each { |x, y| puts x } -# ->(x, y) { puts x } -# @example EnforcedStyleInsidePipes: space -# # bad -# {}.each { |x, y| puts x } -# ->(x, y) { puts x } -# -# # good -# {}.each { | x, y | puts x } -# ->( x, y ) { puts x } -# -# source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#27 -class RuboCop::Cop::Layout::SpaceAroundBlockParameters < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#32 - def on_block(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#65 - def check_after_closing_pipe(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#125 - def check_arg(arg); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#103 - def check_closing_pipe_space(arguments, closing_pipe); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#121 - def check_each_arg(args); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#56 - def check_inside_pipes(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#150 - def check_no_space(space_begin_pos, space_end_pos, msg); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#73 - def check_no_space_style_inside_pipes(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#92 - def check_opening_pipe_space(arguments, opening_pipe); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#136 - def check_space(space_begin_pos, space_end_pos, range, msg, node = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#85 - def check_space_style_inside_pipes(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#113 - def last_end_pos_inside_pipes(arguments, range); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#44 - def pipes(arguments); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#48 - def pipes?(arguments); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#52 - def style_parameter_name; end -end - -# Checks that the equals signs in parameter default assignments -# have or don't have surrounding space depending on configuration. -# -# @example EnforcedStyle: space (default) -# # bad -# def some_method(arg1=:default, arg2=nil, arg3=[]) -# # do something... -# end -# -# # good -# def some_method(arg1 = :default, arg2 = nil, arg3 = []) -# # do something... -# end -# @example EnforcedStyle: no_space -# # bad -# def some_method(arg1 = :default, arg2 = nil, arg3 = []) -# # do something... -# end -# -# # good -# def some_method(arg1=:default, arg2=nil, arg3=[]) -# # do something... -# end -# -# source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#30 -class RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#38 - def on_optarg(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#67 - def autocorrect(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#46 - def check_optarg(arg, equals, value); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#58 - def incorrect_style_detected(arg, value); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#83 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#79 - def no_surrounding_space?(arg, equals); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#75 - def space_on_both_sides?(arg, equals); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#36 -RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault::MSG = T.let(T.unsafe(nil), String) - -# Checks the spacing around the keywords. -# -# @example -# -# # bad -# something 'test'do|x| -# end -# -# while(something) -# end -# -# something = 123if test -# -# # good -# something 'test' do |x| -# end -# -# while (something) -# end -# -# something = 123 if test -# -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#27 -class RuboCop::Cop::Layout::SpaceAroundKeyword < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#41 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#45 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#49 - def on_break(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#53 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#57 - def on_case_match(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#157 - def on_defined?(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#61 - def on_ensure(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#65 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#69 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#73 - def on_if_guard(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#77 - def on_in_pattern(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#81 - def on_kwbegin(node); end - - # Handle one-line pattern matching syntax (`in`) with `Parser::Ruby27`. - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#86 - def on_match_pattern(node); end - - # Handle one-line pattern matching syntax (`in`) with `Parser::Ruby30`. - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#93 - def on_match_pattern_p(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#97 - def on_next(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#101 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#105 - def on_postexe(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#109 - def on_preexe(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#113 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#117 - def on_rescue(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#121 - def on_return(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#125 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#129 - def on_super(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#137 - def on_unless_guard(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#141 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#145 - def on_when(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#149 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#153 - def on_yield(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#133 - def on_zsuper(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#236 - def accept_left_parenthesis?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#240 - def accept_left_square_bracket?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#244 - def accept_namespace_operator?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#229 - def accepted_opening_delimiter?(range, char); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#163 - def check(node, locations, begin_keyword = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#178 - def check_begin(node, range, begin_keyword); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#184 - def check_end(node, range, begin_keyword); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#197 - def check_keyword(node, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#193 - def do?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#252 - def namespace_operator?(range, pos); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#256 - def preceded_by_operator?(node, _range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#248 - def safe_navigation_call?(range, pos); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#218 - def space_after_missing?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#211 - def space_before_missing?(range); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#36 -RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_PAREN = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#37 -RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_SQUARE_BRACKET = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#38 -RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#33 -RuboCop::Cop::Layout::SpaceAroundKeyword::DO = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#31 -RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_AFTER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#30 -RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_BEFORE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#35 -RuboCop::Cop::Layout::SpaceAroundKeyword::NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#39 -RuboCop::Cop::Layout::SpaceAroundKeyword::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#34 -RuboCop::Cop::Layout::SpaceAroundKeyword::SAFE_NAVIGATION = T.let(T.unsafe(nil), String) - -# Checks method call operators to not have spaces around them. -# -# @example -# # bad -# foo. bar -# foo .bar -# foo . bar -# foo. bar .buzz -# foo -# . bar -# . buzz -# foo&. bar -# foo &.bar -# foo &. bar -# foo &. bar&. buzz -# RuboCop:: Cop -# RuboCop:: Cop:: Base -# :: RuboCop::Cop -# -# # good -# foo.bar -# foo.bar.buzz -# foo -# .bar -# .buzz -# foo&.bar -# foo&.bar&.buzz -# RuboCop::Cop -# RuboCop::Cop::Base -# ::RuboCop::Cop -# -# source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#37 -class RuboCop::Cop::Layout::SpaceAroundMethodCallOperator < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#53 - def on_const(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#45 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#45 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#87 - def check_space(begin_pos, end_pos); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#67 - def check_space_after_dot(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#81 - def check_space_after_double_colon(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#61 - def check_space_before_dot(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#43 -RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#41 -RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::SPACES_REGEXP = T.let(T.unsafe(nil), Regexp) - -# Checks that operators have space around them, except for ** which -# should or shouldn't have surrounding space depending on configuration. -# It allows vertical alignment consisting of one or more whitespace -# around operators. -# -# This cop has `AllowForAlignment` option. When `true`, allows most -# uses of extra spacing if the intent is to align with an operator on -# the previous or next line, not counting empty lines or comment lines. -# -# @example -# # bad -# total = 3*4 -# "apple"+"juice" -# my_number = 38/4 -# -# # good -# total = 3 * 4 -# "apple" + "juice" -# my_number = 38 / 4 -# @example AllowForAlignment: true (default) -# # good -# { -# 1 => 2, -# 11 => 3 -# } -# @example AllowForAlignment: false -# # bad -# { -# 1 => 2, -# 11 => 3 -# } -# @example EnforcedStyleForExponentOperator: no_space (default) -# # bad -# a ** b -# -# # good -# a**b -# @example EnforcedStyleForExponentOperator: space -# # bad -# a**b -# -# # good -# a ** b -# @example EnforcedStyleForRationalLiterals: no_space (default) -# # bad -# 1 / 48r -# -# # good -# 1/48r -# @example EnforcedStyleForRationalLiterals: space -# # bad -# 1/48r -# -# # good -# 1 / 48r -# -# source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#67 -class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base - include ::RuboCop::Cop::PrecedingFollowingAlignment - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::RationalLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#132 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_assignment(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#132 - def on_binary(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#124 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#92 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#148 - def on_match_pattern(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#132 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#84 - def on_pair(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#80 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#105 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#140 - def on_setter_method(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#258 - def align_hash_cop_config; end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#197 - def autocorrect(corrector, range, right_operand); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#178 - def check_operator(type, operator, right_operand); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#211 - def enclose_operator_with_space(corrector, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#238 - def excess_leading_space?(type, operator, with_space); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#253 - def excess_trailing_space?(right_operand, with_space); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#279 - def force_equal_sign_alignment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#262 - def hash_table_style?; end - - # @yield [msg] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#192 - def offense(type, operator, with_space, right_operand); end - - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#224 - def offense_message(type, operator, with_space, right_operand); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#174 - def operator_with_regular_syntax?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#168 - def regular_operator?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#283 - def should_not_have_surrounding_space?(operator, right_operand); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#269 - def space_around_exponent_operator?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#273 - def space_around_slash_operator?(right_operand); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#76 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#74 -RuboCop::Cop::Layout::SpaceAroundOperators::EXCESSIVE_SPACE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#73 -RuboCop::Cop::Layout::SpaceAroundOperators::IRREGULAR_METHODS = T.let(T.unsafe(nil), Array) - -# Checks that block braces have or don't have a space before the opening -# brace depending on configuration. -# -# @example EnforcedStyle: space (default) -# # bad -# foo.map{ |a| -# a.bar.to_s -# } -# -# # good -# foo.map { |a| -# a.bar.to_s -# } -# @example EnforcedStyle: no_space -# # bad -# foo.map { |a| -# a.bar.to_s -# } -# -# # good -# foo.map{ |a| -# a.bar.to_s -# } -# @example EnforcedStyleForEmptyBraces: space (default) -# # bad -# 7.times{} -# -# # good -# 7.times {} -# @example EnforcedStyleForEmptyBraces: no_space -# # bad -# 7.times {} -# -# # good -# 7.times{} -# -# source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#44 -class RuboCop::Cop::Layout::SpaceBeforeBlockBraces < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#56 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#56 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#56 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#134 - def autocorrect(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#154 - def block_delimiters_style; end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#84 - def check_empty(left_brace, space_plus_brace, used_style); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#110 - def check_non_empty(left_brace, space_plus_brace, used_style); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#150 - def conflict_with_block_delimiters?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#158 - def empty_braces?(loc); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#102 - def handle_different_styles_for_empty_braces(used_style); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#125 - def space_detected(left_brace, space_plus_brace); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#118 - def space_missing(left_brace); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#141 - def style_for_empty_braces; end - - class << self - # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#52 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#50 -RuboCop::Cop::Layout::SpaceBeforeBlockBraces::DETECTED_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#49 -RuboCop::Cop::Layout::SpaceBeforeBlockBraces::MISSING_MSG = T.let(T.unsafe(nil), String) - -# Checks for space between the name of a receiver and a left -# brackets. -# -# @example -# -# # bad -# collection [index_or_key] -# -# # good -# collection[index_or_key] -# -# source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#17 -class RuboCop::Cop::Layout::SpaceBeforeBrackets < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#24 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#48 - def dot_before_brackets?(node, receiver_end_pos, selector_begin_pos); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#35 - def offense_range(node, begin_pos); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#54 - def offense_range_for_assignment(node, begin_pos); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#67 - def reference_variable_with_brackets?(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#63 - def register_offense(range); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#21 -RuboCop::Cop::Layout::SpaceBeforeBrackets::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_before_brackets.rb#22 -RuboCop::Cop::Layout::SpaceBeforeBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for comma (`,`) preceded by space. -# -# @example -# # bad -# [1 , 2 , 3] -# a(1 , 2) -# each { |a , b| } -# -# # good -# [1, 2, 3] -# a(1, 2) -# each { |a, b| } -# -# source://rubocop//lib/rubocop/cop/layout/space_before_comma.rb#19 -class RuboCop::Cop::Layout::SpaceBeforeComma < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SpaceBeforePunctuation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_comma.rb#23 - def kind(token); end -end - -# Checks for missing space between a token and a comment on the -# same line. -# -# @example -# # bad -# 1 + 1# this operation does ... -# -# # good -# 1 + 1 # this operation does ... -# -# source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#15 -class RuboCop::Cop::Layout::SpaceBeforeComment < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#20 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#18 -RuboCop::Cop::Layout::SpaceBeforeComment::MSG = T.let(T.unsafe(nil), String) - -# Checks that exactly one space is used between a method name and the -# first argument for method calls without parentheses. -# -# Alternatively, extra spaces can be added to align the argument with -# something on a preceding or following line, if the AllowForAlignment -# config parameter is true. -# -# @example -# # bad -# something x -# something y, z -# something'hello' -# -# # good -# something x -# something y, z -# something 'hello' -# -# source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#24 -class RuboCop::Cop::Layout::SpaceBeforeFirstArg < ::RuboCop::Cop::Base - include ::RuboCop::Cop::PrecedingFollowingAlignment - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#35 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#35 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#55 - def expect_params_after_method_name?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#64 - def no_space_between_method_name_and_first_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#51 - def regular_method_call_with_arguments?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#31 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#29 -RuboCop::Cop::Layout::SpaceBeforeFirstArg::MSG = T.let(T.unsafe(nil), String) - -# Checks for semicolon (`;`) preceded by space. -# -# @example -# # bad -# x = 1 ; y = 2 -# -# # good -# x = 1; y = 2 -# -# source://rubocop//lib/rubocop/cop/layout/space_before_semicolon.rb#14 -class RuboCop::Cop::Layout::SpaceBeforeSemicolon < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SpaceBeforePunctuation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_before_semicolon.rb#18 - def kind(token); end -end - -# Checks for spaces between `->` and opening parameter -# parenthesis (`(`) in lambda literals. -# -# @example EnforcedStyle: require_no_space (default) -# # bad -# a = -> (x, y) { x + y } -# -# # good -# a = ->(x, y) { x + y } -# @example EnforcedStyle: require_space -# # bad -# a = ->(x, y) { x + y } -# -# # good -# a = -> (x, y) { x + y } -# -# source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#22 -class RuboCop::Cop::Layout::SpaceInLambdaLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#30 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#50 - def arrow_lambda_with_args?(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#72 - def lambda_arguments(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#65 - def range_of_offense(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#58 - def space_after_arrow(lambda_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#54 - def space_after_arrow?(lambda_node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#28 -RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_NO_SPACE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#27 -RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_SPACE = T.let(T.unsafe(nil), String) - -# Checks that brackets used for array literals have or don't have -# surrounding space depending on configuration. -# -# Array pattern matching is handled in the same way. -# -# @example EnforcedStyle: no_space (default) -# # The `no_space` style enforces that array literals have -# # no surrounding space. -# -# # bad -# array = [ a, b, c, d ] -# array = [ a, [ b, c ]] -# -# # good -# array = [a, b, c, d] -# array = [a, [b, c]] -# @example EnforcedStyle: space -# # The `space` style enforces that array literals have -# # surrounding space. -# -# # bad -# array = [a, b, c, d] -# array = [ a, [ b, c ]] -# -# # good -# array = [ a, b, c, d ] -# array = [ a, [ b, c ] ] -# @example EnforcedStyle: compact -# # The `compact` style normally requires a space inside -# # array brackets, with the exception that successive left -# # or right brackets are collapsed together in nested arrays. -# -# # bad -# array = [a, b, c, d] -# array = [ a, [ b, c ] ] -# array = [ -# [ a ], -# [ b, c ] -# ] -# -# # good -# array = [ a, b, c, d ] -# array = [ a, [ b, c ]] -# array = [[ a ], -# [ b, c ]] -# @example EnforcedStyleForEmptyBrackets: no_space (default) -# # The `no_space` EnforcedStyleForEmptyBrackets style enforces that -# # empty array brackets do not contain spaces. -# -# # bad -# foo = [ ] -# bar = [ ] -# -# # good -# foo = [] -# bar = [] -# @example EnforcedStyleForEmptyBrackets: space -# # The `space` EnforcedStyleForEmptyBrackets style enforces that -# # empty array brackets contain exactly one space. -# -# # bad -# foo = [] -# bar = [ ] -# -# # good -# foo = [ ] -# bar = [ ] -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#78 -class RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#86 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#86 - def on_array_pattern(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#119 - def array_brackets(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#105 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#227 - def compact(corrector, bracket, side); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#213 - def compact_corrections(corrector, node, left, right); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#205 - def compact_offense(node, token, side: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#167 - def compact_offenses(node, left, right, start_ok, end_ok); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#128 - def empty_config; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#136 - def end_has_own_line?(token); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#143 - def index_for(node, token); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#151 - def issue_offenses(node, left, right, start_ok, end_ok); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#147 - def line_and_column_for(token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#188 - def multi_dimensional_array?(node, token, side: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#199 - def next_to_bracket?(token, side: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#163 - def next_to_comment?(node, token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#132 - def next_to_newline?(node, token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#180 - def qualifies_for_compact?(node, token, side: T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#84 -RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#83 -RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::MSG = T.let(T.unsafe(nil), String) - -# Checks for unnecessary additional spaces inside array percent literals -# (i.e. %i/%w). -# -# Note that blank percent literals (e.g. `%i( )`) are checked by -# `Layout/SpaceInsidePercentLiteralDelimiters`. -# -# @example -# -# # bad -# %w(foo bar baz) -# # good -# %i(foo bar baz) -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#18 -class RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MatchRange - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#26 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#30 - def on_percent_literal(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#40 - def each_unnecessary_space_match(node, &blk); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#23 -RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#24 -RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MULTIPLE_SPACES_BETWEEN_ITEMS_REGEX = T.let(T.unsafe(nil), Regexp) - -# Checks that block braces have or don't have surrounding space inside -# them on configuration. For blocks taking parameters, it checks that the -# left brace has or doesn't have trailing space depending on -# configuration. -# -# @example EnforcedStyle: space (default) -# # The `space` style enforces that block braces have -# # surrounding space. -# -# # bad -# some_array.each {puts e} -# -# # good -# some_array.each { puts e } -# @example EnforcedStyle: no_space -# # The `no_space` style enforces that block braces don't -# # have surrounding space. -# -# # bad -# some_array.each { puts e } -# -# # good -# some_array.each {puts e} -# @example EnforcedStyleForEmptyBraces: no_space (default) -# # The `no_space` EnforcedStyleForEmptyBraces style enforces that -# # block braces don't have a space in between when empty. -# -# # bad -# some_array.each { } -# some_array.each { } -# some_array.each { } -# -# # good -# some_array.each {} -# @example EnforcedStyleForEmptyBraces: space -# # The `space` EnforcedStyleForEmptyBraces style enforces that -# # block braces have at least a space in between when empty. -# -# # bad -# some_array.each {} -# -# # good -# some_array.each { } -# some_array.each { } -# some_array.each { } -# @example SpaceBeforeBlockParameters: true (default) -# # The SpaceBeforeBlockParameters style set to `true` enforces that -# # there is a space between `{` and `|`. Overrides `EnforcedStyle` -# # if there is a conflict. -# -# # bad -# [1, 2, 3].each {|n| n * 2 } -# -# # good -# [1, 2, 3].each { |n| n * 2 } -# @example SpaceBeforeBlockParameters: false -# # The SpaceBeforeBlockParameters style set to `false` enforces that -# # there is no space between `{` and `|`. Overrides `EnforcedStyle` -# # if there is a conflict. -# -# # bad -# [1, 2, 3].each { |n| n * 2 } -# -# # good -# [1, 2, 3].each {|n| n * 2 } -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#79 -class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#89 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#89 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#89 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#127 - def adjacent_braces(left_brace, right_brace); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#166 - def aligned_braces?(inner, right_brace, column); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#135 - def braces_with_contents_inside(node, inner); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#110 - def check_inside(node, left_brace, right_brace); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#142 - def check_left_brace(inner, left_brace, args_delimiter); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#150 - def check_right_brace(node, inner, left_brace, right_brace, single_line); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#170 - def inner_last_space_count(inner); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#162 - def multiline_block?(left_brace, right_brace); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#227 - def no_space(begin_pos, end_pos, msg); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#174 - def no_space_inside_left_brace(left_brace, args_delimiter); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#243 - def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#206 - def pipe?(args_delimiter); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#235 - def space(begin_pos, end_pos, msg); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#191 - def space_inside_left_brace(left_brace, args_delimiter); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#210 - def space_inside_right_brace(inner, right_brace, column); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#258 - def style_for_empty_braces; end - - class << self - # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#85 - def autocorrect_incompatible_with; end - end -end - -# Checks that braces used for hash literals have or don't have -# surrounding space depending on configuration. -# -# Hash pattern matching is handled in the same way. -# -# @example EnforcedStyle: space (default) -# # The `space` style enforces that hash literals have -# # surrounding space. -# -# # bad -# h = {a: 1, b: 2} -# foo = {{ a: 1 } => { b: { c: 2 }}} -# -# # good -# h = { a: 1, b: 2 } -# foo = { { a: 1 } => { b: { c: 2 } } } -# @example EnforcedStyle: no_space -# # The `no_space` style enforces that hash literals have -# # no surrounding space. -# -# # bad -# h = { a: 1, b: 2 } -# foo = {{ a: 1 } => { b: { c: 2 }}} -# -# # good -# h = {a: 1, b: 2} -# foo = {{a: 1} => {b: {c: 2}}} -# @example EnforcedStyle: compact -# # The `compact` style normally requires a space inside -# # hash braces, with the exception that successive left -# # braces or right braces are collapsed together in nested hashes. -# -# # bad -# h = { a: { b: 2 } } -# foo = { { a: 1 } => { b: { c: 2 } } } -# -# # good -# h = { a: { b: 2 }} -# foo = {{ a: 1 } => { b: { c: 2 }}} -# @example EnforcedStyleForEmptyBraces: no_space (default) -# # The `no_space` EnforcedStyleForEmptyBraces style enforces that -# # empty hash braces do not contain spaces. -# -# # bad -# foo = { } -# bar = { } -# baz = { -# } -# -# # good -# foo = {} -# bar = {} -# baz = {} -# @example EnforcedStyleForEmptyBraces: space -# # The `space` EnforcedStyleForEmptyBraces style enforces that -# # empty hash braces contain space. -# -# # bad -# foo = {} -# -# # good -# foo = { } -# foo = { } -# foo = { -# } -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#76 -class RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#84 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#84 - def on_hash_pattern(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#144 - def ambiguous_or_unexpected_style_detected(style, is_match); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#136 - def autocorrect(corrector, range); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#96 - def check(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#191 - def check_whitespace_only_hash(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#209 - def enforce_no_space_style_for_empty_braces?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#111 - def expect_space?(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#124 - def incorrect_style_detected(token1, token2, expect_space, is_empty_braces); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#157 - def message(brace, is_empty_braces, expect_space); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#152 - def offense?(token1, expect_space); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#203 - def range_inside_hash(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#183 - def range_of_space_to_the_left(range); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#175 - def range_of_space_to_the_right(range); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#167 - def space_range(token_range); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#82 -RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces::MSG = T.let(T.unsafe(nil), String) - -# Checks for spaces inside ordinary round parentheses. -# -# @example EnforcedStyle: no_space (default) -# # The `no_space` style enforces that parentheses do not have spaces. -# -# # bad -# f( 3) -# g = (a + 3 ) -# f( ) -# -# # good -# f(3) -# g = (a + 3) -# f() -# @example EnforcedStyle: space -# # The `space` style enforces that parentheses have a space at the -# # beginning and end. -# # Note: Empty parentheses should not have spaces. -# -# # bad -# f(3) -# g = (a + 3) -# y( ) -# -# # good -# f( 3 ) -# g = ( a + 3 ) -# y() -# @example EnforcedStyle: compact -# # The `compact` style enforces that parentheses have a space at the -# # beginning with the exception that successive parentheses are allowed. -# # Note: Empty parentheses should not have spaces. -# -# # bad -# f(3) -# g = (a + 3) -# y( ) -# g( f( x ) ) -# g( f( x( 3 ) ), 5 ) -# g( ( ( 3 + 5 ) * f) ** x, 5 ) -# -# # good -# f( 3 ) -# g = ( a + 3 ) -# y() -# g( f( x )) -# g( f( x( 3 )), 5 ) -# g((( 3 + 5 ) * f ) ** x, 5 ) -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#57 -class RuboCop::Cop::Layout::SpaceInsideParens < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#66 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#161 - def can_be_ignored?(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#99 - def correct_extraneous_space(tokens); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#115 - def correct_extraneous_space_between_consecutive_parens(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#124 - def correct_extraneous_space_in_empty_parens(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#135 - def correct_missing_space(token1, token2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#153 - def left_parens?(token1, token2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#149 - def parens?(token1, token2); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#88 - def process_with_compact_style(tokens); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#81 - def process_with_space_style(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#157 - def right_parens?(token1, token2); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#63 -RuboCop::Cop::Layout::SpaceInsideParens::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#64 -RuboCop::Cop::Layout::SpaceInsideParens::MSG_SPACE = T.let(T.unsafe(nil), String) - -# Checks for unnecessary additional spaces inside the delimiters of -# %i/%w/%x literals. -# -# @example -# -# # bad -# %i( foo bar baz ) -# -# # good -# %i(foo bar baz) -# -# # bad -# %w( foo bar baz ) -# -# # good -# %w(foo bar baz) -# -# # bad -# %x( ls -l ) -# -# # good -# %x(ls -l) -# -# # bad -# %w( ) -# %w( -# ) -# -# # good -# %w() -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#36 -class RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MatchRange - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#45 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#53 - def on_percent_literal(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#49 - def on_xstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#60 - def add_offenses_for_blank_spaces(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#69 - def add_offenses_for_unnecessary_spaces(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#85 - def body_range(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#79 - def regex_matches(node, &blk); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#42 -RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::BEGIN_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#43 -RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::END_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#41 -RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::MSG = T.let(T.unsafe(nil), String) - -# Checks for spaces inside range literals. -# -# @example -# # bad -# 1 .. 3 -# -# # good -# 1..3 -# -# # bad -# 'a' .. 'z' -# -# # good -# 'a'..'z' -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#20 -class RuboCop::Cop::Layout::SpaceInsideRangeLiteral < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#29 - def on_erange(node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#25 - def on_irange(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#35 - def check(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#23 -RuboCop::Cop::Layout::SpaceInsideRangeLiteral::MSG = T.let(T.unsafe(nil), String) - -# Checks that reference brackets have or don't have -# surrounding space depending on configuration. -# -# @example EnforcedStyle: no_space (default) -# # The `no_space` style enforces that reference brackets have -# # no surrounding space. -# -# # bad -# hash[ :key ] -# array[ index ] -# -# # good -# hash[:key] -# array[index] -# @example EnforcedStyle: space -# # The `space` style enforces that reference brackets have -# # surrounding space. -# -# # bad -# hash[:key] -# array[index] -# -# # good -# hash[ :key ] -# array[ index ] -# @example EnforcedStyleForEmptyBrackets: no_space (default) -# # The `no_space` EnforcedStyleForEmptyBrackets style enforces that -# # empty reference brackets do not contain spaces. -# -# # bad -# foo[ ] -# foo[ ] -# foo[ -# ] -# -# # good -# foo[] -# @example EnforcedStyleForEmptyBrackets: space -# # The `space` EnforcedStyleForEmptyBrackets style enforces that -# # empty reference brackets contain exactly one space. -# -# # bad -# foo[] -# foo[ ] -# foo[ -# ] -# -# # good -# foo[ ] -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#60 -class RuboCop::Cop::Layout::SpaceInsideReferenceBrackets < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#70 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#92 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#121 - def closing_bracket(tokens, opening_bracket); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#137 - def empty_config; end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#110 - def left_ref_bracket(node, tokens); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#132 - def previous_token(current_token); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#104 - def reference_brackets(node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#66 -RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#65 -RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#68 -RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for whitespace within string interpolations. -# -# @example EnforcedStyle: no_space (default) -# # bad -# var = "This is the #{ space } example" -# -# # good -# var = "This is the #{no_space} example" -# @example EnforcedStyle: space -# # bad -# var = "This is the #{no_space} example" -# -# # good -# var = "This is the #{ space } example" -# -# source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#21 -class RuboCop::Cop::Layout::SpaceInsideStringInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#29 - def on_interpolation(begin_node); end - - private - - # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#45 - def autocorrect(corrector, begin_node); end - - # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#55 - def delimiters(begin_node); end -end - -# source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#27 -RuboCop::Cop::Layout::SpaceInsideStringInterpolation::MSG = T.let(T.unsafe(nil), String) - -# Looks for trailing blank lines and a final newline in the -# source code. -# -# @example EnforcedStyle: final_newline (default) -# # `final_newline` looks for one newline at the end of files. -# -# # bad -# class Foo; end -# -# # EOF -# -# # bad -# class Foo; end # EOF -# -# # good -# class Foo; end -# # EOF -# @example EnforcedStyle: final_blank_line -# # `final_blank_line` looks for one blank line followed by a new line -# # at the end of files. -# -# # bad -# class Foo; end -# # EOF -# -# # bad -# class Foo; end # EOF -# -# # good -# class Foo; end -# -# # EOF -# -# source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#40 -class RuboCop::Cop::Layout::TrailingEmptyLines < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#45 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#90 - def end_with_percent_blank_string?(processed_source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#80 - def ends_in_end?(processed_source); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#94 - def message(wanted_blank_lines, blank_lines); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#67 - def offense_detected(buffer, wanted_blank_lines, blank_lines, whitespace_at_end); end -end - -# Looks for trailing whitespace in the source code. -# -# @example -# # The line in this example contains spaces after the 0. -# # bad -# x = 0 -# -# # The line in this example ends directly after the 0. -# # good -# x = 0 -# @example AllowInHeredoc: false (default) -# # The line in this example contains spaces after the 0. -# # bad -# code = <<~RUBY -# x = 0 -# RUBY -# -# # ok -# code = <<~RUBY -# x = 0 #{} -# RUBY -# -# # good -# trailing_whitespace = ' ' -# code = <<~RUBY -# x = 0#{trailing_whitespace} -# RUBY -# @example AllowInHeredoc: true -# # The line in this example contains spaces after the 0. -# # good -# code = <<~RUBY -# x = 0 -# RUBY -# -# source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#42 -class RuboCop::Cop::Layout::TrailingWhitespace < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Heredoc - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#57 - def on_heredoc(_node); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#49 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#112 - def extract_heredocs(ast); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#103 - def find_heredoc(line_number); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#108 - def heredocs; end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#125 - def offense_range(lineno, line); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#61 - def process_line(line, lineno); end - - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#75 - def process_line_in_heredoc(corrector, range, heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#99 - def skip_heredoc?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#95 - def static?(heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#86 - def whitespace_is_indentation?(range, level); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#90 - def whitespace_only?(range); end -end - -# source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#47 -RuboCop::Cop::Layout::TrailingWhitespace::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#5 -module RuboCop::Cop::Legacy; end - -# Legacy support for Corrector#corrections -# See https://docs.rubocop.org/rubocop/v1_upgrade_notes.html -# -# source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#8 -class RuboCop::Cop::Legacy::CorrectionsProxy - # @return [CorrectionsProxy] a new instance of CorrectionsProxy - # - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#9 - def initialize(corrector); end - - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#13 - def <<(callable); end - - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#21 - def concat(corrections); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#17 - def empty?; end - - protected - - # Returns the value of attribute corrector. - # - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#31 - def corrector; end - - private - - # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#35 - def suppress_clobbering; end -end - -# This class handles autocorrection for code that needs to be moved -# to new lines. -# -# source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#7 -class RuboCop::Cop::LineBreakCorrector - extend ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::TrailingBody - extend ::RuboCop::PathUtil - extend ::RuboCop::Cop::Util - - class << self - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#27 - def break_line_before(range:, node:, corrector:, configured_width:, indent_steps: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#15 - def correct_trailing_body(configured_width:, corrector:, node:, processed_source:); end - - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#35 - def move_comment(eol_comment:, node:, corrector:); end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#13 - def processed_source; end - - private - - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#45 - def remove_semicolon(node, corrector); end - - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#51 - def semicolon(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#60 - def trailing_class_definition?(token, body); end - end -end - -# Help methods for determining if a line is too long. -# -# source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#6 -module RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::Alignment - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#24 - def allow_uri?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#28 - def allowed_uri_position?(line, uri_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#15 - def directive_on_source_line?(line_index); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#73 - def extend_uri_end_position(line, end_position); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#36 - def find_excessive_uri_range(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#11 - def ignore_cop_directives?; end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#60 - def indentation_difference(line); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#32 - def line_length(line); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#111 - def line_length_without_directive(line); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#52 - def match_uris(string); end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#89 - def tab_indentation_width; end - - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#94 - def uri_regexp; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#104 - def valid_uri?(uri_ish_string); end -end - -# source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#5 -module RuboCop::Cop::Lint; end - -# Checks for mistyped shorthand assignments. -# -# @example -# # bad -# x =- y -# x =+ y -# x =* y -# x =! y -# -# # good -# x -= y # or x = -y -# x += y # or x = +y -# x *= y # or x = *y -# x != y # or x = !y -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#21 -class RuboCop::Cop::Lint::AmbiguousAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#30 - def on_lvasgn(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#44 - def rhs(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#28 -RuboCop::Cop::Lint::AmbiguousAssignment::MISTAKES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#24 -RuboCop::Cop::Lint::AmbiguousAssignment::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_assignment.rb#26 -RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# Checks for ambiguous block association with method -# when param passed without parentheses. -# -# This cop can customize allowed methods with `AllowedMethods`. -# By default, there are no methods to allowed. -# -# @example -# -# # bad -# some_method a { |val| puts val } -# -# # good -# # With parentheses, there's no ambiguity. -# some_method(a { |val| puts val }) -# # or (different meaning) -# some_method(a) { |val| puts val } -# -# # good -# # Operator methods require no disambiguation -# foo == bar { |b| b.baz } -# -# # good -# # Lambda arguments require no disambiguation -# foo = ->(bar) { bar.baz } -# @example AllowedMethods: [] (default) -# -# # bad -# expect { do_something }.to change { object.attribute } -# @example AllowedMethods: [change] -# -# # good -# expect { do_something }.to change { object.attribute } -# @example AllowedPatterns: [] (default) -# -# # bad -# expect { do_something }.to change { object.attribute } -# @example AllowedPatterns: ['change'] -# -# # good -# expect { do_something }.to change { object.attribute } -# expect { do_something }.to not_change { object.attribute } -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#52 -class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#62 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#62 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#83 - def allowed_method_pattern?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#79 - def ambiguous_block_association?(send_node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#89 - def message(send_node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#95 - def wrap_in_parentheses(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#58 -RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String) - -# Checks for ambiguous operators in the first argument of a -# method invocation without parentheses. -# -# @example -# -# # bad -# -# # The `*` is interpreted as a splat operator but it could possibly be -# # a `*` method invocation (i.e. `do_something.*(some_array)`). -# do_something *some_array -# -# # good -# -# # With parentheses, there's no ambiguity. -# do_something(*some_array) -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#21 -class RuboCop::Cop::Lint::AmbiguousOperator < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#43 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#62 - def find_offense_node_by(diagnostic); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#80 - def message(diagnostic); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#90 - def offense_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#86 - def offense_position?(node, diagnostic); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#99 - def unary_operator?(node, diagnostic); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#39 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#24 -RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#34 -RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String) - -# Looks for expressions containing multiple binary operators -# where precedence is ambiguous due to lack of parentheses. For example, -# in `1 + 2 * 3`, the multiplication will happen before the addition, but -# lexically it appears that the addition will happen first. -# -# The cop does not consider unary operators (ie. `!a` or `-b`) or comparison -# operators (ie. `a =~ b`) because those are not ambiguous. -# -# NOTE: Ranges are handled by `Lint/AmbiguousRange`. -# -# @example -# # bad -# a + b * c -# a || b && c -# a ** b + c -# -# # good (different precedence) -# a + (b * c) -# a || (b && c) -# (a ** b) + c -# -# # good (same precedence) -# a + b + c -# a * b / c % d -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#30 -class RuboCop::Cop::Lint::AmbiguousOperatorPrecedence < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#54 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#47 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#65 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#105 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#89 - def greater_precedence?(node1, node2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#85 - def operator?(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#97 - def operator_name(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#79 - def precedence(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#45 -RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::MSG = T.let(T.unsafe(nil), String) - -# See https://ruby-doc.org/core-3.0.2/doc/syntax/precedence_rdoc.html -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#34 -RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::PRECEDENCE = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_operator_precedence.rb#44 -RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for ambiguous ranges. -# -# Ranges have quite low precedence, which leads to unexpected behavior when -# using a range with other operators. This cop avoids that by making ranges -# explicit by requiring parenthesis around complex range boundaries (anything -# that is not a literal: numerics, strings, symbols, etc.). -# -# This cop can be configured with `RequireParenthesesForMethodChains` in order to -# specify whether method chains (including `self.foo`) should be wrapped in parens -# by this cop. -# -# NOTE: Regardless of this configuration, if a method receiver is a basic literal -# value, it will be wrapped in order to prevent the ambiguity of `1..2.to_a`. -# -# @example -# # bad -# x || 1..2 -# (x || 1..2) -# 1..2.to_a -# -# # good, unambiguous -# 1..2 -# 'a'..'z' -# :bar..:baz -# MyClass::MIN..MyClass::MAX -# @min..@max -# a..b -# -a..b -# -# # good, ambiguity removed -# x || (1..2) -# (x || 1)..2 -# (x || 1)..(y || 2) -# (1..2).to_a -# @example RequireParenthesesForMethodChains: false (default) -# # good -# a.foo..b.bar -# (a.foo)..(b.bar) -# @example RequireParenthesesForMethodChains: true -# # bad -# a.foo..b.bar -# -# # good -# (a.foo)..(b.bar) -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#59 -class RuboCop::Cop::Lint::AmbiguousRange < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RationalLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#65 - def on_erange(node); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#65 - def on_irange(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#84 - def acceptable?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#92 - def acceptable_call?(node); end - - # @yield [range.begin] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#78 - def each_boundary(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#102 - def require_parentheses_for_method_chain?; end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_range.rb#63 -RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String) - -# Checks for ambiguous regexp literals in the first argument of -# a method invocation without parentheses. -# -# @example -# -# # bad -# -# # This is interpreted as a method invocation with a regexp literal, -# # but it could possibly be `/` method invocations. -# # (i.e. `do_something./(pattern)./(i)`) -# do_something /pattern/i -# -# # good -# -# # With parentheses, there's no ambiguity. -# do_something(/pattern/i) -# -# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#22 -class RuboCop::Cop::Lint::AmbiguousRegexpLiteral < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#29 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#54 - def find_offense_node(node, regexp_receiver); end - - # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#47 - def find_offense_node_by(diagnostic); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#65 - def first_argument_is_regexp?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#69 - def method_chain_to_regexp_receiver?(node, regexp_receiver); end -end - -# source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#25 -RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String) - -# Checks for an array literal interpolated inside a regexp. -# -# When interpolating an array literal, it is converted to a string. This means -# that when inside a regexp, it acts as a character class but with additional -# quotes, spaces and commas that are likely not intended. For example, -# `/#{%w[a b c]}/` parses as `/["a", "b", "c"]/` (or `/["a, bc]/` without -# repeated characters). -# -# The cop can autocorrect to a character class (if all items in the array are a -# single character) or alternation (if the array contains longer items). -# -# NOTE: This only considers interpolated arrays that contain only strings, symbols, -# integers, and floats. Any other type is not easily convertible to a character class -# or regexp alternation. -# -# @example -# # bad -# /#{%w[a b c]}/ -# -# # good -# /[abc]/ -# -# # bad -# /#{%w[foo bar baz]}/ -# -# # good -# /(?:foo|bar|baz)/ -# -# # bad - construct a regexp rather than interpolate an array of identifiers -# /#{[foo, bar]}/ -# -# source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#41 -class RuboCop::Cop::Lint::ArrayLiteralInRegexp < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#53 - def on_interpolation(begin_node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#106 - def alternation_for(values); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#67 - def array_of_literal_values?(node); end - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#92 - def array_values(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#98 - def character_class?(values); end - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#102 - def character_class_for(values); end - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#110 - def escape_values(values); end - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#71 - def register_array_of_literal_values(begin_node, node); end - - # source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#87 - def register_array_of_nonliteral_values(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#45 -RuboCop::Cop::Lint::ArrayLiteralInRegexp::LITERAL_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#49 -RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_ALTERNATION = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#48 -RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_CHARACTER_CLASS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/array_literal_in_regexp.rb#50 -RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_UNKNOWN = T.let(T.unsafe(nil), String) - -# Checks for assignments in the conditions of -# if/while/until. -# -# `AllowSafeAssignment` option for safe assignment. -# By safe assignment we mean putting parentheses around -# an assignment to indicate "I know I'm using an assignment -# as a condition. It's not a mistake." -# -# @example -# # bad -# if some_var = value -# do_something -# end -# -# # good -# if some_var == value -# do_something -# end -# @example AllowSafeAssignment: true (default) -# # good -# if (some_var = value) -# do_something -# end -# @example AllowSafeAssignment: false -# # bad -# if (some_var = value) -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#41 -class RuboCop::Cop::Lint::AssignmentInCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::SafeAssignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#55 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#55 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#55 - def on_while(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#80 - def allowed_construct?(asgn_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#84 - def conditional_assignment?(asgn_node); end - - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#72 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#88 - def skip_children?(asgn_node); end - - # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#94 - def traverse_node(node, &block); end -end - -# source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#53 -RuboCop::Cop::Lint::AssignmentInCondition::ASGN_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#50 -RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITHOUT_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#46 -RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) - -# `BigDecimal.new()` is deprecated since BigDecimal 1.3.3. -# This cop identifies places where `BigDecimal.new()` -# can be replaced by `BigDecimal()`. -# -# @example -# # bad -# BigDecimal.new(123.456, 3) -# -# # good -# BigDecimal(123.456, 3) -# -# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#17 -class RuboCop::Cop::Lint::BigDecimalNew < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#24 - def big_decimal_new(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#29 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#20 -RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#21 -RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where binary operator has identical operands. -# -# It covers comparison operators: `==`, `===`, `=~`, `>`, `>=`, `<`, ``<=``; -# bitwise operators: `|`, `^`, `&`; -# boolean operators: `&&`, `||` -# and "spaceship" operator - ``<=>``. -# -# Simple arithmetic operations are allowed by this cop: `+`, `*`, `**`, `<<` and `>>`. -# Although these can be rewritten in a different way, it should not be necessary to -# do so. Operations such as `-` or `/` where the result will always be the same -# (`x - x` will always be 0; `x / x` will always be 1) are offenses, but these -# are covered by `Lint/NumericOperationWithConstantResult` instead. -# -# @example -# # bad -# x.top >= x.top -# -# if a.x != 0 && a.x != 0 -# do_something -# end -# -# def child? -# left_child || left_child -# end -# -# # good -# x + x -# 1 << 1 -# -# source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#46 -class RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#57 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#57 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#50 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#47 -RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#48 -RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `:true` and `:false` symbols. -# In most cases it would be a typo. -# -# @example -# -# # bad -# :true -# -# # good -# true -# -# # bad -# :false -# -# # good -# false -# -# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#27 -class RuboCop::Cop::Lint::BooleanSymbol < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#33 - def boolean_symbol?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#35 - def on_sym(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#48 - def autocorrect(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#30 -RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) - -# Checks for circular argument references in optional keyword -# arguments and optional ordinal arguments. -# -# NOTE: This syntax was made invalid on Ruby 2.7 - Ruby 3.3 but is allowed -# again since Ruby 3.4. -# -# @example -# -# # bad -# def bake(pie: pie) -# pie.heat_up -# end -# -# # good -# def bake(pie:) -# pie.refrigerate -# end -# -# # good -# def bake(pie: self.pie) -# pie.feed_to(user) -# end -# -# # bad -# def cook(dry_ingredients = dry_ingredients) -# dry_ingredients.reduce(&:+) -# end -# -# # good -# def cook(dry_ingredients = self.dry_ingredients) -# dry_ingredients.combine -# end -# -# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#38 -class RuboCop::Cop::Lint::CircularArgumentReference < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#43 - def on_kwoptarg(node); end - - # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#47 - def on_optarg(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#53 - def check_for_circular_argument_references(arg_name, arg_value); end -end - -# source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#41 -RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String) - -# Do not define constants within a block, since the block's scope does not -# isolate or namespace the constant in any way. -# -# If you are trying to define that constant once, define it outside of -# the block instead, or use a variable or method if defining the constant -# in the outer scope would be problematic. -# -# For meta-programming, use `const_set`. -# -# @example -# # bad -# task :lint do -# FILES_TO_LINT = Dir['lib/*.rb'] -# end -# -# # bad -# describe 'making a request' do -# class TestRequest; end -# end -# -# # bad -# module M -# extend ActiveSupport::Concern -# included do -# LIST = [] -# end -# end -# -# # good -# task :lint do -# files_to_lint = Dir['lib/*.rb'] -# end -# -# # good -# describe 'making a request' do -# let(:test_request) { Class.new } -# # see also `stub_const` for RSpec -# end -# -# # good -# module M -# extend ActiveSupport::Concern -# included do -# const_set(:LIST, []) -# end -# end -# @example AllowedMethods: ['enums'] (default) -# # good -# -# # `enums` for Typed Enums via `T::Enum` in Sorbet. -# # https://sorbet.org/docs/tenum -# class TestEnum < T::Enum -# enums do -# Foo = new("foo") -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#64 -class RuboCop::Cop::Lint::ConstantDefinitionInBlock < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#70 - def constant_assigned_in_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#75 - def module_defined_in_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#79 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#85 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#85 - def on_module(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#94 - def method_name(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#67 -RuboCop::Cop::Lint::ConstantDefinitionInBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for overwriting an exception with an exception result by use ``rescue =>``. -# -# You intended to write as `rescue StandardError`. -# However, you have written `rescue => StandardError`. -# In that case, the result of `rescue` will overwrite `StandardError`. -# -# @example -# -# # bad -# begin -# something -# rescue => StandardError -# end -# -# # good -# begin -# something -# rescue StandardError -# end -# -# source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#26 -class RuboCop::Cop::Lint::ConstantOverwrittenInRescue < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#41 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#33 - def overwritten_constant(param0 = T.unsafe(nil)); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#37 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#30 -RuboCop::Cop::Lint::ConstantOverwrittenInRescue::MSG = T.let(T.unsafe(nil), String) - -# Checks for constant reassignments. -# -# Emulates Ruby's runtime warning "already initialized constant X" -# when a constant is reassigned in the same file and namespace using the -# `NAME = value` syntax. -# -# The cop cannot catch all offenses, like, for example, when a constant -# is reassigned in another file, or when using metaprogramming (`Module#const_set`). -# -# The cop only takes into account constants assigned in a "simple" way: directly -# inside class/module definition, or within another constant. Other type of assignments -# (e.g., inside a conditional) are disregarded. -# -# The cop also tracks constant removal using `Module#remove_const` with symbol -# or string argument. -# -# @example -# # bad -# X = :foo -# X = :bar -# -# # bad -# class A -# X = :foo -# X = :bar -# end -# -# # bad -# module A -# X = :foo -# X = :bar -# end -# -# # good - keep only one assignment -# X = :bar -# -# class A -# X = :bar -# end -# -# module A -# X = :bar -# end -# -# # good - use OR assignment -# X = :foo -# X ||= :bar -# -# # good - use conditional assignment -# X = :foo -# X = :bar unless defined?(X) -# -# # good - remove the assigned constant first -# class A -# X = :foo -# remove_const :X -# X = :bar -# end -# -# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#65 -class RuboCop::Cop::Lint::ConstantReassignment < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#76 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#84 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#71 - def remove_constant(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#135 - def ancestor_namespaces(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#142 - def constant_names; end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#131 - def constant_namespaces(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#98 - def fixed_constant_path?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#111 - def freeze_method?(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#115 - def fully_qualified_constant_name(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#127 - def fully_qualified_name_for(namespaces, constant); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#102 - def simple_assignment?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#66 -RuboCop::Cop::Lint::ConstantReassignment::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#68 -RuboCop::Cop::Lint::ConstantReassignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Check that certain constants are fully qualified. -# -# This is not enabled by default because it would mark a lot of offenses -# unnecessarily. -# -# Generally, gems should fully qualify all constants to avoid conflicts with -# the code that uses the gem. Enable this cop without using `Only`/`Ignore` -# -# Large projects will over time end up with one or two constant names that -# are problematic because of a conflict with a library or just internally -# using the same name a namespace and a class. To avoid too many unnecessary -# offenses, Enable this cop with `Only: [The, Constant, Names, Causing, Issues]` -# -# NOTE: `Style/RedundantConstantBase` cop is disabled if this cop is enabled to prevent -# conflicting rules. Because it respects user configurations that want to enable -# this cop which is disabled by default. -# -# @example -# # By default checks every constant -# -# # bad -# User -# -# # bad -# User::Login -# -# # good -# ::User -# -# # good -# ::User::Login -# @example Only: ['Login'] -# # Restrict this cop to only being concerned about certain constants -# -# # bad -# Login -# -# # good -# ::Login -# -# # good -# User::Login -# @example Ignore: ['Login'] -# # Restrict this cop not being concerned about certain constants -# -# # bad -# User -# -# # good -# ::User::Login -# -# # good -# Login -# -# source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#62 -class RuboCop::Cop::Lint::ConstantResolution < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#70 - def on_const(node); end - - # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#66 - def unqualified_const?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#83 - def allowed_names; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#78 - def const_name?(name); end - - # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#87 - def ignored_names; end -end - -# source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#63 -RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) - -# are strictly formatted. -# -# A comment can be added to the directive by prefixing it with `--`. -# -# @example -# # bad -# # rubocop:disable Layout/LineLength Style/Encoding -# # ^ missing comma -# -# # bad -# # rubocop:disable -# -# # bad -# # rubocop:disable Layout/LineLength # rubocop:disable Style/Encoding -# -# # bad -# # rubocop:wrongmode Layout/LineLength -# -# # good -# # rubocop:disable Layout/LineLength -# -# # good -# # rubocop:disable Layout/LineLength, Style/Encoding -# -# # good -# # rubocop:disable all -# -# # good -# # rubocop:disable Layout/LineLength -- This is a good comment. -# -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#39 -class RuboCop::Cop::Lint::CopDirectiveSyntax < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#48 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#62 - def offense_message(directive_comment); end -end - -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#40 -RuboCop::Cop::Lint::CopDirectiveSyntax::COMMON_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#43 -RuboCop::Cop::Lint::CopDirectiveSyntax::INVALID_MODE_NAME_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#45 -RuboCop::Cop::Lint::CopDirectiveSyntax::MALFORMED_COP_NAMES_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#44 -RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_COP_NAME_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/cop_directive_syntax.rb#42 -RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_MODE_NAME_MSG = T.let(T.unsafe(nil), String) - -# Checks for debug calls (such as `debugger` or `binding.pry`) that should -# not be kept for production code. -# -# The cop can be configured using `DebuggerMethods`. By default, a number of gems -# debug entrypoints are configured (`Kernel`, `Byebug`, `Capybara`, `debug.rb`, -# `Pry`, `Rails`, `RubyJard`, and `WebConsole`). Additional methods can be added. -# -# Specific default groups can be disabled if necessary: -# -# [source,yaml] -# ---- -# Lint/Debugger: -# DebuggerMethods: -# WebConsole: ~ -# ---- -# -# You can also add your own methods by adding a new category: -# -# [source,yaml] -# ---- -# Lint/Debugger: -# DebuggerMethods: -# MyDebugger: -# MyDebugger.debug_this -# ---- -# -# Some gems also ship files that will start a debugging session when required, -# for example `require 'debug/start'` from `ruby/debug`. These requires can -# be configured through `DebuggerRequires`. It has the same structure as -# `DebuggerMethods`, which you can read about above. -# -# @example -# -# # bad (ok during development) -# -# # using pry -# def some_method -# binding.pry -# do_something -# end -# -# # bad (ok during development) -# -# # using byebug -# def some_method -# byebug -# do_something -# end -# -# # good -# -# def some_method -# do_something -# end -# @example DebuggerMethods: [my_debugger] -# -# # bad (ok during development) -# -# def some_method -# my_debugger -# end -# @example DebuggerRequires: [my_debugger/start] -# -# # bad (ok during development) -# -# require 'my_debugger/start' -# -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#74 -class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#78 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#138 - def assumed_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#117 - def assumed_usage_context?(node); end - - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#127 - def chained_method_name(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#104 - def debugger_method?(send_node); end - - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#90 - def debugger_methods; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#110 - def debugger_require?(send_node); end - - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#97 - def debugger_requires; end - - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#86 - def message(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#76 -RuboCop::Cop::Lint::Debugger::BLOCK_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#75 -RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of the deprecated class method usages. -# -# @example -# -# # bad -# File.exists?(some_path) -# Dir.exists?(some_path) -# iterator? -# attr :name, true -# attr :name, false -# ENV.freeze # Calling `Env.freeze` raises `TypeError` since Ruby 2.7. -# ENV.clone -# ENV.dup # Calling `Env.dup` raises `TypeError` since Ruby 3.1. -# Socket.gethostbyname(host) -# Socket.gethostbyaddr(host) -# -# # good -# File.exist?(some_path) -# Dir.exist?(some_path) -# block_given? -# attr_accessor :name -# attr_reader :name -# ENV # `ENV.freeze` cannot prohibit changes to environment variables. -# ENV.to_h -# ENV.to_h # `ENV.dup` cannot dup `ENV`, use `ENV.to_h` to get a copy of `ENV` as a hash. -# Addrinfo.getaddrinfo(nodename, service) -# Addrinfo.tcp(host, port).getnameinfo -# -# source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#33 -class RuboCop::Cop::Lint::DeprecatedClassMethods < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#53 - def deprecated_class_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#63 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#112 - def dir_env_file_const?(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#83 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#93 - def preferred_method(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#108 - def socket_const?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#50 -RuboCop::Cop::Lint::DeprecatedClassMethods::DIR_ENV_FILE_CONSTANTS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#36 -RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#41 -RuboCop::Cop::Lint::DeprecatedClassMethods::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#37 -RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for deprecated constants. -# -# It has `DeprecatedConstants` config. If there is an alternative method, you can set -# alternative value as `Alternative`. And you can set the deprecated version as -# `DeprecatedVersion`. These options can be omitted if they are not needed. -# -# DeprecatedConstants: -# 'DEPRECATED_CONSTANT': -# Alternative: 'alternative_value' -# DeprecatedVersion: 'deprecated_version' -# -# By default, `NIL`, `TRUE`, `FALSE`, `Net::HTTPServerException, `Random::DEFAULT`, -# `Struct::Group`, and `Struct::Passwd` are configured. -# -# @example -# -# # bad -# NIL -# TRUE -# FALSE -# Net::HTTPServerException -# Random::DEFAULT # Return value of Ruby 2 is `Random` instance, Ruby 3.0 is `Random` class. -# Struct::Group -# Struct::Passwd -# -# # good -# nil -# true -# false -# Net::HTTPClientException -# Random.new # `::DEFAULT` has been deprecated in Ruby 3, `.new` is compatible with Ruby 2. -# Etc::Group -# Etc::Passwd -# -# source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#40 -class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#46 - def on_const(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#66 - def constant_name(node, nested_constant_name); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#82 - def deprecated_constants; end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#72 - def message(good, bad, deprecated_version); end -end - -# source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#44 -RuboCop::Cop::Lint::DeprecatedConstants::DO_NOT_USE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_constants.rb#43 -RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), String) - -# Algorithmic constants for `OpenSSL::Cipher` and `OpenSSL::Digest` -# deprecated since OpenSSL version 2.2.0. Prefer passing a string -# instead. -# -# @example -# -# # bad -# OpenSSL::Cipher::AES.new(128, :GCM) -# -# # good -# OpenSSL::Cipher.new('aes-128-gcm') -# -# # bad -# OpenSSL::Digest::SHA256.new -# -# # good -# OpenSSL::Digest.new('SHA256') -# -# # bad -# OpenSSL::Digest::SHA256.digest('foo') -# -# # good -# OpenSSL::Digest.digest('SHA256', 'foo') -# -# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#30 -class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#40 - def algorithm_const(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#50 - def digest_const?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#54 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#101 - def algorithm_name(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#66 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#130 - def build_cipher_arguments(node, algorithm_name, no_arguments); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#93 - def correction_range(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#78 - def message(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#97 - def openssl_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#119 - def replacement_args(node); end - - # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#111 - def sanitize_arguments(arguments); end -end - -# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#34 -RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#37 -RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#36 -RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks constructors for disjunctive assignments (`||=`) that should -# be plain assignments. -# -# So far, this cop is only concerned with disjunctive assignment of -# instance variables. -# -# In ruby, an instance variable is nil until a value is assigned, so the -# disjunction is unnecessary. A plain assignment has the same effect. -# -# @example -# # bad -# def initialize -# @x ||= 1 -# end -# -# # good -# def initialize -# @x = 1 -# end -# -# source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#48 -class RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#53 - def on_def(node); end - - private - - # @param node [DefNode] a constructor definition - # - # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#60 - def check(node); end - - # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#66 - def check_body(body); end - - # @param lines [Array] the logical lines of the constructor - # - # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#78 - def check_body_lines(lines); end - - # Add an offense if the LHS of the given disjunctive assignment is - # an instance variable. - # - # For now, we only care about assignments to instance variables. - # - # @param node [Node] a disjunctive assignment - # - # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#99 - def check_disjunctive_assignment(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#51 -RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil), String) - -# Checks that there are no repeated bodies -# within `if/unless`, `case-when`, `case-in` and `rescue` constructs. -# -# With `IgnoreLiteralBranches: true`, branches are not registered -# as offenses if they return a basic literal value (string, symbol, -# integer, float, rational, complex, `true`, `false`, or `nil`), or -# return an array, hash, regexp or range that only contains one of -# the above basic literal values. -# -# With `IgnoreConstantBranches: true`, branches are not registered -# as offenses if they return a constant value. -# -# With `IgnoreDuplicateElseBranch: true`, in conditionals with multiple branches, -# duplicate 'else' branches are not registered as offenses. -# -# @example -# # bad -# if foo -# do_foo -# do_something_else -# elsif bar -# do_foo -# do_something_else -# end -# -# # good -# if foo || bar -# do_foo -# do_something_else -# end -# -# # bad -# case x -# when foo -# do_foo -# when bar -# do_foo -# else -# do_something_else -# end -# -# # good -# case x -# when foo, bar -# do_foo -# else -# do_something_else -# end -# -# # bad -# begin -# do_something -# rescue FooError -# handle_error -# rescue BarError -# handle_error -# end -# -# # good -# begin -# do_something -# rescue FooError, BarError -# handle_error -# end -# @example IgnoreLiteralBranches: true -# # good -# case size -# when "small" then 100 -# when "medium" then 250 -# when "large" then 1000 -# else 250 -# end -# @example IgnoreConstantBranches: true -# # good -# case size -# when "small" then SMALL_SIZE -# when "medium" then MEDIUM_SIZE -# when "large" then LARGE_SIZE -# else MEDIUM_SIZE -# end -# @example IgnoreDuplicateElseBranch: true -# # good -# if foo -# do_foo -# elsif bar -# do_bar -# else -# do_foo -# end -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#99 -class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102 - def on_branching_statement(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#114 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#102 - def on_rescue(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#136 - def branches(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#140 - def consider_branch?(branches, branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#174 - def const_branch?(branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#178 - def duplicate_else_branch?(branches, branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#155 - def ignore_constant_branches?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#159 - def ignore_duplicate_else_branches?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#151 - def ignore_literal_branches?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#163 - def literal_branch?(branch); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#122 - def offense_range(duplicate_branch); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_branch.rb#100 -RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) - -# Checks that there are no repeated conditions -# used in case 'when' expressions. -# -# @example -# -# # bad -# case x -# when 'first' -# do_something -# when 'first' -# do_something_else -# end -# -# # good -# case x -# when 'first' -# do_something -# when 'second' -# do_something_else -# end -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#26 -class RuboCop::Cop::Lint::DuplicateCaseCondition < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#29 - def on_case(case_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#27 -RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks that there are no repeated conditions used in if 'elsif'. -# -# @example -# # bad -# if x == 1 -# do_something -# elsif x == 1 -# do_something_else -# end -# -# # good -# if x == 1 -# do_something -# elsif x == 2 -# do_something_else -# end -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#23 -class RuboCop::Cop::Lint::DuplicateElsifCondition < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#26 - def on_if(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#24 -RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks for duplicated keys in hash literals. -# This cop considers both primitive types and constants for the hash keys. -# -# This cop mirrors a warning in Ruby 2.2. -# -# @example -# -# # bad -# hash = { food: 'apple', food: 'orange' } -# -# # good -# hash = { food: 'apple', other_food: 'orange' } -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#18 -class RuboCop::Cop::Lint::DuplicateHashKey < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Duplication - - # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#23 - def on_hash(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#21 -RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String) - -# Checks for duplicated magic comments. -# -# @example -# -# # bad -# -# # encoding: ascii -# # encoding: ascii -# -# # good -# -# # encoding: ascii -# -# # bad -# -# # frozen_string_literal: true -# # frozen_string_literal: true -# -# # good -# -# # frozen_string_literal: true -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_magic_comment.rb#28 -class RuboCop::Cop::Lint::DuplicateMagicComment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/duplicate_magic_comment.rb#35 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/duplicate_magic_comment.rb#51 - def magic_comment_lines; end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_magic_comment.rb#65 - def register_offense(range); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_magic_comment.rb#33 -RuboCop::Cop::Lint::DuplicateMagicComment::MSG = T.let(T.unsafe(nil), String) - -# Checks that there are no repeated patterns used in `in` keywords. -# -# @example -# -# # bad -# case x -# in 'first' -# do_something -# in 'first' -# do_something_else -# end -# -# # good -# case x -# in 'first' -# do_something -# in 'second' -# do_something_else -# end -# -# # bad - repeated alternate patterns with the same conditions don't depend on the order -# case x -# in foo | bar -# first_method -# in bar | foo -# second_method -# end -# -# # good -# case x -# in foo | bar -# first_method -# in bar | baz -# second_method -# end -# -# # bad - repeated hash patterns with the same conditions don't depend on the order -# case x -# in foo: a, bar: b -# first_method -# in bar: b, foo: a -# second_method -# end -# -# # good -# case x -# in foo: a, bar: b -# first_method -# in bar: b, baz: c -# second_method -# end -# -# # bad - repeated array patterns with elements in the same order -# case x -# in [foo, bar] -# first_method -# in [foo, bar] -# second_method -# end -# -# # good -# case x -# in [foo, bar] -# first_method -# in [bar, foo] -# second_method -# end -# -# # bad - repeated the same patterns and guard conditions -# case x -# in foo if bar -# first_method -# in foo if bar -# second_method -# end -# -# # good -# case x -# in foo if bar -# first_method -# in foo if baz -# second_method -# end -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_match_pattern.rb#90 -class RuboCop::Cop::Lint::DuplicateMatchPattern < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/duplicate_match_pattern.rb#97 - def on_case_match(case_node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/duplicate_match_pattern.rb#108 - def pattern_identity(pattern); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_match_pattern.rb#93 -RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) - -# Checks for duplicated instance (or singleton) method -# definitions. -# -# @example -# -# # bad -# def foo -# 1 -# end -# -# def foo -# 2 -# end -# -# # bad -# def foo -# 1 -# end -# -# alias foo bar -# -# # good -# def foo -# 1 -# end -# -# def bar -# 2 -# end -# -# # good -# def foo -# 1 -# end -# -# alias bar foo -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# -# # good -# def foo -# 1 -# end -# -# delegate :foo, to: :bar -# @example AllCops:ActiveSupportExtensionsEnabled: true -# -# # bad -# def foo -# 1 -# end -# -# delegate :foo, to: :bar -# -# # good -# def foo -# 1 -# end -# -# delegate :baz, to: :bar -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#67 -class RuboCop::Cop::Lint::DuplicateMethods < ::RuboCop::Cop::Base - # @return [DuplicateMethods] a new instance of DuplicateMethods - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#72 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#110 - def alias_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#115 - def delegate_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#98 - def method_alias?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#102 - def on_alias(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#78 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#86 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#122 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#120 - def sym_name(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#138 - def check_const_receiver(node, name, const_name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#145 - def check_self_receiver(node, name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#235 - def found_attr(node, args, readable: T.unsafe(nil), writable: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#163 - def found_instance_method(node, name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#186 - def found_method(node, method_name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#176 - def found_sclass_method(node, name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#213 - def location(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#245 - def lookup_constant(node, const_name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#152 - def message_for_dup(node, method_name, key); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#205 - def method_key(node, method_name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#221 - def on_attr(node, attr_name, args); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#157 - def on_delegate(node, method_names); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#263 - def qualified_name(enclosing, namespace, mod_name); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#277 - def source_location(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#68 -RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#69 -RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for duplicate elements in `Regexp` character classes. -# -# @example -# -# # bad -# r = /[xyx]/ -# -# # bad -# r = /[0-9x0-9]/ -# -# # good -# r = /[xy]/ -# -# # good -# r = /[0-9x]/ -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#21 -class RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#37 - def each_repeated_character_class_element_loc(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#29 - def on_regexp(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#102 - def escaped_octal?(string); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#54 - def group_expressions(node, expressions); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#110 - def interpolation_locs(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#106 - def octal?(char); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#71 - def pop_octal_digits(current_child, expressions); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#89 - def skip_expression?(expr); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#80 - def source_range(children); end - - # Since we blank interpolations with a space for every char of the interpolation, we would - # mark every space (except the first) as duplicate if we do not skip regexp_parser nodes - # that are within an interpolation. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#96 - def within_interpolation?(node, child); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#25 -RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::MSG_REPEATED_ELEMENT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb#27 -RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::OCTAL_DIGITS_AFTER_ESCAPE = T.let(T.unsafe(nil), Integer) - -# Checks for duplicate ``require``s and ``require_relative``s. -# -# @example -# # bad -# require 'foo' -# require 'bar' -# require 'foo' -# -# # good -# require 'foo' -# require 'bar' -# -# # good -# require 'foo' -# require_relative 'foo' -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#26 -class RuboCop::Cop::Lint::DuplicateRequire < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#39 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#45 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#35 - def require_call?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#30 -RuboCop::Cop::Lint::DuplicateRequire::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#31 -RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#32 -RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# Checks that there are no repeated exceptions -# used in 'rescue' expressions. -# -# @example -# # bad -# begin -# something -# rescue FirstException -# handle_exception -# rescue FirstException -# handle_other_exception -# end -# -# # good -# begin -# something -# rescue FirstException -# handle_exception -# rescue SecondException -# handle_other_exception -# end -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#28 -class RuboCop::Cop::Lint::DuplicateRescueException < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RescueNode - - # source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#33 - def on_rescue(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#31 -RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) - -# Checks for duplicate literal, constant, or variable elements in `Set` and `SortedSet`. -# -# @example -# -# # bad -# Set[:foo, :bar, :foo] -# -# # good -# Set[:foo, :bar] -# -# # bad -# Set.new([:foo, :bar, :foo]) -# -# # good -# Set.new([:foo, :bar]) -# -# # bad -# [:foo, :bar, :foo].to_set -# -# # good -# [:foo, :bar].to_set -# -# # bad -# SortedSet[:foo, :bar, :foo] -# -# # good -# SortedSet[:foo, :bar] -# -# # bad -# SortedSet.new([:foo, :bar, :foo]) -# -# # good -# SortedSet.new([:foo, :bar]) -# -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#39 -class RuboCop::Cop::Lint::DuplicateSetElement < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#54 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#54 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#46 - def set_init_elements(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#75 - def register_offense(current_element, prev_element, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#42 -RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43 -RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks if each_with_object is called with an immutable -# argument. Since the argument is the object that the given block shall -# make calls on to build something based on the enumerable that -# each_with_object iterates over, an immutable argument makes no sense. -# It's definitely a bug. -# -# @example -# -# # bad -# sum = numbers.each_with_object(0) { |e, a| a += e } -# -# # good -# num = 0 -# sum = numbers.each_with_object(num) { |e, a| a += e } -# -# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#20 -class RuboCop::Cop::Lint::EachWithObjectArgument < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#25 - def each_with_object?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#29 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#29 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#21 -RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#22 -RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for odd `else` block layout - like -# having an expression on the same line as the `else` keyword, -# which is usually a mistake. -# -# Its autocorrection tweaks layout to keep the syntax. So, this autocorrection -# is compatible correction for bad case syntax, but if your code makes a mistake -# with `elsif` and `else`, you will have to correct it manually. -# -# @example -# -# # bad -# -# if something -# # ... -# else do_this -# do_that -# end -# -# # good -# -# # This code is compatible with the bad case. It will be autocorrected like this. -# if something -# # ... -# else -# do_this -# do_that -# end -# -# # This code is incompatible with the bad case. -# # If `do_this` is a condition, `elsif` should be used instead of `else`. -# if something -# # ... -# elsif do_this -# do_that -# end -# -# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#41 -class RuboCop::Cop::Lint::ElseLayout < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#48 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#79 - def autocorrect(corrector, node, first_else); end - - # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#59 - def check(node); end - - # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#69 - def check_else(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/else_layout.rb#46 -RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String) - -# Checks for blocks without a body. -# Such empty blocks are typically an oversight or we should provide a comment -# to clarify what we're aiming for. -# -# Empty lambdas and procs are ignored by default. -# -# NOTE: For backwards compatibility, the configuration that allows/disallows -# empty lambdas and procs is called `AllowEmptyLambdas`, even though it also -# applies to procs. -# -# @example -# # bad -# items.each { |item| } -# -# # good -# items.each { |item| puts item } -# @example AllowComments: true (default) -# # good -# items.each do |item| -# # TODO: implement later (inner comment) -# end -# -# items.each { |item| } # TODO: implement later (inline comment) -# @example AllowComments: false -# # bad -# items.each do |item| -# # TODO: implement later (inner comment) -# end -# -# items.each { |item| } # TODO: implement later (inline comment) -# @example AllowEmptyLambdas: true (default) -# # good -# allow(subject).to receive(:callable).and_return(-> {}) -# -# placeholder = lambda do -# end -# (callable || placeholder).call -# -# proc { } -# -# Proc.new { } -# @example AllowEmptyLambdas: false -# # bad -# allow(subject).to receive(:callable).and_return(-> {}) -# -# placeholder = lambda do -# end -# (callable || placeholder).call -# -# proc { } -# -# Proc.new { } -# -# source://rubocop//lib/rubocop/cop/lint/empty_block.rb#63 -class RuboCop::Cop::Lint::EmptyBlock < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/empty_block.rb#66 - def on_block(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_block.rb#76 - def allow_comment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_block.rb#83 - def allow_empty_lambdas?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_block.rb#87 - def comment_disables_cop?(comment); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_block.rb#64 -RuboCop::Cop::Lint::EmptyBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for classes and metaclasses without a body. -# Such empty classes and metaclasses are typically an oversight or we should provide a comment -# to be clearer what we're aiming for. -# -# @example -# # bad -# class Foo -# end -# -# class Bar -# class << self -# end -# end -# -# class << obj -# end -# -# # good -# class Foo -# def do_something -# # ... code -# end -# end -# -# class Bar -# class << self -# attr_reader :bar -# end -# end -# -# class << obj -# attr_reader :bar -# end -# @example AllowComments: false (default) -# # bad -# class Foo -# # TODO: implement later -# end -# -# class Bar -# class << self -# # TODO: implement later -# end -# end -# -# class << obj -# # TODO: implement later -# end -# @example AllowComments: true -# # good -# class Foo -# # TODO: implement later -# end -# -# class Bar -# class << self -# # TODO: implement later -# end -# end -# -# class << obj -# # TODO: implement later -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_class.rb#72 -class RuboCop::Cop::Lint::EmptyClass < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/empty_class.rb#76 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/empty_class.rb#81 - def on_sclass(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_class.rb#87 - def body_or_allowed_comment_lines?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_class.rb#73 -RuboCop::Cop::Lint::EmptyClass::CLASS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/empty_class.rb#74 -RuboCop::Cop::Lint::EmptyClass::METACLASS_MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of `if`, `elsif` and `unless` branches without a body. -# -# NOTE: empty `else` branches are handled by `Style/EmptyElse`. -# -# @example -# # bad -# if condition -# end -# -# # bad -# unless condition -# end -# -# # bad -# if condition -# do_something -# elsif other_condition -# end -# -# # good -# if condition -# do_something -# end -# -# # good -# unless condition -# do_something -# end -# -# # good -# if condition -# do_something -# elsif other_condition -# nil -# end -# -# # good -# if condition -# do_something -# elsif other_condition -# do_something_else -# end -# @example AllowComments: true (default) -# # good -# if condition -# do_something -# elsif other_condition -# # noop -# end -# @example AllowComments: false -# # bad -# if condition -# do_something -# elsif other_condition -# # noop -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#65 -class RuboCop::Cop::Lint::EmptyConditionalBody < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#71 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#125 - def branch_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#94 - def can_simplify_conditional?(node); end - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#133 - def deletion_range(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#121 - def else_branch?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#113 - def empty_if_branch?(node); end - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#108 - def flip_orphaned_else(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#86 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#98 - def remove_empty_branch(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#69 -RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String) - -# Checks for empty `ensure` blocks. -# -# @example -# -# # bad -# def some_method -# do_something -# ensure -# end -# -# # bad -# begin -# do_something -# ensure -# end -# -# # good -# def some_method -# do_something -# ensure -# do_something_else -# end -# -# # good -# begin -# do_something -# ensure -# do_something_else -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#35 -class RuboCop::Cop::Lint::EmptyEnsure < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#40 - def on_ensure(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#38 -RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of empty expressions. -# -# @example -# -# # bad -# -# foo = () -# if () -# bar -# end -# -# # good -# -# foo = (some_expression) -# if (some_expression) -# bar -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#23 -class RuboCop::Cop::Lint::EmptyExpression < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#26 - def on_begin(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#34 - def empty_expression?(begin_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#24 -RuboCop::Cop::Lint::EmptyExpression::MSG = T.let(T.unsafe(nil), String) - -# Enforces that Ruby source files are not empty. -# -# @example -# # bad -# # Empty file -# -# # good -# # File containing non commented source lines -# @example AllowComments: true (default) -# # good -# # File consisting only of comments -# @example AllowComments: false -# # bad -# # File consisting only of comments -# -# source://rubocop//lib/rubocop/cop/lint/empty_file.rb#23 -class RuboCop::Cop::Lint::EmptyFile < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#26 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#40 - def contains_only_comments?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#36 - def empty_file?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#32 - def offending?; end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_file.rb#24 -RuboCop::Cop::Lint::EmptyFile::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of `in` pattern branches without a body. -# -# @example -# -# # bad -# case condition -# in [a] -# do_something -# in [a, b] -# end -# -# # good -# case condition -# in [a] -# do_something -# in [a, b] -# nil -# end -# @example AllowComments: true (default) -# -# # good -# case condition -# in [a] -# do_something -# in [a, b] -# # noop -# end -# @example AllowComments: false -# -# # bad -# case condition -# in [a] -# do_something -# in [a, b] -# # noop -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_in_pattern.rb#45 -class RuboCop::Cop::Lint::EmptyInPattern < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/empty_in_pattern.rb#53 - def on_case_match(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_in_pattern.rb#49 -RuboCop::Cop::Lint::EmptyInPattern::MSG = T.let(T.unsafe(nil), String) - -# Checks for empty interpolation. -# -# @example -# -# # bad -# "result is #{}" -# -# # good -# "result is #{some_result}" -# -# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#15 -class RuboCop::Cop::Lint::EmptyInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#21 - def on_interpolation(begin_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#19 -RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of `when` branches without a body. -# -# @example -# -# # bad -# case foo -# when bar -# do_something -# when baz -# end -# -# # good -# case condition -# when foo -# do_something -# when bar -# nil -# end -# @example AllowComments: true (default) -# -# # good -# case condition -# when foo -# do_something -# when bar -# # noop -# end -# @example AllowComments: false -# -# # bad -# case condition -# when foo -# do_something -# when bar -# # do nothing -# end -# -# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#45 -class RuboCop::Cop::Lint::EmptyWhen < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - - # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#50 - def on_case(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/empty_when.rb#48 -RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) - -# Checks for `return` from an `ensure` block. -# `return` from an ensure block is a dangerous code smell as it -# will take precedence over any exception being raised, -# and the exception will be silently thrown away as if it were rescued. -# -# If you want to rescue some (or all) exceptions, best to do it explicitly -# -# @example -# -# # bad -# def foo -# do_something -# ensure -# cleanup -# return self -# end -# -# # good -# def foo -# do_something -# self -# ensure -# cleanup -# end -# -# # good -# def foo -# begin -# do_something -# rescue SomeException -# # Let's ignore this exception -# end -# self -# ensure -# cleanup -# end -# -# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#42 -class RuboCop::Cop::Lint::EnsureReturn < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#45 - def on_ensure(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#43 -RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) - -# Emulates the following Ruby warnings in Ruby 2.6. -# -# [source,console] -# ---- -# $ cat example.rb -# ERB.new('hi', nil, '-', '@output_buffer') -# $ ruby -rerb example.rb -# example.rb:1: warning: Passing safe_level with the 2nd argument of ERB.new is -# deprecated. Do not use it, and specify other arguments as keyword arguments. -# example.rb:1: warning: Passing trim_mode with the 3rd argument of ERB.new is -# deprecated. Use keyword argument like ERB.new(str, trim_mode:...) instead. -# example.rb:1: warning: Passing eoutvar with the 4th argument of ERB.new is -# deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead. -# ---- -# -# Now non-keyword arguments other than first one are softly deprecated -# and will be removed when Ruby 2.5 becomes EOL. -# `ERB.new` with non-keyword arguments is deprecated since ERB 2.2.0. -# Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`. -# This cop identifies places where `ERB.new(str, trim_mode, eoutvar)` can -# be replaced by `ERB.new(str, :trim_mode: trim_mode, eoutvar: eoutvar)`. -# -# @example -# # Target codes supports Ruby 2.6 and higher only -# # bad -# ERB.new(str, nil, '-', '@output_buffer') -# -# # good -# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') -# -# # Target codes supports Ruby 2.5 and lower only -# # good -# ERB.new(str, nil, '-', '@output_buffer') -# -# # Target codes supports Ruby 2.6, 2.5 and lower -# # bad -# ERB.new(str, nil, '-', '@output_buffer') -# -# # good -# # Ruby standard library style -# # https://github.com/ruby/ruby/commit/3406c5d -# if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ -# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') -# else -# ERB.new(str, nil, '-', '@output_buffer') -# end -# -# # good -# # Use `RUBY_VERSION` style -# if RUBY_VERSION >= '2.6' -# ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') -# else -# ERB.new(str, nil, '-', '@output_buffer') -# end -# -# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#61 -class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#81 - def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#86 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#115 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#130 - def build_kwargs(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#126 - def correct_arguments?(arguments); end - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#104 - def message(positional_argument_index, arg_value); end - - # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#147 - def override_by_legacy_args(kwargs, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#74 -RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_EOUTVAR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#68 -RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_SAFE_LEVEL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#71 -RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_TRIM_MODE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#78 -RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for uses of flip-flop operator -# based on the Ruby Style Guide. -# -# Here is the history of flip-flops in Ruby. -# flip-flop operator is deprecated in Ruby 2.6.0 and -# the deprecation has been reverted by Ruby 2.7.0 and -# backported to Ruby 2.6. -# See: https://bugs.ruby-lang.org/issues/5400 -# -# @example -# # bad -# (1..20).each do |x| -# puts x if (x == 5) .. (x == 10) -# end -# -# # good -# (1..20).each do |x| -# puts x if (x >= 5) && (x <= 10) -# end -# -# source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#25 -class RuboCop::Cop::Lint::FlipFlop < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#32 - def on_eflipflop(node); end - - # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#28 - def on_iflipflop(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#26 -RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of precise comparison of floating point numbers. -# -# Floating point values are inherently inaccurate, and comparing them for exact equality -# is almost never the desired semantics. Comparison via the `==/!=` operators checks -# floating-point value representation to be exactly the same, which is very unlikely -# if you perform any arithmetic operations involving precision loss. -# -# @example -# # bad -# x == 0.1 -# x != 0.1 -# -# # good - using BigDecimal -# x.to_d == 0.1.to_d -# -# # good - comparing against zero -# x == 0.0 -# x != 0.0 -# -# # good -# (x - 0.1).abs < Float::EPSILON -# -# # good -# tolerance = 0.0001 -# (x - 0.1).abs < tolerance -# -# # good - comparing against nil -# Float(x, exception: false) == nil -# -# # Or some other epsilon based type of comparison: -# # https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/ -# -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#38 -class RuboCop::Cop::Lint::FloatComparison < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#48 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#48 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#95 - def check_numeric_returning_method(node); end - - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#84 - def check_send(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#63 - def float?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#78 - def literal_safe?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#42 -RuboCop::Cop::Lint::FloatComparison::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#44 -RuboCop::Cop::Lint::FloatComparison::FLOAT_INSTANCE_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#43 -RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#39 -RuboCop::Cop::Lint::FloatComparison::MSG_EQUALITY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#40 -RuboCop::Cop::Lint::FloatComparison::MSG_INEQUALITY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#46 -RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies `Float` literals which are, like, really really really -# really really really really really big. Too big. No-one needs Floats -# that big. If you need a float that big, something is wrong with you. -# -# @example -# -# # bad -# float = 3.0e400 -# -# # good -# float = 42.9 -# -# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#17 -class RuboCop::Cop::Lint::FloatOutOfRange < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#20 - def on_float(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#18 -RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) - -# This lint sees if there is a mismatch between the number of -# expected fields for format/sprintf/#% and what is actually -# passed as arguments. -# -# In addition, it checks whether different formats are used in the same -# format string. Do not mix numbered, unnumbered, and named formats in -# the same format string. -# -# @example -# -# # bad -# format('A value: %s and another: %i', a_value) -# -# # good -# format('A value: %s and another: %i', a_value, another) -# -# # bad -# format('Unnumbered format: %s and numbered: %2$s', a_value, another) -# -# # good -# format('Numbered format: %1$s and numbered %2$s', a_value, another) -# -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#27 -class RuboCop::Cop::Lint::FormatParameterMismatch < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#90 - def called_on_string?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#39 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#127 - def count_format_matches(node); end - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#109 - def count_matches(node); end - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#131 - def count_percent_matches(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#119 - def countable_format?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#123 - def countable_percent?(node); end - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#143 - def expected_fields_count(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#158 - def format?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#136 - def format_method?(name, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#54 - def format_string?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#105 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#58 - def invalid_format_string?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#81 - def matched_arguments_count?(expected, passed); end - - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#176 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#95 - def method_with_format_args?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#67 - def offending_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#166 - def percent?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#99 - def splat_args?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#162 - def sprintf?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#185 - def string_type?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#34 -RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String) - -# http://rubular.com/r/CvpbxkcTzy -# -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#29 -RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#31 -RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#37 -RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#35 -RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#36 -RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array) - -# Prefer using `Hash#compare_by_identity` rather than using `object_id` -# for hash keys. -# -# This cop looks for hashes being keyed by objects' `object_id`, using -# one of these methods: `key?`, `has_key?`, `fetch`, `[]` and `[]=`. -# -# @example -# # bad -# hash = {} -# hash[foo.object_id] = :bar -# hash.key?(baz.object_id) -# -# # good -# hash = {}.compare_by_identity -# hash[foo] = :bar -# hash.key?(baz) -# -# source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#31 -class RuboCop::Cop::Lint::HashCompareByIdentity < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#37 - def id_as_hash_key?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#41 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#41 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#34 -RuboCop::Cop::Lint::HashCompareByIdentity::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#32 -RuboCop::Cop::Lint::HashCompareByIdentity::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the deprecated use of keyword arguments as a default in `Hash.new`. -# -# This usage raises a warning in Ruby 3.3 and results in an error in Ruby 3.4. -# In Ruby 3.4, keyword arguments will instead be used to change the behavior of a hash. -# For example, the capacity option can be passed to create a hash with a certain size -# if you know it in advance, for better performance. -# -# NOTE: The following corner case may result in a false negative when upgrading from Ruby 3.3 -# or earlier, but it is intentionally not detected to respect the expected usage in Ruby 3.4. -# -# [source,ruby] -# ---- -# Hash.new(capacity: 42) -# ---- -# -# @example -# -# # bad -# Hash.new(key: :value) -# -# # good -# Hash.new({key: :value}) -# -# source://rubocop//lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb#29 -class RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb#36 - def hash_new(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb#40 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb#32 -RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb#33 -RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the ordering of a method call where -# the receiver of the call is a HEREDOC. -# -# @example -# # bad -# <<-SQL -# bar -# SQL -# .strip_indent -# -# <<-SQL -# bar -# SQL -# .strip_indent -# .trim -# -# # good -# <<~SQL -# bar -# SQL -# -# <<~SQL.trim -# bar -# SQL -# -# source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#31 -class RuboCop::Cop::Lint::HeredocMethodCallPosition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#37 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#37 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#97 - def all_on_same_line?(nodes); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#50 - def autocorrect(corrector, node, heredoc); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#77 - def call_after_heredoc_range(heredoc); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#107 - def call_end_pos(node); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#116 - def call_line_range(node); end - - # Returns nil if no range can be safely repositioned. - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#122 - def call_range_to_safely_reposition(node, heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#86 - def calls_on_multiple_lines?(node, _heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#82 - def correctly_positioned?(node, heredoc); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#111 - def heredoc_begin_line_range(heredoc); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#103 - def heredoc_end_pos(heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#73 - def heredoc_node?(node); end - - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#59 - def heredoc_node_descendent_receiver(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#67 - def send_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#146 - def trailing_comma?(call_source, call_line_source); end -end - -# source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#35 -RuboCop::Cop::Lint::HeredocMethodCallPosition::MSG = T.let(T.unsafe(nil), String) - -# Prefer `equal?` over `==` when comparing `object_id`. -# -# `Object#equal?` is provided to compare objects for identity, and in contrast -# `Object#==` is provided for the purpose of doing value comparison. -# -# @example -# # bad -# foo.object_id == bar.object_id -# -# # good -# foo.equal?(bar) -# -# source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#18 -class RuboCop::Cop::Lint::IdentityComparison < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#24 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#40 - def compare_between_object_id_by_double_equal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#44 - def object_id_method?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#21 -RuboCop::Cop::Lint::IdentityComparison::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#22 -RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for implicit string concatenation of string literals -# which are on the same line. -# -# @example -# -# # bad -# array = ['Item 1' 'Item 2'] -# -# # good -# array = ['Item 1Item 2'] -# array = ['Item 1' + 'Item 2'] -# array = [ -# 'Item 1' \ -# 'Item 2' -# ] -# -# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#21 -class RuboCop::Cop::Lint::ImplicitStringConcatenation < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#32 - def on_dstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#92 - def display_str(node); end - - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#59 - def each_bad_cons(node); end - - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#74 - def ending_delimiter(str); end - - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#100 - def str_content(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#84 - def string_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#88 - def string_literals?(node1, node2); end -end - -# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#26 -RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#28 -RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#24 -RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String) - -# Checks for `IO.select` that is incompatible with Fiber Scheduler since Ruby 3.0. -# -# When an array of IO objects waiting for an exception (the third argument of `IO.select`) -# is used as an argument, there is no alternative API, so offenses are not registered. -# -# NOTE: When the method is successful the return value of `IO.select` is `[[IO]]`, -# and the return value of `io.wait_readable` and `io.wait_writable` are `self`. -# They are not autocorrected when assigning a return value because these types are different. -# It's up to user how to handle the return value. -# -# @example -# -# # bad -# IO.select([io], [], [], timeout) -# -# # good -# io.wait_readable(timeout) -# -# # bad -# IO.select([], [io], [], timeout) -# -# # good -# io.wait_writable(timeout) -# -# source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#34 -class RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#41 - def io_select(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#46 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#69 - def preferred_method(read, write, timeout); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#63 - def scheduler_compatible?(io1, io2); end -end - -# source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#37 -RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb#38 -RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `private` or `protected` access modifiers which are -# applied to a singleton method. These access modifiers do not make -# singleton methods private/protected. `private_class_method` can be -# used for that. -# -# @example -# -# # bad -# class C -# private -# -# def self.method -# puts 'hi' -# end -# end -# -# # good -# class C -# def self.method -# puts 'hi' -# end -# -# private_class_method :method -# end -# -# # good -# class C -# class << self -# private -# -# def method -# puts 'hi' -# end -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#41 -class RuboCop::Cop::Lint::IneffectiveAccessModifier < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#52 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#52 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#48 - def private_class_methods(param0); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#102 - def access_modifier?(node); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#59 - def check_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#106 - def correct_visibility?(node, modifier, ignored_methods); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#71 - def format_message(modifier); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#84 - def ineffective_modifier(node, ignored_methods = T.unsafe(nil), modifier = T.unsafe(nil), &block); end - - # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#67 - def private_class_method_names(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#44 -RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#45 -RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#42 -RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String) - -# Looks for error classes inheriting from `Exception`. -# It is configurable to suggest using either `StandardError` (default) or -# `RuntimeError` instead. -# -# @example EnforcedStyle: standard_error (default) -# # bad -# -# class C < Exception; end -# -# C = Class.new(Exception) -# -# # good -# -# class C < StandardError; end -# -# C = Class.new(StandardError) -# @example EnforcedStyle: runtime_error -# # bad -# -# class C < Exception; end -# -# C = Class.new(Exception) -# -# # good -# -# class C < RuntimeError; end -# -# C = Class.new(RuntimeError) -# -# source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#40 -class RuboCop::Cop::Lint::InheritException < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#53 - def class_new_call?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#59 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#70 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#87 - def exception_class?(class_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#91 - def inherit_exception_class_with_omitted_namespace?(class_node); end - - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#83 - def message(node); end - - # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#99 - def preferred_base_class; end -end - -# source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#44 -RuboCop::Cop::Lint::InheritException::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#45 -RuboCop::Cop::Lint::InheritException::PREFERRED_BASE_CLASS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#50 -RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for interpolation in a single quoted string. -# -# @example -# -# # bad -# foo = 'something with #{interpolation} inside' -# -# # good -# foo = "something with #{interpolation} inside" -# -# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#21 -class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#28 - def on_str(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#41 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#52 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#56 - def valid_syntax?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#24 -RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String) - -# Emulates the following Ruby warning in Ruby 3.3. -# -# [source,ruby] -# ---- -# $ ruby -e '0.times { it }' -# -e:1: warning: `it` calls without arguments will refer to the first block param in Ruby 3.4; -# use it() or self.it -# ---- -# -# `it` calls without arguments will refer to the first block param in Ruby 3.4. -# So use `it()` or `self.it` to ensure compatibility. -# -# @example -# -# # bad -# do_something { it } -# -# # good -# do_something { it() } -# do_something { self.it } -# -# source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#27 -class RuboCop::Cop::Lint::ItWithoutArgumentsInBlock < ::RuboCop::Cop::Base - include ::RuboCop::AST::NodePattern::Macros - extend ::RuboCop::Cop::TargetRubyVersion - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#44 - def deprecated_it_method?(node); end - - # source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#37 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#33 -RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/it_without_arguments_in_block.rb#35 -RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks uses of lambda without a literal block. -# It emulates the following warning in Ruby 3.0: -# -# $ ruby -vwe 'lambda(&proc {})' -# ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] -# -e:1: warning: lambda without a literal block is deprecated; use the proc without -# lambda instead -# -# This way, proc object is never converted to lambda. -# Autocorrection replaces with compatible proc argument. -# -# @example -# -# # bad -# lambda(&proc { do_something }) -# lambda(&Proc.new { do_something }) -# -# # good -# proc { do_something } -# Proc.new { do_something } -# lambda { do_something } # If you use lambda. -# -# source://rubocop//lib/rubocop/cop/lint/lambda_without_literal_block.rb#28 -class RuboCop::Cop::Lint::LambdaWithoutLiteralBlock < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/lambda_without_literal_block.rb#35 - def lambda_with_symbol_proc?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/lambda_without_literal_block.rb#39 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/lambda_without_literal_block.rb#31 -RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/lambda_without_literal_block.rb#32 -RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for literals used as the conditions or as -# operands in and/or expressions serving as the conditions of -# if/while/until/case-when/case-in. -# -# NOTE: Literals in `case-in` condition where the match variable is used in -# `in` are accepted as a pattern matching. -# -# @example -# -# # bad -# if 20 -# do_something -# end -# -# # bad -# # We're only interested in the left hand side being a truthy literal, -# # because it affects the evaluation of the &&, whereas the right hand -# # side will be conditionally executed/called and can be a literal. -# if true && some_var -# do_something -# end -# -# # good -# if some_var -# do_something -# end -# -# # good -# # When using a boolean value for an infinite loop. -# while true -# break if condition -# end -# -# source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#38 -class RuboCop::Cop::Lint::LiteralAsCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#160 - def message(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#45 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#125 - def on_case(case_node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#140 - def on_case_match(case_match_node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#57 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#154 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#95 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#110 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#65 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#80 - def on_while_post(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#175 - def basic_literal?(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#207 - def check_case(case_node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#166 - def check_for_literal(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#187 - def check_node(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#216 - def condition(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#231 - def condition_evaluation(node, cond); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#240 - def correct_if_node(node, cond); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#197 - def handle_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#183 - def primitive_array?(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#224 - def when_conditions_range(when_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#42 -RuboCop::Cop::Lint::LiteralAsCondition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#43 -RuboCop::Cop::Lint::LiteralAsCondition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for literal assignments in the conditions of `if`, `while`, and `until`. -# It emulates the following Ruby warning: -# -# [source,console] -# ---- -# $ ruby -we 'if x = true; end' -# -e:1: warning: found `= literal' in conditional, should be == -# ---- -# -# As a lint cop, it cannot be determined if `==` is appropriate as intended, -# therefore this cop does not provide autocorrection. -# -# @example -# -# # bad -# if x = 42 -# do_something -# end -# -# # good -# if x == 42 -# do_something -# end -# -# # good -# if x = y -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#35 -class RuboCop::Cop::Lint::LiteralAssignmentInCondition < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#39 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#39 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#39 - def on_while(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#62 - def all_literals?(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#79 - def offense_range(asgn_node, rhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#75 - def parallel_assignment_with_splat_operator?(node); end - - # @yield [node] - # - # source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#56 - def traverse_node(node, &block); end -end - -# source://rubocop//lib/rubocop/cop/lint/literal_assignment_in_condition.rb#36 -RuboCop::Cop::Lint::LiteralAssignmentInCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks for interpolated literals. -# -# NOTE: Array literals interpolated in regexps are not handled by this cop, but -# by `Lint/ArrayLiteralInRegexp` instead. -# -# @example -# -# # bad -# "result is #{10}" -# -# # good -# "result is 10" -# -# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#18 -class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#28 - def on_interpolation(begin_node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#72 - def array_in_regexp?(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#78 - def autocorrected_value(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#145 - def autocorrected_value_for_array(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#151 - def autocorrected_value_for_hash(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#121 - def autocorrected_value_for_string(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#129 - def autocorrected_value_for_symbol(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#162 - def autocorrected_value_in_hash(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#136 - def autocorrected_value_in_hash_for_symbol(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#192 - def ends_heredoc_line?(node); end - - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#100 - def handle_special_regexp_chars(begin_node, value); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#200 - def in_array_percent_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#57 - def offending?(node); end - - # Does node print its own source when converted to a string? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#183 - def prints_as_self?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#188 - def space_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#67 - def special_keyword?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#25 -RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#24 -RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of `begin...end while/until something`. -# -# @example -# -# # bad -# -# # using while -# begin -# do_something -# end while some_condition -# -# # good -# -# # while replacement -# loop do -# do_something -# break unless some_condition -# end -# -# # bad -# -# # using until -# begin -# do_something -# end until some_condition -# -# # good -# -# # until replacement -# loop do -# do_something -# break if some_condition -# end -# -# source://rubocop//lib/rubocop/cop/lint/loop.rb#44 -class RuboCop::Cop::Lint::Loop < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/loop.rb#53 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/lint/loop.rb#49 - def on_while_post(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/loop.rb#73 - def build_break_line(node); end - - # source://rubocop//lib/rubocop/cop/lint/loop.rb#69 - def keyword_and_condition_range(node); end - - # source://rubocop//lib/rubocop/cop/lint/loop.rb#59 - def register_offense(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/loop.rb#47 -RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String) - -# cop disables on wide ranges of code, that latter contributors to -# a file wouldn't be aware of. -# -# @example -# # Lint/MissingCopEnableDirective: -# # MaximumRangeSize: .inf -# -# # good -# # rubocop:disable Layout/SpaceAroundOperators -# x= 0 -# # rubocop:enable Layout/SpaceAroundOperators -# # y = 1 -# # EOF -# -# # bad -# # rubocop:disable Layout/SpaceAroundOperators -# x= 0 -# # EOF -# @example -# # Lint/MissingCopEnableDirective: -# # MaximumRangeSize: 2 -# -# # good -# # rubocop:disable Layout/SpaceAroundOperators -# x= 0 -# # With the previous, there are 2 lines on which cop is disabled. -# # rubocop:enable Layout/SpaceAroundOperators -# -# # bad -# # rubocop:disable Layout/SpaceAroundOperators -# x= 0 -# x += 1 -# # Including this, that's 3 lines on which the cop is disabled. -# # rubocop:enable Layout/SpaceAroundOperators -# -# source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#45 -class RuboCop::Cop::Lint::MissingCopEnableDirective < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#51 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#70 - def acceptable_range?(cop, line_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#104 - def department_enabled?(cop, comment); end - - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#64 - def each_missing_enable; end - - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#87 - def max_range; end - - # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#91 - def message(cop, comment, type = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#48 -RuboCop::Cop::Lint::MissingCopEnableDirective::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#49 -RuboCop::Cop::Lint::MissingCopEnableDirective::MSG_BOUND = T.let(T.unsafe(nil), String) - -# Checks for the presence of constructors and lifecycle callbacks -# without calls to `super`. -# -# This cop does not consider `method_missing` (and `respond_to_missing?`) -# because in some cases it makes sense to overtake what is considered a -# missing method. In other cases, the theoretical ideal handling could be -# challenging or verbose for no actual gain. -# -# Autocorrection is not supported because the position of `super` cannot be -# determined automatically. -# -# `Object` and `BasicObject` are allowed by this cop because of their -# stateless nature. However, sometimes you might want to allow other parent -# classes from this cop, for example in the case of an abstract class that is -# not meant to be called with `super`. In those cases, you can use the -# `AllowedParentClasses` option to specify which classes should be allowed -# *in addition to* `Object` and `BasicObject`. -# -# @example -# # bad -# class Employee < Person -# def initialize(name, salary) -# @salary = salary -# end -# end -# -# # good -# class Employee < Person -# def initialize(name, salary) -# super(name) -# @salary = salary -# end -# end -# -# # bad -# Employee = Class.new(Person) do -# def initialize(name, salary) -# @salary = salary -# end -# end -# -# # good -# Employee = Class.new(Person) do -# def initialize(name, salary) -# super(name) -# @salary = salary -# end -# end -# -# # bad -# class Parent -# def self.inherited(base) -# do_something -# end -# end -# -# # good -# class Parent -# def self.inherited(base) -# super -# do_something -# end -# end -# -# # good -# class ClassWithNoParent -# def initialize -# do_something -# end -# end -# @example AllowedParentClasses: [MyAbstractClass] -# # good -# class MyConcreteClass < MyAbstractClass -# def initialize -# do_something -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#85 -class RuboCop::Cop::Lint::MissingSuper < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#99 - def class_new_block(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#105 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#115 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#149 - def allowed_class?(node); end - - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#153 - def allowed_classes; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#127 - def callback_method_def?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#133 - def contains_super?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#137 - def inside_class_with_stateful_parent?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#123 - def offender?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#96 -RuboCop::Cop::Lint::MissingSuper::CALLBACKS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#87 -RuboCop::Cop::Lint::MissingSuper::CALLBACK_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#91 -RuboCop::Cop::Lint::MissingSuper::CLASS_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#86 -RuboCop::Cop::Lint::MissingSuper::CONSTRUCTOR_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#92 -RuboCop::Cop::Lint::MissingSuper::METHOD_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/missing_super.rb#89 -RuboCop::Cop::Lint::MissingSuper::STATELESS_CLASSES = T.let(T.unsafe(nil), Array) - -# Checks for mixed-case character ranges since they include likely unintended characters. -# -# Offenses are registered for regexp character classes like `/[A-z]/` -# as well as range objects like `('A'..'z')`. -# -# NOTE: `Range` objects cannot be autocorrected. -# -# @example -# -# # bad -# r = /[A-z]/ -# -# # good -# r = /[A-Za-z]/ -# -# source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#28 -class RuboCop::Cop::Lint::MixedCaseRange < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#55 - def each_unsafe_regexp_range(node); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#37 - def on_erange(node); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#37 - def on_irange(node); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#45 - def on_regexp(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#71 - def build_source_range(range_start, range_end); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#75 - def range_for(char); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#81 - def range_pairs(expr); end - - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#101 - def regexp_range(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#91 - def skip_expression?(expr); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#95 - def skip_range?(range_start, range_end); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#85 - def unsafe_range?(range_start, range_end); end -end - -# source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#32 -RuboCop::Cop::Lint::MixedCaseRange::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#35 -RuboCop::Cop::Lint::MixedCaseRange::RANGES = T.let(T.unsafe(nil), Array) - -# Do not mix named captures and numbered captures in a `Regexp` literal -# because numbered capture is ignored if they're mixed. -# Replace numbered captures with non-capturing groupings or -# named captures. -# -# @example -# # bad -# /(?FOO)(BAR)/ -# -# # good -# /(?FOO)(?BAR)/ -# -# # good -# /(?FOO)(?:BAR)/ -# -# # good -# /(FOO)(BAR)/ -# -# source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#24 -class RuboCop::Cop::Lint::MixedRegexpCaptureTypes < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#27 - def on_regexp(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#25 -RuboCop::Cop::Lint::MixedRegexpCaptureTypes::MSG = T.let(T.unsafe(nil), String) - -# In math and Python, we can use `x < y < z` style comparison to compare -# multiple value. However, we can't use the comparison in Ruby. However, -# the comparison is not syntax error. This cop checks the bad usage of -# comparison operators. -# -# @example -# -# # bad -# x < y < z -# 10 <= x <= 20 -# -# # good -# x < y && y < z -# 10 <= x && x <= 20 -# -# source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#20 -class RuboCop::Cop::Lint::MultipleComparison < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#29 - def multiple_compare?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#33 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#24 -RuboCop::Cop::Lint::MultipleComparison::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#23 -RuboCop::Cop::Lint::MultipleComparison::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#26 -RuboCop::Cop::Lint::MultipleComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#25 -RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe(nil), Array) - -# Checks for nested method definitions. -# -# @example -# -# # bad -# -# # `bar` definition actually produces methods in the same scope -# # as the outer `foo` method. Furthermore, the `bar` method -# # will be redefined every time `foo` is invoked. -# def foo -# def bar -# end -# end -# -# # good -# -# def foo -# bar = -> { puts 'hello' } -# bar.call -# end -# -# # good -# -# # `class_eval`, `instance_eval`, `module_eval`, `class_exec`, `instance_exec`, and -# # `module_exec` blocks are allowed by default. -# -# def foo -# self.class.class_eval do -# def bar -# end -# end -# end -# -# def foo -# self.class.module_exec do -# def bar -# end -# end -# end -# -# # good -# -# def foo -# class << self -# def bar -# end -# end -# end -# @example AllowedMethods: [] (default) -# # bad -# def do_something -# has_many :articles do -# def find_or_create_by_name(name) -# end -# end -# end -# @example AllowedMethods: ['has_many'] -# # bad -# def do_something -# has_many :articles do -# def find_or_create_by_name(name) -# end -# end -# end -# @example AllowedPatterns: [] (default) -# # bad -# def foo(obj) -# obj.do_baz do -# def bar -# end -# end -# end -# @example AllowedPatterns: ['baz'] -# # good -# def foo(obj) -# obj.do_baz do -# def bar -# end -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#91 -class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#131 - def eval_call?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#136 - def exec_call?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#124 - def allowed_method_name?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#120 - def allowed_subject_type?(subject); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#115 - def scoping_method_call?(child); end -end - -# source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#95 -RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Checks for nested percent literals. -# -# @example -# -# # bad -# -# # The percent literal for nested_attributes is parsed as four tokens, -# # yielding the array [:name, :content, :"%i[incorrectly", :"nested]"]. -# attributes = { -# valid_attributes: %i[name content], -# nested_attributes: %i[name content %i[incorrectly nested]] -# } -# -# # good -# -# # Neither is incompatible with the bad case, but probably the intended code. -# attributes = { -# valid_attributes: %i[name content], -# nested_attributes: [:name, :content, %i[incorrectly nested]] -# } -# -# attributes = { -# valid_attributes: %i[name content], -# nested_attributes: [:name, :content, [:incorrectly, :nested]] -# } -# -# source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#32 -class RuboCop::Cop::Lint::NestedPercentLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - - # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#44 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#48 - def on_percent_literal(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#54 - def contains_percent_literals?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#35 -RuboCop::Cop::Lint::NestedPercentLiteral::MSG = T.let(T.unsafe(nil), String) - -# The array of regular expressions representing percent literals that, -# if found within a percent literal expression, will cause a -# NestedPercentLiteral violation to be emitted. -# -# source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#41 -RuboCop::Cop::Lint::NestedPercentLiteral::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#42 -RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array) - -# Don't omit the accumulator when calling `next` in a `reduce` block. -# -# @example -# -# # bad -# result = (1..4).reduce(0) do |acc, i| -# next if i.odd? -# acc + i -# end -# -# # good -# result = (1..4).reduce(0) do |acc, i| -# next acc if i.odd? -# acc + i -# end -# -# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#21 -class RuboCop::Cop::Lint::NextWithoutAccumulator < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#24 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#38 - def on_block_body_of_reduce(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#24 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#45 - def parent_block_node(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#22 -RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of a `return` inside a `begin..end` block -# in assignment contexts. -# In this situation, the `return` will result in an exit from the current -# method, possibly leading to unexpected behavior. -# -# @example -# -# # bad -# @some_variable ||= begin -# return some_value if some_condition_is_met -# -# do_something -# end -# -# # good -# @some_variable ||= begin -# if some_condition_is_met -# some_value -# else -# do_something -# end -# end -# -# # good -# some_variable = if some_condition_is_met -# return if another_condition_is_met -# -# some_value -# else -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#38 -class RuboCop::Cop::Lint::NoReturnInBeginEndBlocks < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 - def on_or_asgn(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#39 -RuboCop::Cop::Lint::NoReturnInBeginEndBlocks::MSG = T.let(T.unsafe(nil), String) - -# Checks for non-atomic file operation. -# And then replace it with a nearly equivalent and atomic method. -# -# These can cause problems that are difficult to reproduce, -# especially in cases of frequent file operations in parallel, -# such as test runs with parallel_rspec. -# -# For examples: creating a directory if there is none, has the following problems -# -# An exception occurs when the directory didn't exist at the time of `exist?`, -# but someone else created it before `mkdir` was executed. -# -# Subsequent processes are executed without the directory that should be there -# when the directory existed at the time of `exist?`, -# but someone else deleted it shortly afterwards. -# -# @example -# # bad - race condition with another process may result in an error in `mkdir` -# unless Dir.exist?(path) -# FileUtils.mkdir(path) -# end -# -# # good - atomic and idempotent creation -# FileUtils.mkdir_p(path) -# -# # bad - race condition with another process may result in an error in `remove` -# if File.exist?(path) -# FileUtils.remove(path) -# end -# -# # good - atomic and idempotent removal -# FileUtils.rm_f(path) -# -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#44 -class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#76 - def explicit_not_force?(param0); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#71 - def force?(param0); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#80 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#66 - def receiver_and_method_name(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#61 - def send_exist_node(param0); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#98 - def allowable_use_with_if?(if_node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#123 - def autocorrect(corrector, node, range); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#134 - def autocorrect_replace_method(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#154 - def force_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#168 - def force_method_name?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#164 - def force_option?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#92 - def if_node_child?(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#113 - def message_change_force_method(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#117 - def message_remove_file_exist_check(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#102 - def register_offense(node, exist_node); end - - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#142 - def replacement_method(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#158 - def require_mode_keyword?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#50 -RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_FORCE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#51 -RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#49 -RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_CHANGE_FORCE_METHOD = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#47 -RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_REMOVE_FILE_EXIST_CHECK = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#54 -RuboCop::Cop::Lint::NonAtomicFileOperation::RECURSIVE_REMOVE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#52 -RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_FORCE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#53 -RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#55 -RuboCop::Cop::Lint::NonAtomicFileOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# `Dir[...]` and `Dir.glob(...)` do not make any guarantees about -# the order in which files are returned. The final order is -# determined by the operating system and file system. -# This means that using them in cases where the order matters, -# such as requiring files, can lead to intermittent failures -# that are hard to debug. To ensure this doesn't happen, -# always sort the list. -# -# `Dir.glob` and `Dir[]` sort globbed results by default in Ruby 3.0. -# So all bad cases are acceptable when Ruby 3.0 or higher are used. -# -# NOTE: This cop will be deprecated and removed when supporting only Ruby 3.0 and higher. -# -# @example -# -# # bad -# Dir["./lib/**/*.rb"].each do |file| -# require file -# end -# -# # good -# Dir["./lib/**/*.rb"].sort.each do |file| -# require file -# end -# -# # bad -# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')) do |file| -# require file -# end -# -# # good -# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')).sort.each do |file| -# require file -# end -# -# # bad -# Dir['./lib/**/*.rb'].each(&method(:require)) -# -# # good -# Dir['./lib/**/*.rb'].sort.each(&method(:require)) -# -# # bad -# Dir.glob(Rails.root.join('test', '*.rb'), &method(:require)) -# -# # good -# Dir.glob(Rails.root.join('test', '*.rb')).sort.each(&method(:require)) -# -# # good - Respect intent if `sort` keyword option is specified in Ruby 3.0 or higher. -# Dir.glob(Rails.root.join(__dir__, 'test', '*.rb'), sort: false).each(&method(:require)) -# -# source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#60 -class RuboCop::Cop::Lint::NonDeterministicRequireOrder < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#172 - def loop_variable(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#155 - def method_require?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#68 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#90 - def on_block_pass(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#79 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#145 - def unsorted_dir_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#150 - def unsorted_dir_each?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#166 - def unsorted_dir_each_pass?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#160 - def unsorted_dir_glob_pass?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#177 - def var_is_required?(param0, param1); end - - private - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#107 - def correct_block(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#117 - def correct_block_pass(corrector, node); end - - # Returns range of last argument including comma and whitespace. - # - # @return [Parser::Source::Range] - # - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#132 - def last_arg_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#136 - def unsorted_dir_loop?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#140 - def unsorted_dir_pass?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#64 -RuboCop::Cop::Lint::NonDeterministicRequireOrder::MSG = T.let(T.unsafe(nil), String) - -# Checks for non-local exits from iterators without a return -# value. It registers an offense under these conditions: -# -# * No value is returned, -# * the block is preceded by a method chain, -# * the block has arguments, -# * the method which receives the block is not `define_method` -# or `define_singleton_method`, -# * the return is not contained in an inner scope, e.g. a lambda or a -# method definition. -# -# @example -# -# class ItemApi -# rescue_from ValidationError do |e| # non-iteration block with arg -# return { message: 'validation error' } unless e.errors # allowed -# error_array = e.errors.map do |error| # block with method chain -# return if error.suppress? # warned -# return "#{error.param}: invalid" unless error.message # allowed -# "#{error.param}: #{error.message}" -# end -# { message: 'validation error', errors: error_array } -# end -# -# def update_items -# transaction do # block without arguments -# return unless update_necessary? # allowed -# find_each do |item| # block without method chain -# return if item.stock == 0 # false-negative... -# item.update!(foobar: true) -# end -# end -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#41 -class RuboCop::Cop::Lint::NonLocalExitFromIterator < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#77 - def chained_send?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#80 - def define_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#46 - def on_return(return_node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#72 - def return_value?(return_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#68 - def scoped_node?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#42 -RuboCop::Cop::Lint::NonLocalExitFromIterator::MSG = T.let(T.unsafe(nil), String) - -# Warns the usage of unsafe number conversions. Unsafe -# number conversion can cause unexpected error if auto type conversion -# fails. Cop prefer parsing with number class instead. -# -# Conversion with `Integer`, `Float`, etc. will raise an `ArgumentError` -# if given input that is not numeric (eg. an empty string), whereas -# `to_i`, etc. will try to convert regardless of input (``''.to_i => 0``). -# As such, this cop is disabled by default because it's not necessarily -# always correct to raise if a value is not numeric. -# -# NOTE: Some values cannot be converted properly using one of the `Kernel` -# method (for instance, `Time` and `DateTime` values are allowed by this -# cop by default). Similarly, Rails' duration methods do not work well -# with `Integer()` and can be allowed with `AllowedMethods`. By default, -# there are no methods to allowed. -# -# @example -# -# # bad -# -# '10'.to_i -# '10.2'.to_f -# '10'.to_c -# '1/3'.to_r -# ['1', '2', '3'].map(&:to_i) -# foo.try(:to_f) -# bar.send(:to_c) -# -# # good -# -# Integer('10', 10) -# Float('10.2') -# Complex('10') -# Rational('1/3') -# ['1', '2', '3'].map { |i| Integer(i, 10) } -# foo.try { |i| Float(i) } -# bar.send { |i| Complex(i) } -# @example AllowedMethods: [] (default) -# -# # bad -# 10.minutes.to_i -# @example AllowedMethods: [minutes] -# -# # good -# 10.minutes.to_i -# @example AllowedPatterns: [] (default) -# -# # bad -# 10.minutes.to_i -# @example AllowedPatterns: ['min*'] -# -# # good -# 10.minutes.to_i -# @example IgnoredClasses: [Time, DateTime] (default) -# -# # good -# Time.now.to_datetime.to_i -# -# source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#73 -class RuboCop::Cop::Lint::NumberConversion < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#106 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#106 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#92 - def to_method(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#97 - def to_method_symbol(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#164 - def allow_receiver?(receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#176 - def allowed_method_name?(name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#186 - def conversion_method?(method_name); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#150 - def correct_method(node, receiver); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#154 - def correct_sym_method(to_method); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#133 - def handle_as_symbol(node); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#114 - def handle_conversion_method(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#194 - def ignored_class?(name); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#190 - def ignored_classes; end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#159 - def remove_parentheses(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#180 - def top_receiver(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#88 -RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#78 -RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHOD_CLASS_MAPPING = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#89 -RuboCop::Cop::Lint::NumberConversion::METHODS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#84 -RuboCop::Cop::Lint::NumberConversion::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of numbered parameter assignment. -# It emulates the following warning in Ruby 2.7: -# -# $ ruby -ve '_1 = :value' -# ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] -# -e:1: warning: `_1' is reserved for numbered parameter; consider another name -# -# Assigning to a numbered parameter (from `_1` to `_9`) causes an error in Ruby 3.0. -# -# $ ruby -ve '_1 = :value' -# ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] -# -e:1: _1 is reserved for numbered parameter -# -# NOTE: The parametered parameters are from `_1` to `_9`. This cop checks `_0`, and over `_10` -# as well to prevent confusion. -# -# @example -# -# # bad -# _1 = :value -# -# # good -# non_numbered_parameter_name = :value -# -# source://rubocop//lib/rubocop/cop/lint/numbered_parameter_assignment.rb#30 -class RuboCop::Cop::Lint::NumberedParameterAssignment < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/numbered_parameter_assignment.rb#35 - def on_lvasgn(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/numbered_parameter_assignment.rb#32 -RuboCop::Cop::Lint::NumberedParameterAssignment::LVAR_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/numbered_parameter_assignment.rb#33 -RuboCop::Cop::Lint::NumberedParameterAssignment::NUMBERED_PARAMETER_RANGE = T.let(T.unsafe(nil), Range) - -# source://rubocop//lib/rubocop/cop/lint/numbered_parameter_assignment.rb#31 -RuboCop::Cop::Lint::NumberedParameterAssignment::NUM_PARAM_MSG = T.let(T.unsafe(nil), String) - -# Certain numeric operations have a constant result, usually 0 or 1. -# Multiplying a number by 0 will always return 0. -# Dividing a number by itself or raising it to the power of 0 will always return 1. -# As such, they can be replaced with that result. -# These are probably leftover from debugging, or are mistakes. -# Other numeric operations that are similarly leftover from debugging or mistakes -# are handled by `Lint/UselessNumericOperation`. -# -# NOTE: This cop doesn't detect offenses for the `-` and `%` operator because it -# can't determine the type of `x`. If `x` is an `Array` or `String`, it doesn't perform -# a numeric operation. -# -# @example -# -# # bad -# x * 0 -# -# # good -# 0 -# -# # bad -# x *= 0 -# -# # good -# x = 0 -# -# # bad -# x / x -# x ** 0 -# -# # good -# 1 -# -# # bad -# x /= x -# x **= 0 -# -# # good -# x = 1 -# -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#46 -class RuboCop::Cop::Lint::NumericOperationWithConstantResult < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#56 - def abbreviated_assignment_with_constant_result?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#59 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#69 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#59 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#52 - def operation_with_constant_result?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#80 - def constant_result?(lhs, operation, rhs); end -end - -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#48 -RuboCop::Cop::Lint::NumericOperationWithConstantResult::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#49 -RuboCop::Cop::Lint::NumericOperationWithConstantResult::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for unintended or-assignment to a constant. -# -# Constants should always be assigned in the same location. And its value -# should always be the same. If constants are assigned in multiple -# locations, the result may vary depending on the order of `require`. -# -# @example -# -# # bad -# CONST ||= 1 -# -# # good -# CONST = 1 -# -# source://rubocop//lib/rubocop/cop/lint/or_assignment_to_constant.rb#24 -class RuboCop::Cop::Lint::OrAssignmentToConstant < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/or_assignment_to_constant.rb#29 - def on_or_asgn(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/or_assignment_to_constant.rb#27 -RuboCop::Cop::Lint::OrAssignmentToConstant::MSG = T.let(T.unsafe(nil), String) - -# Checks the proper ordering of magic comments and whether -# a magic comment is not placed before a shebang. -# -# @example -# # bad -# -# # frozen_string_literal: true -# # encoding: ascii -# p [''.frozen?, ''.encoding] #=> [true, #] -# -# # good -# -# # encoding: ascii -# # frozen_string_literal: true -# p [''.frozen?, ''.encoding] #=> [true, #] -# -# # good -# -# #!/usr/bin/env ruby -# # encoding: ascii -# # frozen_string_literal: true -# p [''.frozen?, ''.encoding] #=> [true, #] -# -# source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#32 -class RuboCop::Cop::Lint::OrderedMagicComments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#38 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#55 - def autocorrect(corrector, encoding_line, frozen_string_literal_line); end - - # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#63 - def magic_comment_lines; end -end - -# source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#36 -RuboCop::Cop::Lint::OrderedMagicComments::MSG = T.let(T.unsafe(nil), String) - -# Looks for references of `Regexp` captures that are out of range -# and thus always returns nil. -# -# @example -# -# /(foo)bar/ =~ 'foobar' -# -# # bad - always returns nil -# -# puts $2 # => nil -# -# # good -# -# puts $1 # => foo -# -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#38 -class RuboCop::Cop::Lint::OutOfRangeRegexpRef < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#55 - def after_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#55 - def after_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#72 - def on_in_pattern(node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#51 - def on_match_with_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#47 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#78 - def on_nth_ref(node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#66 - def on_when(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#103 - def check_regexp(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#123 - def nth_ref_receiver?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#114 - def regexp_first_argument?(send_node); end - - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#94 - def regexp_patterns(in_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#119 - def regexp_receiver?(send_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#39 -RuboCop::Cop::Lint::OutOfRangeRegexpRef::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#42 -RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_ARGUMENT_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#44 -RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_CAPTURE_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#41 -RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_RECEIVER_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#45 -RuboCop::Cop::Lint::OutOfRangeRegexpRef::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# Checks for space between the name of a called method and a left -# parenthesis. -# -# @example -# -# # bad -# do_something (foo) -# -# # good -# do_something(foo) -# do_something (2 + 3) * 4 -# do_something (foo * bar).baz -# -# source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#18 -class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#24 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#24 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#56 - def chained_calls?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#52 - def compound_range?(first_arg); end - - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#81 - def space_range(expr, space_length); end - - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#65 - def spaces_before_left_parenthesis(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#61 - def ternary_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#39 - def valid_context?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#47 - def valid_first_argument?(first_arg); end -end - -# source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#22 -RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), String) - -# Checks for quotes and commas in %w, e.g. `%w('foo', "bar")` -# -# It is more likely that the additional characters are unintended (for -# example, mistranslating an array of literals to percent string notation) -# rather than meant to be part of the resulting strings. -# -# @example -# -# # bad -# %w('foo', "bar") -# -# # good -# %w(foo bar) -# -# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#29 -class RuboCop::Cop::Lint::PercentStringArray < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#40 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#44 - def on_percent_literal(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#61 - def contains_quotes_or_commas?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#34 -RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#37 -RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#33 -RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#35 -RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp) - -# Checks for colons and commas in %i, e.g. `%i(:foo, :bar)` -# -# It is more likely that the additional characters are unintended (for -# example, mistranslating an array of literals to percent string notation) -# rather than meant to be part of the resulting symbols. -# -# @example -# -# # bad -# %i(:foo, :bar) -# -# # good -# %i(foo bar) -# -# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#19 -class RuboCop::Cop::Lint::PercentSymbolArray < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#26 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#30 - def on_percent_literal(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#38 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#48 - def contains_colons_or_commas?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#58 - def non_alphanumeric_literal?(literal); end -end - -# source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#23 -RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String) - -# Checks for `raise` or `fail` statements which raise `Exception` or -# `Exception.new`. Use `StandardError` or a specific exception class instead. -# -# If you have defined your own namespaced `Exception` class, it is possible -# to configure the cop to allow it by setting `AllowedImplicitNamespaces` to -# an array with the names of the namespaces to allow. By default, this is set to -# `['Gem']`, which allows `Gem::Exception` to be raised without an explicit namespace. -# If not allowed, a false positive may be registered if `raise Exception` is called -# within the namespace. -# -# Alternatively, use a fully qualified name with `raise`/`fail` -# (eg. `raise Namespace::Exception`). -# -# @example -# # bad -# raise Exception, 'Error message here' -# raise Exception.new('Error message here') -# -# # good -# raise StandardError, 'Error message here' -# raise MyError.new, 'Error message here' -# @example AllowedImplicitNamespaces: ['Gem'] (default) -# # bad - `Foo` is not an allowed implicit namespace -# module Foo -# def self.foo -# raise Exception # This is qualified to `Foo::Exception`. -# end -# end -# -# # good -# module Gem -# def self.foo -# raise Exception # This is qualified to `Gem::Exception`. -# end -# end -# -# # good -# module Foo -# def self.foo -# raise Foo::Exception -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#53 -class RuboCop::Cop::Lint::RaiseException < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#60 - def exception?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#65 - def exception_new_with_message?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#70 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#104 - def allow_implicit_namespaces; end - - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#76 - def check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#92 - def implicit_namespace?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#56 -RuboCop::Cop::Lint::RaiseException::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#57 -RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `rand(1)` calls. -# Such calls always return `0`. -# -# @example -# -# # bad -# rand 1 -# Kernel.rand(-1) -# rand 1.0 -# rand(-1.0) -# -# # good -# 0 # just use 0 instead -# -# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#19 -class RuboCop::Cop::Lint::RandOne < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#28 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#24 - def rand_one?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#36 - def message(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#20 -RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/rand_one.rb#21 -RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# removed without causing any offenses to be reported. It's implemented -# as a cop in that it inherits from the Cop base class and calls -# add_offense. The unusual part of its implementation is that it doesn't -# have any on_* methods or an investigate method. This means that it -# doesn't take part in the investigation phase when the other cops do -# their work. Instead, it waits until it's called in a later stage of the -# execution. The reason it can't be implemented as a normal cop is that -# it depends on the results of all other cops to do its work. -# -# @example -# # bad -# # rubocop:disable Layout/LineLength -# x += 1 -# # rubocop:enable Layout/LineLength -# -# # good -# x += 1 -# -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#28 -class RuboCop::Cop::Lint::RedundantCopDisableDirective < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # @return [RedundantCopDisableDirective] a new instance of RedundantCopDisableDirective - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#37 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil), offenses = T.unsafe(nil)); end - - # Returns the value of attribute offenses_to_check. - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#35 - def offenses_to_check; end - - # Sets the attribute offenses_to_check - # - # @param value the value to set the attribute offenses_to_check to. - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#35 - def offenses_to_check=(_arg0); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#42 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#323 - def add_department_marker(department); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#229 - def add_offense_for_entire_comment(comment, cops); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#244 - def add_offense_for_some_cops(comment, cops); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#219 - def add_offenses(redundant_cops); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#306 - def all_cop_names; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#190 - def all_disabled?(comment); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#69 - def comment_range_with_surrounding_space(directive_comment_range, line_comment_range); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#57 - def cop_disabled_line_ranges; end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#264 - def cop_range(comment, cop); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#210 - def department_disabled?(cop, comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#315 - def department_marker?(department); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#293 - def describe(cop); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#215 - def directive_count(comment); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#92 - def directive_range_in_list(range, ranges); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#61 - def disabled_ranges; end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#132 - def each_already_disabled(cop, line_ranges); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#113 - def each_line_range(cop, line_ranges); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#106 - def each_redundant_disable(&block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#310 - def ends_its_line?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#202 - def expected_final_disable?(cop, line_range); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#166 - def find_redundant_all(range, next_range); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#161 - def find_redundant_cop(cop, range); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#176 - def find_redundant_department(cop, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#182 - def followed_ranges?(range, next_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#194 - def ignore_offense?(line_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#258 - def leave_free_comment?(comment, range); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#271 - def matching_range(haystack, needle); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#302 - def message(cop_names); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#65 - def previous_line_blank?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#186 - def range_with_offense?(range, offenses = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#319 - def remove_department_marker(department); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#279 - def trailing_range?(ranges, range); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#32 -RuboCop::Cop::Lint::RedundantCopDisableDirective::COP_NAME = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#33 -RuboCop::Cop::Lint::RedundantCopDisableDirective::DEPARTMENT_MARKER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#287 -RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.let(T.unsafe(nil), Hash) - -# removed. -# -# that cop checks whether any cop was actually enabled. -# -# @example -# -# # bad -# foo = 1 -# # rubocop:enable Layout/LineLength -# -# # good -# foo = 1 -# -# # bad -# # rubocop:disable Style/StringLiterals -# foo = "1" -# # rubocop:enable Style/StringLiterals -# baz -# # rubocop:enable all -# -# # good -# # rubocop:disable Style/StringLiterals -# foo = "1" -# # rubocop:enable all -# baz -# -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#39 -class RuboCop::Cop::Lint::RedundantCopEnableDirective < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#46 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#122 - def all_or_name(name); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#78 - def comment_start(comment); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#82 - def cop_name_indention(comment, name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#126 - def department?(directive, name); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#73 - def range_of_offense(comment, name); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#97 - def range_to_remove(begin_pos, end_pos, comment); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#86 - def range_with_comma(comment, name); end - - # If the list of cops is comma-separated, but without an empty space after the comma, - # we should **not** remove the prepending empty space, thus begin_pos += 1 - # - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#116 - def range_with_comma_after(comment, start, begin_pos, end_pos); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#110 - def range_with_comma_before(start, begin_pos, end_pos); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#55 - def register_offense(comment, cop_names); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44 -RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String) - -# Sort globbed results by default in Ruby 3.0. -# This cop checks for redundant `sort` method to `Dir.glob` and `Dir[]`. -# -# @example -# -# # bad -# Dir.glob('./lib/**/*.rb').sort.each do |file| -# end -# -# Dir['./lib/**/*.rb'].sort.each do |file| -# end -# -# # good -# Dir.glob('./lib/**/*.rb').each do |file| -# end -# -# Dir['./lib/**/*.rb'].each do |file| -# end -# -# source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#30 -class RuboCop::Cop::Lint::RedundantDirGlobSort < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#40 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#56 - def multiple_argument?(glob_method); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#38 -RuboCop::Cop::Lint::RedundantDirGlobSort::GLOB_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#36 -RuboCop::Cop::Lint::RedundantDirGlobSort::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_dir_glob_sort.rb#37 -RuboCop::Cop::Lint::RedundantDirGlobSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant quantifiers inside `Regexp` literals. -# -# It is always allowed when interpolation is used in a regexp literal, -# because it's unknown what kind of string will be expanded as a result: -# -# [source,ruby] -# ---- -# /(?:a*#{interpolation})?/x -# ---- -# -# @example -# # bad -# /(?:x+)+/ -# -# # good -# /(?:x)+/ -# -# # good -# /(?:x+)/ -# -# # bad -# /(?:x+)?/ -# -# # good -# /(?:x)*/ -# -# # good -# /(?:x*)/ -# -# source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#34 -class RuboCop::Cop::Lint::RedundantRegexpQuantifiers < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#42 - def on_regexp(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#83 - def character_set?(expr); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#61 - def each_redundantly_quantified_pair(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#87 - def mergeable_quantifier(expr); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#103 - def merged_quantifier(exp1, exp2); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#119 - def message(group, child, replacement); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#115 - def quantifier_range(group, child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#75 - def redundant_group?(expr); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#79 - def redundantly_quantifiable?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb#38 -RuboCop::Cop::Lint::RedundantRegexpQuantifiers::MSG_REDUNDANT_QUANTIFIER = T.let(T.unsafe(nil), String) - -# Checks for unnecessary `require` statement. -# -# The following features are unnecessary `require` statement because -# they are already loaded. e.g. Ruby 2.2: -# -# ruby -ve 'p $LOADED_FEATURES.reject { |feature| %r|/| =~ feature }' -# ruby 2.2.8p477 (2017-09-14 revision 59906) [x86_64-darwin13] -# ["enumerator.so", "rational.so", "complex.so", "thread.rb"] -# -# Below are the features that each `TargetRubyVersion` targets. -# -# * 2.0+ ... `enumerator` -# * 2.1+ ... `thread` -# * 2.2+ ... Add `rational` and `complex` above -# * 2.7+ ... Add `ruby2_keywords` above -# * 3.1+ ... Add `fiber` above -# * 3.2+ ... `set` -# -# This cop target those features. -# -# @example -# # bad -# require 'unloaded_feature' -# require 'thread' -# -# # good -# require 'unloaded_feature' -# -# source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#33 -class RuboCop::Cop::Lint::RedundantRequireStatement < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#47 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#42 - def redundant_require_statement?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#66 - def redundant_feature?(feature_name); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#37 -RuboCop::Cop::Lint::RedundantRequireStatement::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#38 -RuboCop::Cop::Lint::RedundantRequireStatement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#39 -RuboCop::Cop::Lint::RedundantRequireStatement::RUBY_22_LOADED_FEATURES = T.let(T.unsafe(nil), Array) - -# Checks for redundant safe navigation calls. -# Use cases where a constant, named in camel case for classes and modules is `nil` are rare, -# and an offense is not detected when the receiver is a constant. The detection also applies -# to `self`, and to literal receivers, except for `nil`. -# -# For all receivers, the `instance_of?`, `kind_of?`, `is_a?`, `eql?`, `respond_to?`, -# and `equal?` methods are checked by default. -# These are customizable with `AllowedMethods` option. -# -# The `AllowedMethods` option specifies nil-safe methods, -# in other words, it is a method that is allowed to skip safe navigation. -# Note that the `AllowedMethod` option is not an option that specifies methods -# for which to suppress (allow) this cop's check. -# -# In the example below, the safe navigation operator (`&.`) is unnecessary -# because `NilClass` has methods like `respond_to?` and `is_a?`. -# -# @example -# # bad -# CamelCaseConst&.do_something -# -# # good -# CamelCaseConst.do_something -# -# # bad -# do_something if attrs&.respond_to?(:[]) -# -# # good -# do_something if attrs.respond_to?(:[]) -# -# # bad -# while node&.is_a?(BeginNode) -# node = node.parent -# end -# -# # good -# while node.is_a?(BeginNode) -# node = node.parent -# end -# -# # good - without `&.` this will always return `true` -# foo&.respond_to?(:to_a) -# -# # bad - for `nil`s conversion methods return default values for the type -# foo&.to_h || {} -# foo&.to_h { |k, v| [k, v] } || {} -# foo&.to_a || [] -# foo&.to_i || 0 -# foo&.to_f || 0.0 -# foo&.to_s || '' -# -# # good -# foo.to_h -# foo.to_h { |k, v| [k, v] } -# foo.to_a -# foo.to_i -# foo.to_f -# foo.to_s -# -# # bad -# self&.foo -# -# # good -# self.foo -# @example AllowedMethods: [nil_safe_method] -# # bad -# do_something if attrs&.nil_safe_method(:[]) -# -# # good -# do_something if attrs.nil_safe_method(:[]) -# do_something if attrs&.not_nil_safe_method(:[]) -# -# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#84 -class RuboCop::Cop::Lint::RedundantSafeNavigation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#101 - def conversion_with_default?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#113 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#123 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#96 - def respond_to_nil_specific_method?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#139 - def assume_receiver_instance_exists?(receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#145 - def check?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#154 - def condition?(parent, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#88 -RuboCop::Cop::Lint::RedundantSafeNavigation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#89 -RuboCop::Cop::Lint::RedundantSafeNavigation::MSG_LITERAL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#91 -RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_SPECIFIC_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#93 -RuboCop::Cop::Lint::RedundantSafeNavigation::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) - -# Checks for unneeded usages of splat expansion. -# -# @example -# -# # bad -# a = *[1, 2, 3] -# a = *'a' -# a = *1 -# ['a', 'b', *%w(c d e), 'f', 'g'] -# -# # good -# c = [1, 2, 3] -# a = *c -# a, b = *c -# a, *b = *c -# a = *1..10 -# a = ['a'] -# ['a', 'b', 'c', 'd', 'e', 'f', 'g'] -# -# # bad -# do_something(*['foo', 'bar', 'baz']) -# -# # good -# do_something('foo', 'bar', 'baz') -# -# # bad -# begin -# foo -# rescue *[StandardError, ApplicationError] -# bar -# end -# -# # good -# begin -# foo -# rescue StandardError, ApplicationError -# bar -# end -# -# # bad -# case foo -# when *[1, 2, 3] -# bar -# else -# baz -# end -# -# # good -# case foo -# when 1, 2, 3 -# bar -# else -# baz -# end -# @example AllowPercentLiteralArrayArgument: true (default) -# -# # good -# do_something(*%w[foo bar baz]) -# @example AllowPercentLiteralArrayArgument: false -# -# # bad -# do_something(*%w[foo bar baz]) -# -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#71 -class RuboCop::Cop::Lint::RedundantSplatExpansion < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#83 - def array_new?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#91 - def literal_expansion(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#95 - def on_splat(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#204 - def allow_percent_literal_array_argument?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#131 - def array_new_inside_array_literal?(array_new_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#156 - def array_splat?(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#112 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#160 - def method_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#164 - def part_of_an_array?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#171 - def redundant_brackets?(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#118 - def redundant_splat_expansion(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#179 - def remove_brackets(array); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#139 - def replacement_range_and_content(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#197 - def use_percent_literal_array_argument?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#75 -RuboCop::Cop::Lint::RedundantSplatExpansion::ARRAY_PARAM_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#80 -RuboCop::Cop::Lint::RedundantSplatExpansion::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#74 -RuboCop::Cop::Lint::RedundantSplatExpansion::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#79 -RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_I = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#77 -RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_W = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#78 -RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_I = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#76 -RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), String) - -# Checks for string conversion in string interpolation, `print`, `puts`, and `warn` arguments, -# which is redundant. -# -# @example -# -# # bad -# "result is #{something.to_s}" -# print something.to_s -# puts something.to_s -# warn something.to_s -# -# # good -# "result is #{something}" -# print something -# puts something -# warn something -# -# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#23 -class RuboCop::Cop::Lint::RedundantStringCoercion < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#34 - def on_interpolation(begin_node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#42 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#32 - def to_s_without_args?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#54 - def register_offense(node, context); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#27 -RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#28 -RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#29 -RuboCop::Cop::Lint::RedundantStringCoercion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant uses of `to_s`, `to_sym`, `to_i`, `to_f`, `to_d`, `to_r`, `to_c`, -# `to_a`, `to_h`, and `to_set`. -# -# When one of these methods is called on an object of the same type, that object -# is returned, making the call unnecessary. The cop detects conversion methods called -# on object literals, class constructors, class `[]` methods, and the `Kernel` methods -# `String()`, `Integer()`, `Float()`, BigDecimal(), `Rational()`, `Complex()`, and `Array()`. -# -# Specifically, these cases are detected for each conversion method: -# -# * `to_s` when called on a string literal, interpolated string, heredoc, -# or with `String.new` or `String()`. -# * `to_sym` when called on a symbol literal or interpolated symbol. -# * `to_i` when called on an integer literal or with `Integer()`. -# * `to_f` when called on a float literal of with `Float()`. -# * `to_r` when called on a rational literal or with `Rational()`. -# * `to_c` when called on a complex literal of with `Complex()`. -# * `to_a` when called on an array literal, or with `Array.new`, `Array()` or `Array[]`. -# * `to_h` when called on a hash literal, or with `Hash.new`, `Hash()` or `Hash[]`. -# * `to_set` when called on `Set.new` or `Set[]`. -# -# In all cases, chaining one same `to_*` conversion methods listed above is redundant. -# -# The cop can also register an offense for chaining conversion methods on methods that are -# expected to return a specific type regardless of receiver (eg. `foo.inspect.to_s` and -# `foo.to_json.to_s`). -# -# @example -# # bad -# "text".to_s -# :sym.to_sym -# 42.to_i -# 8.5.to_f -# 12r.to_r -# 1i.to_c -# [].to_a -# {}.to_h -# Set.new.to_set -# -# # good -# "text" -# :sym -# 42 -# 8.5 -# 12r -# 1i -# [] -# {} -# Set.new -# -# # bad -# Integer(var).to_i -# -# # good -# Integer(var) -# -# # good - chaining to a type constructor with exceptions suppressed -# # in this case, `Integer()` could return `nil` -# Integer(var, exception: false).to_i -# -# # bad - chaining the same conversion -# foo.to_s.to_s -# -# # good -# foo.to_s -# -# # bad - chaining a conversion to a method that is expected to return the same type -# foo.inspect.to_s -# foo.to_json.to_s -# -# # good -# foo.inspect -# foo.to_json -# -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#80 -class RuboCop::Cop::Lint::RedundantTypeConversion < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#160 - def array_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#145 - def bigdecimal_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#155 - def complex_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#184 - def exception_false_keyword_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#140 - def float_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#168 - def hash_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#135 - def integer_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#189 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#189 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#150 - def rational_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#177 - def set_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#127 - def string_constructor?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#122 - def type_constructor?(param0 = T.unsafe(nil), param1); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#247 - def chained_conversion?(node, receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#253 - def chained_to_typed_method?(node, receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#234 - def constructor?(node, receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#241 - def constructor_suppresses_exceptions?(receiver); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#215 - def find_receiver(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#209 - def hash_or_set_with_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#228 - def literal_receiver?(node, receiver); end -end - -# Maps each conversion method to the pattern matcher for that type's constructors -# Not every type has a constructor, for instance Symbol. -# -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#100 -RuboCop::Cop::Lint::RedundantTypeConversion::CONSTRUCTOR_MAPPING = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#116 -RuboCop::Cop::Lint::RedundantTypeConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Set) - -# Maps conversion methods to the node types for the literals of that type -# -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#86 -RuboCop::Cop::Lint::RedundantTypeConversion::LITERAL_NODE_TYPES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#83 -RuboCop::Cop::Lint::RedundantTypeConversion::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#117 -RuboCop::Cop::Lint::RedundantTypeConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# Methods that already are expected to return a given type, which makes a further -# conversion redundant. -# -# source://rubocop//lib/rubocop/cop/lint/redundant_type_conversion.rb#114 -RuboCop::Cop::Lint::RedundantTypeConversion::TYPED_METHODS = T.let(T.unsafe(nil), Hash) - -# Checks for redundant `with_index`. -# -# @example -# # bad -# ary.each_with_index do |v| -# v -# end -# -# # good -# ary.each do |v| -# v -# end -# -# # bad -# ary.each.with_index do |v| -# v -# end -# -# # good -# ary.each do |v| -# v -# end -# -# source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#29 -class RuboCop::Cop::Lint::RedundantWithIndex < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#37 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#37 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#37 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#61 - def redundant_with_index?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#73 - def message(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#81 - def with_index_range(send); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#33 -RuboCop::Cop::Lint::RedundantWithIndex::MSG_EACH_WITH_INDEX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#34 -RuboCop::Cop::Lint::RedundantWithIndex::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) - -# Checks for redundant `with_object`. -# -# @example -# # bad -# ary.each_with_object([]) do |v| -# v -# end -# -# # good -# ary.each do |v| -# v -# end -# -# # bad -# ary.each.with_object([]) do |v| -# v -# end -# -# # good -# ary.each do |v| -# v -# end -# -# source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#29 -class RuboCop::Cop::Lint::RedundantWithObject < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#36 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#36 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#36 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#57 - def redundant_with_object?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#68 - def message(node); end - - # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#76 - def with_object_range(send); end -end - -# source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#33 -RuboCop::Cop::Lint::RedundantWithObject::MSG_EACH_WITH_OBJECT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#34 -RuboCop::Cop::Lint::RedundantWithObject::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) - -# Checks if `include` or `prepend` is called in `refine` block. -# These methods are deprecated and should be replaced with `Refinement#import_methods`. -# -# It emulates deprecation warnings in Ruby 3.1. Functionality has been removed in Ruby 3.2. -# -# @example -# -# # bad -# refine Foo do -# include Bar -# end -# -# # bad -# refine Foo do -# prepend Bar -# end -# -# # good -# refine Foo do -# import_methods Bar -# end -# -# source://rubocop//lib/rubocop/cop/lint/refinement_import_methods.rb#34 -class RuboCop::Cop::Lint::RefinementImportMethods < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/refinement_import_methods.rb#42 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/refinement_import_methods.rb#37 -RuboCop::Cop::Lint::RefinementImportMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/refinement_import_methods.rb#38 -RuboCop::Cop::Lint::RefinementImportMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for regexp literals used as `match-current-line`. -# If a regexp literal is in condition, the regexp matches `$_` implicitly. -# -# @example -# # bad -# if /foo/ -# do_something -# end -# -# # good -# if /foo/ =~ $_ -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#19 -class RuboCop::Cop::Lint::RegexpAsCondition < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#25 - def on_match_current_line(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#22 -RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks for expressions where there is a call to a predicate -# method with at least one argument, where no parentheses are used around -# the parameter list, and a boolean operator, && or ||, is used in the -# last argument. -# -# The idea behind warning for these constructs is that the user might -# be under the impression that the return value from the method call is -# an operand of &&/||. -# -# @example -# -# # bad -# if day.is? :tuesday && month == :jan -# # ... -# end -# -# # good -# if day.is?(:tuesday) && month == :jan -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#26 -class RuboCop::Cop::Lint::RequireParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#31 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#31 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#54 - def check_predicate(predicate, node); end - - # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#44 - def check_ternary(ternary, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#29 -RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String) - -# Checks that a range literal is enclosed in parentheses when the end of the range is -# at a line break. -# -# NOTE: The following is maybe intended for `(42..)`. But, compatible is `42..do_something`. -# So, this cop does not provide autocorrection because it is left to user. -# -# [source,ruby] -# ---- -# case condition -# when 42.. -# do_something -# end -# ---- -# -# @example -# -# # bad - Represents `(1..42)`, not endless range. -# 1.. -# 42 -# -# # good - It's incompatible, but your intentions when using endless range may be: -# (1..) -# 42 -# -# # good -# 1..42 -# -# # good -# (1..42) -# -# # good -# (1.. -# 42) -# -# source://rubocop//lib/rubocop/cop/lint/require_range_parentheses.rb#40 -class RuboCop::Cop::Lint::RequireRangeParentheses < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/require_range_parentheses.rb#43 - def on_erange(node); end - - # source://rubocop//lib/rubocop/cop/lint/require_range_parentheses.rb#43 - def on_irange(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/require_range_parentheses.rb#41 -RuboCop::Cop::Lint::RequireRangeParentheses::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses a file requiring itself with `require_relative`. -# -# @example -# -# # bad -# -# # foo.rb -# require_relative 'foo' -# require_relative 'bar' -# -# # good -# -# # foo.rb -# require_relative 'bar' -# -# source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#21 -class RuboCop::Cop::Lint::RequireRelativeSelfPath < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#28 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#44 - def remove_ext(file_path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#40 - def same_file?(file_path, required_feature); end -end - -# source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#25 -RuboCop::Cop::Lint::RequireRelativeSelfPath::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/require_relative_self_path.rb#26 -RuboCop::Cop::Lint::RequireRelativeSelfPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `rescue` blocks targeting the `Exception` class. -# -# @example -# -# # bad -# begin -# do_something -# rescue Exception -# handle_exception -# end -# -# # good -# begin -# do_something -# rescue ArgumentError -# handle_exception -# end -# -# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#23 -class RuboCop::Cop::Lint::RescueException < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#26 - def on_resbody(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#35 - def targets_exception?(rescue_arg_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#24 -RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String) - -# Check for arguments to `rescue` that will result in a `TypeError` -# if an exception is raised. -# -# @example -# # bad -# begin -# bar -# rescue nil -# baz -# end -# -# # bad -# def foo -# bar -# rescue 1, 'a', "#{b}", 0.0, [], {} -# baz -# end -# -# # good -# begin -# bar -# rescue -# baz -# end -# -# # good -# def foo -# bar -# rescue NameError -# baz -# end -# -# source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#37 -class RuboCop::Cop::Lint::RescueType < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#56 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#44 - def on_resbody(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#65 - def correction(*exceptions); end - - # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#76 - def invalid_exceptions(exceptions); end - - # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#72 - def valid_exceptions(exceptions); end -end - -# source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#42 -RuboCop::Cop::Lint::RescueType::INVALID_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#40 -RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of a return with a value in a context -# where the value will be ignored. (initialize and setter methods) -# -# @example -# -# # bad -# def initialize -# foo -# return :qux if bar? -# baz -# end -# -# def foo=(bar) -# return 42 -# end -# -# # good -# def initialize -# foo -# return if bar? -# baz -# end -# -# def foo=(bar) -# return -# end -# -# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#32 -class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#38 - def on_return(return_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#33 -RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) - -# Returning out of these methods only exits the block itself. -# -# source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#36 -RuboCop::Cop::Lint::ReturnInVoidContext::SCOPE_CHANGING_METHODS = T.let(T.unsafe(nil), Array) - -# The safe navigation operator returns nil if the receiver is -# nil. If you chain an ordinary method call after a safe -# navigation operator, it raises NoMethodError. We should use a -# safe navigation operator after a safe navigation operator. -# This cop checks for the problem outlined above. -# -# @example -# -# # bad -# x&.foo.bar -# x&.foo + bar -# x&.foo[bar] -# -# # good -# x&.foo&.bar -# x&.foo || bar -# -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#22 -class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::NilMethods - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#33 - def bad_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#40 - def on_send(node); end - - private - - # @param offense_range [Parser::Source::Range] - # @param send_node [RuboCop::AST::SendNode] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#67 - def add_safe_navigation_operator(offense_range:, send_node:); end - - # @param corrector [RuboCop::Cop::Corrector] - # @param offense_range [Parser::Source::Range] - # @param send_node [RuboCop::AST::SendNode] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#86 - def autocorrect(corrector, offense_range:, send_node:); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#95 - def brackets?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#108 - def operator_inside_hash?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#99 - def require_parentheses?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#57 - def require_safe_navigation?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#29 -RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#30 -RuboCop::Cop::Lint::SafeNavigationChain::PLUS_MINUS_METHODS = T.let(T.unsafe(nil), Array) - -# Check to make sure that if safe navigation is used in an `&&` or `||` condition, -# consistent and appropriate safe navigation, without excess or deficiency, -# is used for all method calls on the same object. -# -# @example -# # bad -# foo&.bar && foo&.baz -# -# # good -# foo&.bar && foo.baz -# -# # bad -# foo.bar && foo&.baz -# -# # good -# foo.bar && foo.baz -# -# # bad -# foo&.bar || foo.baz -# -# # good -# foo&.bar || foo&.baz -# -# # bad -# foo.bar || foo&.baz -# -# # good -# foo.bar || foo.baz -# -# # bad -# foo&.bar && (foobar.baz || foo&.baz) -# -# # good -# foo&.bar && (foobar.baz || foo.baz) -# -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#41 -class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::NilMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#48 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#48 - def on_or(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#98 - def already_appropriate_call?(operand, dot_op); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#67 - def collect_operands(node, operand_nodes); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#83 - def find_consistent_parts(grouped_operands); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#124 - def most_left_indices(grouped_operands); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#154 - def nilable?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#138 - def operand_in_and?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#146 - def operand_in_or?(node); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#115 - def operand_nodes(operand, operand_nodes); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#74 - def receiver_name_as_key(method, fully_receivers); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#104 - def register_offense(operand, dot_operator); end -end - -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#45 -RuboCop::Cop::Lint::SafeNavigationConsistency::USE_DOT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#46 -RuboCop::Cop::Lint::SafeNavigationConsistency::USE_SAFE_NAVIGATION_MSG = T.let(T.unsafe(nil), String) - -# Checks to make sure safe navigation isn't used with `empty?` in -# a conditional. -# -# While the safe navigation operator is generally a good idea, when -# checking `foo&.empty?` in a conditional, `foo` being `nil` will actually -# do the opposite of what the author intends. -# -# @example -# # bad -# return if foo&.empty? -# return unless foo&.empty? -# -# # good -# return if foo && foo.empty? -# return unless foo && foo.empty? -# -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#22 -class RuboCop::Cop::Lint::SafeNavigationWithEmpty < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#32 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#28 - def safe_navigation_empty_in_conditional?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#25 -RuboCop::Cop::Lint::SafeNavigationWithEmpty::MSG = T.let(T.unsafe(nil), String) - -# Checks if a file which has a shebang line as -# its first line is granted execute permission. -# -# @example -# # bad -# -# # A file which has a shebang line as its first line is not -# # granted execute permission. -# -# #!/usr/bin/env ruby -# puts 'hello, world' -# -# # good -# -# # A file which has a shebang line as its first line is -# # granted execute permission. -# -# #!/usr/bin/env ruby -# puts 'hello, world' -# -# # good -# -# # A file which has not a shebang line as its first line is not -# # granted execute permission. -# -# puts 'hello, world' -# -# source://rubocop//lib/rubocop/cop/lint/script_permission.rb#33 -class RuboCop::Cop::Lint::ScriptPermission < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#39 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#55 - def autocorrect; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#59 - def executable?(processed_source); end - - # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#66 - def format_message_from(processed_source); end -end - -# source://rubocop//lib/rubocop/cop/lint/script_permission.rb#36 -RuboCop::Cop::Lint::ScriptPermission::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/script_permission.rb#37 -RuboCop::Cop::Lint::ScriptPermission::SHEBANG = T.let(T.unsafe(nil), String) - -# Checks for self-assignments. -# -# @example -# # bad -# foo = foo -# foo, bar = foo, bar -# Foo = Foo -# hash['foo'] = hash['foo'] -# obj.attr = obj.attr -# -# # good -# foo = bar -# foo, bar = bar, foo -# Foo = Bar -# hash['foo'] = hash['bar'] -# obj.attr = obj.attr2 -# -# # good (method calls possibly can return different results) -# hash[foo] = hash[foo] -# -# source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#26 -class RuboCop::Cop::Lint::SelfAssignment < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#67 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#56 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#36 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#45 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#45 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#45 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#45 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#63 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#67 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#36 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#101 - def handle_attribute_assignment(node); end - - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#90 - def handle_key_assignment(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#74 - def multiple_self_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#85 - def rhs_matches_lhs?(rhs, lhs); end -end - -# source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#29 -RuboCop::Cop::Lint::SelfAssignment::ASSIGNMENT_TYPE_TO_RHS_TYPE = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#27 -RuboCop::Cop::Lint::SelfAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for `send`, `public_send`, and `__send__` methods -# when using mix-in. -# -# `include` and `prepend` methods were private methods until Ruby 2.0, -# they were mixed-in via `send` method. This cop uses Ruby 2.1 or -# higher style that can be called by public methods. -# And `extend` method that was originally a public method is also targeted -# for style unification. -# -# @example -# # bad -# Foo.send(:include, Bar) -# Foo.send(:prepend, Bar) -# Foo.send(:extend, Bar) -# -# # bad -# Foo.public_send(:include, Bar) -# Foo.public_send(:prepend, Bar) -# Foo.public_send(:extend, Bar) -# -# # bad -# Foo.__send__(:include, Bar) -# Foo.__send__(:prepend, Bar) -# Foo.__send__(:extend, Bar) -# -# # good -# Foo.include Bar -# Foo.prepend Bar -# Foo.extend Bar -# -# source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#36 -class RuboCop::Cop::Lint::SendWithMixinArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#53 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#46 - def send_with_mixin_argument?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#67 - def bad_location(node); end - - # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#73 - def message(method, module_name, bad_method); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#77 - def mixin_method?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#41 -RuboCop::Cop::Lint::SendWithMixinArgument::MIXIN_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#40 -RuboCop::Cop::Lint::SendWithMixinArgument::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#43 -RuboCop::Cop::Lint::SendWithMixinArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#42 -RuboCop::Cop::Lint::SendWithMixinArgument::SEND_METHODS = T.let(T.unsafe(nil), Array) - -# Checks for shadowed arguments. -# -# This cop has `IgnoreImplicitReferences` configuration option. -# It means argument shadowing is used in order to pass parameters -# to zero arity `super` when `IgnoreImplicitReferences` is `true`. -# -# @example -# -# # bad -# do_something do |foo| -# foo = 42 -# puts foo -# end -# -# def do_something(foo) -# foo = 42 -# puts foo -# end -# -# # good -# do_something do |foo| -# foo = foo + 42 -# puts foo -# end -# -# def do_something(foo) -# foo = foo + 42 -# puts foo -# end -# -# def do_something(foo) -# puts foo -# end -# @example IgnoreImplicitReferences: false (default) -# -# # bad -# def do_something(foo) -# foo = 42 -# super -# end -# -# def do_something(foo) -# foo = super -# bar -# end -# @example IgnoreImplicitReferences: true -# -# # good -# def do_something(foo) -# foo = 42 -# super -# end -# -# def do_something(foo) -# foo = super -# bar -# end -# -# source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#66 -class RuboCop::Cop::Lint::ShadowedArgument < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#76 - def after_leaving_scope(scope, _variable_table); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#70 - def uses_var?(param0, param1); end - - private - - # Get argument references without assignments' references - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#161 - def argument_references(argument); end - - # Find the first argument assignment, which doesn't reference the - # argument at the rhs. If the assignment occurs inside a branch or - # block, it is impossible to tell whether it's executed, so precise - # shadowing location is not known. - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#120 - def assignment_without_argument_usage(argument); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#82 - def check_argument(argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#171 - def ignore_implicit_references?; end - - # Check whether the given node is nested into block or conditional. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#152 - def node_within_block_or_conditional?(node, stop_search_node); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#144 - def reference_pos(node); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#95 - def shadowing_assignment(argument); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#72 - def joining_forces; end - end -end - -# source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#67 -RuboCop::Cop::Lint::ShadowedArgument::MSG = T.let(T.unsafe(nil), String) - -# Checks for a rescued exception that get shadowed by a -# less specific exception being rescued before a more specific -# exception is rescued. -# -# An exception is considered shadowed if it is rescued after its -# ancestor is, or if it and its ancestor are both rescued in the -# same `rescue` statement. In both cases, the more specific rescue is -# unnecessary because it is covered by rescuing the less specific -# exception. (ie. `rescue Exception, StandardError` has the same behavior -# whether `StandardError` is included or not, because all ``StandardError``s -# are rescued by `rescue Exception`). -# -# @example -# -# # bad -# -# begin -# something -# rescue Exception -# handle_exception -# rescue StandardError -# handle_standard_error -# end -# -# # bad -# begin -# something -# rescue Exception, StandardError -# handle_error -# end -# -# # good -# -# begin -# something -# rescue StandardError -# handle_standard_error -# rescue Exception -# handle_exception -# end -# -# # good, however depending on runtime environment. -# # -# # This is a special case for system call errors. -# # System dependent error code depends on runtime environment. -# # For example, whether `Errno::EAGAIN` and `Errno::EWOULDBLOCK` are -# # the same error code or different error code depends on environment. -# # This good case is for `Errno::EAGAIN` and `Errno::EWOULDBLOCK` with -# # the same error code. -# begin -# something -# rescue Errno::EAGAIN, Errno::EWOULDBLOCK -# handle_standard_error -# end -# -# source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#61 -class RuboCop::Cop::Lint::ShadowedException < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RescueNode - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#67 - def on_rescue(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#101 - def compare_exceptions(exception, other_exception); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#94 - def contains_multiple_levels_of_exceptions?(group); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#119 - def evaluate_exceptions(group); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#152 - def find_shadowing_rescue(rescues); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#84 - def offense_range(rescues); end - - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#90 - def rescued_groups_for(rescues); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#137 - def sorted?(rescued_groups); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#115 - def system_call_err?(error); end -end - -# source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#65 -RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of local variable names from an outer scope -# in block arguments or block-local variables. This mirrors the warning -# given by `ruby -cw` prior to Ruby 2.6: -# "shadowing outer local variable - foo". -# -# NOTE: Shadowing of variables in block passed to `Ractor.new` is allowed -# because `Ractor` should not access outer variables. -# eg. following style is encouraged: -# -# [source,ruby] -# ---- -# worker_id, pipe = env -# Ractor.new(worker_id, pipe) do |worker_id, pipe| -# end -# ---- -# -# @example -# -# # bad -# def some_method -# foo = 1 -# -# 2.times do |foo| # shadowing outer `foo` -# do_something(foo) -# end -# end -# -# # good -# def some_method -# foo = 1 -# -# 2.times do |bar| -# do_something(bar) -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#41 -class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#53 - def before_declaring_variable(variable, variable_table); end - - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#45 - def ractor_block?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#96 - def find_conditional_node_from_ascendant(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#103 - def node_or_its_ascendant_conditional?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#72 - def same_conditions_node_different_branch?(variable, outer_local_variable); end - - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#86 - def variable_node(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#68 - def variable_used_in_declaration_of_outer?(variable, outer_local_variable); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#49 - def joining_forces; end - end -end - -# source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#42 -RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) - -# Checks for `Hash` creation with a mutable default value. -# Creating a `Hash` in such a way will share the default value -# across all keys, causing unexpected behavior when modifying it. -# -# For example, when the `Hash` was created with an `Array` as the argument, -# calling `hash[:foo] << 'bar'` will also change the value of all -# other keys that have not been explicitly assigned to. -# -# @example -# # bad -# Hash.new([]) -# Hash.new({}) -# Hash.new(Array.new) -# Hash.new(Hash.new) -# -# # okay -- In rare cases that intentionally have this behavior, -# # without disabling the cop, you can set the default explicitly. -# h = Hash.new -# h.default = [] -# h[:a] << 1 -# h[:b] << 2 -# h # => {:a => [1, 2], :b => [1, 2]} -# -# # okay -- beware this will discard mutations and only remember assignments -# Hash.new { Array.new } -# Hash.new { Hash.new } -# Hash.new { {} } -# Hash.new { [] } -# -# # good - frozen solution will raise an error when mutation attempted -# Hash.new([].freeze) -# Hash.new({}.freeze) -# -# # good - using a proc will create a new object for each key -# h = Hash.new -# h.default_proc = ->(h, k) { [] } -# h.default_proc = ->(h, k) { {} } -# -# # good - using a block will create a new object for each key -# Hash.new { |h, k| h[k] = [] } -# Hash.new { |h, k| h[k] = {} } -# -# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#47 -class RuboCop::Cop::Lint::SharedMutableDefault < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#64 - def capacity_keyword_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#53 - def hash_initialized_with_mutable_shared_object?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#68 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#48 -RuboCop::Cop::Lint::SharedMutableDefault::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#50 -RuboCop::Cop::Lint::SharedMutableDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks unexpected overrides of the `Struct` built-in methods -# via `Struct.new`. -# -# @example -# # bad -# Bad = Struct.new(:members, :clone, :count) -# b = Bad.new([], true, 1) -# b.members #=> [] (overriding `Struct#members`) -# b.clone #=> true (overriding `Object#clone`) -# b.count #=> 1 (overriding `Enumerable#count`) -# -# # good -# Good = Struct.new(:id, :name) -# g = Good.new(1, "foo") -# g.members #=> [:id, :name] -# g.clone #=> # -# g.count #=> 2 -# -# source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#24 -class RuboCop::Cop::Lint::StructNewOverride < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#38 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#33 - def struct_new(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#25 -RuboCop::Cop::Lint::StructNewOverride::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#27 -RuboCop::Cop::Lint::StructNewOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#30 -RuboCop::Cop::Lint::StructNewOverride::STRUCT_MEMBER_NAME_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#29 -RuboCop::Cop::Lint::StructNewOverride::STRUCT_METHOD_NAMES = T.let(T.unsafe(nil), Array) - -# Checks for `rescue` blocks with no body. -# -# @example -# -# # bad -# def some_method -# do_something -# rescue -# end -# -# # bad -# begin -# do_something -# rescue -# end -# -# # good -# def some_method -# do_something -# rescue -# handle_exception -# end -# -# # good -# begin -# do_something -# rescue -# handle_exception -# end -# @example AllowComments: true (default) -# -# # good -# def some_method -# do_something -# rescue -# # do nothing -# end -# -# # good -# begin -# do_something -# rescue -# # do nothing -# end -# @example AllowComments: false -# -# # bad -# def some_method -# do_something -# rescue -# # do nothing -# end -# -# # bad -# begin -# do_something -# rescue -# # do nothing -# end -# @example AllowNil: true (default) -# -# # good -# def some_method -# do_something -# rescue -# nil -# end -# -# # good -# begin -# do_something -# rescue -# # do nothing -# end -# -# # good -# do_something rescue nil -# @example AllowNil: false -# -# # bad -# def some_method -# do_something -# rescue -# nil -# end -# -# # bad -# begin -# do_something -# rescue -# nil -# end -# -# # bad -# do_something rescue nil -# -# source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#105 -class RuboCop::Cop::Lint::SuppressedException < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#108 - def on_resbody(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#118 - def comment_between_rescue_and_end?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#126 - def nil_body?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#106 -RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String) - -# Checks for cases where exceptions unrelated to the numeric constructors `Integer()`, -# `Float()`, `BigDecimal()`, `Complex()`, and `Rational()` may be unintentionally swallowed. -# -# @example -# -# # bad -# Integer(arg) rescue nil -# -# # bad -# begin -# Integer(arg) -# rescue -# nil -# end -# -# # bad -# begin -# Integer(arg) -# rescue -# end -# -# # good -# Integer(arg, exception: false) -# -# source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#41 -class RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#56 - def begin_numeric_constructor_rescue_nil(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#75 - def constructor_receiver?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#49 - def numeric_constructor_rescue_nil(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#65 - def numeric_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#82 - def on_rescue(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#103 - def expected_exception_classes_only?(exception_classes); end -end - -# source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#46 -RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::EXPECTED_EXCEPTION_CLASSES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb#45 -RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of literal strings converted to -# a symbol where a literal symbol could be used instead. -# -# There are two possible styles for this cop. -# `strict` (default) will register an offense for any incorrect usage. -# `consistent` additionally requires hashes to use the same style for -# every symbol key (ie. if any symbol key needs to be quoted it requires -# all keys to be quoted). -# -# @example -# # bad -# 'string'.to_sym -# :symbol.to_sym -# 'underscored_string'.to_sym -# :'underscored_symbol' -# 'hyphenated-string'.to_sym -# "string_#{interpolation}".to_sym -# -# # good -# :string -# :symbol -# :underscored_string -# :underscored_symbol -# :'hyphenated-string' -# :"string_#{interpolation}" -# @example EnforcedStyle: strict (default) -# -# # bad -# { -# 'a': 1, -# "b": 2, -# 'c-d': 3 -# } -# -# # good (don't quote keys that don't require quoting) -# { -# a: 1, -# b: 2, -# 'c-d': 3 -# } -# @example EnforcedStyle: consistent -# -# # bad -# { -# a: 1, -# 'b-c': 2 -# } -# -# # good (quote all keys if any need quoting) -# { -# 'a': 1, -# 'b-c': 2 -# } -# -# # good (no quoting required) -# { -# a: 1, -# b: 2 -# } -# -# source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#68 -class RuboCop::Cop::Lint::SymbolConversion < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::SymbolHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#105 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#78 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#88 - def on_sym(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#147 - def correct_hash_key(node); end - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#166 - def correct_inconsistent_hash_keys(keys); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#139 - def in_alias?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#143 - def in_percent_literal_array?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#126 - def properly_quoted?(source, value); end - - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#122 - def register_offense(node, correction:, message: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#135 - def requires_quotes?(sym_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#73 -RuboCop::Cop::Lint::SymbolConversion::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#74 -RuboCop::Cop::Lint::SymbolConversion::MSG_CONSISTENCY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/symbol_conversion.rb#76 -RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Repacks Parser's diagnostics/errors -# into RuboCop's offenses. -# -# source://rubocop//lib/rubocop/cop/lint/syntax.rb#8 -class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#11 - def on_other_file; end - - private - - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#22 - def add_offense_from_diagnostic(diagnostic, ruby_version); end - - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#32 - def add_offense_from_error(error); end - - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#37 - def beautify_message(message); end - - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#43 - def find_severity(_range, _severity); end -end - -# source://rubocop//lib/rubocop/cop/lint/syntax.rb#9 -RuboCop::Cop::Lint::Syntax::LEVELS = T.let(T.unsafe(nil), Array) - -# Ensures that `to_enum`/`enum_for`, called for the current method, -# has correct arguments. -# -# @example -# # bad -# def foo(x, y = 1) -# return to_enum(__callee__, x) # `y` is missing -# end -# -# # good -# def foo(x, y = 1) -# # Alternatives to `__callee__` are `__method__` and `:foo`. -# return to_enum(__callee__, x, y) -# end -# -# # good -# def foo(x, y = 1) -# # It is also allowed if it is wrapped in some method like Sorbet. -# return to_enum(T.must(__callee__), x, y) -# end -# -# source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#27 -class RuboCop::Cop::Lint::ToEnumArguments < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#33 - def enum_conversion_call?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#38 - def method_name?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#47 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#43 - def passing_keyword_arg?(param0 = T.unsafe(nil), param1); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#76 - def argument_match?(send_arg, def_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#61 - def arguments_match?(arguments, def_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#28 -RuboCop::Cop::Lint::ToEnumArguments::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/to_enum_arguments.rb#30 -RuboCop::Cop::Lint::ToEnumArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks to make sure `#to_json` includes an optional argument. -# When overriding `#to_json`, callers may invoke JSON -# generation via `JSON.generate(your_obj)`. Since `JSON#generate` allows -# for an optional argument, your method should too. -# -# @example -# class Point -# attr_reader :x, :y -# -# # bad, incorrect arity -# def to_json -# JSON.generate([x, y]) -# end -# -# # good, preserving args -# def to_json(*args) -# JSON.generate([x, y], *args) -# end -# -# # good, discarding args -# def to_json(*_args) -# JSON.generate([x, y]) -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/to_json.rb#31 -class RuboCop::Cop::Lint::ToJSON < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/to_json.rb#36 - def on_def(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/to_json.rb#34 -RuboCop::Cop::Lint::ToJSON::MSG = T.let(T.unsafe(nil), String) - -# Checks for top level return with arguments. If there is a -# top-level return statement with an argument, then the argument is -# always ignored. This is detected automatically since Ruby 2.7. -# -# @example -# # bad -# return 1 -# -# # good -# return -# -# source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#16 -class RuboCop::Cop::Lint::TopLevelReturnWithArgument < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#21 - def on_return(return_node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#35 - def remove_arguments(corrector, return_node); end - - # This cop works by validating the ancestors of the return node. A - # top-level return node's ancestors should not be of block, def, or - # defs type. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#42 - def top_level_return?(return_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#31 - def top_level_return_with_any_argument?(return_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#19 -RuboCop::Cop::Lint::TopLevelReturnWithArgument::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing commas in attribute declarations, such as -# `#attr_reader`. Leaving a trailing comma will nullify the next method -# definition by overriding it with a getter method. -# -# @example -# -# # bad -# class Foo -# attr_reader :foo, -# -# def bar -# puts "Unreachable." -# end -# end -# -# # good -# class Foo -# attr_reader :foo -# -# def bar -# puts "No problem!" -# end -# end -# -# source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#30 -class RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#36 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#46 - def trailing_comma_range(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#34 -RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration::MSG = T.let(T.unsafe(nil), String) - -# Checks for "triple quotes" (strings delimited by any odd number -# of quotes greater than 1). -# -# Ruby allows multiple strings to be implicitly concatenated by just -# being adjacent in a statement (ie. `"foo""bar" == "foobar"`). This sometimes -# gives the impression that there is something special about triple quotes, but -# in fact it is just extra unnecessary quotes and produces the same string. Each -# pair of quotes produces an additional concatenated empty string, so the result -# is still only the "actual" string within the delimiters. -# -# NOTE: Although this cop is called triple quotes, the same behavior is present -# for strings delimited by 5, 7, etc. quotation marks. -# -# @example -# # bad -# """ -# A string -# """ -# -# # bad -# ''' -# A string -# ''' -# -# # good -# " -# A string -# " -# -# # good -# < b } -# values.sort { |*x| x[0] <=> x[1] } -# -# source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#41 -class RuboCop::Cop::Lint::UnexpectedBlockArity < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#44 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#44 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#44 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#64 - def acceptable?(node); end - - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#76 - def arg_count(node); end - - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#72 - def expected_arity(method); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#68 - def included_method?(name); end - - # source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#60 - def methods; end -end - -# source://rubocop//lib/rubocop/cop/lint/unexpected_block_arity.rb#42 -RuboCop::Cop::Lint::UnexpectedBlockArity::MSG = T.let(T.unsafe(nil), String) - -# Checks for using Fixnum or Bignum constant. -# -# @example -# -# # bad -# 1.is_a?(Fixnum) -# 1.is_a?(Bignum) -# -# # good -# 1.is_a?(Integer) -# -# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#16 -class RuboCop::Cop::Lint::UnifiedInteger < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#22 - def fixnum_or_bignum_const(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#26 - def on_const(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#19 -RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String) - -# Looks for `reduce` or `inject` blocks where the value returned (implicitly or -# explicitly) does not include the accumulator. A block is considered valid as -# long as at least one return value includes the accumulator. -# -# If the accumulator is not included in the return value, then the entire -# block will just return a transformation of the last element value, and -# could be rewritten as such without a loop. -# -# Also catches instances where an index of the accumulator is returned, as -# this may change the type of object being retained. -# -# NOTE: For the purpose of reducing false positives, this cop only flags -# returns in `reduce` blocks where the element is the only variable in -# the expression (since we will not be able to tell what other variables -# relate to via static analysis). -# -# @example -# -# # bad -# (1..4).reduce(0) do |acc, el| -# el * 2 -# end -# -# # bad, may raise a NoMethodError after the first iteration -# %w(a b c).reduce({}) do |acc, letter| -# acc[letter] = true -# end -# -# # good -# (1..4).reduce(0) do |acc, el| -# acc + el * 2 -# end -# -# # good, element is returned but modified using the accumulator -# values.reduce do |acc, el| -# el << acc -# el -# end -# -# # good, returns the accumulator instead of the index -# %w(a b c).reduce({}) do |acc, letter| -# acc[letter] = true -# acc -# end -# -# # good, at least one branch returns the accumulator -# values.reduce(nil) do |result, value| -# break result if something? -# value -# end -# -# # good, recursive -# keys.reduce(self) { |result, key| result[key] } -# -# # ignored as the return value cannot be determined -# enum.reduce do |acc, el| -# x = foo(acc, el) -# bar(x) -# end -# -# source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#65 -class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#78 - def accumulator_index?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#83 - def element_modified?(param0, param1); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#104 - def expression_values(param0); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#93 - def lvar_used?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#115 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#115 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#70 - def reduce_with_block?(param0 = T.unsafe(nil)); end - - private - - # Determine if a return value is acceptable for the purposes of this cop - # If it is an expression containing the accumulator, it is acceptable - # Otherwise, it is only unacceptable if it contains the iterated element, since we - # otherwise do not have enough information to prevent false positives. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#191 - def acceptable_return?(return_val, element_name); end - - # Exclude `begin` nodes inside a `dstr` from being collected by `return_values` - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#199 - def allowed_type?(parent_node); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#159 - def block_arg_name(node, index); end - - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#142 - def check_return_values(block_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#176 - def potential_offense?(return_values, block_body, element_name, accumulator_name); end - - # Return values in a block are either the value given to next, - # the last line of a multiline block, or the only line of the block - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#128 - def return_values(block_body_node); end - - # Look for an index of the accumulator being returned, except where the index - # is the element. - # This is always an offense, in order to try to catch potential exceptions - # due to type mismatches - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#167 - def returned_accumulator_index(return_values, accumulator_name, element_name); end - - # If the accumulator is used in any return value, the node is acceptable since - # the accumulator has a chance to change each iteration - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#183 - def returns_accumulator_anywhere?(return_values, accumulator_name); end -end - -# source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#66 -RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#67 -RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil), String) - -# Checks for unreachable code. -# The check are based on the presence of flow of control -# statement in non-final position in `begin` (implicit) blocks. -# -# @example -# -# # bad -# def some_method -# return -# do_something -# end -# -# # bad -# def some_method -# if cond -# return -# else -# return -# end -# do_something -# end -# -# # good -# def some_method -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#32 -class RuboCop::Cop::Lint::UnreachableCode < ::RuboCop::Cop::Base - # @return [UnreachableCode] a new instance of UnreachableCode - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#35 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#48 - def after_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#71 - def flow_command?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#52 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#41 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#41 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#52 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#41 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#105 - def check_case(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#99 - def check_if(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#81 - def flow_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#120 - def instance_eval_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#66 - def redefinable_flow_method?(method); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#115 - def register_redefinition(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#124 - def report_on_flow_command?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#33 -RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) - -# Checks for loops that will have at most one iteration. -# -# A loop that can never reach the second iteration is a possible error in the code. -# In rare cases where only one iteration (or at most one iteration) is intended behavior, -# the code should be refactored to use `if` conditionals. -# -# NOTE: Block methods that are used with ``Enumerable``s are considered to be loops. -# -# `AllowedPatterns` can be used to match against the block receiver in order to allow -# code that would otherwise be registered as an offense (eg. `times` used not in an -# `Enumerable` context). -# -# @example -# # bad -# while node -# do_something(node) -# node = node.parent -# break -# end -# -# # good -# while node -# do_something(node) -# node = node.parent -# end -# -# # bad -# def verify_list(head) -# item = head -# begin -# if verify(item) -# return true -# else -# return false -# end -# end while(item) -# end -# -# # good -# def verify_list(head) -# item = head -# begin -# if verify(item) -# item = item.next -# else -# return false -# end -# end while(item) -# -# true -# end -# -# # bad -# def find_something(items) -# items.each do |item| -# if something?(item) -# return item -# else -# raise NotFoundError -# end -# end -# end -# -# # good -# def find_something(items) -# items.each do |item| -# if something?(item) -# return item -# end -# end -# raise NotFoundError -# end -# -# # bad -# 2.times { raise ArgumentError } -# @example AllowedPatterns: ['(exactly|at_least|at_most)\(\d+\)\.times'] (default) -# -# # good -# exactly(2).times { raise StandardError } -# -# source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#86 -class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedPattern - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#142 - def break_command?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#100 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#92 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#100 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#100 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#92 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#92 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#92 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#92 - def on_while_post(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#152 - def break_statement?(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#118 - def check(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#175 - def check_case(node); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#169 - def check_if(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#200 - def conditional_continue_keyword?(break_statement); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#109 - def loop_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#189 - def preceded_by_continue_statement?(break_statement); end - - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#129 - def statements(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#90 -RuboCop::Cop::Lint::UnreachableLoop::CONTINUE_KEYWORDS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#89 -RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for cops handling unused arguments. -# -# source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#7 -module RuboCop::Cop::Lint::UnusedArgument - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#10 - def after_leaving_scope(scope, _variable_table); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#16 - def check_argument(variable); end -end - -# Checks for unused block arguments. -# -# @example -# # bad -# do_something do |used, unused| -# puts used -# end -# -# do_something do |bar| -# puts :foo -# end -# -# define_method(:foo) do |bar| -# puts :baz -# end -# -# # good -# do_something do |used, _unused| -# puts used -# end -# -# do_something do -# puts :foo -# end -# -# define_method(:foo) do |_bar| -# puts :baz -# end -# @example IgnoreEmptyBlocks: true (default) -# # good -# do_something { |unused| } -# @example IgnoreEmptyBlocks: false -# # bad -# do_something { |unused| } -# @example AllowUnusedKeywordArguments: false (default) -# # bad -# do_something do |unused: 42| -# foo -# end -# @example AllowUnusedKeywordArguments: true -# # good -# do_something do |unused: 42| -# foo -# end -# -# source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#55 -class RuboCop::Cop::Lint::UnusedBlockArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Lint::UnusedArgument - extend ::RuboCop::Cop::AutoCorrector - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#162 - def allow_unused_keyword_arguments?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#81 - def allowed_block?(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#85 - def allowed_keyword_argument?(variable); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#99 - def augment_message(message, variable); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#65 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#69 - def check_argument(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#149 - def define_method_call?(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#156 - def empty_block?(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#166 - def ignore_empty_blocks?; end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#89 - def message(variable); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#132 - def message_for_lambda(variable, all_arguments); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#120 - def message_for_normal_block(variable, all_arguments); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#144 - def message_for_underscore_prefix(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#77 - def used_block_local?(variable); end - - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#112 - def variable_type(variable); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#59 - def joining_forces; end - end -end - -# Checks for unused method arguments. -# -# @example IgnoreNotImplementedMethods: false -# # bad -# def do_something(unused) -# raise NotImplementedError -# end -# -# def do_something_else(unused) -# fail "TODO" -# end -# @example AllowUnusedKeywordArguments: false (default) -# # bad -# def do_something(used, unused: 42) -# used -# end -# @example AllowUnusedKeywordArguments: true -# # good -# def do_something(used, unused: 42) -# used -# end -# @example IgnoreEmptyMethods: true (default) -# # good -# def do_something(unused) -# end -# @example IgnoreEmptyMethods: false -# # bad -# def do_something(unused) -# end -# @example IgnoreNotImplementedMethods: true (default) -# # with default value of `NotImplementedExceptions: ['NotImplementedError']` -# -# # good -# def do_something(unused) -# raise NotImplementedError -# end -# -# def do_something_else(unused) -# fail "TODO" -# end -# @example IgnoreNotImplementedMethods: true -# # with `NotImplementedExceptions: ['AbstractMethodError']` -# -# # good -# def do_something(unused) -# raise AbstractMethodError -# end -# @example -# # bad -# def some_method(used, unused, _unused_but_allowed) -# puts used -# end -# -# # good -# def some_method(used, _unused, _unused_but_allowed) -# puts used -# end -# -# source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#70 -class RuboCop::Cop::Lint::UnusedMethodArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Lint::UnusedArgument - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#75 - def not_implemented?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#128 - def allowed_exception_class?(node); end - - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#90 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#94 - def check_argument(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#102 - def ignored_method?(body); end - - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#107 - def message(variable); end - - class << self - # source://rubocop-performance/1.25.0/lib/rubocop-performance.rb#12 - def autocorrect_incompatible_with; end - - # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#84 - def joining_forces; end - end -end - -# Identifies places where `URI.escape` can be replaced by -# `CGI.escape`, `URI.encode_www_form`, or `URI.encode_www_form_component` -# depending on your specific use case. -# Also this cop identifies places where `URI.unescape` can be replaced by -# `CGI.unescape`, `URI.decode_www_form`, -# or `URI.decode_www_form_component` depending on your specific use case. -# -# @example -# # bad -# URI.escape('http://example.com') -# URI.encode('http://example.com') -# -# # good -# CGI.escape('http://example.com') -# URI.encode_www_form([['example', 'param'], ['lang', 'en']]) -# URI.encode_www_form(page: 10, locale: 'en') -# URI.encode_www_form_component('http://example.com') -# -# # bad -# URI.unescape(enc_uri) -# URI.decode(enc_uri) -# -# # good -# CGI.unescape(enc_uri) -# URI.decode_www_form(enc_uri) -# URI.decode_www_form_component(enc_uri) -# -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#32 -class RuboCop::Cop::Lint::UriEscapeUnescape < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#57 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#51 - def uri_escape_unescape?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#33 -RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_ESCAPE = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#38 -RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_UNESCAPE = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#47 -RuboCop::Cop::Lint::UriEscapeUnescape::METHOD_NAMES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#44 -RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#48 -RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies places where `URI.regexp` is obsolete and should not be used. -# -# For Ruby 3.3 or lower, use `URI::DEFAULT_PARSER.make_regexp`. -# For Ruby 3.4 or higher, use `URI::RFC2396_PARSER.make_regexp`. -# -# NOTE: If you need to support both Ruby 3.3 and lower as well as Ruby 3.4 and higher, -# consider manually changing the code as follows: -# -# [source,ruby] -# ---- -# defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER -# ---- -# -# @example -# # bad -# URI.regexp('http://example.com') -# -# # good - Ruby 3.3 or lower -# URI::DEFAULT_PARSER.make_regexp('http://example.com') -# -# # good - Ruby 3.4 or higher -# URI::RFC2396_PARSER.make_regexp('http://example.com') -# -# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#29 -class RuboCop::Cop::Lint::UriRegexp < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#40 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#36 - def uri_constant?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#32 -RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#33 -RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant access modifiers, including those with no -# code, those which are repeated, and leading `public` modifiers in a -# class or module body. Conditionally-defined methods are considered as -# always being defined, and thus access modifiers guarding such methods -# are not redundant. -# -# This cop has `ContextCreatingMethods` option. The default setting value -# is an empty array that means no method is specified. -# This setting is an array of methods which, when called, are known to -# create its own context in the module's current access context. -# -# It also has `MethodCreatingMethods` option. The default setting value -# is an empty array that means no method is specified. -# This setting is an array of methods which, when called, are known to -# create other methods in the module's current access context. -# -# @example -# # bad -# class Foo -# public # this is redundant (default access is public) -# -# def method -# end -# end -# -# # bad -# class Foo -# # The following is redundant (methods defined on the class' -# # singleton class are not affected by the private modifier) -# private -# -# def self.method3 -# end -# end -# -# # bad -# class Foo -# protected -# -# define_method(:method2) do -# end -# -# protected # this is redundant (repeated from previous modifier) -# -# [1,2,3].each do |i| -# define_method("foo#{i}") do -# end -# end -# end -# -# # bad -# class Foo -# private # this is redundant (no following methods are defined) -# end -# -# # good -# class Foo -# private # this is not redundant (a method is defined) -# -# def method2 -# end -# end -# -# # good -# class Foo -# # The following is not redundant (conditionally defined methods are -# # considered as always defining a method) -# private -# -# if condition? -# def method -# end -# end -# end -# -# # good -# class Foo -# protected # this is not redundant (a method is defined) -# -# define_method(:method2) do -# end -# end -# @example ContextCreatingMethods: concerning -# # Lint/UselessAccessModifier: -# # ContextCreatingMethods: -# # - concerning -# -# # good -# require 'active_support/concern' -# class Foo -# concerning :Bar do -# def some_public_method -# end -# -# private -# -# def some_private_method -# end -# end -# -# # this is not redundant because `concerning` created its own context -# private -# -# def some_other_private_method -# end -# end -# @example MethodCreatingMethods: delegate -# # Lint/UselessAccessModifier: -# # MethodCreatingMethods: -# # - delegate -# -# # good -# require 'active_support/core_ext/module/delegation' -# class Foo -# # this is not redundant because `delegate` creates methods -# private -# -# delegate :method_a, to: :method_b -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#127 -class RuboCop::Cop::Lint::UselessAccessModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#167 - def class_or_instance_eval?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#162 - def dynamic_method_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#139 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#139 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#139 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 - def on_sclass(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#157 - def static_method_definition?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#183 - def access_modifier?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#281 - def any_context_creating_methods?(child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#258 - def any_method_definition?(child); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#150 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#197 - def check_child_nodes(node, unused, cur_vis); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#227 - def check_new_visibility(node, unused, new_vis, cur_vis); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#171 - def check_node(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#187 - def check_scope(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#216 - def check_send_node(node, cur_vis, unused); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#275 - def eval_call?(child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#248 - def included_block?(block_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#252 - def method_definition?(child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#271 - def start_of_new_scope?(child); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#131 -RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String) - -# Checks for every useless assignment to local variable in every -# scope. -# The basic idea for this cop was from the warning of `ruby -cw`: -# -# [source,console] -# ---- -# assigned but unused variable - foo -# ---- -# -# Currently this cop has advanced logic that detects unreferenced -# reassignments and properly handles varied cases such as branch, loop, -# rescue, ensure, etc. -# -# This cop's autocorrection avoids cases like `a ||= 1` because removing assignment from -# operator assignment can cause `NameError` if this assignment has been used to declare -# a local variable. For example, replacing `a ||= 1` with `a || 1` may cause -# "undefined local variable or method `a' for main:Object (NameError)". -# -# NOTE: Given the assignment `foo = 1, bar = 2`, removing unused variables -# can lead to a syntax error, so this case is not autocorrected. -# -# @example -# -# # bad -# def some_method -# some_var = 1 -# do_something -# end -# -# # good -# def some_method -# some_var = 1 -# do_something(some_var) -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#40 -class RuboCop::Cop::Lint::UselessAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#51 - def after_leaving_scope(scope, _variable_table); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#167 - def autocorrect(corrector, assignment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#106 - def chained_assignment?(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#56 - def check_for_unused_assignments(variable); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#151 - def collect_variable_like_names(scope); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#82 - def message_for_useless_assignment(assignment); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#112 - def message_specification(assignment, variable); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#122 - def multiple_assignment_message(variable_name); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#88 - def offense_range(assignment); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#127 - def operator_assignment_message(scope, assignment); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#184 - def remove_exception_assignment_part(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#208 - def remove_local_variable_assignment_part(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#197 - def remove_trailing_character_from_operator(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#193 - def rename_variable_with_underscore(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#201 - def replace_named_capture_group_with_non_capturing_group(corrector, node, variable_name); end - - # TODO: More precise handling (rescue, ensure, nested begin, etc.) - # - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#141 - def return_value_node_of_scope(scope); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#96 - def sequential_assignment?(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#134 - def similar_name_message(variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#160 - def variable_like_method_invocation?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#47 - def joining_forces; end - end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#45 -RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for useless constant scoping. Private constants must be defined using -# `private_constant`. Even if `private` access modifier is used, it is public scope despite -# its appearance. -# -# It does not support autocorrection due to behavior change and multiple ways to fix it. -# Or a public constant may be intended. -# -# @example -# -# # bad -# class Foo -# private -# PRIVATE_CONST = 42 -# end -# -# # good -# class Foo -# PRIVATE_CONST = 42 -# private_constant :PRIVATE_CONST -# end -# -# # good -# class Foo -# PUBLIC_CONST = 42 # If private scope is not intended. -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#32 -class RuboCop::Cop::Lint::UselessConstantScoping < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#40 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#36 - def private_constants(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#49 - def after_private_modifier?(left_siblings); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#59 - def private_constantize?(right_siblings, const_value); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_constant_scoping.rb#33 -RuboCop::Cop::Lint::UselessConstantScoping::MSG = T.let(T.unsafe(nil), String) - -# Checks for calls to `defined?` with strings or symbols as the argument. -# Such calls will always return `'expression'`, you probably meant to -# check for the existence of a constant, method, or variable instead. -# -# `defined?` is part of the Ruby syntax and doesn't behave like normal methods. -# You can safely pass in what you are checking for directly, without encountering -# a `NameError`. -# -# When interpolation is used, oftentimes it is not possible to write the -# code with `defined?`. In these cases, switch to one of the more specific methods: -# -# * `class_variable_defined?` -# * `const_defined?` -# * `method_defined?` -# * `instance_variable_defined?` -# * `binding.local_variable_defined?` -# -# @example -# -# # bad -# defined?('FooBar') -# defined?(:FooBar) -# defined?(:foo_bar) -# defined?('foo_bar') -# -# # good -# defined?(FooBar) -# defined?(foo_bar) -# -# # bad - interpolation -# bar = 'Bar' -# defined?("Foo::#{bar}::Baz") -# -# # good -# bar = 'Bar' -# defined?(Foo) && Foo.const_defined?(bar) && Foo.const_get(bar).const_defined?(:Baz) -# -# source://rubocop//lib/rubocop/cop/lint/useless_defined.rb#42 -class RuboCop::Cop::Lint::UselessDefined < ::RuboCop::Cop::Base - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_defined.rb#46 - def on_defined?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_defined.rb#43 -RuboCop::Cop::Lint::UselessDefined::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/useless_defined.rb#44 -RuboCop::Cop::Lint::UselessDefined::TYPES = T.let(T.unsafe(nil), Hash) - -# Checks for useless `else` in `begin..end` without `rescue`. -# -# NOTE: This syntax is no longer valid on Ruby 2.6 or higher. -# -# @example -# -# # bad -# begin -# do_something -# else -# do_something_else # This will never be run. -# end -# -# # good -# begin -# do_something -# rescue -# handle_errors -# else -# do_something_else -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#27 -class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#34 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#30 -RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) - -# Checks for useless method definitions, specifically: empty constructors -# and methods just delegating to `super`. -# -# @example -# # bad -# def initialize -# super -# end -# -# def method -# super -# end -# -# # good - with default arguments -# def initialize(x = Object.new) -# super -# end -# -# # good -# def initialize -# super -# initialize_internals -# end -# -# def method(*args) -# super(:extra_arg, *args) -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#38 -class RuboCop::Cop::Lint::UselessMethodDefinition < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#43 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#43 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#65 - def delegating?(node, def_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#57 - def method_definition_with_modifier?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#61 - def use_rest_or_optional_args?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#41 -RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Certain numeric operations have no impact, being: -# Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. -# These are probably leftover from debugging, or are mistakes. -# -# @example -# -# # bad -# x + 0 -# x - 0 -# x * 1 -# x / 1 -# x ** 1 -# -# # good -# x -# -# # bad -# x += 0 -# x -= 0 -# x *= 1 -# x /= 1 -# x **= 1 -# -# # good -# x = x -# -# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#32 -class RuboCop::Cop::Lint::UselessNumericOperation < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#43 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#55 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#43 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#41 - def useless_abbreviated_assignment?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#38 - def useless_operation?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#68 - def useless?(operation, number); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#34 -RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/useless_numeric_operation.rb#35 -RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for useless ``rescue``s, which only reraise rescued exceptions. -# -# @example -# # bad -# def foo -# do_something -# rescue -# raise -# end -# -# # bad -# def foo -# do_something -# rescue => e -# raise # or 'raise e', or 'raise $!', or 'raise $ERROR_INFO' -# end -# -# # good -# def foo -# do_something -# rescue -# do_cleanup -# raise -# end -# -# # bad (latest rescue) -# def foo -# do_something -# rescue ArgumentError -# # noop -# rescue -# raise -# end -# -# # good (not the latest rescue) -# def foo -# do_something -# rescue ArgumentError -# raise -# rescue -# # noop -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#49 -class RuboCop::Cop::Lint::UselessRescue < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#52 - def on_rescue(node); end - - private - - # source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#83 - def exception_objects(resbody_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#60 - def only_reraising?(resbody_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#75 - def use_exception_variable_in_ensure?(resbody_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_rescue.rb#50 -RuboCop::Cop::Lint::UselessRescue::MSG = T.let(T.unsafe(nil), String) - -# Looks for `ruby2_keywords` calls for methods that do not need it. -# -# `ruby2_keywords` should only be called on methods that accept an argument splat -# (`\*args`) but do not explicit keyword arguments (`k:` or `k: true`) or -# a keyword splat (`**kwargs`). -# -# @example -# # good (splat argument without keyword arguments) -# ruby2_keywords def foo(*args); end -# -# # bad (no arguments) -# ruby2_keywords def foo; end -# -# # good -# def foo; end -# -# # bad (positional argument) -# ruby2_keywords def foo(arg); end -# -# # good -# def foo(arg); end -# -# # bad (double splatted argument) -# ruby2_keywords def foo(**args); end -# -# # good -# def foo(**args); end -# -# # bad (keyword arguments) -# ruby2_keywords def foo(i:, j:); end -# -# # good -# def foo(i:, j:); end -# -# # bad (splat argument with keyword arguments) -# ruby2_keywords def foo(*args, i:, j:); end -# -# # good -# def foo(*args, i:, j:); end -# -# # bad (splat argument with double splat) -# ruby2_keywords def foo(*args, **kwargs); end -# -# # good -# def foo(*args, **kwargs); end -# -# # bad (ruby2_keywords given a symbol) -# def foo; end -# ruby2_keywords :foo -# -# # good -# def foo; end -# -# # bad (ruby2_keywords with dynamic method) -# define_method(:foo) { |arg| } -# ruby2_keywords :foo -# -# # good -# define_method(:foo) { |arg| } -# -# source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#66 -class RuboCop::Cop::Lint::UselessRuby2Keywords < ::RuboCop::Cop::Base - # Looks for statically or dynamically defined methods with a given name - # - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#72 - def method_definition(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#79 - def on_send(node); end - - private - - # `ruby2_keywords` is only allowed if there's a `restarg` and no keyword arguments - # - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#118 - def allowed_arguments(arguments); end - - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#109 - def find_method_definition(node, method_name); end - - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#91 - def inspect_def(node, def_node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#97 - def inspect_sym(node, sym_node); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#67 -RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/useless_ruby2_keywords.rb#68 -RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for setter call to local variable as the final -# expression of a function definition. -# -# @example -# -# # bad -# def something -# x = Something.new -# x.attr = 5 -# end -# -# # good -# def something -# x = Something.new -# x.attr = 5 -# x -# end -# -# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#31 -class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#37 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#37 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#59 - def setter_call_to_local_variable?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#63 - def last_expression(body); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#35 -RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#34 -RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String) - -# This class tracks variable assignments in a method body -# and if a variable contains object passed as argument at the end of -# the method. -# -# source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#72 -class RuboCop::Cop::Lint::UselessSetterCall::MethodVariableTracker - # @return [MethodVariableTracker] a new instance of MethodVariableTracker - # - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#73 - def initialize(body_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#148 - def constructor?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#78 - def contain_local_object?(variable_name); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#140 - def process_assignment(asgn_node, rhs_node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#96 - def process_assignment_node(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#131 - def process_binary_operator_assignment(op_asgn_node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#123 - def process_logical_operator_assignment(asgn_node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#109 - def process_multiple_assignment(masgn_node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#88 - def scan(node, &block); end -end - -# Checks for uses of `Integer#times` that will never yield -# (when the integer ``<= 0``) or that will only ever yield once -# (`1.times`). -# -# @example -# # bad -# -5.times { do_something } -# 0.times { do_something } -# 1.times { do_something } -# 1.times { |i| do_something(i) } -# -# # good -# do_something -# do_something(1) -# -# source://rubocop//lib/rubocop/cop/lint/useless_times.rb#24 -class RuboCop::Cop::Lint::UselessTimes < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#37 - def block_arg(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#42 - def block_reassigns_arg?(param0, param1); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#46 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#32 - def times_call?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#62 - def autocorrect(corrector, count, node, proc_name); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#84 - def autocorrect_block(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#80 - def autocorrect_block_pass(corrector, node, proc_name); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#94 - def fix_indentation(source, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#72 - def never_process?(count, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#106 - def own_line?(node); end - - # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#76 - def remove_node(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/lint/useless_times.rb#28 -RuboCop::Cop::Lint::UselessTimes::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/useless_times.rb#29 -RuboCop::Cop::Lint::UselessTimes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for operators, variables, literals, lambda, proc and nonmutating -# methods used in void context. -# -# `each` blocks are allowed to prevent false positives. -# For example, the expression inside the `each` block below. -# It's not void, especially when the receiver is an `Enumerator`: -# -# [source,ruby] -# ---- -# enumerator = [1, 2, 3].filter -# enumerator.each { |item| item >= 2 } #=> [2, 3] -# ---- -# -# @example CheckForMethodsWithNoSideEffects: false (default) -# # bad -# def some_method -# some_num * 10 -# do_something -# end -# -# def some_method(some_var) -# some_var -# do_something -# end -# @example CheckForMethodsWithNoSideEffects: true -# # bad -# def some_method(some_array) -# some_array.sort -# do_something(some_array) -# end -# -# # good -# def some_method -# do_something -# some_num * 10 -# end -# -# def some_method(some_var) -# do_something -# some_var -# end -# -# def some_method(some_array) -# some_array.sort! -# do_something(some_array) -# end -# -# source://rubocop//lib/rubocop/cop/lint/void.rb#53 -class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/lint/void.rb#91 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#81 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#96 - def on_ensure(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#81 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#91 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#81 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/void.rb#262 - def all_keys_entirely_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/void.rb#266 - def all_values_entirely_literal?(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#240 - def autocorrect_nonmutating_send(corrector, node, suggestion); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#234 - def autocorrect_void_expression(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#221 - def autocorrect_void_op(corrector, node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#102 - def check_begin(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#206 - def check_ensure(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#116 - def check_expression(expr); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#164 - def check_literal(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#188 - def check_nonmutating(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#172 - def check_self(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#146 - def check_var(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#180 - def check_void_expression(node); end - - # source://rubocop//lib/rubocop/cop/lint/void.rb#130 - def check_void_op(node, &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/void.rb#249 - def entirely_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/lint/void.rb#214 - def in_void_context?(node); end -end - -# source://rubocop//lib/rubocop/cop/lint/void.rb#66 -RuboCop::Cop::Lint::Void::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#60 -RuboCop::Cop::Lint::Void::CONST_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#63 -RuboCop::Cop::Lint::Void::EXPRESSION_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#61 -RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#76 -RuboCop::Cop::Lint::Void::METHODS_REPLACEABLE_BY_EACH = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#78 -RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#69 -RuboCop::Cop::Lint::Void::NONMUTATING_METHODS_WITH_BANG_VERSION = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#64 -RuboCop::Cop::Lint::Void::NONMUTATING_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#68 -RuboCop::Cop::Lint::Void::OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#58 -RuboCop::Cop::Lint::Void::OP_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#62 -RuboCop::Cop::Lint::Void::SELF_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#67 -RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/lint/void.rb#59 -RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String) - -# Common functionality for obtaining source ranges from regexp matches -# -# source://rubocop//lib/rubocop/cop/mixin/match_range.rb#6 -module RuboCop::Cop::MatchRange - include ::RuboCop::Cop::RangeHelp - - private - - # Return a new `Range` covering the first matching group number for each - # match of `regex` inside `range` - # - # source://rubocop//lib/rubocop/cop/mixin/match_range.rb#13 - def each_match_range(range, regex); end - - # For a `match` inside `range`, return a new `Range` covering the match - # - # source://rubocop//lib/rubocop/cop/mixin/match_range.rb#18 - def match_range(range, match); end -end - -# Message Annotator class annotates a basic offense message -# based on params passed into initializer. -# -# #=> 'Cop/CopName: message (http://example.org/styleguide)' -# -# @example -# RuboCop::Cop::MessageAnnotator.new( -# config, cop_name, cop_config, @options -# ).annotate('message') -# @see #initialize -# -# source://rubocop//lib/rubocop/cop/message_annotator.rb#15 -class RuboCop::Cop::MessageAnnotator - # @option cop_config - # @option cop_config - # @option cop_config - # @option options - # @option options - # @option options - # @option options - # @param config [RuboCop::Config] Check configs for all cops - # @note Message Annotator specifically checks the - # following config options for_all_cops - # :StyleGuideBaseURL [String] URL for styleguide - # :DisplayStyleGuide [Boolean] Include styleguide and reference URLs - # :ExtraDetails [Boolean] Include cop details - # :DisplayCopNames [Boolean] Include cop name - # @param cop_name [String] for specific cop name - # @param cop_config [Hash] configs for specific cop, from config#for_cop - # @param options [Hash, nil] optional - # @return [MessageAnnotator] a new instance of MessageAnnotator - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#47 - def initialize(config, cop_name, cop_config, options); end - - # Returns the annotated message, - # based on params passed into initializer - # - # @return [String] annotated message - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#58 - def annotate(message); end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 - def config; end - - # Returns the value of attribute cop_config. - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 - def cop_config; end - - # Returns the value of attribute cop_name. - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 - def cop_name; end - - # Returns the value of attribute options. - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 - def options; end - - # source://rubocop//lib/rubocop/cop/message_annotator.rb#68 - def urls; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#115 - def debug?; end - - # source://rubocop//lib/rubocop/cop/message_annotator.rb#128 - def details; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#119 - def display_cop_names?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#98 - def display_style_guide?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#111 - def extra_details?; end - - # source://rubocop//lib/rubocop/cop/message_annotator.rb#102 - def reference_urls; end - - # Returns the base style guide URL from AllCops or the specific department - # - # @return [String] style guide URL - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#91 - def style_guide_base_url; end - - # source://rubocop//lib/rubocop/cop/message_annotator.rb#74 - def style_guide_url; end - - class << self - # Returns the value of attribute style_guide_urls. - # - # source://rubocop//lib/rubocop/cop/message_annotator.rb#21 - def style_guide_urls; end - end -end - -# This module handles measurement and reporting of complexity in methods. -# -# @api private -# -# source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#8 -module RuboCop::Cop::MethodComplexity - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount - extend ::RuboCop::AST::NodePattern::Macros - extend ::RuboCop::ExcludeLimit - - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#38 - def define_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#24 - def on_block(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#17 - def on_def(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#17 - def on_defs(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#24 - def on_itblock(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#24 - def on_numblock(node); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#43 - def check_complexity(node, method_name); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#62 - def complexity(body); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#74 - def location(node); end -end - -# Common code for cops that deal with preferred methods. -# -# source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#6 -module RuboCop::Cop::MethodPreference - private - - # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#25 - def default_cop_config; end - - # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#9 - def preferred_method(method); end - - # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#13 - def preferred_methods; end -end - -# source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#5 -module RuboCop::Cop::Metrics; end - -# Checks that the ABC size of methods is not higher than the -# configured maximum. The ABC size is based on assignments, branches -# (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric -# and https://en.wikipedia.org/wiki/ABC_Software_Metric. -# -# Interpreting ABC size: -# -# * ``<= 17`` satisfactory -# * `18..30` unsatisfactory -# * `>` 30 dangerous -# -# You can have repeated "attributes" calls count as a single "branch". -# For this purpose, attributes are any method with no argument; no attempt -# is meant to distinguish actual `attr_reader` from other methods. -# -# This cop also takes into account `AllowedMethods` (defaults to `[]`) -# And `AllowedPatterns` (defaults to `[]`) -# -# @example CountRepeatedAttributes: false (default is true) -# -# # `model` and `current_user`, referenced 3 times each, -# # are each counted as only 1 branch each if -# # `CountRepeatedAttributes` is set to 'false' -# -# def search -# @posts = model.active.visible_by(current_user) -# .search(params[:q]) -# @posts = model.some_process(@posts, current_user) -# @posts = model.another_process(@posts, current_user) -# -# render 'pages/search/page' -# end -# -# source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#39 -class RuboCop::Cop::Metrics::AbcSize < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount - include ::RuboCop::Cop::MethodComplexity - - private - - # source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#47 - def complexity(node); end -end - -# source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#42 -RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) - -# Checks if the length of a block exceeds some maximum value. -# Comment lines can optionally be ignored. -# The maximum allowed length is configurable. -# The cop can be configured to ignore blocks passed to certain methods. -# -# You can set constructs you want to fold with `CountAsOne`. -# -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. -# Each construct will be counted as one line regardless of its actual size. -# -# NOTE: This cop does not apply for `Struct` definitions. -# -# NOTE: The `ExcludedMethods` configuration is deprecated and only kept -# for backwards compatibility. Please use `AllowedMethods` and `AllowedPatterns` -# instead. By default, there are no methods to allowed. -# -# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] -# -# something do -# array = [ # +1 -# 1, -# 2 -# ] -# -# hash = { # +1 -# key: 'value' -# } -# -# msg = <<~HEREDOC # +1 -# Heredoc -# content. -# HEREDOC -# -# foo( # +1 -# 1, -# 2 -# ) -# end # 4 points -# -# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#45 -class RuboCop::Cop::Metrics::BlockLength < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CodeLength - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - - # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#52 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#52 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#52 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#82 - def cop_label; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#64 - def method_receiver_excluded?(node); end -end - -# source://rubocop//lib/rubocop/cop/metrics/block_length.rb#50 -RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String) - -# Checks for excessive nesting of conditional and looping constructs. -# -# You can configure if blocks are considered using the `CountBlocks` and `CountModifierForms` -# options. When both are set to `false` (the default) blocks and modifier forms are not -# counted towards the nesting level. Set them to `true` to include these in the nesting level -# calculation as well. -# -# The maximum level of nesting allowed is configurable. -# -# source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#14 -class RuboCop::Cop::Metrics::BlockNesting < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#19 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#28 - def check_nesting_level(node, max, current_level); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#52 - def consider_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#62 - def count_blocks?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#44 - def count_if_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#66 - def count_modifier_forms?; end - - # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#58 - def message(max); end -end - -# source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#15 -RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array) - -# Checks if the length of a class exceeds some maximum value. -# Comment lines can optionally be ignored. -# The maximum allowed length is configurable. -# -# You can set constructs you want to fold with `CountAsOne`. -# -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. -# Each construct will be counted as one line regardless of its actual size. -# -# NOTE: This cop also applies for `Struct` definitions. -# -# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] -# -# class Foo -# ARRAY = [ # +1 -# 1, -# 2 -# ] -# -# HASH = { # +1 -# key: 'value' -# } -# -# MSG = <<~HEREDOC # +1 -# Heredoc -# content. -# HEREDOC -# -# foo( # +1 -# 1, -# 2 -# ) -# end # 4 points -# -# source://rubocop//lib/rubocop/cop/metrics/class_length.rb#40 -class RuboCop::Cop::Metrics::ClassLength < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CodeLength - - # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#53 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#43 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#47 - def on_sclass(node); end - - private - - # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#67 - def find_expression_within_parent(parent); end - - # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#63 - def message(length, max_length); end -end - -# Checks for literals with extremely many entries. This is indicative of -# configuration or data that may be better extracted somewhere else, like -# a database, fetched from an API, or read from a non-code file (CSV, -# JSON, YAML, etc.). -# -# @example -# # bad -# # Huge Array literal -# [1, 2, '...', 999_999_999] -# -# # bad -# # Huge Hash literal -# { 1 => 1, 2 => 2, '...' => '...', 999_999_999 => 999_999_999} -# -# # bad -# # Huge Set "literal" -# Set[1, 2, '...', 999_999_999] -# -# # good -# # Reasonably sized Array literal -# [1, 2, '...', 10] -# -# # good -# # Reading huge Array from external data source -# # File.readlines('numbers.txt', chomp: true).map!(&:to_i) -# -# # good -# # Reasonably sized Hash literal -# { 1 => 1, 2 => 2, '...' => '...', 10 => 10} -# -# # good -# # Reading huge Hash from external data source -# CSV.foreach('numbers.csv', headers: true).each_with_object({}) do |row, hash| -# hash[row["key"].to_i] = row["value"].to_i -# end -# -# # good -# # Reasonably sized Set "literal" -# Set[1, 2, '...', 10] -# -# # good -# # Reading huge Set from external data source -# SomeFramework.config_for(:something)[:numbers].to_set -# -# source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#50 -class RuboCop::Cop::Metrics::CollectionLiteralLength < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#60 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#60 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#65 - def on_index(node); end - - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#71 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#56 - def set_const?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#77 - def collection_threshold; end -end - -# source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#51 -RuboCop::Cop::Metrics::CollectionLiteralLength::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/metrics/collection_literal_length.rb#53 -RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks that the cyclomatic complexity of methods is not higher -# than the configured maximum. The cyclomatic complexity is the number of -# linearly independent paths through a method. The algorithm counts -# decision points and adds one. -# -# An if statement (or unless or ?:) increases the complexity by one. An -# else branch does not, since it doesn't add a decision point. The && -# operator (or keyword and) can be converted to a nested if statement, -# and ||/or is shorthand for a sequence of ifs, so they also add one. -# Loops can be said to have an exit condition, so they add one. -# Blocks that are calls to builtin iteration methods -# (e.g. `ary.map{...}`) also add one, others are ignored. -# -# @example -# -# def each_child_node(*types) # count begins: 1 -# unless block_given? # unless: +1 -# return to_enum(__method__, *types) -# end -# -# children.each do |child| # each{}: +1 -# next unless child.is_a?(Node) # unless: +1 -# -# yield child if types.empty? || # if: +1, ||: +1 -# types.include?(child.type) -# end -# -# self -# end # total: 6 -# -# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#35 -class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount - include ::RuboCop::Cop::MethodComplexity - include ::RuboCop::Cop::Metrics::Utils::IteratingBlock - - private - - # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#45 - def complexity_score_for(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#52 - def count_block?(block); end -end - -# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#40 -RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#39 -RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) - -# Checks if the length of a method exceeds some maximum value. -# Comment lines can optionally be allowed. -# The maximum allowed length is configurable. -# -# You can set constructs you want to fold with `CountAsOne`. -# -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. -# Each construct will be counted as one line regardless of its actual size. -# -# NOTE: The `ExcludedMethods` and `IgnoredMethods` configuration is -# deprecated and only kept for backwards compatibility. -# Please use `AllowedMethods` and `AllowedPatterns` instead. -# By default, there are no methods to allowed. -# -# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] -# -# def m -# array = [ # +1 -# 1, -# 2 -# ] -# -# hash = { # +1 -# key: 'value' -# } -# -# <<~HEREDOC # +1 -# Heredoc -# content. -# HEREDOC -# -# foo( # +1 -# 1, -# 2 -# ) -# end # 4 points -# -# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#43 -class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CodeLength - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#57 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#50 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#50 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#57 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#57 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#74 - def allowed?(method_name); end - - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#70 - def cop_label; end -end - -# source://rubocop//lib/rubocop/cop/metrics/method_length.rb#48 -RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) - -# Checks if the length of a module exceeds some maximum value. -# Comment lines can optionally be ignored. -# The maximum allowed length is configurable. -# -# You can set constructs you want to fold with `CountAsOne`. -# -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. -# Each construct will be counted as one line regardless of its actual size. -# -# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] -# -# module M -# ARRAY = [ # +1 -# 1, -# 2 -# ] -# -# HASH = { # +1 -# key: 'value' -# } -# -# MSG = <<~HEREDOC # +1 -# Heredoc -# content. -# HEREDOC -# -# foo( # +1 -# 1, -# 2 -# ) -# end # 4 points -# -# source://rubocop//lib/rubocop/cop/metrics/module_length.rb#38 -class RuboCop::Cop::Metrics::ModuleLength < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CodeLength - - # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#52 - def module_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#45 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#41 - def on_module(node); end - - private - - # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#56 - def message(length, max_length); end -end - -# Checks for methods with too many parameters. -# -# The maximum number of parameters is configurable. -# Keyword arguments can optionally be excluded from the total count, -# as they add less complexity than positional or optional parameters. -# -# Any number of arguments for `initialize` method inside a block of -# `Struct.new` and `Data.define` like this is always allowed: -# -# [source,ruby] -# ---- -# Struct.new(:one, :two, :three, :four, :five, keyword_init: true) do -# def initialize(one:, two:, three:, four:, five:) -# end -# end -# ---- -# -# This is because checking the number of arguments of the `initialize` method -# does not make sense. -# -# NOTE: Explicit block argument `&block` is not counted to prevent -# erroneous change that is avoided by making block argument implicit. -# -# This cop also checks for the maximum number of optional parameters. -# This can be configured using the `MaxOptionalParameters` config option. -# -# @example Max: 3 -# # good -# def foo(a, b, c = 1) -# end -# @example Max: 2 -# # bad -# def foo(a, b, c = 1) -# end -# @example CountKeywordArgs: true (default) -# # counts keyword args towards the maximum -# -# # bad (assuming Max is 3) -# def foo(a, b, c, d: 1) -# end -# -# # good (assuming Max is 3) -# def foo(a, b, c: 1) -# end -# @example CountKeywordArgs: false -# # don't count keyword args towards the maximum -# -# # good (assuming Max is 3) -# def foo(a, b, c, d: 1) -# end -# @example MaxOptionalParameters: 3 (default) -# # good -# def foo(a = 1, b = 2, c = 3) -# end -# @example MaxOptionalParameters: 2 -# # bad -# def foo(a = 1, b = 2, c = 3) -# end -# -# source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#70 -class RuboCop::Cop::Metrics::ParameterLists < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#121 - def argument_to_lambda_or_proc?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max_optional_parameters=(value); end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#104 - def on_args(node); end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#90 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#90 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#81 - def struct_new_or_data_define_block?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#125 - def args_count(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#141 - def count_keyword_args?; end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#137 - def max_optional_parameters; end - - # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#133 - def max_params; end -end - -# source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#74 -RuboCop::Cop::Metrics::ParameterLists::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#77 -RuboCop::Cop::Metrics::ParameterLists::NAMED_KEYWORD_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#75 -RuboCop::Cop::Metrics::ParameterLists::OPTIONAL_PARAMETERS_MSG = T.let(T.unsafe(nil), String) - -# Tries to produce a complexity score that's a measure of the -# complexity the reader experiences when looking at a method. For that -# reason it considers `when` nodes as something that doesn't add as much -# complexity as an `if` or a `&&`. Except if it's one of those special -# `case`/`when` constructs where there's no expression after `case`. Then -# the cop treats it as an `if`/`elsif`/`elsif`... and lets all the `when` -# nodes count. In contrast to the CyclomaticComplexity cop, this cop -# considers `else` nodes as adding complexity. -# -# @example -# -# def my_method # 1 -# if cond # 1 -# case var # 2 (0.8 + 4 * 0.2, rounded) -# when 1 then func_one -# when 2 then func_two -# when 3 then func_three -# when 4..10 then func_other -# end -# else # 1 -# do_something until a && b # 2 -# end # === -# end # 7 complexity points -# -# source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#29 -class RuboCop::Cop::Metrics::PerceivedComplexity < ::RuboCop::Cop::Metrics::CyclomaticComplexity - private - - # source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#36 - def complexity_score_for(node); end -end - -# source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#32 -RuboCop::Cop::Metrics::PerceivedComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#30 -RuboCop::Cop::Metrics::PerceivedComplexity::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#6 -module RuboCop::Cop::Metrics::Utils; end - -# > ABC is .. a software size metric .. computed by counting the number -# > of assignments, branches and conditions for a section of code. -# > http://c2.com/cgi/wiki?AbcMetric -# -# We separate the *calculator* from the *cop* so that the calculation, -# the formula itself, is easier to test. -# -# source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#13 -class RuboCop::Cop::Metrics::Utils::AbcSizeCalculator - include ::RuboCop::AST::Sexp - include ::RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount - include ::RuboCop::Cop::Metrics::Utils::IteratingBlock - include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount - - # @return [AbcSizeCalculator] a new instance of AbcSizeCalculator - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#37 - def initialize(node, discount_repeated_attributes: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#42 - def calculate; end - - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#60 - def calculate_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#65 - def else_branch?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#54 - def evaluate_branch_nodes(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#60 - def evaluate_condition_node(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#127 - def argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#86 - def assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#123 - def branch?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#119 - def capturing_variable?(name); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#95 - def compound_assignment(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#131 - def condition?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#108 - def simple_assignment?(node); end - - # @yield [node] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#71 - def visit_depth_last(node, &block); end - - class << self - # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#30 - def calculate(node, discount_repeated_attributes: T.unsafe(nil)); end - end -end - -# > Branch -- an explicit forward program branch out of scope -- a -# > function call, class method call .. -# > http://c2.com/cgi/wiki?AbcMetric -# -# source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#21 -RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::BRANCH_NODES = T.let(T.unsafe(nil), Array) - -# > Condition -- a logical/Boolean test, == != <= >= < > else case -# > default try catch ? and unary conditionals. -# > http://c2.com/cgi/wiki?AbcMetric -# -# source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#26 -RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::CONDITION_NODES = T.let(T.unsafe(nil), Array) - -# Helps to calculate code length for the provided node. -# -# source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#8 -class RuboCop::Cop::Metrics::Utils::CodeLengthCalculator - include ::RuboCop::PathUtil - include ::RuboCop::Cop::Util - extend ::RuboCop::AST::NodePattern::Macros - - # @return [CodeLengthCalculator] a new instance of CodeLengthCalculator - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#16 - def initialize(node, processed_source, count_comments: T.unsafe(nil), foldable_types: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#24 - def calculate; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#181 - def another_args?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#42 - def build_foldable_checks(types); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#90 - def classlike_code_length(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#138 - def classlike_node?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#66 - def code_length(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#162 - def count_comments?; end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#126 - def each_top_level_descendant(node, types, &block); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#146 - def extract_body(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#142 - def foldable_node?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#121 - def heredoc_length(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#86 - def heredoc_node?(node); end - - # Returns true for lines that shall not be included in the count. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#158 - def irrelevant_line?(source_line); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#110 - def line_numbers_of_inner_nodes(node, *types); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#106 - def namespace_module?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#185 - def node_with_heredoc?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#60 - def normalize_foldable_types(types); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#166 - def omit_length(descendant); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#177 - def parenthesized?(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#189 - def source_from_node_with_heredoc(node); end -end - -# source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#13 -RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::CLASSLIKE_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#12 -RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::FOLDABLE_TYPES = T.let(T.unsafe(nil), Array) - -# Used to identify iterating blocks like `.map{}` and `.map(&:...)` -# -# source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#8 -module RuboCop::Cop::Metrics::Utils::IteratingBlock - # Returns the name of the method called with a block - # if node is a block node, or a block-pass node. - # - # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#37 - def block_method_name(node); end - - # Returns nil if node is neither a block node or a block-pass node. - # Otherwise returns true/false if method call is a known iterating call - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#53 - def iterating_block?(node); end - - # Returns true iff name is a known iterating type (e.g. :each, :transform_values) - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#47 - def iterating_method?(name); end -end - -# source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#33 -RuboCop::Cop::Metrics::Utils::IteratingBlock::KNOWN_ITERATING_METHODS = T.let(T.unsafe(nil), Set) - -# Identifies repetitions `{c}send` calls with no arguments: -# -# foo.bar -# foo.bar # => repeated -# foo.bar.baz.qux # => inner send repeated -# foo.bar.baz.other # => both inner send repeated -# foo.bar(2) # => not repeated -# -# It also invalidates sequences if a receiver is reassigned: -# -# xx.foo.bar -# xx.foo.baz # => inner send repeated -# self.xx = any # => invalidates everything so far -# xx.foo.baz # => no repetition -# self.xx.foo.baz # => all repeated -# -# @api private -# -# source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#25 -module RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount - include ::RuboCop::AST::Sexp - extend ::RuboCop::AST::NodePattern::Macros - - # Plug into the calculator - # - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#37 - def initialize(node, discount_repeated_attributes: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#68 - def attribute_call?(param0 = T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#60 - def calculate_node(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#50 - def discount_repeated_attributes?; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#54 - def evaluate_branch_nodes(node); end - - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#99 - def root_node?(param0 = T.unsafe(nil)); end - - private - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#73 - def discount_repeated_attribute?(send_node); end - - # Returns the "known_attributes" for the `node` by walking the receiver tree - # If at any step the subdirectory does not exist, it is yielded with the - # associated key (method_name) - # If the node is not a series of `(c)send` calls with no arguments, - # then `nil` is yielded - # - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#110 - def find_attributes(node, &block); end - - # or `nil` if it is not a setter. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#126 - def setter_to_getter(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#87 - def update_repeated_attribute(node); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb#29 -RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount::VAR_SETTER_TO_GETTER = T.let(T.unsafe(nil), Hash) - -# Identifies repetitions `&.` on the same variable: -# -# my_var&.foo -# my_var&.bar # => repeated -# my_var = baz # => reset -# my_var&.qux # => not repeated -# -# @api private -# -# source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#15 -module RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#20 - def discount_for_repeated_csend?(csend_node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#34 - def reset_on_lvasgn(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#16 - def reset_repeated_csend; end -end - -# source://rubocop//lib/rubocop/cop/migration/department_name.rb#5 -module RuboCop::Cop::Migration; end - -# department name. -# -# source://rubocop//lib/rubocop/cop/migration/department_name.rb#8 -class RuboCop::Cop::Migration::DepartmentName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#21 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#47 - def check_cop_name(name, comment, offset); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#69 - def contain_unexpected_character_for_department_name?(name); end - - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#43 - def disable_comment_offset; end - - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#73 - def qualified_legacy_cop_name(cop_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/migration/department_name.rb#63 - def valid_content_token?(content_token); end -end - -# source://rubocop//lib/rubocop/cop/migration/department_name.rb#14 -RuboCop::Cop::Migration::DepartmentName::DISABLE_COMMENT_FORMAT = T.let(T.unsafe(nil), Regexp) - -# The token that makes up a disable comment. -# `DepartmentName/CopName` or` all`. -# -# source://rubocop//lib/rubocop/cop/migration/department_name.rb#19 -RuboCop::Cop::Migration::DepartmentName::DISABLING_COPS_CONTENT_TOKEN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/migration/department_name.rb#12 -RuboCop::Cop::Migration::DepartmentName::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for checking minimum body length. -# -# source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#6 -module RuboCop::Cop::MinBodyLength - private - - # source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#13 - def min_body_length; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#9 - def min_body_length?(node); end -end - -# Common functionality for checking minimum branches count. -# -# source://rubocop//lib/rubocop/cop/mixin/min_branches_count.rb#6 -module RuboCop::Cop::MinBranchesCount - private - - # source://rubocop//lib/rubocop/cop/mixin/min_branches_count.rb#29 - def if_conditional_branches(node, branches = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/min_branches_count.rb#22 - def min_branches_count; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/min_branches_count.rb#9 - def min_branches_count?(node); end -end - -# Common code for indenting the first elements in multiline -# array literals, hash literals, and method definitions. -# -# source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#7 -module RuboCop::Cop::MultilineElementIndentation - private - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#42 - def check_expected_style(styles); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#26 - def check_first(first, left_brace, left_parenthesis, offset); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#80 - def detected_styles(actual_column, offset, left_parenthesis, left_brace); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#85 - def detected_styles_for_column(column, left_parenthesis, left_brace); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#10 - def each_argument_node(node, type); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#66 - def hash_pair_where_value_beginning_with(left_brace, first); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#98 - def incorrect_style_detected(styles, first, base_column_type); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#50 - def indent_base(left_brace, first, left_parenthesis); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#72 - def key_and_value_begin_on_same_line?(pair); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#76 - def right_sibling_begins_on_subsequent_line?(pair); end -end - -# Common functionality for checking for a line break before each -# element in a multi-line collection. -# -# source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#7 -module RuboCop::Cop::MultilineElementLineBreaks - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#23 - def all_on_same_line?(nodes, ignore_last: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#10 - def check_line_breaks(_node, children, ignore_last: T.unsafe(nil)); end -end - -# Common functionality for checking multiline method calls and binary -# operations. -# -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#7 -module RuboCop::Cop::MultilineExpressionIndentation - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#14 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#14 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#132 - def argument_in_method_call(node, kind); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#188 - def assignment_rhs(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#67 - def check(range, node, lhs, rhs); end - - # The correct indentation of `node` is usually `IndentationWidth`, with - # one exception: prefix keywords. - # - # ``` - # while foo && # Here, `while` is called a "prefix keyword" - # bar # This is called "special indentation" - # baz - # end - # ``` - # - # Note that *postfix conditionals* do *not* get "special indentation". - # - # ``` - # next if foo && - # bar # normal indentation, not special - # ``` - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#57 - def correct_indentation(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#160 - def disqualified_rhs?(candidate, ancestor); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#202 - def grouped_expression?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#75 - def incorrect_style_detected(range, node, lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#87 - def indentation(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#124 - def indented_keyword_expression(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#206 - def inside_arg_list_parentheses?(node, ancestor); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#101 - def keyword_message_tail(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#109 - def kw_node_with_special_indentation(node); end - - # In a chain of method calls, we regard the top call node as the base - # for indentation of all lines following the first. For example: - # a. - # b c { block }. <-- b is indented relative to a - # d <-- d is indented relative to a - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#34 - def left_hand_side(lhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#196 - def not_for_this_cop?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#91 - def operation_description(node, rhs); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#146 - def part_of_assignment_rhs(node, candidate); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#184 - def part_of_block_body?(candidate, block_node); end - - # Returns true if `node` is a conditional whose `body` and `condition` - # begin on the same line. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#215 - def postfix_conditional?(node); end - - # The []= operator and setters (a.b = c) are parsed as :send nodes. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#176 - def valid_method_rhs_candidate?(candidate, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#165 - def valid_rhs?(candidate, ancestor); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#180 - def valid_rhs_candidate?(candidate, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#219 - def within_node?(inner, outer); end -end - -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#11 -RuboCop::Cop::MultilineExpressionIndentation::ASSIGNMENT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#10 -RuboCop::Cop::MultilineExpressionIndentation::DEFAULT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#8 -RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#12 -RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_MESSAGE_TAIL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#9 -RuboCop::Cop::MultilineExpressionIndentation::UNALIGNED_RHS_TYPES = T.let(T.unsafe(nil), Array) - -# Autocorrection logic for the closing brace of a literal either -# on the same line as the last contained elements, or a new line. -# -# source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#7 -class RuboCop::Cop::MultilineLiteralBraceCorrector - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MultilineLiteralBraceLayout - include ::RuboCop::Cop::RangeHelp - - # @return [MultilineLiteralBraceCorrector] a new instance of MultilineLiteralBraceCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#15 - def initialize(corrector, node, processed_source); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#21 - def call; end - - private - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#61 - def content_if_comment_present(corrector, node); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#51 - def correct_heredoc_argument_method_chain(corrector, end_range); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#46 - def correct_next_line_brace(corrector, end_range); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#42 - def correct_same_line_brace(corrector); end - - # Returns the value of attribute corrector. - # - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#40 - def corrector; end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#94 - def last_element_range_with_trailing_comma(node); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#103 - def last_element_trailing_comma_range(node); end - - # Returns the value of attribute node. - # - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#40 - def node; end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#40 - def processed_source; end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#90 - def remove_trailing_content_of_comment(corrector, range); end - - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#80 - def select_content_to_be_inserted_after_last_element(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#73 - def use_heredoc_argument_method_chain?(parent); end - - class << self - # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#11 - def correct(corrector, node, processed_source); end - end -end - -# Common functionality for checking the closing brace of a literal is -# either on the same line as the last contained elements or a new line. -# -# source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#7 -module RuboCop::Cop::MultilineLiteralBraceLayout - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - private - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#34 - def check(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#12 - def check_brace_layout(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#42 - def check_new_line(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#50 - def check_same_line(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#58 - def check_symmetrical(node); end - - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#86 - def children(node); end - - # This method depends on the fact that we have guarded - # against implicit and empty literals. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#98 - def closing_brace_on_same_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#74 - def empty_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#82 - def ignored_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#78 - def implicit_literal?(node); end - - # Starting with the parent node and recursively for the parent node's - # children, check if the node is a HEREDOC and if the HEREDOC ends below - # or on the last line of the parent node. - # - # Example: - # - # # node is `b: ...` parameter - # # last_line_heredoc?(node) => false - # foo(a, - # b: { - # a: 1, - # c: <<-EOM - # baz - # EOM - # } - # ) - # - # # node is `b: ...` parameter - # # last_line_heredoc?(node) => true - # foo(a, - # b: <<-EOM - # baz - # EOM - # ) - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#126 - def last_line_heredoc?(node, parent = T.unsafe(nil)); end - - # Returns true for the case - # [a, - # b # comment - # ].some_method - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#26 - def new_line_needed_before_closing_brace?(node); end - - # This method depends on the fact that we have guarded - # against implicit and empty literals. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#92 - def opening_brace_on_same_line?(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#5 -module RuboCop::Cop::Naming; end - -# Avoid prefixing accessor method names with `get_` or `set_`. -# Applies to both instance and class methods. -# -# NOTE: Method names starting with `get_` or `set_` only register an offense -# when the methods match the expected arity for getters and setters respectively. -# Getters (`get_attribute`) must have no arguments to be registered, -# and setters (`set_attribute(value)`) must have exactly one. -# -# @example -# # bad -# def set_attribute(value) -# end -# -# # good -# def attribute=(value) -# end -# -# # bad -# def get_attribute -# end -# -# # good -# def attribute -# end -# -# # accepted, incorrect arity for getter -# def get_value(attr) -# end -# -# # accepted, incorrect arity for setter -# def set_value -# end -# -# source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#38 -class RuboCop::Cop::Naming::AccessorMethodName < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#42 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#42 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#66 - def bad_reader_name?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#70 - def bad_writer_name?(node); end - - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#54 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#62 - def proper_attribute_name?(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#39 -RuboCop::Cop::Naming::AccessorMethodName::MSG_READER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#40 -RuboCop::Cop::Naming::AccessorMethodName::MSG_WRITER = T.let(T.unsafe(nil), String) - -# Checks for non-ascii characters in identifier and constant names. -# Identifiers are always checked and whether constants are checked -# can be controlled using AsciiConstants config. -# -# @example -# # bad -# def καλημερα # Greek alphabet (non-ascii) -# end -# -# # bad -# def こんにちはと言う # Japanese character (non-ascii) -# end -# -# # bad -# def hello_🍣 # Emoji (non-ascii) -# end -# -# # good -# def say_hello -# end -# -# # bad -# 신장 = 10 # Hangul character (non-ascii) -# -# # good -# height = 10 -# -# # bad -# params[:عرض_gteq] # Arabic character (non-ascii) -# -# # good -# params[:width_gteq] -# @example AsciiConstants: true (default) -# # bad -# class Foö -# end -# -# FOÖ = "foo" -# @example AsciiConstants: false -# # good -# class Foö -# end -# -# FOÖ = "foo" -# -# source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#53 -class RuboCop::Cop::Naming::AsciiIdentifiers < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#59 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#84 - def first_non_ascii_chars(string); end - - # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#74 - def first_offense_range(identifier); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#70 - def should_check?(token); end -end - -# source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#57 -RuboCop::Cop::Naming::AsciiIdentifiers::CONSTANT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#56 -RuboCop::Cop::Naming::AsciiIdentifiers::IDENTIFIER_MSG = T.let(T.unsafe(nil), String) - -# Makes sure that certain binary operator methods have their -# sole parameter named `other`. -# -# @example -# -# # bad -# def +(amount); end -# -# # good -# def +(other); end -# -# source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#16 -class RuboCop::Cop::Naming::BinaryOperatorParameterName < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#29 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#25 - def op_method_candidate?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#45 - def op_method?(name); end -end - -# source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#22 -RuboCop::Cop::Naming::BinaryOperatorParameterName::EXCLUDED = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#19 -RuboCop::Cop::Naming::BinaryOperatorParameterName::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#21 -RuboCop::Cop::Naming::BinaryOperatorParameterName::OP_LIKE_METHODS = T.let(T.unsafe(nil), Array) - -# In Ruby 3.1, anonymous block forwarding has been added. -# -# This cop identifies places where `do_something(&block)` can be replaced -# by `do_something(&)`. -# -# It also supports the opposite style by alternative `explicit` option. -# You can specify the block variable name for autocorrection with `BlockForwardingName`. -# The default variable name is `block`. If the name is already in use, it will not be -# autocorrected. -# -# [NOTE] -# ==== -# Because of a bug in Ruby 3.3.0, when a block is referenced inside of another block, -# no offense will be registered until Ruby 3.4: -# -# [source,ruby] -# ---- -# def foo(&block) -# # Using an anonymous block would be a syntax error on Ruby 3.3.0 -# block_method { bar(&block) } -# end -# ---- -# ==== -# -# @example EnforcedStyle: anonymous (default) -# -# # bad -# def foo(&block) -# bar(&block) -# end -# -# # good -# def foo(&) -# bar(&) -# end -# @example EnforcedStyle: explicit -# -# # bad -# def foo(&) -# bar(&) -# end -# -# # good -# def foo(&block) -# bar(&block) -# end -# -# source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#54 -class RuboCop::Cop::Naming::BlockForwarding < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#68 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#68 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#118 - def anonymous_block_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#101 - def block_argument_name_matched?(block_pass_node, last_argument); end - - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#150 - def block_forwarding_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#91 - def expected_block_forwarding_style?(node, last_argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#122 - def explicit_block_argument?(node); end - - # Ruby 3.3.0 had a bug where accessing an anonymous block argument inside of a block - # was a syntax error in unambiguous cases: https://bugs.ruby-lang.org/issues/20090 - # We disallow this also for earlier Ruby versions so that code is forwards compatible. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#110 - def invalidates_syntax?(block_pass_node); end - - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#126 - def register_offense(block_argument, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#142 - def use_block_argument_as_local_variable?(node, last_argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#114 - def use_kwarg_in_method_definition?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#64 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#62 -RuboCop::Cop::Naming::BlockForwarding::MSG = T.let(T.unsafe(nil), String) - -# Checks block parameter names for how descriptive they -# are. It is highly configurable. -# -# The `MinNameLength` config option takes an integer. It represents -# the minimum amount of characters the name must be. Its default is 1. -# The `AllowNamesEndingInNumbers` config option takes a boolean. When -# set to false, this cop will register offenses for names ending with -# numbers. Its default is false. The `AllowedNames` config option -# takes an array of permitted names that will never register an -# offense. The `ForbiddenNames` config option takes an array of -# restricted names that will always register an offense. -# -# @example -# # bad -# bar do |varOne, varTwo| -# varOne + varTwo -# end -# -# # With `AllowNamesEndingInNumbers` set to false -# foo { |num1, num2| num1 * num2 } -# -# # With `MinNameLength` set to number greater than 1 -# baz { |a, b, c| do_stuff(a, b, c) } -# -# # good -# bar do |thud, fred| -# thud + fred -# end -# -# foo { |speed, distance| speed * distance } -# -# baz { |age, height, gender| do_stuff(age, height, gender) } -# -# source://rubocop//lib/rubocop/cop/naming/block_parameter_name.rb#38 -class RuboCop::Cop::Naming::BlockParameterName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::UncommunicativeName - - # source://rubocop//lib/rubocop/cop/naming/block_parameter_name.rb#41 - def on_block(node); end -end - -# Checks for class and module names with -# an underscore in them. -# -# `AllowedNames` config takes an array of permitted names. -# Its default value is `['module_parent']`. -# These names can be full class/module names or part of the name. -# eg. Adding `my_class` to the `AllowedNames` config will allow names like -# `my_class`, `my_class::User`, `App::my_class`, `App::my_class::User`, etc. -# -# @example -# # bad -# class My_Class -# end -# module My_Module -# end -# -# # good -# class MyClass -# end -# module MyModule -# end -# class module_parent::MyModule -# end -# -# source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#29 -class RuboCop::Cop::Naming::ClassAndModuleCamelCase < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#32 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#32 - def on_module(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#30 -RuboCop::Cop::Naming::ClassAndModuleCamelCase::MSG = T.let(T.unsafe(nil), String) - -# Checks whether constant names are written using -# SCREAMING_SNAKE_CASE. -# -# To avoid false positives, it ignores cases in which we cannot know -# for certain the type of value that would be assigned to a constant. -# -# @example -# # bad -# InchInCm = 2.54 -# INCHinCM = 2.54 -# Inch_In_Cm = 2.54 -# -# # good -# INCH_IN_CM = 2.54 -# -# source://rubocop//lib/rubocop/cop/naming/constant_name.rb#20 -class RuboCop::Cop::Naming::ConstantName < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#27 - def class_or_struct_return_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#67 - def literal_receiver?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#33 - def on_casgn(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#55 - def allowed_assignment?(value); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#72 - def allowed_conditional_expression_on_rhs?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#62 - def allowed_method_call_on_rhs?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#76 - def contains_constant?(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/constant_name.rb#21 -RuboCop::Cop::Naming::ConstantName::MSG = T.let(T.unsafe(nil), String) - -# Use POSIX character classes, so we allow accented characters rather -# than just standard ASCII characters -# -# source://rubocop//lib/rubocop/cop/naming/constant_name.rb#24 -RuboCop::Cop::Naming::ConstantName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) - -# Makes sure that Ruby source files have snake_case -# names. Ruby scripts (i.e. source files with a shebang in the -# first line) are ignored. -# -# The cop also ignores `.gemspec` files, because Bundler -# recommends using dashes to separate namespaces in nested gems -# (i.e. `bundler-console` becomes `Bundler::Console`). As such, the -# gemspec is supposed to be named `bundler-console.gemspec`. -# -# When `ExpectMatchingDefinition` (default: `false`) is `true`, the cop requires -# each file to have a class, module or `Struct` defined in it that matches -# the filename. This can be further configured using -# `CheckDefinitionPathHierarchy` (default: `true`) to determine whether the -# path should match the namespace of the above definition. -# -# When `IgnoreExecutableScripts` (default: `true`) is `true`, files that start -# with a shebang line are not considered by the cop. -# -# When `Regex` is set, the cop will flag any filename that does not match -# the regular expression. -# -# @example -# # bad -# lib/layoutManager.rb -# -# anything/usingCamelCase -# -# # good -# lib/layout_manager.rb -# -# anything/using_snake_case.rake -# -# source://rubocop//lib/rubocop/cop/naming/file_name.rb#39 -class RuboCop::Cop::Naming::FileName < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#54 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#47 - def struct_definition(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#132 - def allowed_acronyms; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#94 - def bad_filename_allowed?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#120 - def check_definition_path_hierarchy?; end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#167 - def defined_struct(node); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#124 - def definition_path_hierarchy_roots; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#116 - def expect_matching_definition?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#136 - def filename_good?(basename); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#145 - def find_class_or_module(node, namespace); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#163 - def find_definition(node); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#63 - def for_bad_filename(file_path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#112 - def ignore_executable_scripts?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#200 - def match?(expected); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#204 - def match_acronym?(expected, name); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#172 - def match_namespace(node, namespace, expected); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#90 - def matching_class?(file_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#86 - def matching_definition?(file_path); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#98 - def no_definition_message(basename, file_path); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#104 - def other_message(basename); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#186 - def partial_matcher!(expected); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#75 - def perform_class_and_module_naming_checks(file_path, basename); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#128 - def regex; end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#238 - def to_module_name(basename); end - - # source://rubocop//lib/rubocop/cop/naming/file_name.rb#211 - def to_namespace(path); end -end - -# source://rubocop//lib/rubocop/cop/naming/file_name.rb#41 -RuboCop::Cop::Naming::FileName::MSG_NO_DEFINITION = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/file_name.rb#42 -RuboCop::Cop::Naming::FileName::MSG_REGEX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/file_name.rb#40 -RuboCop::Cop::Naming::FileName::MSG_SNAKE_CASE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/file_name.rb#44 -RuboCop::Cop::Naming::FileName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) - -# Checks that your heredocs are using the configured case. -# By default it is configured to enforce uppercase heredocs. -# -# @example EnforcedStyle: uppercase (default) -# # bad -# <<-sql -# SELECT * FROM foo -# sql -# -# # good -# <<-SQL -# SELECT * FROM foo -# SQL -# @example EnforcedStyle: lowercase -# # bad -# <<-SQL -# SELECT * FROM foo -# SQL -# -# # good -# <<-sql -# SELECT * FROM foo -# sql -# -# source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#30 -class RuboCop::Cop::Naming::HeredocDelimiterCase < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Heredoc - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#37 - def on_heredoc(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#54 - def correct_case_delimiters?(node); end - - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#58 - def correct_delimiters(source); end - - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#50 - def message(_node); end -end - -# source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#35 -RuboCop::Cop::Naming::HeredocDelimiterCase::MSG = T.let(T.unsafe(nil), String) - -# Checks that your heredocs are using meaningful delimiters. -# By default it disallows `END` and `EO*`, and can be configured through -# forbidden listing additional delimiters. -# -# @example -# -# # good -# <<-SQL -# SELECT * FROM foo -# SQL -# -# # bad -# <<-END -# SELECT * FROM foo -# END -# -# # bad -# <<-EOS -# SELECT * FROM foo -# EOS -# -# source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#26 -class RuboCop::Cop::Naming::HeredocDelimiterNaming < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Heredoc - - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#31 - def on_heredoc(node); end - - private - - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#51 - def forbidden_delimiters; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#41 - def meaningful_delimiters?(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#29 -RuboCop::Cop::Naming::HeredocDelimiterNaming::MSG = T.let(T.unsafe(nil), String) - -# Recommends the use of inclusive language instead of problematic terms. -# The cop can check the following locations for offenses: -# -# - identifiers -# - constants -# - variables -# - strings -# - symbols -# - comments -# - file paths -# -# Each of these locations can be individually enabled/disabled via configuration, -# for example CheckIdentifiers = true/false. -# -# Flagged terms are configurable for the cop. For each flagged term an optional -# Regex can be specified to identify offenses. Suggestions for replacing a flagged term can -# be configured and will be displayed as part of the offense message. -# An AllowedRegex can be specified for a flagged term to exempt allowed uses of the term. -# `WholeWord: true` can be set on a flagged term to indicate the cop should only match when -# a term matches the whole word (partial matches will not be offenses). -# -# The cop supports autocorrection when there is only one suggestion. When there are multiple -# suggestions, the best suggestion cannot be identified and will not be autocorrected. -# -# @example FlaggedTerms: { whitelist: { Suggestions: ['allowlist'] } } -# # Suggest replacing identifier whitelist with allowlist -# -# # bad -# whitelist_users = %w(user1 user1) -# -# # good -# allowlist_users = %w(user1 user2) -# @example FlaggedTerms: { master: { Suggestions: ['main', 'primary', 'leader'] } } -# # Suggest replacing master in an instance variable name with main, primary, or leader -# -# # bad -# @master_node = 'node1.example.com' -# -# # good -# @primary_node = 'node1.example.com' -# @example FlaggedTerms: { whitelist: { Regex: !ruby/regexp '/white[-_\s]?list' } } -# # Identify problematic terms using a Regexp -# -# # bad -# white_list = %w(user1 user2) -# -# # good -# allow_list = %w(user1 user2) -# @example FlaggedTerms: { master: { AllowedRegex: 'master\'?s degree' } } -# # Specify allowed uses of the flagged term as a string or regexp. -# -# # bad -# # They had a masters -# -# # good -# # They had a master's degree -# @example FlaggedTerms: { slave: { WholeWord: true } } -# # Specify that only terms that are full matches will be flagged. -# -# # bad -# Slave -# -# # good (won't be flagged despite containing `slave`) -# TeslaVehicle -# -# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#74 -class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # @return [InclusiveLanguage] a new instance of InclusiveLanguage - # - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#84 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#93 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#111 - def add_offenses_for_token(token, word_locations); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#176 - def add_to_flagged_term_hash(regex_string, term, term_definition); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#202 - def array_to_ignorecase_regex(strings); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#126 - def check_token?(type); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#252 - def create_message(word, message = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#226 - def create_multiple_word_message_for_file(words); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#222 - def create_single_word_message_for_file(word); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#198 - def ensure_regex_string(regex); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#169 - def extract_regexp(term, term_definition); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#260 - def find_flagged_term(word); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#274 - def format_suggestions(suggestions); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#206 - def investigate_filepath; end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#100 - def investigate_tokens; end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#240 - def mask_input(str); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#289 - def offense_range(token, word); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#160 - def preferred_sole_term(suggestions); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#130 - def preprocess_check_config; end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#144 - def preprocess_flagged_terms; end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#267 - def preprocess_suggestions(suggestions); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#188 - def process_allowed_regex(allowed); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#230 - def scan_for_words(input); end - - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#183 - def set_regexes(flagged_term_strings, allowed_strings); end -end - -# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#78 -RuboCop::Cop::Naming::InclusiveLanguage::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#79 -RuboCop::Cop::Naming::InclusiveLanguage::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#80 -RuboCop::Cop::Naming::InclusiveLanguage::MSG_FOR_FILE_PATH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#82 -class RuboCop::Cop::Naming::InclusiveLanguage::WordLocation < ::Struct - # Returns the value of attribute position - # - # @return [Object] the current value of position - def position; end - - # Sets the attribute position - # - # @param value [Object] the value to set the attribute position to. - # @return [Object] the newly set value - def position=(_); end - - # Returns the value of attribute word - # - # @return [Object] the current value of word - def word; end - - # Sets the attribute word - # - # @param value [Object] the value to set the attribute word to. - # @return [Object] the newly set value - def word=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Checks for memoized methods whose instance variable name -# does not match the method name. Applies to both regular methods -# (defined with `def`) and dynamic methods (defined with -# `define_method` or `define_singleton_method`). -# -# This cop can be configured with the EnforcedStyleForLeadingUnderscores -# directive. It can be configured to allow for memoized instance variables -# prefixed with an underscore. Prefixing ivars with an underscore is a -# convention that is used to implicitly indicate that an ivar should not -# be set or referenced outside of the memoization method. -# -# @example EnforcedStyleForLeadingUnderscores: disallowed (default) -# # bad -# # Method foo is memoized using an instance variable that is -# # not `@foo`. This can cause confusion and bugs. -# def foo -# @something ||= calculate_expensive_thing -# end -# -# def foo -# return @something if defined?(@something) -# @something = calculate_expensive_thing -# end -# -# # good -# def _foo -# @foo ||= calculate_expensive_thing -# end -# -# # good -# def foo -# @foo ||= calculate_expensive_thing -# end -# -# # good -# def foo -# @foo ||= begin -# calculate_expensive_thing -# end -# end -# -# # good -# def foo -# helper_variable = something_we_need_to_calculate_foo -# @foo ||= calculate_expensive_thing(helper_variable) -# end -# -# # good -# define_method(:foo) do -# @foo ||= calculate_expensive_thing -# end -# -# # good -# define_method(:foo) do -# return @foo if defined?(@foo) -# @foo = calculate_expensive_thing -# end -# @example EnforcedStyleForLeadingUnderscores: required -# # bad -# def foo -# @something ||= calculate_expensive_thing -# end -# -# # bad -# def foo -# @foo ||= calculate_expensive_thing -# end -# -# def foo -# return @foo if defined?(@foo) -# @foo = calculate_expensive_thing -# end -# -# # good -# def foo -# @_foo ||= calculate_expensive_thing -# end -# -# # good -# def _foo -# @_foo ||= calculate_expensive_thing -# end -# -# def foo -# return @_foo if defined?(@_foo) -# @_foo = calculate_expensive_thing -# end -# -# # good -# define_method(:foo) do -# @_foo ||= calculate_expensive_thing -# end -# -# # good -# define_method(:foo) do -# return @_foo if defined?(@_foo) -# @_foo = calculate_expensive_thing -# end -# @example EnforcedStyleForLeadingUnderscores :optional -# # bad -# def foo -# @something ||= calculate_expensive_thing -# end -# -# # good -# def foo -# @foo ||= calculate_expensive_thing -# end -# -# # good -# def foo -# @_foo ||= calculate_expensive_thing -# end -# -# # good -# def _foo -# @_foo ||= calculate_expensive_thing -# end -# -# # good -# def foo -# return @_foo if defined?(@_foo) -# @_foo = calculate_expensive_thing -# end -# -# # good -# define_method(:foo) do -# @foo ||= calculate_expensive_thing -# end -# -# # good -# define_method(:foo) do -# @_foo ||= calculate_expensive_thing -# end -# -# source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#148 -class RuboCop::Cop::Naming::MemoizedInstanceVariableName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#198 - def defined_memoized?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#161 - def method_definition?(param0 = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#206 - def on_defined?(node); end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#171 - def on_or_asgn(node); end - - private - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#242 - def find_definition(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#253 - def matches?(method_name, ivar_assign); end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#262 - def message(variable); end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#238 - def style_parameter_name; end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#270 - def suggested_var(method_name); end - - # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#276 - def variable_name_candidates(method_name); end -end - -# source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#157 -RuboCop::Cop::Naming::MemoizedInstanceVariableName::DYNAMIC_DEFINE_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#158 -RuboCop::Cop::Naming::MemoizedInstanceVariableName::INITIALIZE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#153 -RuboCop::Cop::Naming::MemoizedInstanceVariableName::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#155 -RuboCop::Cop::Naming::MemoizedInstanceVariableName::UNDERSCORE_REQUIRED = T.let(T.unsafe(nil), String) - -# Makes sure that all methods use the configured style, -# snake_case or camelCase, for their names. -# -# Method names matching patterns are always allowed. -# -# The cop can be configured with `AllowedPatterns` to allow certain regexp patterns: -# -# [source,yaml] -# ---- -# Naming/MethodName: -# AllowedPatterns: -# - '\AonSelectionBulkChange\z' -# - '\AonSelectionCleared\z' -# ---- -# -# As well, you can also forbid specific method names or regexp patterns -# using `ForbiddenIdentifiers` or `ForbiddenPatterns`: -# -# [source,yaml] -# ---- -# Naming/MethodName: -# ForbiddenIdentifiers: -# - 'def' -# - 'super' -# ForbiddenPatterns: -# - '_v1\z' -# - '_gen1\z' -# ---- -# -# @example EnforcedStyle: snake_case (default) -# # bad -# def fooBar; end -# -# # good -# def foo_bar; end -# @example EnforcedStyle: camelCase -# # bad -# def foo_bar; end -# -# # good -# def fooBar; end -# @example ForbiddenIdentifiers: ['def', 'super'] -# # bad -# def def; end -# def super; end -# @example ForbiddenPatterns: ['_v1\z', '_gen1\z'] -# # bad -# def release_v1; end -# def api_gen1; end -# -# source://rubocop//lib/rubocop/cop/naming/method_name.rb#59 -class RuboCop::Cop::Naming::MethodName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::ConfigurableFormatting - include ::RuboCop::Cop::ConfigurableNaming - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::ForbiddenIdentifiers - include ::RuboCop::Cop::ForbiddenPattern - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#90 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#90 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#75 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#73 - def str_name(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#70 - def sym_name(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#120 - def attr_name(name_item); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#103 - def forbidden_name?(name); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#131 - def message(style); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#124 - def range_position(node); end - - # source://rubocop//lib/rubocop/cop/naming/method_name.rb#107 - def register_forbidden_name(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/method_name.rb#66 -RuboCop::Cop::Naming::MethodName::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/method_name.rb#67 -RuboCop::Cop::Naming::MethodName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) - -# Checks method parameter names for how descriptive they -# are. It is highly configurable. -# -# The `MinNameLength` config option takes an integer. It represents -# the minimum amount of characters the name must be. Its default is 3. -# The `AllowNamesEndingInNumbers` config option takes a boolean. When -# set to false, this cop will register offenses for names ending with -# numbers. Its default is false. The `AllowedNames` config option -# takes an array of permitted names that will never register an -# offense. The `ForbiddenNames` config option takes an array of -# restricted names that will always register an offense. -# -# @example -# # bad -# def bar(varOne, varTwo) -# varOne + varTwo -# end -# -# # With `AllowNamesEndingInNumbers` set to false -# def foo(num1, num2) -# num1 * num2 -# end -# -# # With `MinNameLength` set to number greater than 1 -# def baz(a, b, c) -# do_stuff(a, b, c) -# end -# -# # good -# def bar(thud, fred) -# thud + fred -# end -# -# def foo(speed, distance) -# speed * distance -# end -# -# def baz(age_a, height_b, gender_c) -# do_stuff(age_a, height_b, gender_c) -# end -# -# source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#46 -class RuboCop::Cop::Naming::MethodParameterName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::UncommunicativeName - - # source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#49 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#49 - def on_defs(node); end -end - -# Checks that predicate method names end with a question mark and -# do not start with a forbidden prefix. -# -# A method is determined to be a predicate method if its name starts with -# one of the prefixes listed in the `NamePrefix` configuration. The list -# defaults to `is_`, `has_`, and `have_` but may be overridden. -# -# Predicate methods must end with a question mark. -# -# When `ForbiddenPrefixes` is also set (as it is by default), predicate -# methods which begin with a forbidden prefix are not allowed, even if -# they end with a `?`. These methods should be changed to remove the -# prefix. -# -# When `UseSorbetSigs` set to true (optional), the cop will only report -# offenses if the method has a Sorbet `sig` with a return type of -# `T::Boolean`. Dynamic methods are not supported with this configuration. -# -# @example MethodDefinitionMacros: ['def_node_matcher'] -# # bad -# def_node_matcher(:is_even) { |value| } -# -# # good -# def_node_matcher(:even?) { |value| } -# @example NamePrefix: ['seems_to_be_'] -# # bad -# def seems_to_be_even(value) -# end -# -# # When ForbiddenPrefixes: ['seems_to_be_'] -# # good -# def even?(value) -# end -# -# # When ForbiddenPrefixes: [] -# # good -# def seems_to_be_even?(value) -# end -# @example AllowedMethods: ['is_a?'] (default) -# # Despite starting with the `is_` prefix, this method is allowed -# # good -# def is_a?(value) -# end -# @example AllowedMethods: ['is_even?'] -# # good -# def is_even?(value) -# end -# @example UseSorbetSigs: false (default) -# # bad -# sig { returns(String) } -# def is_this_thing_on -# "yes" -# end -# -# # good - Sorbet signature is not evaluated -# sig { returns(String) } -# def is_this_thing_on? -# "yes" -# end -# @example UseSorbetSigs: true -# # bad -# sig { returns(T::Boolean) } -# def odd(value) -# end -# -# # good -# sig { returns(T::Boolean) } -# def odd?(value) -# end -# @example MethodDefinitionMacros: ['define_method', 'define_singleton_method'] (default) -# # bad -# define_method(:is_even) { |value| } -# -# # good -# define_method(:even?) { |value| } -# @example NamePrefix: ['is_', 'has_', 'have_'] (default) -# # bad -# def is_even(value) -# end -# -# # When ForbiddenPrefixes: ['is_', 'has_', 'have_'] (default) -# # good -# def even?(value) -# end -# -# # When ForbiddenPrefixes: [] -# # good -# def is_even?(value) -# end -# -# source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#103 -class RuboCop::Cop::Naming::PredicateName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#107 - def dynamic_method_define(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#126 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#126 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#113 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#154 - def sorbet_return_type(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#141 - def validate_config; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#164 - def allowed_method_name?(method_name, prefix); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#172 - def expected_name(method_name, prefix); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#186 - def forbidden_prefixes; end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#182 - def message(method_name, new_name); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#198 - def method_definition_macros(macro_name); end - - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#190 - def predicate_prefixes; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#158 - def sorbet_sig?(node, return_type: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#194 - def use_sorbet_sigs?; end -end - -# Makes sure that rescued exceptions variables are named as -# expected. -# -# The `PreferredName` config option takes a `String`. It represents -# the required name of the variable. Its default is `e`. -# -# NOTE: This cop does not consider nested rescues because it cannot -# guarantee that the variable from the outer rescue is not used within -# the inner rescue (in which case, changing the inner variable would -# shadow the outer variable). -# -# @example PreferredName: e (default) -# # bad -# begin -# # do something -# rescue MyException => exception -# # do something -# end -# -# # good -# begin -# # do something -# rescue MyException => e -# # do something -# end -# -# # good -# begin -# # do something -# rescue MyException => _e -# # do something -# end -# @example PreferredName: exception -# # bad -# begin -# # do something -# rescue MyException => e -# # do something -# end -# -# # good -# begin -# # do something -# rescue MyException => exception -# # do something -# end -# -# # good -# begin -# # do something -# rescue MyException => _exception -# # do something -# end -# -# source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#61 -class RuboCop::Cop::Naming::RescuedExceptionsVariableName < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#66 - def on_resbody(node); end - - private - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#96 - def autocorrect(corrector, node, range, offending_name, preferred_name); end - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#117 - def correct_node(corrector, node, offending_name, preferred_name); end - - # If the exception variable is reassigned, that assignment needs to be corrected. - # Further `lvar` nodes will not be corrected though since they now refer to a - # different variable. - # - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#143 - def correct_reassignment(corrector, node, offending_name, preferred_name); end - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#160 - def message(node); end - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#91 - def offense_range(resbody); end - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#147 - def preferred_name(variable_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#166 - def shadowed_variable_name?(node); end - - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#156 - def variable_name(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#106 - def variable_name_matches?(node, name); end -end - -# source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#64 -RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String) - -# Checks that the configured style (snake_case or camelCase) is used for all variable names. -# This includes local variables, instance variables, class variables, method arguments -# (positional, keyword, rest or block), and block arguments. -# -# The cop can also be configured to forbid using specific names for variables, using -# `ForbiddenIdentifiers` or `ForbiddenPatterns`. In addition to the above, this applies -# to global variables as well. -# -# Method definitions and method calls are not affected by this cop. -# -# @example EnforcedStyle: snake_case (default) -# # bad -# fooBar = 1 -# -# # good -# foo_bar = 1 -# @example EnforcedStyle: camelCase -# # bad -# foo_bar = 1 -# -# # good -# fooBar = 1 -# @example AllowedIdentifiers: ['fooBar'] -# # good (with EnforcedStyle: snake_case) -# fooBar = 1 -# @example AllowedPatterns: ['_v\d+\z'] -# # good (with EnforcedStyle: camelCase) -# release_v1 = true -# @example ForbiddenIdentifiers: ['fooBar'] -# # bad (in all cases) -# fooBar = 1 -# @fooBar = 1 -# @@fooBar = 1 -# $fooBar = 1 -# @example ForbiddenPatterns: ['_v\d+\z'] -# # bad (in all cases) -# release_v1 = true -# @release_v1 = true -# @@release_v1 = true -# $release_v1 = true -# -# source://rubocop//lib/rubocop/cop/naming/variable_name.rb#52 -class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedIdentifiers - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::ConfigurableFormatting - include ::RuboCop::Cop::ConfigurableNaming - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::ForbiddenIdentifiers - include ::RuboCop::Cop::ForbiddenPattern - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_arg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_blockarg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_cvasgn(node); end - - # Only forbidden names are checked for global variable assignment - # - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#88 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_kwarg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_kwoptarg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_kwrestarg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_lvar(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_optarg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#66 - def on_restarg(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#62 - def valid_name?(node, name, given_style = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#97 - def forbidden_name?(name); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#101 - def message(style); end - - # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#105 - def register_forbidden_name(node); end -end - -# source://rubocop//lib/rubocop/cop/naming/variable_name.rb#59 -RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/naming/variable_name.rb#60 -RuboCop::Cop::Naming::VariableName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) - -# Makes sure that all numbered variables use the -# configured style, snake_case, normalcase, or non_integer, -# for their numbering. -# -# Additionally, `CheckMethodNames` and `CheckSymbols` configuration options -# can be used to specify whether method names and symbols should be checked. -# Both are enabled by default. -# -# @example AllowedPatterns: ['_v\d+\z'] -# # good -# :some_sym_v1 -# @example EnforcedStyle: snake_case -# # bad -# :some_sym1 -# variable1 = 1 -# -# def some_method1; end -# -# def some_method_1(arg1); end -# -# # good -# :some_sym_1 -# variable_1 = 1 -# -# def some_method_1; end -# -# def some_method_1(arg_1); end -# @example EnforcedStyle: non_integer -# # bad -# :some_sym1 -# :some_sym_1 -# -# variable1 = 1 -# variable_1 = 1 -# -# def some_method1; end -# -# def some_method_1; end -# -# def some_methodone(arg1); end -# def some_methodone(arg_1); end -# -# # good -# :some_symone -# :some_sym_one -# -# variableone = 1 -# variable_one = 1 -# -# def some_methodone; end -# -# def some_method_one; end -# -# def some_methodone(argone); end -# def some_methodone(arg_one); end -# -# # In the following examples, we assume `EnforcedStyle: normalcase` (default). -# @example CheckMethodNames: true (default) -# # bad -# def some_method_1; end -# @example CheckMethodNames: false -# # good -# def some_method_1; end -# @example CheckSymbols: true (default) -# # bad -# :some_sym_1 -# @example CheckSymbols: false -# # good -# :some_sym_1 -# @example AllowedIdentifiers: [capture3] -# # good -# expect(Open3).to receive(:capture3) -# @example EnforcedStyle: normalcase (default) -# # bad -# :some_sym_1 -# variable_1 = 1 -# -# def some_method_1; end -# -# def some_method1(arg_1); end -# -# # good -# :some_sym1 -# variable1 = 1 -# -# def some_method1; end -# -# def some_method1(arg1); end -# -# source://rubocop//lib/rubocop/cop/naming/variable_number.rb#103 -class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedIdentifiers - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::ConfigurableFormatting - include ::RuboCop::Cop::ConfigurableNumbering - include ::RuboCop::Cop::AllowedPattern - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#114 - def on_arg(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#114 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#125 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#125 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#114 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#114 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#114 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#133 - def on_sym(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#110 - def valid_name?(node, name, given_style = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#142 - def message(style); end -end - -# source://rubocop//lib/rubocop/cop/naming/variable_number.rb#108 -RuboCop::Cop::Naming::VariableNumber::MSG = T.let(T.unsafe(nil), String) - -# Some common code shared between `NegatedIf` and -# `NegatedWhile` cops. -# -# source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#7 -module RuboCop::Cop::NegativeConditional - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#18 - def empty_condition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#15 - def single_negative?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#20 - def check_negative_conditional(node, message:, &block); end -end - -# source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#10 -RuboCop::Cop::NegativeConditional::MSG = T.let(T.unsafe(nil), String) - -# This module provides a list of methods that are: -# 1. In the NilClass by default -# 2. Added to NilClass by explicitly requiring any standard libraries -# 3. Cop's configuration parameter AllowedMethods. -# -# source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#9 -module RuboCop::Cop::NilMethods - include ::RuboCop::Cop::AllowedMethods - - private - - # source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#14 - def nil_methods; end - - # source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#18 - def other_stdlib_methods; end -end - -# An offense represents a style violation detected by RuboCop. -# -# source://rubocop//lib/rubocop/cop/offense.rb#6 -class RuboCop::Cop::Offense - include ::Comparable - - # @api private - # @return [Offense] a new instance of Offense - # - # source://rubocop//lib/rubocop/cop/offense.rb#83 - def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end - - # Returns `-1`, `0`, or `+1` - # if this offense is less than, equal to, or greater than `other`. - # - # @api public - # @return [Integer] comparison result - # - # source://rubocop//lib/rubocop/cop/offense.rb#229 - def <=>(other); end - - # @api public - # @return [Boolean] returns `true` if two offenses contain same attributes - # - # source://rubocop//lib/rubocop/cop/offense.rb#210 - def ==(other); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#159 - def column; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#169 - def column_length; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#193 - def column_range; end - - # @api public - # @example - # 'Layout/LineLength' - # @return [String] the cop name as a String for which this offense is for. - # - # source://rubocop//lib/rubocop/cop/offense.rb#50 - def cop_name; end - - # @api public - # @return [Boolean] whether this offense can be automatically corrected via autocorrect. - # This includes todo comments, for example when requested with `--disable-uncorrectable`. - # - # source://rubocop//lib/rubocop/cop/offense.rb#101 - def correctable?; end - - # @api public - # @return [Boolean] whether this offense is automatically corrected via - # autocorrect or a todo. - # - # source://rubocop//lib/rubocop/cop/offense.rb#112 - def corrected?; end - - # @api public - # @return [Boolean] whether this offense is automatically disabled via a todo. - # - # source://rubocop//lib/rubocop/cop/offense.rb#122 - def corrected_with_todo?; end - - # @api public - # @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available - # - # source://rubocop//lib/rubocop/cop/offense.rb#61 - def corrector; end - - # @api public - # @return [Boolean] whether this offense was locally disabled with a - # disable or todo where it occurred. - # - # source://rubocop//lib/rubocop/cop/offense.rb#133 - def disabled?; end - - # @api public - # @return [Boolean] returns `true` if two offenses contain same attributes - # - # source://rubocop//lib/rubocop/cop/offense.rb#210 - def eql?(other); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#178 - def first_line; end - - # source://rubocop//lib/rubocop/cop/offense.rb#218 - def hash; end - - # @api public - # @return [Parser::Source::Range] the range of the code that is highlighted - # - # source://rubocop//lib/rubocop/cop/offense.rb#141 - def highlighted_area; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#188 - def last_column; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#183 - def last_line; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#154 - def line; end - - # @api public - # @return [Parser::Source::Range] the location where the violation is detected. - # @see https://www.rubydoc.info/gems/parser/Parser/Source/Range Parser::Source::Range - # - # source://rubocop//lib/rubocop/cop/offense.rb#28 - def location; end - - # @api public - # @example - # 'Line is too long. [90/80]' - # @return [String] human-readable message - # - # source://rubocop//lib/rubocop/cop/offense.rb#39 - def message; end - - # Internally we use column number that start at 0, but when - # outputting column numbers, we want them to start at 1. One - # reason is that editors, such as Emacs, expect this. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#202 - def real_column; end - - # @api public - # @return [RuboCop::Cop::Severity] - # - # source://rubocop//lib/rubocop/cop/offense.rb#17 - def severity; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#164 - def source_line; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#53 - def status; end - - # This is just for debugging purpose. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/offense.rb#147 - def to_s; end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/offense.rb#10 -RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/offense.rb#80 -RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) - -# source://rubocop//lib/rubocop/cop/offense.rb#63 -class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct - # Returns the value of attribute begin_pos - # - # @return [Object] the current value of begin_pos - def begin_pos; end - - # Sets the attribute begin_pos - # - # @param value [Object] the value to set the attribute begin_pos to. - # @return [Object] the newly set value - def begin_pos=(_); end - - # Returns the value of attribute column - # - # @return [Object] the current value of column - def column; end - - # Sets the attribute column - # - # @param value [Object] the value to set the attribute column to. - # @return [Object] the newly set value - def column=(_); end - - # source://rubocop//lib/rubocop/cop/offense.rb#69 - def column_range; end - - # Returns the value of attribute end_pos - # - # @return [Object] the current value of end_pos - def end_pos; end - - # Sets the attribute end_pos - # - # @param value [Object] the value to set the attribute end_pos to. - # @return [Object] the newly set value - def end_pos=(_); end - - # Returns the value of attribute line - # - # @return [Object] the current value of line - def first_line; end - - # Returns the value of attribute column - # - # @return [Object] the current value of column - def last_column; end - - # Returns the value of attribute line - # - # @return [Object] the current value of line - def last_line; end - - # source://rubocop//lib/rubocop/cop/offense.rb#73 - def length; end - - # Returns the value of attribute line - # - # @return [Object] the current value of line - def line; end - - # Sets the attribute line - # - # @param value [Object] the value to set the attribute line to. - # @return [Object] the newly set value - def line=(_); end - - # source://rubocop//lib/rubocop/cop/offense.rb#73 - def size; end - - # Returns the value of attribute source_line - # - # @return [Object] the current value of source_line - def source_line; end - - # Sets the attribute source_line - # - # @param value [Object] the value to set the attribute source_line to. - # @return [Object] the newly set value - def source_line=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Common functionality for cops checking if and unless expressions. -# -# source://rubocop//lib/rubocop/cop/mixin/on_normal_if_unless.rb#6 -module RuboCop::Cop::OnNormalIfUnless - # source://rubocop//lib/rubocop/cop/mixin/on_normal_if_unless.rb#7 - def on_if(node); end -end - -# This autocorrects gem dependency order -# -# source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#6 -class RuboCop::Cop::OrderedGemCorrector - extend ::RuboCop::Cop::OrderedGemNode - extend ::RuboCop::Cop::RangeHelp - - class << self - # Returns the value of attribute comments_as_separators. - # - # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#11 - def comments_as_separators; end - - # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#13 - def correct(processed_source, node, previous_declaration, comments_as_separators); end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#11 - def processed_source; end - - private - - # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#26 - def declaration_with_comment(node); end - end -end - -# Common functionality for Bundler/OrderedGems and -# Gemspec/OrderedDependencies. -# -# source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#7 -module RuboCop::Cop::OrderedGemNode - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#23 - def case_insensitive_out_of_order?(string_a, string_b); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#27 - def consecutive_lines(previous, current); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#55 - def find_gem_name(gem_node); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#18 - def gem_canonical_name(name); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#49 - def gem_name(declaration_node); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#10 - def get_source_range(node, comments_as_separators); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#32 - def register_offense(previous, current); end - - # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#61 - def treat_comments_as_separators; end -end - -# Common functionality for handling parentheses. -# -# source://rubocop//lib/rubocop/cop/mixin/parentheses.rb#6 -module RuboCop::Cop::Parentheses - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/parentheses.rb#9 - def parens_required?(node); end -end - -# This autocorrects parentheses -# -# source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#6 -class RuboCop::Cop::ParenthesesCorrector - extend ::RuboCop::Cop::RangeHelp - - class << self - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#12 - def correct(corrector, node); end - - private - - # Add a comma back after the heredoc identifier - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#74 - def add_heredoc_comma(corrector, node); end - - # If the node contains a heredoc, remove the comma too - # It'll be added back in the right place later - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#64 - def extend_range_for_heredoc(node, range); end - - # If removing parentheses leaves a comma on its own line, remove all the whitespace - # preceding it to prevent a syntax error. - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#41 - def handle_orphaned_comma(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#80 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#28 - def next_char_is_question_mark?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#32 - def only_closing_paren_before_comma?(node); end - - # Get a range for the closing parenthesis and all whitespace to the left of it - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#51 - def parens_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#24 - def ternary_condition?(node); end - end -end - -# Common functionality for handling percent arrays. -# -# source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#6 -module RuboCop::Cop::PercentArray - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#26 - def allowed_bracket_array?(node); end - - # @param node [RuboCop::AST::ArrayNode] - # @param elements [Array] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#83 - def build_bracketed_array_with_appropriate_whitespace(elements:, node:); end - - # @param preferred_array_code [String] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#56 - def build_message_for_bracketed_array(preferred_array_code); end - - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#67 - def check_bracketed_array(node, literal_prefix); end - - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#36 - def check_percent_array(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#31 - def comments_in_array?(node); end - - # Override to determine values that are invalid in a percent array - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#22 - def invalid_percent_array_contents?(_node); end - - # Ruby does not allow percent arrays in an ambiguous block context. - # - # @example - # - # foo %i[bar baz] { qux } - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#14 - def invalid_percent_array_context?(node); end - - # Provides whitespace between elements for building a bracketed array. - # %w[ a b c ] - # ^^^ - # - # @param node [RuboCop::AST::ArrayNode] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#98 - def whitespace_between(node); end - - # Provides leading whitespace for building a bracketed array. - # %w[ a b c ] - # ^^ - # - # @param node [RuboCop::AST::ArrayNode] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#111 - def whitespace_leading(node); end - - # Provides trailing whitespace for building a bracketed array. - # %w[ a b c ] - # ^^^^ - # - # @param node [RuboCop::AST::ArrayNode] - # @return [String] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#120 - def whitespace_trailing(node); end -end - -# Common functionality for handling percent literals. -# -# source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#6 -module RuboCop::Cop::PercentLiteral - include ::RuboCop::Cop::RangeHelp - - private - - # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#23 - def begin_source(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#11 - def percent_literal?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#17 - def process(node, *types); end - - # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#27 - def type(node); end -end - -# This autocorrects percent literals -# -# source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#6 -class RuboCop::Cop::PercentLiteralCorrector - include ::RuboCop::PathUtil - include ::RuboCop::Cop::Util - - # @return [PercentLiteralCorrector] a new instance of PercentLiteralCorrector - # - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#11 - def initialize(config, preferred_delimiters); end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#9 - def config; end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#16 - def correct(corrector, node, char); end - - # Returns the value of attribute preferred_delimiters. - # - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#9 - def preferred_delimiters; end - - private - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#46 - def autocorrect_multiline_words(node, escape, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#52 - def autocorrect_words(node, escape, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#34 - def delimiters_for(type); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#110 - def end_content(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#30 - def escape_words?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#78 - def first_line?(node, previous_line_num); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#89 - def fix_escaped_content(word_node, escape, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#69 - def line_breaks(node, source, previous_line_num, base_line_num, node_index); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#38 - def new_contents(node, escape, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#82 - def process_lines(node, previous_line_num, base_line_num, source_in_lines); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#58 - def process_multiline_words(node, escape, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#96 - def substitute_escaped_delimiters(content, delimiters); end - - # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#26 - def wrap_contents(corrector, node, contents, char, delimiters); end -end - -# Common functionality for checking whether an AST node/token is aligned -# with something on a preceding or following line -# -# source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#8 -module RuboCop::Cop::PrecedingFollowingAlignment - private - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#79 - def aligned_comment_lines; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#102 - def aligned_equals_operator?(range, lineno); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#133 - def aligned_identical?(range, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#90 - def aligned_operator?(range, line, lineno); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#86 - def aligned_token?(range, line, lineno); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#43 - def aligned_with_adjacent_line?(range, predicate); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#61 - def aligned_with_any_line?(line_ranges, range, indent = T.unsafe(nil), &predicate); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#51 - def aligned_with_any_line_range?(line_ranges, range, &predicate); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#125 - def aligned_with_append_operator?(range, token); end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#137 - def aligned_with_equals_sign(token, line_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#65 - def aligned_with_line?(line_nos, range, indent = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#23 - def aligned_with_operator?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#119 - def aligned_with_preceding_equals?(range, token); end - - # Allows alignment with a preceding operator that ends with an `=`, - # including assignment and comparison operators. - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#29 - def aligned_with_preceding_equals_operator(token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#19 - def aligned_with_something?(range); end - - # Allows alignment with a subsequent operator that ends with an `=`, - # including assignment and comparison operators. - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#37 - def aligned_with_subsequent_equals_operator(token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#94 - def aligned_words?(range, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#15 - def allow_for_alignment?; end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#152 - def assignment_lines; end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#156 - def assignment_tokens; end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#176 - def relevant_assignment_lines(line_range); end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#203 - def remove_equals_in_def(asgn_tokens, processed_source); end -end - -# Tokens that end with an `=`, as well as `<<`, that can be aligned together: -# `=`, `==`, `===`, `!=`, `<=`, `>=`, `<<` and operator assignment (`+=`, etc). -# -# source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#11 -RuboCop::Cop::PrecedingFollowingAlignment::ASSIGNMENT_OR_COMPARISON_TOKENS = T.let(T.unsafe(nil), Array) - -# Common functionality for handling percent literal delimiters. -# -# source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#6 -class RuboCop::Cop::PreferredDelimiters - # @return [PreferredDelimiters] a new instance of PreferredDelimiters - # - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#11 - def initialize(type, config, preferred_delimiters); end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#7 - def config; end - - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#17 - def delimiters; end - - # Returns the value of attribute type. - # - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#7 - def type; end - - private - - # @raise [ArgumentError] - # - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#23 - def ensure_valid_preferred_delimiters; end - - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#30 - def preferred_delimiters; end - - # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#45 - def preferred_delimiters_config; end -end - -# source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#9 -RuboCop::Cop::PreferredDelimiters::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) - -# This autocorrects punctuation -# -# source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#6 -class RuboCop::Cop::PunctuationCorrector - class << self - # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#12 - def add_space(corrector, token); end - - # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#8 - def remove_space(corrector, space_before); end - - # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#16 - def swap_comma(corrector, range); end - end -end - -module RuboCop::Cop::RSpec; end - -class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#78 - def aggregate_failures?(param0 = T.unsafe(nil), param1); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#89 - def aggregate_failures_block?(param0 = T.unsafe(nil)); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#86 - def expect?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#93 - def on_block(node); end - - private - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#109 - def example_with_aggregate_failures?(example_node); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#116 - def find_aggregate_failures(example_node); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#121 - def find_expectation(node, &block); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#132 - def flag_example(node, expectation_count:); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_expectations.rb#143 - def max_expectations; end -end - -class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#91 - def on_block(node); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#102 - def on_new_investigation; end - - private - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#111 - def all_helpers(node); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#141 - def allow_subject?; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#109 - def example_group_memoized_helpers; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#116 - def helpers(node); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#137 - def max; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#127 - def variable_nodes(node); end -end - -class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#107 - def on_top_level_group(node); end - - private - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#157 - def allowed_groups; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#134 - def count_up_nesting?(node, example_group); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#119 - def find_nested_example_groups(node, nesting: T.unsafe(nil), &block); end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#144 - def max_nesting; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#148 - def max_nesting_config; end - - # source://rubocop-rspec/3.6.0/lib/rubocop/cop/rspec/nested_groups.rb#140 - def message(nesting); end -end - -# Methods that calculate and return Parser::Source::Ranges -# -# source://rubocop//lib/rubocop/cop/mixin/range_help.rb#6 -module RuboCop::Cop::RangeHelp - private - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#152 - def add_range(range1, range2); end - - # A range containing the first to the last argument - # of a method call or method definition. - # def foo(a, b:) - # ^^^^^ - # bar(1, 2, 3, &blk) - # ^^^^^^^^^^^^^ - # baz { |x, y:, z:| } - # ^^^^^^^^^ - # - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#45 - def arguments_range(node); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#93 - def column_offset_between(base_range, range); end - - # A range containing only the contents of a literal with delimiters (e.g. in - # `%i{1 2 3}` this will be the range covering `1 2 3` only). - # - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#33 - def contents_range(node); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#111 - def directions(side); end - - # Returns the column attribute of the range, except if the range is on - # the first line and there's a byte order mark at the beginning of that - # line, in which case 1 is subtracted from the column value. This gives - # the column as it appears when viewing the file in an editor. - # - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#103 - def effective_column(range); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#120 - def final_pos(src, pos, increment, continuations, newlines, whitespace); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#128 - def move_pos(src, pos, step, condition, regexp); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#134 - def move_pos_str(src, pos, step, condition, needle); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#49 - def range_between(start_pos, end_pos); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#84 - def range_by_whole_lines(range, include_final_newline: T.unsafe(nil), buffer: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#145 - def range_with_comments(node); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#141 - def range_with_comments_and_lines(node); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#53 - def range_with_surrounding_comma(range, side = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#67 - def range_with_surrounding_space(range_positional = T.unsafe(nil), range: T.unsafe(nil), side: T.unsafe(nil), newlines: T.unsafe(nil), whitespace: T.unsafe(nil), continuations: T.unsafe(nil), buffer: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#12 - def source_range(source_buffer, line_number, column, length = T.unsafe(nil)); end -end - -# The Unicode codepoint -# -# source://rubocop//lib/rubocop/cop/mixin/range_help.rb#7 -RuboCop::Cop::RangeHelp::BYTE_ORDER_MARK = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/mixin/range_help.rb#8 -module RuboCop::Cop::RangeHelp::NOT_GIVEN; end - -# Common functionality for handling Rational literals. -# -# source://rubocop//lib/rubocop/cop/mixin/rational_literal.rb#6 -module RuboCop::Cop::RationalLiteral - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/rational_literal.rb#12 - def rational_literal?(param0 = T.unsafe(nil)); end -end - -# Registry that tracks all cops by their badge and department. -# -# source://rubocop//lib/rubocop/cop/registry.rb#19 -class RuboCop::Cop::Registry - include ::Enumerable - - # @return [Registry] a new instance of Registry - # - # source://rubocop//lib/rubocop/cop/registry.rb#51 - def initialize(cops = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/registry.rb#232 - def ==(other); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#97 - def contains_cop_matching?(names); end - - # source://rubocop//lib/rubocop/cop/registry.rb#179 - def cops; end - - # source://rubocop//lib/rubocop/cop/registry.rb#224 - def cops_for_department(department); end - - # @return [Boolean] Checks if given name is department - # - # source://rubocop//lib/rubocop/cop/registry.rb#93 - def department?(name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#147 - def department_missing?(badge, name); end - - # @return [Array] list of departments for current cops. - # - # source://rubocop//lib/rubocop/cop/registry.rb#72 - def departments; end - - # source://rubocop//lib/rubocop/cop/registry.rb#193 - def disabled(config); end - - # source://rubocop//lib/rubocop/cop/registry.rb#67 - def dismiss(cop); end - - # source://rubocop//lib/rubocop/cop/registry.rb#247 - def each(&block); end - - # source://rubocop//lib/rubocop/cop/registry.rb#189 - def enabled(config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#197 - def enabled?(cop, config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#213 - def enabled_pending_cop?(cop_cfg, config); end - - # source://rubocop//lib/rubocop/cop/registry.rb#63 - def enlist(cop); end - - # @param cop_name [String] - # @return [Class, nil] - # - # source://rubocop//lib/rubocop/cop/registry.rb#253 - def find_by_cop_name(cop_name); end - - # When a cop name is given returns a single-element array with the cop class. - # When a department name is given returns an array with all the cop classes - # for that department. - # - # source://rubocop//lib/rubocop/cop/registry.rb#260 - def find_cops_by_directive(directive); end - - # source://rubocop//lib/rubocop/cop/registry.rb#265 - def freeze; end - - # source://rubocop//lib/rubocop/cop/registry.rb#184 - def length; end - - # source://rubocop//lib/rubocop/cop/registry.rb#220 - def names; end - - # source://rubocop//lib/rubocop/cop/registry.rb#228 - def names_for_department(department); end - - # Returns the value of attribute options. - # - # source://rubocop//lib/rubocop/cop/registry.rb#49 - def options; end - - # source://rubocop//lib/rubocop/cop/registry.rb#151 - def print_warning(name, path); end - - # Convert a user provided cop name into a properly namespaced name - # - # @example gives back a correctly qualified cop name - # - # registry = RuboCop::Cop::Registry - # registry.qualified_cop_name('Layout/EndOfLine', '') # => 'Layout/EndOfLine' - # @example fixes incorrect namespaces - # - # registry = RuboCop::Cop::Registry - # registry.qualified_cop_name('Lint/EndOfLine', '') # => 'Layout/EndOfLine' - # @example namespaces bare cop identifiers - # - # registry = RuboCop::Cop::Registry - # registry.qualified_cop_name('EndOfLine', '') # => 'Layout/EndOfLine' - # @example passes back unrecognized cop names - # - # registry = RuboCop::Cop::Registry - # registry.qualified_cop_name('NotACop', '') # => 'NotACop' - # @note Emits a warning if the provided name has an incorrect namespace - # @param name [String] Cop name extracted from config - # @param path [String, nil] Path of file that `name` was extracted from - # @param warn [Boolean] Print a warning if no department given for `name` - # @raise [AmbiguousCopName] if a bare identifier with two possible namespaces is provided - # @return [String] Qualified cop name - # - # source://rubocop//lib/rubocop/cop/registry.rb#133 - def qualified_cop_name(name, path, warn: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/registry.rb#166 - def qualify_badge(badge); end - - # source://rubocop//lib/rubocop/cop/registry.rb#243 - def select(&block); end - - # source://rubocop//lib/rubocop/cop/registry.rb#236 - def sort!; end - - # @return [Hash{String => Array}] - # - # source://rubocop//lib/rubocop/cop/registry.rb#174 - def to_h; end - - # source://rubocop//lib/rubocop/cop/registry.rb#159 - def unqualified_cop_names; end - - # @return [Registry] Cops for that specific department. - # - # source://rubocop//lib/rubocop/cop/registry.rb#78 - def with_department(department); end - - # @return [Registry] Cops not for a specific department. - # - # source://rubocop//lib/rubocop/cop/registry.rb#84 - def without_department(department); end - - private - - # source://rubocop//lib/rubocop/cop/registry.rb#283 - def clear_enrollment_queue; end - - # source://rubocop//lib/rubocop/cop/registry.rb#279 - def initialize_copy(reg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#312 - def registered?(badge); end - - # source://rubocop//lib/rubocop/cop/registry.rb#299 - def resolve_badge(given_badge, real_badge, source_path, warn: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/registry.rb#295 - def with(cops); end - - class << self - # source://rubocop//lib/rubocop/cop/registry.rb#22 - def all; end - - # Returns the value of attribute global. - # - # source://rubocop//lib/rubocop/cop/registry.rb#274 - def global; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/registry.rb#44 - def qualified_cop?(name); end - - # source://rubocop//lib/rubocop/cop/registry.rb#26 - def qualified_cop_name(name, origin, warn: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/registry.rb#40 - def reset!; end - - # Changes momentarily the global registry - # Intended for testing purposes - # - # source://rubocop//lib/rubocop/cop/registry.rb#32 - def with_temporary_global(temp_global = T.unsafe(nil)); end - end -end - -# Ensure a require statement is present for a standard library determined -# by variable library_name -# -# source://rubocop//lib/rubocop/cop/mixin/require_library.rb#7 -module RuboCop::Cop::RequireLibrary - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#12 - def ensure_required(corrector, node, library_name); end - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#33 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#24 - def remove_subsequent_requires(corrector, node, library_name); end - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#51 - def require_any_library?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#56 - def require_library_name?(param0 = T.unsafe(nil), param1); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/require_library.rb#44 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/mixin/require_library.rb#10 -RuboCop::Cop::RequireLibrary::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# This class ensures a require statement is present for a standard library -# determined by the variable library_name -# -# source://rubocop//lib/rubocop/cop/correctors/require_library_corrector.rb#7 -class RuboCop::Cop::RequireLibraryCorrector - extend ::RuboCop::Cop::RangeHelp - - class << self - # source://rubocop//lib/rubocop/cop/correctors/require_library_corrector.rb#11 - def correct(corrector, node, library_name); end - - # source://rubocop//lib/rubocop/cop/correctors/require_library_corrector.rb#17 - def require_statement(library_name); end - end -end - -# Common functionality for checking `rescue` nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#6 -module RuboCop::Cop::RescueNode - # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#7 - def modifier_locations; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#13 - def rescue_modifier?(node); end - - # @deprecated Use ResbodyNode#exceptions instead - # - # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#20 - def rescued_exceptions(resbody); end -end - -# Common functionality for safe assignment. By safe assignment we mean -# putting parentheses around an assignment to indicate "I know I'm using an -# assignment as a condition. It's not a mistake." -# -# source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#8 -module RuboCop::Cop::SafeAssignment - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#14 - def empty_condition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#20 - def safe_assignment?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#17 - def setter_method?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#22 - def safe_assignment_allowed?; end -end - -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#5 -module RuboCop::Cop::Security; end - -# Checks for implementations of the `hash` method which combine -# values using custom logic instead of delegating to `Array#hash`. -# -# Manually combining hashes is error prone and hard to follow, especially -# when there are many values. Poor implementations may also introduce -# performance or security concerns if they are prone to collisions. -# Delegating to `Array#hash` is clearer and safer, although it might be slower -# depending on the use case. -# -# @example -# -# # bad -# def hash -# @foo ^ @bar -# end -# -# # good -# def hash -# [@foo, @bar].hash -# end -# -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#30 -class RuboCop::Cop::Security::CompoundHash < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#59 - def bad_hash_combinator?(param0 = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#76 - def contained_in_hash_method?(node, &block); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#43 - def dynamic_hash_method_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#38 - def hash_method_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#64 - def monuple_hash?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#88 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#88 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#88 - def on_send(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#82 - def outer_bad_hash_combinator?(node); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#69 - def redundant_hash?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/compound_hash.rb#52 - def static_hash_method_definition?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#31 -RuboCop::Cop::Security::CompoundHash::COMBINATOR_IN_HASH_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#32 -RuboCop::Cop::Security::CompoundHash::MONUPLE_HASH_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#34 -RuboCop::Cop::Security::CompoundHash::REDUNDANT_HASH_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/compound_hash.rb#35 -RuboCop::Cop::Security::CompoundHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of `Kernel#eval` and `Binding#eval`. -# -# @example -# -# # bad -# -# eval(something) -# binding.eval(something) -# -# source://rubocop//lib/rubocop/cop/security/eval.rb#14 -class RuboCop::Cop::Security::Eval < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/security/eval.rb#19 - def eval?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/eval.rb#23 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/security/eval.rb#15 -RuboCop::Cop::Security::Eval::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/eval.rb#16 -RuboCop::Cop::Security::Eval::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`, -# `IO.foreach`, and `IO.readlines`. -# -# If argument starts with a pipe character (`'|'`) and the receiver is the `IO` class, -# a subprocess is created in the same way as `Kernel#open`, and its output is returned. -# `Kernel#open` may allow unintentional command injection, which is the reason these -# `IO` methods are a security risk. -# Consider to use `File.read` to disable the behavior of subprocess invocation. -# -# @example -# -# # bad -# IO.read(path) -# IO.read('path') -# -# # good -# File.read(path) -# File.read('path') -# IO.read('| command') # Allow intentional command invocation. -# -# source://rubocop//lib/rubocop/cop/security/io_methods.rb#30 -class RuboCop::Cop::Security::IoMethods < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/security/io_methods.rb#36 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/security/io_methods.rb#33 -RuboCop::Cop::Security::IoMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/io_methods.rb#34 -RuboCop::Cop::Security::IoMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of JSON class methods which have potential -# security issues. -# -# @example -# # bad -# JSON.load("{}") -# JSON.restore("{}") -# -# # good -# JSON.parse("{}") -# -# source://rubocop//lib/rubocop/cop/security/json_load.rb#26 -class RuboCop::Cop::Security::JSONLoad < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/security/json_load.rb#33 - def json_load(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/json_load.rb#37 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/security/json_load.rb#29 -RuboCop::Cop::Security::JSONLoad::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/json_load.rb#30 -RuboCop::Cop::Security::JSONLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of Marshal class methods which have -# potential security issues leading to remote code execution when -# loading from an untrusted source. -# -# @example -# # bad -# Marshal.load("{}") -# Marshal.restore("{}") -# -# # good -# Marshal.dump("{}") -# -# # okish - deep copy hack -# Marshal.load(Marshal.dump({})) -# -# source://rubocop//lib/rubocop/cop/security/marshal_load.rb#21 -class RuboCop::Cop::Security::MarshalLoad < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#26 - def marshal_load(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#31 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/security/marshal_load.rb#22 -RuboCop::Cop::Security::MarshalLoad::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/marshal_load.rb#23 -RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of `Kernel#open` and `URI.open` with dynamic -# data. -# -# `Kernel#open` and `URI.open` enable not only file access but also process -# invocation by prefixing a pipe symbol (e.g., `open("| ls")`). -# So, it may lead to a serious security risk by using variable input to -# the argument of `Kernel#open` and `URI.open`. It would be better to use -# `File.open`, `IO.popen` or `URI.parse#open` explicitly. -# -# NOTE: `open` and `URI.open` with literal strings are not flagged by this -# cop. -# -# @example -# # bad -# open(something) -# open("| #{something}") -# open("| foo") -# URI.open(something) -# -# # good -# File.open(something) -# IO.popen(something) -# URI.parse(something).open -# -# # good (literal strings) -# open("foo.text") -# URI.open("http://example.com") -# -# source://rubocop//lib/rubocop/cop/security/open.rb#37 -class RuboCop::Cop::Security::Open < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/security/open.rb#46 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/security/open.rb#42 - def open?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#75 - def composite_string?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#83 - def concatenated_string?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#79 - def interpolated_string?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#57 - def safe?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#67 - def safe_argument?(argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/security/open.rb#71 - def simple_string?(node); end -end - -# source://rubocop//lib/rubocop/cop/security/open.rb#38 -RuboCop::Cop::Security::Open::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/open.rb#39 -RuboCop::Cop::Security::Open::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of YAML class methods which have -# potential security issues leading to remote code execution when -# loading from an untrusted source. -# -# NOTE: Ruby 3.1+ (Psych 4) uses `Psych.load` as `Psych.safe_load` by default. -# -# @example -# # bad -# YAML.load("--- !ruby/object:Foo {}") # Psych 3 is unsafe by default -# -# # good -# YAML.safe_load("--- !ruby/object:Foo {}", [Foo]) # Ruby 2.5 (Psych 3) -# YAML.safe_load("--- !ruby/object:Foo {}", permitted_classes: [Foo]) # Ruby 3.0- (Psych 3) -# YAML.load("--- !ruby/object:Foo {}", permitted_classes: [Foo]) # Ruby 3.1+ (Psych 4) -# YAML.dump(foo) -# -# source://rubocop//lib/rubocop/cop/security/yaml_load.rb#26 -class RuboCop::Cop::Security::YAMLLoad < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#40 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#36 - def yaml_load(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/security/yaml_load.rb#30 -RuboCop::Cop::Security::YAMLLoad::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/security/yaml_load.rb#31 -RuboCop::Cop::Security::YAMLLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Severity class is simple value object about severity -# -# source://rubocop//lib/rubocop/cop/severity.rb#6 -class RuboCop::Cop::Severity - include ::Comparable - - # @api private - # @raise [ArgumentError] - # @return [Severity] a new instance of Severity - # - # source://rubocop//lib/rubocop/cop/severity.rb#30 - def initialize(name_or_code); end - - # source://rubocop//lib/rubocop/cop/severity.rb#62 - def <=>(other); end - - # source://rubocop//lib/rubocop/cop/severity.rb#50 - def ==(other); end - - # source://rubocop//lib/rubocop/cop/severity.rb#42 - def code; end - - # source://rubocop//lib/rubocop/cop/severity.rb#58 - def hash; end - - # source://rubocop//lib/rubocop/cop/severity.rb#46 - def level; end - - # @api public - # @return [Symbol] severity. - # any of `:info`, `:refactor`, `:convention`, `:warning`, `:error` or `:fatal`. - # - # source://rubocop//lib/rubocop/cop/severity.rb#22 - def name; end - - # source://rubocop//lib/rubocop/cop/severity.rb#38 - def to_s; end - - class << self - # source://rubocop//lib/rubocop/cop/severity.rb#24 - def name_from_code(code); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/severity.rb#12 -RuboCop::Cop::Severity::CODE_TABLE = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/severity.rb#9 -RuboCop::Cop::Severity::NAMES = T.let(T.unsafe(nil), Array) - -# Common functionality for cops checking for missing space after -# punctuation. -# -# source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#7 -module RuboCop::Cop::SpaceAfterPunctuation - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#10 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#38 - def allowed_type?(token); end - - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#20 - def each_missing_space(tokens); end - - # The normal offset, i.e., the distance from the punctuation - # token where a space should be, is 1. - # - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#49 - def offset; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#42 - def space_forbidden_before_rcurly?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#30 - def space_missing?(token1, token2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#34 - def space_required_before?(token); end -end - -# source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#8 -RuboCop::Cop::SpaceAfterPunctuation::MSG = T.let(T.unsafe(nil), String) - -# Common functionality for cops checking for space before -# punctuation. -# -# source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#7 -module RuboCop::Cop::SpaceBeforePunctuation - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#12 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#22 - def each_missing_space(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#34 - def space_missing?(token1, token2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#38 - def space_required_after?(token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#42 - def space_required_after_lcurly?; end -end - -# source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#10 -RuboCop::Cop::SpaceBeforePunctuation::MSG = T.let(T.unsafe(nil), String) - -# This autocorrects whitespace -# -# source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#6 -class RuboCop::Cop::SpaceCorrector - extend ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::SurroundingSpace - - class << self - # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#36 - def add_space(processed_source, corrector, left_token, right_token); end - - # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#12 - def empty_corrections(processed_source, corrector, empty_config, left_token, right_token); end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#10 - def processed_source; end - - # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#24 - def remove_space(processed_source, corrector, left_token, right_token); end - end -end - -# Common functionality for modifier cops. -# -# source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#6 -module RuboCop::Cop::StatementModifier - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - - private - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#85 - def code_after(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#109 - def comment_disables_cop?(comment); end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#77 - def first_line_comment(node); end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#57 - def if_body_source(if_body); end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#43 - def length_in_modifier_form(node); end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#103 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#71 - def method_source(if_body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#37 - def modifier_fits_on_single_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#26 - def non_eligible_body?(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#33 - def non_eligible_condition?(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#19 - def non_eligible_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#65 - def omitted_value_in_last_hash_arg?(if_body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#91 - def parenthesize?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#11 - def single_line_as_modifier?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#50 - def to_modifier_form(node); end -end - -# Classes that include this module just implement functions to determine -# what is an offense and how to do autocorrection. They get help with -# adding offenses for the faulty string nodes, and with filtering out -# nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/string_help.rb#9 -module RuboCop::Cop::StringHelp - # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#26 - def on_regexp(node); end - - # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#10 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#32 - def inside_interpolation?(node); end -end - -# This autocorrects string literals -# -# source://rubocop//lib/rubocop/cop/correctors/string_literal_corrector.rb#6 -class RuboCop::Cop::StringLiteralCorrector - extend ::RuboCop::PathUtil - extend ::RuboCop::Cop::Util - - class << self - # source://rubocop//lib/rubocop/cop/correctors/string_literal_corrector.rb#10 - def correct(corrector, node, style); end - end -end - -# Common functionality for cops checking single/double quotes. -# -# source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#6 -module RuboCop::Cop::StringLiteralsHelp - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#24 - def enforce_double_quotes?; end - - # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#20 - def preferred_string_literal; end - - # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#28 - def string_literals_config; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#9 - def wrong_quotes?(src_or_node); end -end - -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#5 -module RuboCop::Cop::Style; end - -# Access modifiers should be declared to apply to a group of methods -# or inline before each method, depending on configuration. -# EnforcedStyle config covers only method definitions. -# Applications of visibility methods to symbols can be controlled -# using AllowModifiersOnSymbols config. -# Also, the visibility of `attr*` methods can be controlled using -# AllowModifiersOnAttrs config. -# -# In Ruby 3.0, `attr*` methods now return an array of defined method names -# as symbols. So we can write the modifier and `attr*` in inline style. -# AllowModifiersOnAttrs config allows `attr*` methods to be written in -# inline style without modifying applications that have been maintained -# for a long time in group style. Furthermore, developers who are not very -# familiar with Ruby may know that the modifier applies to `def`, but they -# may not know that it also applies to `attr*` methods. It would be easier -# to understand if we could write `attr*` methods in inline style. -# -# @example AllowModifiersOnAliasMethod: false -# # bad -# class Foo -# -# public alias_method :bar, :foo -# protected alias_method :baz, :foo -# private alias_method :qux, :foo -# -# end -# @example EnforcedStyle: inline -# # bad -# class Foo -# -# private -# -# def bar; end -# def baz; end -# -# end -# -# # good -# class Foo -# -# private def bar; end -# private def baz; end -# -# end -# @example AllowModifiersOnSymbols: true (default) -# # good -# class Foo -# -# private :bar, :baz -# private *%i[qux quux] -# private *METHOD_NAMES -# private *private_methods -# -# end -# @example AllowModifiersOnSymbols: false -# # bad -# class Foo -# -# private :bar, :baz -# private *%i[qux quux] -# private *METHOD_NAMES -# private *private_methods -# -# end -# @example AllowModifiersOnAttrs: true (default) -# # good -# class Foo -# -# public attr_reader :bar -# protected attr_writer :baz -# private attr_accessor :qux -# private attr :quux -# -# def public_method; end -# -# private -# -# def private_method; end -# -# end -# @example AllowModifiersOnAttrs: false -# # bad -# class Foo -# -# public attr_reader :bar -# protected attr_writer :baz -# private attr_accessor :qux -# private attr :quux -# -# end -# @example AllowModifiersOnAliasMethod: true (default) -# # good -# class Foo -# -# public alias_method :bar, :foo -# protected alias_method :baz, :foo -# private alias_method :qux, :foo -# -# end -# @example EnforcedStyle: group (default) -# # bad -# class Foo -# -# private def bar; end -# private def baz; end -# -# end -# -# # good -# class Foo -# -# private -# -# def bar; end -# def baz; end -# -# end -# -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#135 -class RuboCop::Cop::Style::AccessModifierDeclarations < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#167 - def access_modifier_with_alias_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#161 - def access_modifier_with_attr?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#154 - def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#172 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#247 - def access_modifier_is_inlined?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#251 - def access_modifier_is_not_inlined?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#222 - def allow_modifiers_on_alias_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#218 - def allow_modifiers_on_attrs?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#214 - def allow_modifiers_on_symbols?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#187 - def allowed?(node); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#195 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#232 - def correctable_group_offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#334 - def def_source(node, def_nodes); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#294 - def find_argument_less_modifier_node(node); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#275 - def find_corresponding_def_nodes(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#239 - def group_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#243 - def inline_style?; end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#324 - def insert_inline_modifier(corrector, node, modifier_name); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#265 - def message(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#226 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#210 - def percent_symbol_array?(node); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#328 - def remove_nodes(corrector, *nodes); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#308 - def replace_defs(corrector, node, def_nodes); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#255 - def right_siblings_same_inline_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#302 - def select_grouped_def_nodes(node); end -end - -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#141 -RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#146 -RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#151 -RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for grouping of accessors in `class` and `module` bodies. -# By default it enforces accessors to be placed in grouped declarations, -# but it can be configured to enforce separating them in multiple declarations. -# -# NOTE: If there is a method call before the accessor method it is always allowed -# as it might be intended like Sorbet. -# -# NOTE: If there is a RBS::Inline annotation comment just after the accessor method -# it is always allowed. -# -# @example EnforcedStyle: grouped (default) -# # bad -# class Foo -# attr_reader :bar -# attr_reader :bax -# attr_reader :baz -# end -# -# # good -# class Foo -# attr_reader :bar, :bax, :baz -# end -# -# # good -# class Foo -# # may be intended comment for bar. -# attr_reader :bar -# -# sig { returns(String) } -# attr_reader :bax -# -# may_be_intended_annotation :baz -# attr_reader :baz -# end -# @example EnforcedStyle: separated -# # bad -# class Foo -# attr_reader :bar, :baz -# end -# -# # good -# class Foo -# attr_reader :bar -# attr_reader :baz -# end -# -# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#53 -class RuboCop::Cop::Style::AccessorGrouping < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::VisibilityHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#62 - def on_sclass(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#85 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#74 - def check(send_node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#122 - def class_send_elements(class_node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#179 - def group_accessors(node, accessors); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#99 - def groupable_accessor?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#142 - def groupable_sibling_accessor?(node, sibling); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#149 - def groupable_sibling_accessors(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#134 - def grouped_style?; end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#155 - def message(send_node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#160 - def preferred_accessors(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#94 - def previous_line_comment?(node); end - - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#185 - def separate_accessors(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#138 - def separated_style?; end - - # Group after constants - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#174 - def skip_for_grouping?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#59 -RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#60 -RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String) - -# Enforces the use of either `#alias` or `#alias_method` -# depending on configuration. -# It also flags uses of `alias :symbol` rather than `alias bareword`. -# -# However, it will always enforce `method_alias` when used `alias` -# in an instance method definition and in a singleton method definition. -# If used in a block, always enforce `alias_method` -# unless it is an `instance_eval` block. -# -# @example EnforcedStyle: prefer_alias (default) -# # bad -# alias_method :bar, :foo -# alias :bar :foo -# -# # good -# alias bar foo -# @example EnforcedStyle: prefer_alias_method -# # bad -# alias :bar :foo -# alias bar foo -# -# # good -# alias_method :bar, :foo -# -# source://rubocop//lib/rubocop/cop/style/alias.rb#31 -class RuboCop::Cop::Style::Alias < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/alias.rb#52 - def on_alias(node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#41 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/alias.rb#86 - def add_offense_for_args(node, &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/alias.rb#76 - def alias_keyword_possible?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/alias.rb#80 - def alias_method_possible?(node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#66 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/alias.rb#125 - def bareword?(sym_node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#129 - def correct_alias_method_to_alias(corrector, send_node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#136 - def correct_alias_to_alias_method(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#143 - def correct_alias_with_symbol_args(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#148 - def identifier(node); end - - # source://rubocop//lib/rubocop/cop/style/alias.rb#114 - def lexical_scope_type(node); end - - # In this expression, will `self` be the same as the innermost enclosing - # class or module block (:lexical)? Or will it be something else - # (:dynamic)? If we're in an instance_eval block, return that. - # - # source://rubocop//lib/rubocop/cop/style/alias.rb#97 - def scope_type(node); end -end - -# source://rubocop//lib/rubocop/cop/style/alias.rb#35 -RuboCop::Cop::Style::Alias::MSG_ALIAS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/alias.rb#36 -RuboCop::Cop::Style::Alias::MSG_ALIAS_METHOD = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/alias.rb#37 -RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/alias.rb#39 -RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for endless methods inside operations of lower precedence (`and`, `or`, and -# modifier forms of `if`, `unless`, `while`, `until`) that are ambiguous due to -# lack of parentheses. This may lead to unexpected behavior as the code may appear -# to use these keywords as part of the method but in fact they modify -# the method definition itself. -# -# In these cases, using a normal method definition is more clear. -# -# @example -# -# # bad -# def foo = true if bar -# -# # good - using a non-endless method is more explicit -# def foo -# true -# end if bar -# -# # ok - method body is explicit -# def foo = (true if bar) -# -# # ok - method definition is explicit -# (def foo = true) if bar -# -# source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#29 -class RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::EndlessMethodRewriter - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::TargetRubyVersion - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#40 - def ambiguous_endless_method_body(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#48 - def on_def(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#69 - def keyword(operation); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#63 - def modifier_form?(operation); end -end - -# source://rubocop//lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#37 -RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of `and` and `or`, and suggests using `&&` and -# `||` instead. It can be configured to check only in conditions or in -# all contexts. -# -# @example EnforcedStyle: conditionals (default) -# # bad -# if foo and bar -# end -# -# # good -# foo.save && return -# -# # good -# foo.save and return -# -# # good -# if foo && bar -# end -# @example EnforcedStyle: always -# # bad -# foo.save and return -# -# # bad -# if foo and bar -# end -# -# # good -# foo.save && return -# -# # good -# if foo && bar -# end -# -# source://rubocop//lib/rubocop/cop/style/and_or.rb#44 -class RuboCop::Cop::Style::AndOr < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#56 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#56 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#56 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#56 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#56 - def on_while_post(node); end - - private - - # ! is a special case: - # 'x and !obj.method arg' can be autocorrected if we - # recurse down a level and add parens to 'obj.method arg' - # however, 'not x' also parses as (send x :!) - # - # source://rubocop//lib/rubocop/cop/style/and_or.rb#117 - def correct_not(node, receiver, corrector); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#129 - def correct_other(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#95 - def correct_send(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#108 - def correct_setter(node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/and_or.rb#143 - def correctable_send?(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#135 - def keep_operator_precedence(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#91 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#85 - def on_conditionals(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#66 - def process_logical_operator(node); end - - # source://rubocop//lib/rubocop/cop/style/and_or.rb#147 - def whitespace_before_arg(node); end -end - -# source://rubocop//lib/rubocop/cop/style/and_or.rb#49 -RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) - -# In Ruby 2.7, arguments forwarding has been added. -# -# This cop identifies places where `do_something(*args, &block)` -# can be replaced by `do_something(...)`. -# -# In Ruby 3.1, anonymous block forwarding has been added. -# -# This cop identifies places where `do_something(&block)` can be replaced -# by `do_something(&)`; if desired, this functionality can be disabled -# by setting `UseAnonymousForwarding: false`. -# -# In Ruby 3.2, anonymous args/kwargs forwarding has been added. -# -# This cop also identifies places where `+use_args(*args)+`/`+use_kwargs(**kwargs)+` can be -# replaced by `+use_args(*)+`/`+use_kwargs(**)+`; if desired, this functionality can be -# disabled by setting `UseAnonymousForwarding: false`. -# -# And this cop has `RedundantRestArgumentNames`, `RedundantKeywordRestArgumentNames`, -# and `RedundantBlockArgumentNames` options. This configuration is a list of redundant names -# that are sufficient for anonymizing meaningless naming. -# -# Meaningless names that are commonly used can be anonymized by default: -# e.g., `+*args+`, `+**options+`, `&block`, and so on. -# -# Names not on this list are likely to be meaningful and are allowed by default. -# -# This cop handles not only method forwarding but also forwarding to `super`. -# -# [NOTE] -# ==== -# Because of a bug in Ruby 3.3.0, when a block is referenced inside of another block, -# no offense will be registered until Ruby 3.4: -# -# [source,ruby] -# ---- -# def foo(&block) -# # Using an anonymous block would be a syntax error on Ruby 3.3.0 -# block_method { bar(&block) } -# end -# ---- -# ==== -# -# @example RedundantBlockArgumentNames: ['blk', 'block', 'proc'] (default) -# # bad - But it is good with `EnforcedStyle: explicit` set for `Naming/BlockForwarding`. -# def foo(&block) -# bar(&block) -# end -# -# # good -# def foo(&) -# bar(&) -# end -# @example UseAnonymousForwarding: true (default, only relevant for Ruby >= 3.2) -# # bad -# def foo(*args, **kwargs, &block) -# args_only(*args) -# kwargs_only(**kwargs) -# block_only(&block) -# end -# -# # good -# def foo(*, **, &) -# args_only(*) -# kwargs_only(**) -# block_only(&) -# end -# @example UseAnonymousForwarding: false (only relevant for Ruby >= 3.2) -# # good -# def foo(*args, **kwargs, &block) -# args_only(*args) -# kwargs_only(**kwargs) -# block_only(&block) -# end -# @example AllowOnlyRestArgument: true (default, only relevant for Ruby < 3.2) -# # good -# def foo(*args) -# bar(*args) -# end -# -# def foo(**kwargs) -# bar(**kwargs) -# end -# @example AllowOnlyRestArgument: false (only relevant for Ruby < 3.2) -# # bad -# # The following code can replace the arguments with `...`, -# # but it will change the behavior. Because `...` forwards block also. -# def foo(*args) -# bar(*args) -# end -# -# def foo(**kwargs) -# bar(**kwargs) -# end -# @example RedundantRestArgumentNames: ['args', 'arguments'] (default) -# # bad -# def foo(*args) -# bar(*args) -# end -# -# # good -# def foo(*) -# bar(*) -# end -# @example RedundantKeywordRestArgumentNames: ['kwargs', 'options', 'opts'] (default) -# # bad -# def foo(**kwargs) -# bar(**kwargs) -# end -# -# # good -# def foo(**) -# bar(**) -# end -# @example -# # bad -# def foo(*args, &block) -# bar(*args, &block) -# end -# -# # bad -# def foo(*args, **kwargs, &block) -# bar(*args, **kwargs, &block) -# end -# -# # good -# def foo(...) -# bar(...) -# end -# -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#141 -class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#160 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#160 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#202 - def add_forward_all_offenses(node, send_classifications, forwardable_args); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#385 - def add_parens_if_missing(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#227 - def add_post_ruby_32_offenses(def_node, send_classifications, forwardable_args); end - - # Checks if forwarding is uses both in blocks and outside of blocks. - # On Ruby 3.3.0, anonymous block forwarding in blocks can be is a syntax - # error, so we only want to register an offense if we can change all occurrences. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#309 - def all_forwarding_offenses_correctable?(send_classifications); end - - # Ruby 3.3.0 had a bug where accessing an anonymous block argument inside of a block - # was a syntax error in unambiguous cases: https://bugs.ruby-lang.org/issues/20090 - # We disallow this also for earlier Ruby versions so that code is forwards compatible. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#320 - def allow_anonymous_forwarding_in_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#377 - def allow_only_rest_arguments?; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#365 - def arguments_range(node, first_node); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#277 - def classification_and_forwards(def_node, send_node, referenced_lvars, forwardable_args); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#262 - def classify_send_nodes(def_node, send_nodes, referenced_lvars, forwardable_args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#564 - def explicit_block_name?; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#184 - def extract_forwardable_args(args); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#252 - def non_splat_or_block_pass_lvar_references(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#196 - def only_forwards_all?(send_classifications); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#188 - def redundant_forwardable_named_args(restarg, kwrestarg, blockarg); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#296 - def redundant_named_arg(arg, config_name, keyword); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#354 - def register_forward_all_offense(def_or_send, send_or_arguments, rest_or_splat); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#327 - def register_forward_args_offense(def_arguments_or_send, rest_arg_or_splat); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#343 - def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#335 - def register_forward_kwargs_offense(add_parens, def_arguments_or_send, kwrest_arg_or_splat); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#381 - def use_anonymous_forwarding?; end - - class << self - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#156 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#149 -RuboCop::Cop::Style::ArgumentsForwarding::ADDITIONAL_ARG_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#152 -RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#154 -RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#148 -RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#151 -RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#153 -RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), String) - -# Classifies send nodes for possible rest/kwrest/all (including block) forwarding. -# -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#393 -class RuboCop::Cop::Style::ArgumentsForwarding::SendNodeClassifier - extend ::RuboCop::AST::NodePattern::Macros - - # @return [SendNodeClassifier] a new instance of SendNodeClassifier - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#422 - def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#450 - def classification; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#406 - def def_all_anonymous_args?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#400 - def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#444 - def forwarded_block_arg; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#403 - def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#438 - def forwarded_kwrest_arg; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#432 - def forwarded_rest_arg; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#397 - def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#415 - def send_all_anonymous_args?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#535 - def additional_kwargs?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#531 - def additional_kwargs_or_forwarded_kwargs?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#545 - def allow_offense_for_no_block?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#516 - def any_arg_referenced?; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#500 - def arguments; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#465 - def can_forward_all?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#539 - def forward_additional_kwargs?; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#496 - def forwarded_rest_and_kwrest_args; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#558 - def missing_rest_arg_or_kwrest_arg?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#549 - def no_additional_args?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#524 - def no_post_splat_args?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#492 - def offensive_block_forwarding?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#512 - def referenced_block_arg?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#508 - def referenced_kwrest_arg?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#504 - def referenced_rest_arg?; end - - # def foo(a = 41, ...) is a syntax error in 3.0. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#477 - def ruby_30_or_lower_optarg?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#481 - def ruby_32_only_anonymous_forwarding?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#488 - def ruby_32_or_higher_missing_rest_or_kwest?; end - - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#520 - def target_ruby_version; end -end - -# Enforces the use of `Array()` instead of explicit `Array` check or `[*var]`. -# -# The cop is disabled by default due to safety concerns. -# -# @example -# # bad -# paths = [paths] unless paths.is_a?(Array) -# paths.each { |path| do_something(path) } -# -# # bad (always creates a new Array instance) -# [*paths].each { |path| do_something(path) } -# -# # good (and a bit more readable) -# Array(paths).each { |path| do_something(path) } -# -# source://rubocop//lib/rubocop/cop/style/array_coercion.rb#41 -class RuboCop::Cop::Style::ArrayCoercion < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#48 - def array_splat?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#63 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#74 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#53 - def unless_array?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/style/array_coercion.rb#45 -RuboCop::Cop::Style::ArrayCoercion::CHECK_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/array_coercion.rb#44 -RuboCop::Cop::Style::ArrayCoercion::SPLAT_MSG = T.let(T.unsafe(nil), String) - -# Identifies usages of `arr[0]` and `arr[-1]` and suggests to change -# them to use `arr.first` and `arr.last` instead. -# -# The cop is disabled by default due to safety concerns. -# -# @example -# # bad -# arr[0] -# arr[-1] -# -# # good -# arr.first -# arr.last -# arr[0] = 2 -# arr[0][-2] -# -# source://rubocop//lib/rubocop/cop/style/array_first_last.rb#28 -class RuboCop::Cop::Style::ArrayFirstLast < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#35 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#35 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#74 - def brace_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#61 - def find_offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#69 - def innermost_braces_node(node); end - - # source://rubocop//lib/rubocop/cop/style/array_first_last.rb#56 - def preferred_value(node, value); end -end - -# source://rubocop//lib/rubocop/cop/style/array_first_last.rb#31 -RuboCop::Cop::Style::ArrayFirstLast::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/array_first_last.rb#32 -RuboCop::Cop::Style::ArrayFirstLast::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# In Ruby 3.1, `Array#intersect?` has been added. -# -# This cop identifies places where `(array1 & array2).any?` -# or `(array1.intersection(array2)).any?` can be replaced by -# `array1.intersect?(array2)`. -# -# The `array1.intersect?(array2)` method is faster than -# `(array1 & array2).any?` and is more readable. -# -# In cases like the following, compatibility is not ensured, -# so it will not be detected when using block argument. -# -# [source,ruby] -# ---- -# ([1] & [1,2]).any? { |x| false } # => false -# [1].intersect?([1,2]) { |x| false } # => true -# ---- -# -# NOTE: Although `Array#intersection` can take zero or multiple arguments, -# only cases where exactly one argument is provided can be replaced with -# `Array#intersect?` and are handled by this cop. -# -# @example -# # bad -# (array1 & array2).any? -# (array1 & array2).empty? -# (array1 & array2).none? -# -# # bad -# array1.intersection(array2).any? -# array1.intersection(array2).empty? -# array1.intersection(array2).none? -# -# # good -# array1.intersect?(array2) -# !array1.intersect?(array2) -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# # good -# (array1 & array2).present? -# (array1 & array2).blank? -# @example AllCops:ActiveSupportExtensionsEnabled: true -# # bad -# (array1 & array2).present? -# (array1 & array2).blank? -# -# # good -# array1.intersect?(array2) -# !array1.intersect?(array2) -# -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#60 -class RuboCop::Cop::Style::ArrayIntersect < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#70 - def bad_intersection_check?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#86 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#86 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#103 - def bad_intersection?(node); end - - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#117 - def message(receiver, argument, method_name, dot, existing); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/array_intersect.rb#113 - def straight?(method_name); end -end - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#67 -RuboCop::Cop::Style::ArrayIntersect::ACTIVE_SUPPORT_PREDICATES = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#80 -RuboCop::Cop::Style::ArrayIntersect::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#83 -RuboCop::Cop::Style::ArrayIntersect::NEGATED_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#66 -RuboCop::Cop::Style::ArrayIntersect::PREDICATES = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#84 -RuboCop::Cop::Style::ArrayIntersect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/array_intersect.rb#82 -RuboCop::Cop::Style::ArrayIntersect::STRAIGHT_METHODS = T.let(T.unsafe(nil), Array) - -# Checks for uses of "*" as a substitute for _join_. -# -# Not all cases can reliably checked, due to Ruby's dynamic -# types, so we consider only cases when the first argument is an -# array literal or the second is a string literal. -# -# @example -# -# # bad -# %w(foo bar baz) * "," -# -# # good -# %w(foo bar baz).join(",") -# -# source://rubocop//lib/rubocop/cop/style/array_join.rb#20 -class RuboCop::Cop::Style::ArrayJoin < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/array_join.rb#27 - def join_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/array_join.rb#29 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/array_join.rb#23 -RuboCop::Cop::Style::ArrayJoin::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/array_join.rb#24 -RuboCop::Cop::Style::ArrayJoin::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#16 -class RuboCop::Cop::Style::AsciiComments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#21 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#51 - def allowed_non_ascii_chars; end - - # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#42 - def first_non_ascii_chars(string); end - - # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#32 - def first_offense_range(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#46 - def only_allowed_non_ascii_chars?(string); end -end - -# source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#19 -RuboCop::Cop::Style::AsciiComments::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of Module#attr. -# -# @example -# # bad - creates a single attribute accessor (deprecated in Ruby 1.9) -# attr :something, true -# attr :one, :two, :three # behaves as attr_reader -# -# # good -# attr_accessor :something -# attr_reader :one, :two, :three -# -# source://rubocop//lib/rubocop/cop/style/attr.rb#17 -class RuboCop::Cop::Style::Attr < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/attr.rb#74 - def class_eval?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/attr.rb#24 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/attr.rb#37 - def allowed_context?(node); end - - # source://rubocop//lib/rubocop/cop/style/attr.rb#47 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/attr.rb#43 - def define_attr_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/attr.rb#59 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/attr.rb#63 - def replacement_method(node); end -end - -# source://rubocop//lib/rubocop/cop/style/attr.rb#21 -RuboCop::Cop::Style::Attr::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/attr.rb#22 -RuboCop::Cop::Style::Attr::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for cases when you could use a block -# accepting version of a method that does automatic -# resource cleanup. -# -# @example -# -# # bad -# f = File.open('file') -# -# # good -# File.open('file') do |f| -# # ... -# end -# -# # bad -# f = Tempfile.open('temp') -# -# # good -# Tempfile.open('temp') do |f| -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#27 -class RuboCop::Cop::Style::AutoResourceCleanup < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#32 - def file_open_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#36 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#46 - def cleanup?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#28 -RuboCop::Cop::Style::AutoResourceCleanup::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#29 -RuboCop::Cop::Style::AutoResourceCleanup::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks if usage of %() or %Q() matches configuration. -# -# @example EnforcedStyle: bare_percent (default) -# # bad -# %Q(He said: "#{greeting}") -# %q{She said: 'Hi'} -# -# # good -# %(He said: "#{greeting}") -# %{She said: 'Hi'} -# @example EnforcedStyle: percent_q -# # bad -# %|He said: "#{greeting}"| -# %/She said: 'Hi'/ -# -# # good -# %Q|He said: "#{greeting}"| -# %q/She said: 'Hi'/ -# -# source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#26 -class RuboCop::Cop::Style::BarePercentLiterals < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#32 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#36 - def on_str(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#63 - def add_offense_for_wrong_style(node, good, bad); end - - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#42 - def check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#59 - def requires_bare_percent?(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#55 - def requires_percent_q?(source); end -end - -# source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#30 -RuboCop::Cop::Style::BarePercentLiterals::MSG = T.let(T.unsafe(nil), String) - -# Checks for BEGIN blocks. -# -# @example -# # bad -# BEGIN { test } -# -# source://rubocop//lib/rubocop/cop/style/begin_block.rb#12 -class RuboCop::Cop::Style::BeginBlock < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/begin_block.rb#15 - def on_preexe(node); end -end - -# source://rubocop//lib/rubocop/cop/style/begin_block.rb#13 -RuboCop::Cop::Style::BeginBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for places where `attr_reader` and `attr_writer` -# for the same method can be combined into single `attr_accessor`. -# -# @example -# # bad -# class Foo -# attr_reader :bar -# attr_writer :bar -# end -# -# # good -# class Foo -# attr_accessor :bar -# end -# -# source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#21 -class RuboCop::Cop::Style::BisectedAttrAccessor < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # Each offending macro is captured and registered in `on_class` but correction - # happens in `after_class` because a macro might have multiple attributes - # rewritten from it - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#55 - def after_class(class_node); end - - # Each offending macro is captured and registered in `on_class` but correction - # happens in `after_class` because a macro might have multiple attributes - # rewritten from it - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#55 - def after_module(class_node); end - - # Each offending macro is captured and registered in `on_class` but correction - # happens in `after_class` because a macro might have multiple attributes - # rewritten from it - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#55 - def after_sclass(class_node); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#33 - def on_class(class_node); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#33 - def on_module(class_node); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#29 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#33 - def on_sclass(class_node); end - - private - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#102 - def correct_reader(corrector, macro, node, range); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#114 - def correct_writer(corrector, macro, node, range); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#91 - def find_bisection(macros); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#74 - def find_macros(class_def); end - - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#98 - def register_offense(attr); end -end - -# source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#27 -RuboCop::Cop::Style::BisectedAttrAccessor::MSG = T.let(T.unsafe(nil), String) - -# Representation of an `attr_reader`, `attr_writer` or `attr` macro -# for use by `Style/BisectedAttrAccessor`. -# -# @api private -# -# source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#10 -class RuboCop::Cop::Style::BisectedAttrAccessor::Macro - include ::RuboCop::Cop::VisibilityHelp - - # @api private - # @return [Macro] a new instance of Macro - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#19 - def initialize(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#49 - def all_bisected?; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#29 - def attr_names; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#13 - def attrs; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#25 - def bisect(*names); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#33 - def bisected_names; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#13 - def bisection; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#13 - def node; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#41 - def reader?; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#53 - def rest; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#37 - def visibility; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#45 - def writer?; end - - class << self - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor/macro.rb#15 - def macro?(node); end - end -end - -# Prefer bitwise predicate methods over direct comparison operations. -# -# @example -# -# # bad - checks any set bits -# (variable & flags).positive? -# -# # good -# variable.anybits?(flags) -# -# # bad - checks all set bits -# (variable & flags) == flags -# -# # good -# variable.allbits?(flags) -# -# # bad - checks no set bits -# (variable & flags).zero? -# -# # good -# variable.nobits?(flags) -# -# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#32 -class RuboCop::Cop::Style::BitwisePredicate < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#52 - def allbits?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#42 - def anybits?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#68 - def bit_operation?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#60 - def nobits?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#73 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#88 - def preferred_method(node); end -end - -# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#36 -RuboCop::Cop::Style::BitwisePredicate::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/bitwise_predicate.rb#37 -RuboCop::Cop::Style::BitwisePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for uses of block comments (=begin...=end). -# -# @example -# # bad -# =begin -# Multiple lines -# of comments... -# =end -# -# # good -# # Multiple lines -# # of comments... -# -# source://rubocop//lib/rubocop/cop/style/block_comments.rb#19 -class RuboCop::Cop::Style::BlockComments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/block_comments.rb#27 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/block_comments.rb#56 - def eq_end_part(comment, expr); end - - # source://rubocop//lib/rubocop/cop/style/block_comments.rb#48 - def parts(comment); end -end - -# source://rubocop//lib/rubocop/cop/style/block_comments.rb#24 -RuboCop::Cop::Style::BlockComments::BEGIN_LENGTH = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/style/block_comments.rb#25 -RuboCop::Cop::Style::BlockComments::END_LENGTH = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/style/block_comments.rb#23 -RuboCop::Cop::Style::BlockComments::MSG = T.let(T.unsafe(nil), String) - -# Check for uses of braces or do/end around single line or -# multi-line blocks. -# -# Methods that can be either procedural or functional and cannot be -# categorised from their usage alone is ignored. -# `lambda`, `proc`, and `it` are their defaults. -# Additional methods can be added to the `AllowedMethods`. -# -# @example AllowedPatterns: ['map'] -# -# # good -# things.map { |thing| -# something = thing.some_method -# process(something) -# } -# @example EnforcedStyle: semantic -# # Prefer `do...end` over `{...}` for procedural blocks. -# -# # return value is used/assigned -# # bad -# foo = map do |x| -# x -# end -# puts (map do |x| -# x -# end) -# -# # return value is not used out of scope -# # good -# map do |x| -# x -# end -# -# # Prefer `{...}` over `do...end` for functional blocks. -# -# # return value is not used out of scope -# # bad -# each { |x| -# x -# } -# -# # return value is used/assigned -# # good -# foo = map { |x| -# x -# } -# map { |x| -# x -# }.inspect -# -# # The AllowBracesOnProceduralOneLiners option is allowed unless the -# # EnforcedStyle is set to `semantic`. If so: -# -# # If the AllowBracesOnProceduralOneLiners option is unspecified, or -# # set to `false` or any other falsey value, then semantic purity is -# # maintained, so one-line procedural blocks must use do-end, not -# # braces. -# -# # bad -# collection.each { |element| puts element } -# -# # good -# collection.each do |element| puts element end -# -# # If the AllowBracesOnProceduralOneLiners option is set to `true`, or -# # any other truthy value, then one-line procedural blocks may use -# # either style. (There is no setting for requiring braces on them.) -# -# # good -# collection.each { |element| puts element } -# -# # also good -# collection.each do |element| puts element end -# @example EnforcedStyle: braces_for_chaining -# # bad -# words.each do |word| -# word.flip.flop -# end.join("-") -# -# # good -# words.each { |word| -# word.flip.flop -# }.join("-") -# @example EnforcedStyle: always_braces -# # bad -# words.each do |word| -# word.flip.flop -# end -# -# # good -# words.each { |word| -# word.flip.flop -# } -# @example BracesRequiredMethods: ['sig'] -# -# # Methods listed in the BracesRequiredMethods list, such as 'sig' -# # in this example, will require `{...}` braces. This option takes -# # precedence over all other configurations except AllowedMethods. -# -# # bad -# sig do -# params( -# foo: string, -# ).void -# end -# def bar(foo) -# puts foo -# end -# -# # good -# sig { -# params( -# foo: string, -# ).void -# } -# def bar(foo) -# puts foo -# end -# @example AllowedMethods: ['lambda', 'proc', 'it' ] (default) -# -# # good -# foo = lambda do |x| -# puts "Hello, #{x}" -# end -# -# foo = lambda do |x| -# x * 100 -# end -# @example AllowedPatterns: [] (default) -# -# # bad -# things.map { |thing| -# something = thing.some_method -# process(something) -# } -# @example EnforcedStyle: line_count_based (default) -# # bad - single line block -# items.each do |item| item / 5 end -# -# # good - single line block -# items.each { |item| item / 5 } -# -# # bad - multi-line block -# things.map { |thing| -# something = thing.some_method -# process(something) -# } -# -# # good - multi-line block -# things.map do |thing| -# something = thing.some_method -# process(something) -# end -# -# source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#168 -class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#200 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#183 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#200 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#200 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#183 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#484 - def array_or_range?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#215 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#488 - def begin_required?(block_node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#243 - def braces_for_chaining_message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#429 - def braces_for_chaining_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#255 - def braces_required_message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#406 - def braces_required_method?(method_name); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#410 - def braces_required_methods; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#439 - def braces_style?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#443 - def correction_would_break_code?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#331 - def end_of_chain(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#453 - def functional_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#449 - def functional_method?(method_name); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#349 - def get_blocks(node, &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#414 - def line_count_based_block_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#225 - def line_count_based_message(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#259 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#307 - def move_comment_before_block(corrector, comment, block_node, closing_brace); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#461 - def procedural_method?(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#457 - def procedural_oneliners_may_have_braces?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#374 - def proper_block_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#338 - def remove_trailing_whitespace(corrector, range, comment); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#270 - def replace_braces_with_do_end(corrector, loc); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#286 - def replace_do_end_with_braces(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#386 - def require_do_end?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#477 - def return_value_of_scope?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#465 - def return_value_used?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#418 - def semantic_block_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#233 - def semantic_message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#494 - def single_argument_operator_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#321 - def source_range_before_comment(range, comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#393 - def special_method?(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#399 - def special_method_proper_block_style?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#303 - def whitespace_after?(range, length = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#299 - def whitespace_before?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#344 - def with_block?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#179 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#175 -RuboCop::Cop::Style::BlockDelimiters::ALWAYS_BRACES_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#177 -RuboCop::Cop::Style::BlockDelimiters::BRACES_REQUIRED_MESSAGE = T.let(T.unsafe(nil), String) - -# Corrector to correct conditional assignment in `case` statements. -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#616 -class RuboCop::Cop::Style::CaseCorrector - extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper - extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper - - class << self - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#621 - def correct(corrector, cop, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#631 - def move_assignment_inside_condition(corrector, node); end - - private - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#651 - def extract_branches(case_node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#645 - def extract_tail_branches(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#661 - def move_branch_inside_condition(corrector, branch, condition, assignment, column); end - end -end - -# If `AllowOnSelfClass` option is enabled, the cop will ignore violations when the receiver of -# the case equality operator is `self.class`. Note intermediate variables are not accepted. -# -# @example -# # bad -# (1..100) === 7 -# /something/ === some_string -# -# # good -# something.is_a?(Array) -# (1..100).include?(7) -# /something/.match?(some_string) -# @example AllowOnConstant: false (default) -# # bad -# Array === something -# @example AllowOnConstant: true -# # good -# Array === something -# @example AllowOnSelfClass: false (default) -# # bad -# self.class === something -# @example AllowOnSelfClass: true -# # good -# self.class === something -# -# source://rubocop//lib/rubocop/cop/style/case_equality.rb#40 -class RuboCop::Cop::Style::CaseEquality < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#47 - def case_equality?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#52 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#50 - def self_class?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#90 - def begin_replacement(lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#96 - def const_replacement(lhs, rhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#65 - def offending_receiver?(node); end - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#72 - def replacement(lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/style/case_equality.rb#100 - def send_replacement(lhs, rhs); end -end - -# source://rubocop//lib/rubocop/cop/style/case_equality.rb#43 -RuboCop::Cop::Style::CaseEquality::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/case_equality.rb#44 -RuboCop::Cop::Style::CaseEquality::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies places where `if-elsif` constructions -# can be replaced with `case-when`. -# -# @example MinBranchesCount: 3 (default) -# # bad -# if status == :active -# perform_action -# elsif status == :inactive || status == :hibernating -# check_timeout -# elsif status == :invalid -# report_invalid -# else -# final_action -# end -# -# # good -# case status -# when :active -# perform_action -# when :inactive, :hibernating -# check_timeout -# when :invalid -# report_invalid -# else -# final_action -# end -# @example MinBranchesCount: 4 -# # good -# if status == :active -# perform_action -# elsif status == :inactive || status == :hibernating -# check_timeout -# elsif status == :invalid -# report_invalid -# else -# final_action -# end -# -# source://rubocop//lib/rubocop/cop/style/case_like_if.rb#50 -class RuboCop::Cop::Style::CaseLikeIf < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MinBranchesCount - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#57 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#81 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#228 - def branch_conditions(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#246 - def class_reference?(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#166 - def collect_conditions(node, target, conditions); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#217 - def condition_from_binary_op(lhs, rhs, target); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#201 - def condition_from_equality_node(node, target); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#210 - def condition_from_include_or_cover_node(node, target); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#206 - def condition_from_match_node(node, target); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#185 - def condition_from_send_node(node, target); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#237 - def const_reference?(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#255 - def correction_range(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#250 - def deparenthesize(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#102 - def find_target(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#136 - def find_target_in_equality_node(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#148 - def find_target_in_include_or_cover_node(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#154 - def find_target_in_match_node(node); end - - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#121 - def find_target_in_send_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#271 - def regexp_with_named_captures?(node); end - - # Named captures work with `=~` (if regexp is on lhs) and with `match` (both sides) - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#260 - def regexp_with_working_captures?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#96 - def should_check?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/case_like_if.rb#55 -RuboCop::Cop::Style::CaseLikeIf::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of the character literal ?x. -# Starting with Ruby 1.9 character literals are -# essentially one-character strings, so this syntax -# is mostly redundant at this point. -# -# ? character literal can be used to express meta and control character. -# That's a good use case of ? literal so it doesn't count it as an offense. -# -# @example -# # bad -# ?x -# -# # good -# 'x' -# -# # good - control & meta escapes -# ?\C-\M-d -# "\C-\M-d" # same as above -# -# source://rubocop//lib/rubocop/cop/style/character_literal.rb#24 -class RuboCop::Cop::Style::CharacterLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::StringHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/character_literal.rb#35 - def autocorrect(corrector, node); end - - # Dummy implementation of method in ConfigurableEnforcedStyle that is - # called from StringHelp. - # - # source://rubocop//lib/rubocop/cop/style/character_literal.rb#53 - def correct_style_detected; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/character_literal.rb#30 - def offense?(node); end - - # Dummy implementation of method in ConfigurableEnforcedStyle that is - # called from StringHelp. - # - # source://rubocop//lib/rubocop/cop/style/character_literal.rb#49 - def opposite_style_detected; end -end - -# source://rubocop//lib/rubocop/cop/style/character_literal.rb#28 -RuboCop::Cop::Style::CharacterLiteral::MSG = T.let(T.unsafe(nil), String) - -# Checks that namespaced classes and modules are defined with a consistent style. -# -# With `nested` style, classes and modules should be defined separately (one constant -# on each line, without `::`). With `compact` style, classes and modules should be -# defined with fully qualified names (using `::` for namespaces). -# -# NOTE: The style chosen will affect `Module.nesting` for the class or module. Using -# `nested` style will result in each level being added, whereas `compact` style will -# only include the fully qualified class or module name. -# -# By default, `EnforcedStyle` applies to both classes and modules. If desired, separate -# styles can be defined for classes and modules by using `EnforcedStyleForClasses` and -# `EnforcedStyleForModules` respectively. If not set, or set to nil, the `EnforcedStyle` -# value will be used. -# -# The compact style is only forced for classes/modules with one child. -# -# @example EnforcedStyle: nested (default) -# # good -# # have each child on its own line -# class Foo -# class Bar -# end -# end -# @example EnforcedStyle: compact -# # good -# # combine definitions as much as possible -# class Foo::Bar -# end -# -# source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#45 -class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#54 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#60 - def on_module(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#103 - def add_trailing_end(corrector, node, padding); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#203 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#192 - def check_compact_style(node, body); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#184 - def check_nested_style(node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#174 - def check_style(node, body, style); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#108 - def compact_definition(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#129 - def compact_identifier_name(node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#114 - def compact_node(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#213 - def compact_node_name?(node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#119 - def compact_replacement(node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#160 - def leading_spaces(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#209 - def needs_compacting?(body); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#76 - def nest_definition(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#66 - def nest_or_compact(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#135 - def remove_end(corrector, body); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#85 - def replace_namespace_keyword(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#164 - def spaces_size(spaces_string); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#94 - def split_on_double_colon(corrector, node, padding); end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#217 - def style_for_classes; end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#221 - def style_for_modules; end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#169 - def tab_indentation_width; end - - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#148 - def unindent(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#52 -RuboCop::Cop::Style::ClassAndModuleChildren::COMPACT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#51 -RuboCop::Cop::Style::ClassAndModuleChildren::NESTED_MSG = T.let(T.unsafe(nil), String) - -# Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. -# -# @example EnforcedStyle: is_a? (default) -# # bad -# var.kind_of?(Date) -# var.kind_of?(Integer) -# -# # good -# var.is_a?(Date) -# var.is_a?(Integer) -# @example EnforcedStyle: kind_of? -# # bad -# var.is_a?(Time) -# var.is_a?(String) -# -# # good -# var.kind_of?(Time) -# var.kind_of?(String) -# -# source://rubocop//lib/rubocop/cop/style/class_check.rb#26 -class RuboCop::Cop::Style::ClassCheck < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/class_check.rb#45 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/class_check.rb#33 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/class_check.rb#33 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_check.rb#30 -RuboCop::Cop::Style::ClassCheck::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/class_check.rb#31 -RuboCop::Cop::Style::ClassCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the use of `Object#instance_of?` instead of class comparison -# for equality. -# `==`, `equal?`, and `eql?` custom method definitions are allowed by default. -# These are customizable with `AllowedMethods` option. -# -# @example -# # bad -# var.class == Date -# var.class.equal?(Date) -# var.class.eql?(Date) -# var.class.name == 'Date' -# -# # good -# var.instance_of?(Date) -# @example AllowedMethods: ['==', 'equal?', 'eql?'] (default) -# # good -# def ==(other) -# self.class == other.class && name == other.name -# end -# -# def equal?(other) -# self.class.equal?(other.class) && name.equal?(other.name) -# end -# -# def eql?(other) -# self.class.eql?(other.class) && name.eql?(other.name) -# end -# @example AllowedPatterns: [] (default) -# # bad -# def eq(other) -# self.class.eq(other.class) && name.eq(other.name) -# end -# @example AllowedPatterns: ['eq'] -# # good -# def eq(other) -# self.class.eq(other.class) && name.eq(other.name) -# end -# -# source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#52 -class RuboCop::Cop::Style::ClassEqualityComparison < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#64 - def class_comparison_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#70 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#92 - def class_name(class_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#112 - def class_name_method?(method_name); end - - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#128 - def offense_range(receiver_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#116 - def require_cbase?(class_node); end - - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#124 - def trim_string_quotes(class_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#120 - def unable_to_determine_type?(class_node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#61 -RuboCop::Cop::Style::ClassEqualityComparison::CLASS_NAME_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#58 -RuboCop::Cop::Style::ClassEqualityComparison::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#60 -RuboCop::Cop::Style::ClassEqualityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of the class/module name instead of -# self, when defining class/module methods. -# -# @example -# # bad -# class SomeClass -# def SomeClass.class_method -# # ... -# end -# end -# -# # good -# class SomeClass -# def self.class_method -# # ... -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/class_methods.rb#23 -class RuboCop::Cop::Style::ClassMethods < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/class_methods.rb#28 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/class_methods.rb#28 - def on_module(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/class_methods.rb#41 - def check_defs(name, node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_methods.rb#26 -RuboCop::Cop::Style::ClassMethods::MSG = T.let(T.unsafe(nil), String) - -# Enforces using `def self.method_name` or `class << self` to define class methods. -# -# @example EnforcedStyle: def_self (default) -# # bad -# class SomeClass -# class << self -# attr_accessor :class_accessor -# -# def class_method -# # ... -# end -# end -# end -# -# # good -# class SomeClass -# def self.class_method -# # ... -# end -# -# class << self -# attr_accessor :class_accessor -# end -# end -# -# # good - contains private method -# class SomeClass -# class << self -# attr_accessor :class_accessor -# -# private -# -# def private_class_method -# # ... -# end -# end -# end -# @example EnforcedStyle: self_class -# # bad -# class SomeClass -# def self.class_method -# # ... -# end -# end -# -# # good -# class SomeClass -# class << self -# def class_method -# # ... -# end -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#61 -class RuboCop::Cop::Style::ClassMethodsDefinitions < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::CommentsHelp - include ::RuboCop::Cop::VisibilityHelp - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#81 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#71 - def on_sclass(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#95 - def all_methods_public?(sclass_node); end - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#115 - def autocorrect_sclass(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#102 - def def_nodes(sclass_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#91 - def def_self_style?; end - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#141 - def extract_def_from_sclass(def_node, sclass_node); end - - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#152 - def indentation_diff(node1, node2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#137 - def sclass_only_has_methods?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#68 -RuboCop::Cop::Style::ClassMethodsDefinitions::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#69 -RuboCop::Cop::Style::ClassMethodsDefinitions::MSG_SCLASS = T.let(T.unsafe(nil), String) - -# Checks for uses of class variables. Offenses -# are signaled only on assignment to class variables to -# reduce the number of offenses that would be reported. -# -# You have to be careful when setting a value for a class -# variable; if a class has been inherited, changing the -# value of a class variable also affects the inheriting -# classes. This means that it's almost always better to -# use a class instance variable instead. -# -# @example -# # bad -# class A -# @@test = 10 -# end -# -# class A -# def self.test(name, value) -# class_variable_set("@@#{name}", value) -# end -# end -# -# class A; end -# A.class_variable_set(:@@test, 10) -# -# # good -# class A -# @test = 10 -# end -# -# class A -# def test -# @@test # you can access class variable without offense -# end -# end -# -# class A -# def self.test(name) -# class_variable_get("@@#{name}") # you can access without offense -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/class_vars.rb#48 -class RuboCop::Cop::Style::ClassVars < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/class_vars.rb#52 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/class_vars.rb#56 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/class_vars.rb#49 -RuboCop::Cop::Style::ClassVars::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/class_vars.rb#50 -RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where custom logic on rejection nils from arrays -# and hashes can be replaced with `{Array,Hash}#{compact,compact!}`. -# -# @example -# # bad -# array.reject(&:nil?) -# array.reject { |e| e.nil? } -# array.select { |e| !e.nil? } -# array.filter { |e| !e.nil? } -# array.grep_v(nil) -# array.grep_v(NilClass) -# -# # good -# array.compact -# -# # bad -# hash.reject!(&:nil?) -# hash.reject! { |k, v| v.nil? } -# hash.select! { |k, v| !v.nil? } -# hash.filter! { |k, v| !v.nil? } -# -# # good -# hash.compact! -# @example AllowedReceivers: ['params'] -# # good -# params.reject(&:nil?) -# -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#44 -class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedReceivers - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#86 - def grep_v_with_nil?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#90 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#90 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#65 - def reject_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#58 - def reject_method_with_block_pass?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#75 - def select_method?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#129 - def good_method_name(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#106 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#137 - def range(begin_pos_node, end_pos_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/collection_compact.rb#123 - def to_enum_method?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#53 -RuboCop::Cop::Style::CollectionCompact::FILTER_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#50 -RuboCop::Cop::Style::CollectionCompact::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#51 -RuboCop::Cop::Style::CollectionCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/collection_compact.rb#52 -RuboCop::Cop::Style::CollectionCompact::TO_ENUM_METHODS = T.let(T.unsafe(nil), Array) - -# Enforces the use of consistent method names -# from the Enumerable module. -# -# You can customize the mapping from undesired method to desired method. -# -# e.g. to use `detect` over `find`: -# -# Style/CollectionMethods: -# PreferredMethods: -# find: detect -# -# @example -# # These examples are based on the default mapping for `PreferredMethods`. -# -# # bad -# items.collect -# items.collect! -# items.collect_concat -# items.inject -# items.detect -# items.find_all -# items.member? -# -# # good -# items.map -# items.map! -# items.flat_map -# items.reduce -# items.find -# items.select -# items.include? -# -# source://rubocop//lib/rubocop/cop/style/collection_methods.rb#43 -class RuboCop::Cop::Style::CollectionMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MethodPreference - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#49 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#55 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#49 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#49 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#55 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#64 - def check_method_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#73 - def implicit_block?(node); end - - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#81 - def message(node); end - - # Some enumerable methods accept a bare symbol (ie. _not_ Symbol#to_proc) instead - # of a block. - # - # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#87 - def methods_accepting_symbol; end -end - -# source://rubocop//lib/rubocop/cop/style/collection_methods.rb#47 -RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String) - -# Checks for methods invoked via the `::` operator instead -# of the `.` operator (like `FileUtils::rmdir` instead of `FileUtils.rmdir`). -# -# @example -# # bad -# Timeout::timeout(500) { do_something } -# FileUtils::rmdir(dir) -# Marshal::dump(obj) -# -# # good -# Timeout.timeout(500) { do_something } -# FileUtils.rmdir(dir) -# Marshal.dump(obj) -# -# source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#20 -class RuboCop::Cop::Style::ColonMethodCall < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#26 - def java_type_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#35 - def on_send(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#31 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#23 -RuboCop::Cop::Style::ColonMethodCall::MSG = T.let(T.unsafe(nil), String) - -# Checks for class methods that are defined using the `::` -# operator instead of the `.` operator. -# -# @example -# # bad -# class Foo -# def self::bar -# end -# end -# -# # good -# class Foo -# def self.bar -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#22 -class RuboCop::Cop::Style::ColonMethodDefinition < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#27 - def on_defs(node); end -end - -# source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#25 -RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Checks for multiple `defined?` calls joined by `&&` that can be combined -# into a single `defined?`. -# -# When checking that a nested constant or chained method is defined, it is -# not necessary to check each ancestor or component of the chain. -# -# @example -# # bad -# defined?(Foo) && defined?(Foo::Bar) && defined?(Foo::Bar::Baz) -# -# # good -# defined?(Foo::Bar::Baz) -# -# # bad -# defined?(foo) && defined?(foo.bar) && defined?(foo.bar.baz) -# -# # good -# defined?(foo.bar.baz) -# -# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#24 -class RuboCop::Cop::Style::CombinableDefined < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#31 - def on_and(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#55 - def defined_calls(nodes); end - - # If the redundant `defined?` node is the LHS of an `and` node, - # the term as well as the subsequent `&&`/`and` operator will be removed. - # - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#85 - def lhs_range_to_remove(term); end - - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#62 - def namespaces(nodes); end - - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#72 - def remove_term(corrector, term); end - - # If the redundant `defined?` node is the RHS of an `and` node, - # the term as well as the preceding `&&`/`and` operator will be removed. - # - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#100 - def rhs_range_to_remove(term); end - - # source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#49 - def terms(node); end -end - -# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#28 -RuboCop::Cop::Style::CombinableDefined::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/combinable_defined.rb#29 -RuboCop::Cop::Style::CombinableDefined::OPERATORS = T.let(T.unsafe(nil), Array) - -# Checks for places where multiple consecutive loops over the same data -# can be combined into a single loop. It is very likely that combining them -# will make the code more efficient and more concise. -# -# NOTE: Autocorrection is not applied when the block variable names differ in separate loops, -# as it is impossible to determine which variable name should be prioritized. -# -# @example -# # bad -# def method -# items.each do |item| -# do_something(item) -# end -# -# items.each do |item| -# do_something_else(item) -# end -# end -# -# # good -# def method -# items.each do |item| -# do_something(item) -# do_something_else(item) -# end -# end -# -# # bad -# def method -# for item in items do -# do_something(item) -# end -# -# for item in items do -# do_something_else(item) -# end -# end -# -# # good -# def method -# for item in items do -# do_something(item) -# do_something_else(item) -# end -# end -# -# # good -# def method -# each_slice(2) { |slice| do_something(slice) } -# each_slice(3) { |slice| do_something(slice) } -# end -# -# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#62 -class RuboCop::Cop::Style::CombinableLoops < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#85 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#96 - def collection_looping_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#113 - def combine_with_left_sibling(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#120 - def correct_end_of_block(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#101 - def same_collection_looping_block?(node, sibling); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#109 - def same_collection_looping_for?(node, sibling); end -end - -# source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#65 -RuboCop::Cop::Style::CombinableLoops::MSG = T.let(T.unsafe(nil), String) - -# Enforces using `` or %x around command literals. -# -# @example EnforcedStyle: backticks (default) -# # bad -# folders = %x(find . -type d).split -# -# # bad -# %x( -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ) -# -# # good -# folders = `find . -type d`.split -# -# # good -# ` -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ` -# @example EnforcedStyle: mixed -# # bad -# folders = %x(find . -type d).split -# -# # bad -# ` -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ` -# -# # good -# folders = `find . -type d`.split -# -# # good -# %x( -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ) -# @example EnforcedStyle: percent_x -# # bad -# folders = `find . -type d`.split -# -# # bad -# ` -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ` -# -# # good -# folders = %x(find . -type d).split -# -# # good -# %x( -# ln -s foo.example.yml foo.example -# ln -s bar.example.yml bar.example -# ) -# @example AllowInnerBackticks: false (default) -# # If `false`, the cop will always recommend using `%x` if one or more -# # backticks are found in the command string. -# -# # bad -# `echo \`ls\`` -# -# # good -# %x(echo `ls`) -# @example AllowInnerBackticks: true -# # good -# `echo \`ls\`` -# -# source://rubocop//lib/rubocop/cop/style/command_literal.rb#78 -class RuboCop::Cop::Style::CommandLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#85 - def on_xstr(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#146 - def allow_inner_backticks?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#122 - def allowed_backtick_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#131 - def allowed_percent_x_literal?(node); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#109 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#159 - def backtick_literal?(node); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#97 - def check_backtick_literal(node, message); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#103 - def check_percent_x_literal(node, message); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#167 - def command_delimiter; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#150 - def contains_backtick?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#142 - def contains_disallowed_backtick?(node); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#171 - def default_delimiter; end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#154 - def node_body(node); end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#163 - def preferred_delimiter; end - - # source://rubocop//lib/rubocop/cop/style/command_literal.rb#175 - def preferred_delimiters_config; end -end - -# source://rubocop//lib/rubocop/cop/style/command_literal.rb#82 -RuboCop::Cop::Style::CommandLiteral::MSG_USE_BACKTICKS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/command_literal.rb#83 -RuboCop::Cop::Style::CommandLiteral::MSG_USE_PERCENT_X = T.let(T.unsafe(nil), String) - -# Checks that comment annotation keywords are written according -# to guidelines. -# -# Annotation keywords can be specified by overriding the cop's `Keywords` -# configuration. Keywords are allowed to be single words or phrases. -# -# NOTE: With a multiline comment block (where each line is only a -# comment), only the first line will be able to register an offense, even -# if an annotation keyword starts another line. This is done to prevent -# incorrect registering of keywords (eg. `review`) inside a paragraph as an -# annotation. -# -# @example RequireColon: true (default) -# # bad -# # TODO make better -# -# # good -# # TODO: make better -# -# # bad -# # TODO:make better -# -# # good -# # TODO: make better -# -# # bad -# # fixme: does not work -# -# # good -# # FIXME: does not work -# -# # bad -# # Optimize does not work -# -# # good -# # OPTIMIZE: does not work -# @example RequireColon: false -# # bad -# # TODO: make better -# -# # good -# # TODO make better -# -# # bad -# # fixme does not work -# -# # good -# # FIXME does not work -# -# # bad -# # Optimize does not work -# -# # good -# # OPTIMIZE does not work -# -# source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#61 -class RuboCop::Cop::Style::CommentAnnotation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#73 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#110 - def annotation_range(annotation); end - - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#114 - def correct_offense(corrector, range, keyword); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#102 - def first_comment_line?(comments, index); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#106 - def inline_comment?(comment); end - - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#124 - def keywords; end - - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#87 - def register_offense(annotation); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#120 - def requires_colon?; end -end - -# source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#71 -RuboCop::Cop::Style::CommentAnnotation::MISSING_NOTE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#65 -RuboCop::Cop::Style::CommentAnnotation::MSG_COLON_STYLE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#68 -RuboCop::Cop::Style::CommentAnnotation::MSG_SPACE_STYLE = T.let(T.unsafe(nil), String) - -# Checks for comments put on the same line as some keywords. -# These keywords are: `class`, `module`, `def`, `begin`, `end`. -# -# Note that some comments -# RBS::Inline annotation, and Steep annotation (`steep:ignore`) are allowed. -# -# Autocorrection removes comments from `end` keyword and keeps comments -# for `class`, `module`, `def` and `begin` above the keyword. -# -# @example -# # bad -# if condition -# statement -# end # end if -# -# # bad -# class X # comment -# statement -# end -# -# # bad -# def x; end # comment -# -# # good -# if condition -# statement -# end -# -# # good -# class X # :nodoc: -# y -# end -# -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#45 -class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#65 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#88 - def offensive?(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#101 - def rbs_inline_annotation?(line, comment); end - - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#75 - def register_offense(comment, matched_keyword); end - - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#97 - def source_line(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#112 - def steep_annotation?(comment); end -end - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#54 -RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENTS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#55 -RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENT_REGEXES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#51 -RuboCop::Cop::Style::CommentedKeyword::KEYWORDS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#52 -RuboCop::Cop::Style::CommentedKeyword::KEYWORD_REGEXES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#61 -RuboCop::Cop::Style::CommentedKeyword::METHOD_OR_END_DEFINITIONS = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#49 -RuboCop::Cop::Style::CommentedKeyword::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#58 -RuboCop::Cop::Style::CommentedKeyword::REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#63 -RuboCop::Cop::Style::CommentedKeyword::STEEP_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#60 -RuboCop::Cop::Style::CommentedKeyword::SUBCLASS_DEFINITION = T.let(T.unsafe(nil), Regexp) - -# Checks for logical comparison which can be replaced with `Comparable#between?`. -# -# NOTE: `Comparable#between?` is on average slightly slower than logical comparison, -# although the difference generally isn't observable. If you require maximum -# performance, consider using logical comparison. -# -# @example -# -# # bad -# x >= min && x <= max -# -# # bad -# x <= max && x >= min -# -# # good -# x.between?(min, max) -# -# source://rubocop//lib/rubocop/cop/style/comparable_between.rb#26 -class RuboCop::Cop::Style::ComparableBetween < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/comparable_between.rb#41 - def logical_comparison_between_by_max_first?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/comparable_between.rb#32 - def logical_comparison_between_by_min_first?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/comparable_between.rb#49 - def on_and(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/comparable_between.rb#65 - def register_offense(node, min_and_value, max_and_value); end -end - -# source://rubocop//lib/rubocop/cop/style/comparable_between.rb#29 -RuboCop::Cop::Style::ComparableBetween::MSG = T.let(T.unsafe(nil), String) - -# Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum. -# -# This cop supports autocorrection for `if/elsif/else` bad style only. -# Because `ArgumentError` occurs if the minimum and maximum of `clamp` arguments are reversed. -# When these are variables, it is not possible to determine which is the minimum and maximum: -# -# [source,ruby] -# ---- -# [1, [2, 3].max].min # => 1 -# 1.clamp(3, 1) # => min argument must be smaller than max argument (ArgumentError) -# ---- -# -# @example -# -# # bad -# [[x, low].max, high].min -# -# # bad -# if x < low -# low -# elsif high < x -# high -# else -# x -# end -# -# # good -# x.clamp(low, high) -# -# source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#35 -class RuboCop::Cop::Style::ComparableClamp < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#61 - def array_min_max?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#47 - def if_elsif_else_condition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#78 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#100 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#108 - def autocorrect(corrector, node, prefer); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#117 - def min_condition?(if_condition, else_body); end -end - -# source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#42 -RuboCop::Cop::Style::ComparableClamp::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#43 -RuboCop::Cop::Style::ComparableClamp::MSG_MIN_MAX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/comparable_clamp.rb#44 -RuboCop::Cop::Style::ComparableClamp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the use of `Array#push(item)` instead of `Array#concat([item])` -# to avoid redundant array literals. -# -# @example -# -# # bad -# list.concat([foo]) -# list.concat([bar, baz]) -# list.concat([qux, quux], [corge]) -# -# # good -# list.push(foo) -# list.push(bar, baz) -# list.push(qux, quux, corge) -# -# source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#25 -class RuboCop::Cop::Style::ConcatArrayLiterals < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#34 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#34 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#70 - def offense_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#87 - def percent_literals_includes_only_basic_literals?(node); end - - # source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#74 - def preferred_method(node); end -end - -# source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#28 -RuboCop::Cop::Style::ConcatArrayLiterals::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#29 -RuboCop::Cop::Style::ConcatArrayLiterals::MSG_FOR_PERCENT_LITERALS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/concat_array_literals.rb#31 -RuboCop::Cop::Style::ConcatArrayLiterals::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Check for `if` and `case` statements where each branch is used for -# both the assignment and comparison of the same variable -# when using the return of the condition can be used instead. -# -# @example EnforcedStyle: assign_to_condition (default) -# # bad -# if foo -# bar = 1 -# else -# bar = 2 -# end -# -# case foo -# when 'a' -# bar += 1 -# else -# bar += 2 -# end -# -# if foo -# some_method -# bar = 1 -# else -# some_other_method -# bar = 2 -# end -# -# # good -# bar = if foo -# 1 -# else -# 2 -# end -# -# bar += case foo -# when 'a' -# 1 -# else -# 2 -# end -# -# bar << if foo -# some_method -# 1 -# else -# some_other_method -# 2 -# end -# @example EnforcedStyle: assign_inside_condition -# # bad -# bar = if foo -# 1 -# else -# 2 -# end -# -# bar += case foo -# when 'a' -# 1 -# else -# 2 -# end -# -# bar << if foo -# some_method -# 1 -# else -# some_other_method -# 2 -# end -# -# # good -# if foo -# bar = 1 -# else -# bar = 2 -# end -# -# case foo -# when 'a' -# bar += 1 -# else -# bar += 2 -# end -# -# if foo -# some_method -# bar = 1 -# else -# some_other_method -# bar = 2 -# end -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#207 -class RuboCop::Cop::Style::ConditionalAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Style::ConditionalAssignmentHelper - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # The shovel operator `<<` does not have its own type. It is a `send` - # type. - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#224 - def assignment_type?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#305 - def candidate_condition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#260 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#270 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#246 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_op_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#232 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#240 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#311 - def allowed_single_line?(branches); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#385 - def allowed_statements?(branches); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#307 - def allowed_ternary?(assignment); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#315 - def assignment_node(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#362 - def assignment_types_match?(*nodes); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#377 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#300 - def candidate_node?(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#282 - def check_assignment_to_condition(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#368 - def check_node(node, branches); end - - # If `Layout/LineLength` is enabled, we do not want to introduce an - # offense by autocorrecting this cop. Find the max configured line - # length. Find the longest line of condition. Remove the assignment - # from lines that contain the offending assignment because after - # correcting, this will not be on the line anymore. Check if the length - # of the longest line + the length of the corrected assignment is - # greater than the max configured line length - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#401 - def correction_exceeds_line_limit?(node, branches); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#432 - def include_ternary?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#355 - def lhs_all_match?(branches); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#420 - def line_length_cop_enabled?; end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#413 - def longest_line(node, assignment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#409 - def longest_line_exceeds_line_limit?(node, assignment); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#424 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#339 - def move_assignment_inside_condition(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#329 - def move_assignment_outside_condition(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#428 - def single_line_conditions_only?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#351 - def ternary_condition?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#215 -RuboCop::Cop::Style::ConditionalAssignment::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#213 -RuboCop::Cop::Style::ConditionalAssignment::ASSIGN_TO_CONDITION_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#217 -RuboCop::Cop::Style::ConditionalAssignment::ENABLED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#216 -RuboCop::Cop::Style::ConditionalAssignment::LINE_LENGTH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#218 -RuboCop::Cop::Style::ConditionalAssignment::MAX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#212 -RuboCop::Cop::Style::ConditionalAssignment::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#219 -RuboCop::Cop::Style::ConditionalAssignment::SINGLE_LINE_CONDITIONS_ONLY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#214 -RuboCop::Cop::Style::ConditionalAssignment::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# Helper module to provide common methods to classes needed for the -# ConditionalAssignment Cop. -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#8 -module RuboCop::Cop::Style::ConditionalAssignmentHelper - extend ::RuboCop::AST::NodePattern::Macros - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#60 - def end_with_eq?(sym); end - - # `elsif` branches show up in the `node` as an `else`. We need - # to recursively iterate over all `else` branches and consider all - # but the last `node` an `elsif` branch and consider the last `node` - # the actual `else` branch. - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#20 - def expand_elses(branch); end - - # `when` nodes contain the entire branch including the condition. - # We only need the contents of the branch, not the condition. - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#28 - def expand_when_branches(when_branches); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#51 - def indent(cop, source); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#36 - def lhs(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#32 - def tail(branch); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#106 - def assignment_rhs_exist?(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#66 - def expand_elsif(node, elsif_branches = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#92 - def lhs_for_casgn(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#79 - def lhs_for_send(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#102 - def setter_method?(method_name); end -end - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#13 -RuboCop::Cop::Style::ConditionalAssignmentHelper::ALIGN_WITH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#12 -RuboCop::Cop::Style::ConditionalAssignmentHelper::END_ALIGNMENT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#11 -RuboCop::Cop::Style::ConditionalAssignmentHelper::EQUAL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#14 -RuboCop::Cop::Style::ConditionalAssignmentHelper::KEYWORD = T.let(T.unsafe(nil), String) - -# Helper module to provide common methods to ConditionalAssignment -# correctors -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#439 -module RuboCop::Cop::Style::ConditionalCorrectorHelper - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#471 - def assignment(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#500 - def correct_branches(corrector, branches); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#477 - def correct_if_branches(corrector, cop, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#441 - def remove_whitespace_in_branches(corrector, branch, condition, column); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#487 - def replace_branch_assignment(corrector, branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#460 - def same_line?(node1, node2); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#464 - def white_space_range(node, column); end -end - -# Checks that constants defined in classes and modules have -# an explicit visibility declaration. By default, Ruby makes all class- -# and module constants public, which litters the public API of the -# class or module. Explicitly declaring a visibility makes intent more -# clear, and prevents outside actors from touching private state. -# -# @example -# -# # bad -# class Foo -# BAR = 42 -# BAZ = 43 -# end -# -# # good -# class Foo -# BAR = 42 -# private_constant :BAR -# -# BAZ = 43 -# public_constant :BAZ -# end -# @example IgnoreModules: false (default) -# # bad -# class Foo -# MyClass = Struct.new() -# end -# -# # good -# class Foo -# MyClass = Struct.new() -# public_constant :MyClass -# end -# @example IgnoreModules: true -# # good -# class Foo -# MyClass = Struct.new() -# end -# -# source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#47 -class RuboCop::Cop::Style::ConstantVisibility < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#51 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#87 - def visibility_declaration_for?(param0 = T.unsafe(nil), param1); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#69 - def class_or_module_scope?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#61 - def ignore_modules?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#91 - def match_name?(name, constant_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#65 - def module?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#80 - def visibility_declaration?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#48 -RuboCop::Cop::Style::ConstantVisibility::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/copyright.rb#21 -class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/copyright.rb#28 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/copyright.rb#45 - def autocorrect(corrector); end - - # source://rubocop//lib/rubocop/cop/style/copyright.rb#56 - def autocorrect_notice; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#86 - def encoding_token?(processed_source, token_index); end - - # source://rubocop//lib/rubocop/cop/style/copyright.rb#72 - def insert_notice_before(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/copyright.rb#52 - def notice; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#93 - def notice_found?(processed_source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#79 - def shebang_token?(processed_source, token_index); end - - # @raise [Warning] - # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#60 - def verify_autocorrect_notice!; end -end - -# source://rubocop//lib/rubocop/cop/style/copyright.rb#26 -RuboCop::Cop::Style::Copyright::AUTOCORRECT_EMPTY_WARNING = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/copyright.rb#25 -RuboCop::Cop::Style::Copyright::MSG = T.let(T.unsafe(nil), String) - -# Checks for inheritance from `Data.define` to avoid creating the anonymous parent class. -# Inheriting from `Data.define` adds a superfluous level in inheritance tree. -# -# @example -# # bad -# class Person < Data.define(:first_name, :last_name) -# def age -# 42 -# end -# end -# -# Person.ancestors -# # => [Person, #, Data, (...)] -# -# # good -# Person = Data.define(:first_name, :last_name) do -# def age -# 42 -# end -# end -# -# Person.ancestors -# # => [Person, Data, (...)] -# -# source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#33 -class RuboCop::Cop::Style::DataInheritance < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#55 - def data_define?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#43 - def on_class(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#62 - def correct_parent(parent, corrector); end - - # source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#72 - def range_for_empty_class_body(class_node, data_define); end -end - -# source://rubocop//lib/rubocop/cop/style/data_inheritance.rb#38 -RuboCop::Cop::Style::DataInheritance::MSG = T.let(T.unsafe(nil), String) - -# Checks for consistent usage of the `DateTime` class over the -# `Time` class. This cop is disabled by default since these classes, -# although highly overlapping, have particularities that make them not -# replaceable in certain situations when dealing with multiple timezones -# and/or DST. -# -# @example -# -# # bad - uses `DateTime` for current time -# DateTime.now -# -# # good - uses `Time` for current time -# Time.now -# -# # bad - uses `DateTime` for modern date -# DateTime.iso8601('2016-06-29') -# -# # good - uses `Time` for modern date -# Time.iso8601('2016-06-29') -# -# # good - uses `DateTime` with start argument for historical date -# DateTime.iso8601('1751-04-23', Date::ENGLAND) -# @example AllowCoercion: false (default) -# -# # bad - coerces to `DateTime` -# something.to_datetime -# -# # good - coerces to `Time` -# something.to_time -# @example AllowCoercion: true -# -# # good -# something.to_datetime -# -# # good -# something.to_time -# -# source://rubocop//lib/rubocop/cop/style/date_time.rb#49 -class RuboCop::Cop::Style::DateTime < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#56 - def date_time?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#61 - def historic_date?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#70 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#70 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#66 - def to_datetime?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/date_time.rb#86 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/date_time.rb#82 - def disallow_coercion?; end -end - -# source://rubocop//lib/rubocop/cop/style/date_time.rb#52 -RuboCop::Cop::Style::DateTime::CLASS_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/date_time.rb#53 -RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String) - -# Checks for parentheses in the definition of a method, -# that does not take any arguments. Both instance and -# class/singleton methods are checked. -# -# @example -# -# # bad -# def foo() -# do_something -# end -# -# # good -# def foo -# do_something -# end -# -# # bad -# def foo() = do_something -# -# # good -# def foo = do_something -# -# # good (without parentheses it's a syntax error) -# def foo() do_something end -# -# # bad -# def Baz.foo() -# do_something -# end -# -# # good -# def Baz.foo -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#40 -class RuboCop::Cop::Style::DefWithParentheses < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#45 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#45 - def on_defs(node); end -end - -# source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#43 -RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String) - -# Check for chained `dig` calls that can be collapsed into a single `dig`. -# -# @example -# # bad -# x.dig(:foo).dig(:bar).dig(:baz) -# x.dig(:foo, :bar).dig(:baz) -# x.dig(:foo, :bar)&.dig(:baz) -# -# # good -# x.dig(:foo, :bar, :baz) -# -# # good - `dig`s cannot be combined -# x.dig(:foo).bar.dig(:baz) -# -# source://rubocop//lib/rubocop/cop/style/dig_chain.rb#25 -class RuboCop::Cop::Style::DigChain < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - include ::RuboCop::Cop::DigHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/dig_chain.rb#33 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/dig_chain.rb#33 - def on_send(node); end - - private - - # Walk up the method chain while the receiver is `dig` with arguments. - # - # source://rubocop//lib/rubocop/cop/style/dig_chain.rb#49 - def inspect_chain(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/dig_chain.rb#64 - def invalid_arguments?(arguments); end - - # source://rubocop//lib/rubocop/cop/style/dig_chain.rb#74 - def register_offense(node, range, arguments); end -end - -# source://rubocop//lib/rubocop/cop/style/dig_chain.rb#30 -RuboCop::Cop::Style::DigChain::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/dig_chain.rb#31 -RuboCop::Cop::Style::DigChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where the `#\_\_dir\_\_` method can replace more -# complex constructs to retrieve a canonicalized absolute path to the -# current file. -# -# @example -# # bad -# path = File.expand_path(File.dirname(__FILE__)) -# -# # bad -# path = File.dirname(File.realpath(__FILE__)) -# -# # good -# path = __dir__ -# -# source://rubocop//lib/rubocop/cop/style/dir.rb#19 -class RuboCop::Cop::Style::Dir < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/dir.rb#29 - def dir_replacement?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/dir.rb#34 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/dir.rb#44 - def file_keyword?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/dir.rb#25 -RuboCop::Cop::Style::Dir::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/dir.rb#26 -RuboCop::Cop::Style::Dir::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty. -# -# @example -# # bad -# Dir.entries('path/to/dir').size == 2 -# Dir.children('path/to/dir').empty? -# Dir.children('path/to/dir').size == 0 -# Dir.each_child('path/to/dir').none? -# -# # good -# Dir.empty?('path/to/dir') -# -# source://rubocop//lib/rubocop/cop/style/dir_empty.rb#18 -class RuboCop::Cop::Style::DirEmpty < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/dir_empty.rb#28 - def offensive?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/dir_empty.rb#37 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/dir_empty.rb#48 - def bang(node); end -end - -# source://rubocop//lib/rubocop/cop/style/dir_empty.rb#22 -RuboCop::Cop::Style::DirEmpty::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/dir_empty.rb#23 -RuboCop::Cop::Style::DirEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Detects comments to enable/disable RuboCop. -# This is useful if want to make sure that every RuboCop error gets fixed -# and not quickly disabled with a comment. -# -# Specific cops can be allowed with the `AllowedCops` configuration. Note that -# -# @example -# # bad -# # rubocop:disable Metrics/AbcSize -# def foo -# end -# # rubocop:enable Metrics/AbcSize -# -# # good -# def foo -# end -# @example AllowedCops: [Metrics/AbcSize] -# # good -# # rubocop:disable Metrics/AbcSize -# def foo -# end -# # rubocop:enable Metrics/AbcSize -# -# source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#33 -class RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#40 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#77 - def allowed_cops; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#81 - def any_cops_allowed?; end - - # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#72 - def directive_cops(comment); end - - # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#53 - def register_offense(comment, directive_cops, disallowed_cops); end -end - -# source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#37 -RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#38 -RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective::MSG_FOR_COPS = T.let(T.unsafe(nil), String) - -# When using `class_eval` (or other `eval`) with string interpolation, -# add a comment block showing its appearance if interpolated (a practice used in Rails code). -# -# @example -# # from activesupport/lib/active_support/core_ext/string/output_safety.rb -# -# # bad -# UNSAFE_STRING_METHODS.each do |unsafe_method| -# if 'String'.respond_to?(unsafe_method) -# class_eval <<-EOT, __FILE__, __LINE__ + 1 -# def #{unsafe_method}(*params, &block) -# to_str.#{unsafe_method}(*params, &block) -# end -# -# def #{unsafe_method}!(*params) -# @dirty = true -# super -# end -# EOT -# end -# end -# -# # good, inline comments in heredoc -# UNSAFE_STRING_METHODS.each do |unsafe_method| -# if 'String'.respond_to?(unsafe_method) -# class_eval <<-EOT, __FILE__, __LINE__ + 1 -# def #{unsafe_method}(*params, &block) # def capitalize(*params, &block) -# to_str.#{unsafe_method}(*params, &block) # to_str.capitalize(*params, &block) -# end # end -# -# def #{unsafe_method}!(*params) # def capitalize!(*params) -# @dirty = true # @dirty = true -# super # super -# end # end -# EOT -# end -# end -# -# # good, block comments in heredoc -# class_eval <<-EOT, __FILE__, __LINE__ + 1 -# # def capitalize!(*params) -# # @dirty = true -# # super -# # end -# -# def #{unsafe_method}!(*params) -# @dirty = true -# super -# end -# EOT -# -# # good, block comments before heredoc -# class_eval( -# # def capitalize!(*params) -# # @dirty = true -# # super -# # end -# -# <<-EOT, __FILE__, __LINE__ + 1 -# def #{unsafe_method}!(*params) -# @dirty = true -# super -# end -# EOT -# ) -# -# # bad - interpolated string without comment -# class_eval("def #{unsafe_method}!(*params); end") -# -# # good - with inline comment or replace it with block comment using heredoc -# class_eval("def #{unsafe_method}!(*params); end # def capitalize!(*params); end") -# -# source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#77 -class RuboCop::Cop::Style::DocumentDynamicEvalDefinition < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#84 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#107 - def comment_block_docs?(arg_node); end - - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#147 - def comment_regexp(arg_node); end - - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#126 - def heredoc_comment_blocks(heredoc_body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#100 - def inline_comment_docs?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#96 - def interpolated?(arg_node); end - - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#136 - def merge_adjacent_comments(line, index, hash); end - - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#117 - def preceding_comment_blocks(node); end - - # source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#156 - def source_to_regexp(source); end -end - -# source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#78 -RuboCop::Cop::Style::DocumentDynamicEvalDefinition::BLOCK_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#79 -RuboCop::Cop::Style::DocumentDynamicEvalDefinition::COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#80 -RuboCop::Cop::Style::DocumentDynamicEvalDefinition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/document_dynamic_eval_definition.rb#82 -RuboCop::Cop::Style::DocumentDynamicEvalDefinition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for missing top-level documentation of classes and -# modules. Classes with no body are exempt from the check and so are -# namespace modules - modules that have nothing in their bodies except -# classes, other modules, constant definitions or constant visibility -# declarations. -# -# The documentation requirement is annulled if the class or module has -# same for all its children. -# -# @example -# # bad -# class Person -# # ... -# end -# -# module Math -# end -# -# # good -# # Description/Explanation of Person class -# class Person -# # ... -# end -# -# # allowed -# # Class without body -# class Person -# end -# -# # Namespace - A namespace can be a class or a module -# # Containing a class -# module Namespace -# # Description/Explanation of Person class -# class Person -# # ... -# end -# end -# -# # Containing constant visibility declaration -# module Namespace -# class Private -# end -# -# private_constant :Private -# end -# -# # Containing constant definition -# module Namespace -# Public = Class.new -# end -# -# # Macro calls -# module Namespace -# extend Foo -# end -# @example AllowedConstants: ['ClassMethods'] -# -# # good -# module A -# module ClassMethods -# # ... -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/documentation.rb#72 -class RuboCop::Cop::Style::Documentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::DocumentationComment - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#79 - def constant_definition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#85 - def constant_visibility_declaration?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#90 - def include_statement?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#94 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#100 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#82 - def outer_module(param0); end - - private - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#174 - def allowed_constants; end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#106 - def check(node, body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#147 - def compact_namespace?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#143 - def constant_allowed?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#139 - def constant_declaration?(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#178 - def identifier(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#123 - def include_statement_only?(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#129 - def namespace?(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#170 - def nodoc(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#166 - def nodoc?(comment, require_all: T.unsafe(nil)); end - - # Note: How end-of-line comments are associated with code changed in - # parser-2.2.0.4. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#156 - def nodoc_comment?(node, require_all: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation.rb#118 - def nodoc_self_or_outer_module?(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation.rb#186 - def qualify_const(node); end -end - -# source://rubocop//lib/rubocop/cop/style/documentation.rb#76 -RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) - -# Checks for missing documentation comment for public methods. -# It can optionally be configured to also require documentation for -# non-public methods. -# -# NOTE: This cop allows `initialize` method because `initialize` is -# a special method called from `new`. In some programming languages -# they are called constructor to distinguish it from method. -# -# @example -# -# # bad -# -# class Foo -# def bar -# puts baz -# end -# end -# -# module Foo -# def bar -# puts baz -# end -# end -# -# def foo.bar -# puts baz -# end -# -# # good -# -# class Foo -# # Documentation -# def bar -# puts baz -# end -# end -# -# module Foo -# # Documentation -# def bar -# puts baz -# end -# end -# -# # Documentation -# def foo.bar -# puts baz -# end -# @example RequireForNonPublicMethods: false (default) -# # good -# class Foo -# protected -# def do_something -# end -# end -# -# class Foo -# private -# def do_something -# end -# end -# @example RequireForNonPublicMethods: true -# # bad -# class Foo -# protected -# def do_something -# end -# end -# -# class Foo -# private -# def do_something -# end -# end -# -# # good -# class Foo -# protected -# # Documentation -# def do_something -# end -# end -# -# class Foo -# private -# # Documentation -# def do_something -# end -# end -# @example AllowedMethods: ['method_missing', 'respond_to_missing?'] -# -# # good -# class Foo -# def method_missing(name, *args) -# end -# -# def respond_to_missing?(symbol, include_private) -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#109 -class RuboCop::Cop::Style::DocumentationMethod < ::RuboCop::Cop::Base - include ::RuboCop::Cop::DocumentationComment - include ::RuboCop::Cop::VisibilityHelp - include ::RuboCop::Cop::DefNode - - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#116 - def modifier_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#120 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#120 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#146 - def allowed_methods; end - - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#130 - def check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#142 - def method_allowed?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#138 - def require_for_non_public_methods?; end -end - -# source://rubocop//lib/rubocop/cop/style/documentation_method.rb#113 -RuboCop::Cop::Style::DocumentationMethod::MSG = T.let(T.unsafe(nil), String) - -# Detects double disable comments on one line. This is mostly to catch -# automatically generated comments that need to be regenerated. -# -# @example -# # bad -# def f # rubocop:disable Style/For # rubocop:disable Metrics/AbcSize -# end -# -# # good -# # rubocop:disable Metrics/AbcSize -# def f # rubocop:disable Style/For -# end -# # rubocop:enable Metrics/AbcSize -# -# # if both fit on one line -# def f # rubocop:disable Style/For, Metrics/AbcSize -# end -# -# source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#27 -class RuboCop::Cop::Style::DoubleCopDisableDirective < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#34 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#32 -RuboCop::Cop::Style::DoubleCopDisableDirective::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of double negation (`!!`) to convert something to a boolean value. -# -# When using `EnforcedStyle: allowed_in_returns`, allow double negation in contexts -# that use boolean as a return value. When using `EnforcedStyle: forbidden`, double negation -# should be forbidden always. -# -# NOTE: when `something` is a boolean value -# `!!something` and `!something.nil?` are not the same thing. -# As you're unlikely to write code that can accept values of any type -# this is rarely a problem in practice. -# -# @example -# # bad -# !!something -# -# # good -# !something.nil? -# @example EnforcedStyle: allowed_in_returns (default) -# # good -# def foo? -# !!return_value -# end -# -# define_method :foo? do -# !!return_value -# end -# -# define_singleton_method :foo? do -# !!return_value -# end -# @example EnforcedStyle: forbidden -# # bad -# def foo? -# !!return_value -# end -# -# define_method :foo? do -# !!return_value -# end -# -# define_singleton_method :foo? do -# !!return_value -# end -# -# source://rubocop//lib/rubocop/cop/style/double_negation.rb#61 -class RuboCop::Cop::Style::DoubleNegation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#69 - def double_negative?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#71 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#84 - def allowed_in_returns?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#111 - def define_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#138 - def double_negative_condition_return_value?(node, last_child, conditional_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#88 - def end_of_method_definition?(node); end - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#120 - def find_conditional_node_from_ascendant(node); end - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#103 - def find_def_node_from_ascendant(node); end - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#127 - def find_last_child(node); end - - # source://rubocop//lib/rubocop/cop/style/double_negation.rb#147 - def find_parent_not_enumerable(node); end -end - -# source://rubocop//lib/rubocop/cop/style/double_negation.rb#65 -RuboCop::Cop::Style::DoubleNegation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/double_negation.rb#66 -RuboCop::Cop::Style::DoubleNegation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for loops which iterate a constant number of times, -# using a `Range` literal and `#each`. This can be done more readably using -# `Integer#times`. -# -# This check only applies if the block takes no parameters. -# -# @example -# # bad -# (1..5).each { } -# -# # good -# 5.times { } -# -# # bad -# (0...10).each {} -# -# # good -# 10.times {} -# -# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#24 -class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#52 - def each_range(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#63 - def each_range_with_zero_origin?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#74 - def each_range_without_block_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#29 - def on_block(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#45 - def offending?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#27 -RuboCop::Cop::Style::EachForSimpleLoop::MSG = T.let(T.unsafe(nil), String) - -# Looks for inject / reduce calls where the passed in object is -# returned at the end and so could be replaced by each_with_object without -# the need to return the object at the end. -# -# However, we can't replace with each_with_object if the accumulator -# parameter is assigned to within the block. -# -# @example -# # bad -# [1, 2].inject({}) { |a, e| a[e] = e; a } -# -# # good -# [1, 2].each_with_object({}) { |e, a| a[e] = e } -# -# source://rubocop//lib/rubocop/cop/style/each_with_object.rb#19 -class RuboCop::Cop::Style::EachWithObject < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#60 - def each_with_object_block_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#65 - def each_with_object_numblock_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#26 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#43 - def on_numblock(node); end - - private - - # if the accumulator parameter is assigned to in the block, - # then we can't convert to each_with_object - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#101 - def accumulator_param_assigned_to?(body, args); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#69 - def autocorrect_block(corrector, node, return_value); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#83 - def autocorrect_numblock(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#120 - def first_argument_returned?(args, return_value); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#113 - def return_value(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#128 - def return_value_occupies_whole_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#95 - def simple_method_arg?(method_arg); end - - # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#132 - def whole_line_expression(node); end -end - -# source://rubocop//lib/rubocop/cop/style/each_with_object.rb#24 -RuboCop::Cop::Style::EachWithObject::METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/each_with_object.rb#23 -RuboCop::Cop::Style::EachWithObject::MSG = T.let(T.unsafe(nil), String) - -# Checks for pipes for empty block parameters. Pipes for empty -# block parameters do not cause syntax errors, but they are redundant. -# -# @example -# # bad -# a do || -# do_something -# end -# -# # bad -# a { || do_something } -# -# # good -# a do -# end -# -# # good -# a { do_something } -# -# source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#24 -class RuboCop::Cop::Style::EmptyBlockParameter < ::RuboCop::Cop::Base - include ::RuboCop::Cop::EmptyParameter - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#31 - def on_block(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#38 - def autocorrect(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#29 -RuboCop::Cop::Style::EmptyBlockParameter::MSG = T.let(T.unsafe(nil), String) - -# Checks for case statements with an empty condition. -# -# @example -# -# # bad: -# case -# when x == 0 -# puts 'x is 0' -# when y == 0 -# puts 'y is 0' -# else -# puts 'neither is 0' -# end -# -# # good: -# if x == 0 -# puts 'x is 0' -# elsif y == 0 -# puts 'y is 0' -# else -# puts 'neither is 0' -# end -# -# # good: (the case condition node is not empty) -# case n -# when 0 -# puts 'zero' -# when 1 -# puts 'one' -# else -# puts 'more' -# end -# -# source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#38 -class RuboCop::Cop::Style::EmptyCaseCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#46 - def on_case(case_node); end - - private - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#63 - def autocorrect(corrector, case_node); end - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#70 - def correct_case_when(corrector, case_node, when_nodes); end - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#82 - def correct_when_conditions(corrector, when_nodes); end - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#97 - def keep_first_when_comment(case_range, corrector); end - - # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#107 - def replace_then_with_line_break(corrector, conditions, when_node); end -end - -# source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#42 -RuboCop::Cop::Style::EmptyCaseCondition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#43 -RuboCop::Cop::Style::EmptyCaseCondition::NOT_SUPPORTED_PARENT_TYPES = T.let(T.unsafe(nil), Array) - -# Checks for empty else-clauses, possibly including comments and/or an -# explicit `nil` depending on the EnforcedStyle. -# -# @example EnforcedStyle: both (default) -# # warn on empty else and else with nil in it -# -# # bad -# if condition -# statement -# else -# nil -# end -# -# # bad -# if condition -# statement -# else -# end -# -# # good -# if condition -# statement -# else -# statement -# end -# -# # good -# if condition -# statement -# end -# @example EnforcedStyle: empty -# # warn only on empty else -# -# # bad -# if condition -# statement -# else -# end -# -# # good -# if condition -# statement -# else -# nil -# end -# -# # good -# if condition -# statement -# else -# statement -# end -# -# # good -# if condition -# statement -# end -# @example EnforcedStyle: nil -# # warn on else with nil in it -# -# # bad -# if condition -# statement -# else -# nil -# end -# -# # good -# if condition -# statement -# else -# end -# -# # good -# if condition -# statement -# else -# statement -# end -# -# # good -# if condition -# statement -# end -# @example AllowComments: false (default) -# -# # bad -# if condition -# statement -# else -# # something comment -# nil -# end -# -# # bad -# if condition -# statement -# else -# # something comment -# end -# @example AllowComments: true -# -# # good -# if condition -# statement -# else -# # something comment -# nil -# end -# -# # good -# if condition -# statement -# else -# # something comment -# end -# -# source://rubocop//lib/rubocop/cop/style/empty_else.rb#127 -class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OnNormalIfUnless - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#141 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#137 - def on_normal_if_unless(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#174 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#196 - def autocorrect_forbidden?(type); end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#189 - def base_node(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#147 - def check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#182 - def comment_in_else?(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#162 - def empty_check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#158 - def empty_style?; end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#200 - def missing_else_style; end - - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#168 - def nil_check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#154 - def nil_style?; end -end - -# source://rubocop//lib/rubocop/cop/style/empty_else.rb#135 -RuboCop::Cop::Style::EmptyElse::EMPTY_STYLES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/empty_else.rb#133 -RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/empty_else.rb#134 -RuboCop::Cop::Style::EmptyElse::NIL_STYLES = T.let(T.unsafe(nil), Array) - -# Checks for using empty heredoc to reduce redundancy. -# -# @example -# -# # bad -# <<~EOS -# EOS -# -# <<-EOS -# EOS -# -# < () { do_something } -# -# # good -# -> { do_something } -# -# # good -# -> (arg) { do_something(arg) } -# -# source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#19 -class RuboCop::Cop::Style::EmptyLambdaParameter < ::RuboCop::Cop::Base - include ::RuboCop::Cop::EmptyParameter - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#26 - def on_block(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#35 - def autocorrect(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#24 -RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of a method, the result of which -# would be a literal, like an empty array, hash, or string. -# -# NOTE: When frozen string literals are enabled, `String.new` -# isn't corrected to an empty string since the former is -# mutable and the latter would be frozen. -# -# @example -# # bad -# a = Array.new -# a = Array[] -# h = Hash.new -# h = Hash[] -# s = String.new -# -# # good -# a = [] -# h = {} -# s = '' -# -# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#25 -class RuboCop::Cop::Style::EmptyLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::StringLiteralsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#38 - def array_node(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#47 - def array_with_block(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#58 - def array_with_index(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#41 - def hash_node(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#50 - def hash_with_block(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#66 - def hash_with_index(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#73 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#44 - def str_node(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#122 - def correction(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#93 - def first_argument_unparenthesized?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#140 - def frozen_strings?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#113 - def offense_array_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#117 - def offense_hash_node?(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#83 - def offense_message(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#100 - def replacement_range(node); end -end - -# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#31 -RuboCop::Cop::Style::EmptyLiteral::ARR_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#32 -RuboCop::Cop::Style::EmptyLiteral::HASH_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#35 -RuboCop::Cop::Style::EmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/empty_literal.rb#33 -RuboCop::Cop::Style::EmptyLiteral::STR_MSG = T.let(T.unsafe(nil), String) - -# Checks for the formatting of empty method definitions. -# By default it enforces empty method definitions to go on a single -# line (compact style), but it can be configured to enforce the `end` -# to go on its own line (expanded style). -# -# NOTE: A method definition is not considered empty if it contains -# comments. -# -# NOTE: Autocorrection will not be applied for the `compact` style -# if the resulting code is longer than the `Max` configuration for -# `Layout/LineLength`, but an offense will still be registered. -# -# @example EnforcedStyle: compact (default) -# # bad -# def foo(bar) -# end -# -# def self.foo(bar) -# end -# -# # good -# def foo(bar); end -# -# def foo(bar) -# # baz -# end -# -# def self.foo(bar); end -# @example EnforcedStyle: expanded -# # bad -# def foo(bar); end -# -# def self.foo(bar); end -# -# # good -# def foo(bar) -# end -# -# def self.foo(bar) -# end -# -# source://rubocop//lib/rubocop/cop/style/empty_method.rb#47 -class RuboCop::Cop::Style::EmptyMethod < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#54 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#54 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#95 - def compact?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#103 - def compact_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#73 - def correct_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#77 - def corrected(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#99 - def expanded?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#107 - def expanded_style?; end - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#89 - def joint(node); end - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#111 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/style/empty_method.rb#69 - def message(_range); end -end - -# source://rubocop//lib/rubocop/cop/style/empty_method.rb#51 -RuboCop::Cop::Style::EmptyMethod::MSG_COMPACT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/empty_method.rb#52 -RuboCop::Cop::Style::EmptyMethod::MSG_EXPANDED = T.let(T.unsafe(nil), String) - -# Checks ensures source files have no utf-8 encoding comments. -# -# @example -# # bad -# # encoding: UTF-8 -# # coding: UTF-8 -# # -*- coding: UTF-8 -*- -# -# source://rubocop//lib/rubocop/cop/style/encoding.rb#12 -class RuboCop::Cop::Style::Encoding < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/encoding.rb#20 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/encoding.rb#32 - def comments; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/encoding.rb#43 - def offense?(comment); end - - # source://rubocop//lib/rubocop/cop/style/encoding.rb#47 - def register_offense(line_number, comment); end -end - -# source://rubocop//lib/rubocop/cop/style/encoding.rb#17 -RuboCop::Cop::Style::Encoding::ENCODING_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/encoding.rb#16 -RuboCop::Cop::Style::Encoding::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/encoding.rb#18 -RuboCop::Cop::Style::Encoding::SHEBANG = T.let(T.unsafe(nil), String) - -# Checks for END blocks. -# -# @example -# # bad -# END { puts 'Goodbye!' } -# -# # good -# at_exit { puts 'Goodbye!' } -# -# source://rubocop//lib/rubocop/cop/style/end_block.rb#15 -class RuboCop::Cop::Style::EndBlock < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/end_block.rb#20 - def on_postexe(node); end -end - -# source://rubocop//lib/rubocop/cop/style/end_block.rb#18 -RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for endless methods. -# -# It can enforce endless method definitions whenever possible or with single line methods. -# It can also disallow multiline endless method definitions or all endless definitions. -# -# `require_single_line` style enforces endless method definitions for single line methods. -# `require_always` style enforces endless method definitions for single statement methods. -# -# Other method definition types are not considered by this cop. -# -# The supported styles are: -# -# * allow_single_line (default) - only single line endless method definitions are allowed. -# * allow_always - all endless method definitions are allowed. -# * disallow - all endless method definitions are disallowed. -# * require_single_line - endless method definitions are required for single line methods. -# * require_always - all endless method definitions are required. -# -# NOTE: Incorrect endless method definitions will always be -# corrected to a multi-line definition. -# -# @example EnforcedStyle: allow_single_line (default) -# # bad, multi-line endless method -# def my_method = x.foo -# .bar -# .baz -# -# # good -# def my_method -# x -# end -# -# # good -# def my_method = x -# -# # good -# def my_method -# x.foo -# .bar -# .baz -# end -# @example EnforcedStyle: allow_always -# # good -# def my_method -# x -# end -# -# # good -# def my_method = x -# -# # good -# def my_method = x.foo -# .bar -# .baz -# -# # good -# def my_method -# x.foo -# .bar -# .baz -# end -# @example EnforcedStyle: disallow -# # bad -# def my_method = x -# -# # bad -# def my_method = x.foo -# .bar -# .baz -# -# # good -# def my_method -# x -# end -# -# # good -# def my_method -# x.foo -# .bar -# .baz -# end -# @example EnforcedStyle: require_single_line -# # bad -# def my_method -# x -# end -# -# # bad -# def my_method = x.foo -# .bar -# .baz -# -# # good -# def my_method = x -# -# # good -# def my_method -# x.foo -# .bar -# .baz -# end -# @example EnforcedStyle: require_always -# # bad -# def my_method -# x -# end -# -# # bad -# def my_method -# x.foo -# .bar -# .baz -# end -# -# # good -# def my_method = x -# -# # good -# def my_method = x.foo -# .bar -# .baz -# -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#132 -class RuboCop::Cop::Style::EndlessMethod < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::EndlessMethodRewriter - extend ::RuboCop::Cop::TargetRubyVersion - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#146 - def on_def(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#217 - def arguments(node, missing = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#221 - def can_be_made_endless?(node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#201 - def correct_to_multiline(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#211 - def endless_replacement(node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#163 - def handle_allow_style(node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#195 - def handle_disallow_style(node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#186 - def handle_require_always_style(node); end - - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#172 - def handle_require_single_line_style(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/endless_method.rb#225 - def too_long_when_made_endless?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#140 -RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#141 -RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#142 -RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#144 -RuboCop::Cop::Style::EndlessMethod::MSG_REQUIRE_ALWAYS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/endless_method.rb#143 -RuboCop::Cop::Style::EndlessMethod::MSG_REQUIRE_SINGLE = T.let(T.unsafe(nil), String) - -# Checks for consistent usage of `ENV['HOME']`. If `nil` is used as -# the second argument of `ENV.fetch`, it is treated as a bad case like `ENV[]`. -# -# @example -# -# # bad -# ENV['HOME'] -# ENV.fetch('HOME', nil) -# -# # good -# Dir.home -# -# # good -# ENV.fetch('HOME', default) -# -# source://rubocop//lib/rubocop/cop/style/env_home.rb#31 -class RuboCop::Cop::Style::EnvHome < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/env_home.rb#38 - def env_home?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/env_home.rb#45 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/env_home.rb#34 -RuboCop::Cop::Style::EnvHome::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/env_home.rb#35 -RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Ensures that eval methods (`eval`, `instance_eval`, `class_eval` -# and `module_eval`) are given filename and line number values (`+__FILE__+` -# and `+__LINE__+`). This data is used to ensure that any errors raised -# within the evaluated code will be given the correct identification -# in a backtrace. -# -# The cop also checks that the line number given relative to `+__LINE__+` is -# correct. -# -# This cop will autocorrect incorrect or missing filename and line number -# values. However, if `eval` is called without a binding argument, the cop -# will not attempt to automatically add a binding, or add filename and -# line values. -# -# NOTE: This cop works only when a string literal is given as a code string. -# No offense is reported if a string variable is given as below: -# -# [source,ruby] -# ---- -# code = <<-RUBY -# def do_something -# end -# RUBY -# eval code # not checked. -# ---- -# -# @example -# # bad -# eval <<-RUBY -# def do_something -# end -# RUBY -# -# # bad -# C.class_eval <<-RUBY -# def do_something -# end -# RUBY -# -# # good -# eval <<-RUBY, binding, __FILE__, __LINE__ + 1 -# def do_something -# end -# RUBY -# -# # good -# C.class_eval <<-RUBY, __FILE__, __LINE__ + 1 -# def do_something -# end -# RUBY -# -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#57 -class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#75 - def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#82 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#70 - def valid_eval_receiver?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#187 - def add_offense_for_different_line(node, line_node, line_diff); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#132 - def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#202 - def add_offense_for_missing_line(node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#209 - def add_offense_for_missing_location(node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#181 - def add_offense_for_same_line(node, line_node); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#144 - def check_file(node, file_node); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#157 - def check_line(node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#96 - def check_location(node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#194 - def expected_line(sign, line_diff); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#123 - def file_and_line(node); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#169 - def line_difference(line_node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#221 - def missing_line(node, code); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#110 - def register_offense(node, &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#115 - def special_file_keyword?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#119 - def special_line_keyword?(node); end - - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#173 - def string_first_line(str_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#128 - def with_binding?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#60 -RuboCop::Cop::Style::EvalWithLocation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#61 -RuboCop::Cop::Style::EvalWithLocation::MSG_EVAL = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#62 -RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_FILE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#64 -RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_LINE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#67 -RuboCop::Cop::Style::EvalWithLocation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where `Integer#even?` or `Integer#odd?` -# can be used. -# -# @example -# -# # bad -# if x % 2 == 0 -# end -# -# # good -# if x.even? -# end -# -# source://rubocop//lib/rubocop/cop/style/even_odd.rb#18 -class RuboCop::Cop::Style::EvenOdd < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/even_odd.rb#25 - def even_odd_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/even_odd.rb#33 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/even_odd.rb#45 - def replacement_method(arg, method); end -end - -# source://rubocop//lib/rubocop/cop/style/even_odd.rb#21 -RuboCop::Cop::Style::EvenOdd::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/even_odd.rb#22 -RuboCop::Cop::Style::EvenOdd::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for exact regexp match inside `Regexp` literals. -# -# @example -# -# # bad -# string =~ /\Astring\z/ -# string === /\Astring\z/ -# string.match(/\Astring\z/) -# string.match?(/\Astring\z/) -# -# # good -# string == 'string' -# -# # bad -# string !~ /\Astring\z/ -# -# # good -# string != 'string' -# -# source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#25 -class RuboCop::Cop::Style::ExactRegexpMatch < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#32 - def exact_regexp_match(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#40 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#40 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#56 - def exact_match_pattern?(parsed_regexp); end - - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#63 - def new_method(node); end -end - -# source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#28 -RuboCop::Cop::Style::ExactRegexpMatch::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#29 -RuboCop::Cop::Style::ExactRegexpMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for use of the `File.expand_path` arguments. -# Likewise, it also checks for the `Pathname.new` argument. -# -# Contrastive bad case and good case are alternately shown in -# the following examples. -# -# @example -# # bad -# File.expand_path('..', __FILE__) -# -# # good -# File.expand_path(__dir__) -# -# # bad -# File.expand_path('../..', __FILE__) -# -# # good -# File.expand_path('..', __dir__) -# -# # bad -# File.expand_path('.', __FILE__) -# -# # good -# File.expand_path(__FILE__) -# -# # bad -# Pathname(__FILE__).parent.expand_path -# -# # good -# Pathname(__dir__).expand_path -# -# # bad -# Pathname.new(__FILE__).parent.expand_path -# -# # good -# Pathname.new(__dir__).expand_path -# -# source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#43 -class RuboCop::Cop::Style::ExpandPathArguments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#58 - def file_expand_path(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#82 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#74 - def pathname_new_parent_expand_path(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#66 - def pathname_parent_expand_path(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#100 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#135 - def autocorrect_expand_path(corrector, current_path, default_dir); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#162 - def depth(current_path); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#113 - def inspect_offense_for_expand_path(node, current_path, default_dir); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#168 - def parent_path(current_path); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#182 - def remove_parent_method(corrector, default_dir); end - - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#155 - def strip_surrounded_quotes!(path_string); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#109 - def unrecommended_argument?(default_dir); end -end - -# source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#47 -RuboCop::Cop::Style::ExpandPathArguments::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#49 -RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#51 -RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_NEW_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#55 -RuboCop::Cop::Style::ExpandPathArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the use of explicit block argument to avoid writing -# block literal that just passes its arguments to another block. -# -# NOTE: This cop only registers an offense if the block args match the -# yield args exactly. -# -# @example -# # bad -# def with_tmp_dir -# Dir.mktmpdir do |tmp_dir| -# Dir.chdir(tmp_dir) { |dir| yield dir } # block just passes arguments -# end -# end -# -# # bad -# def nine_times -# 9.times { yield } -# end -# -# # good -# def with_tmp_dir(&block) -# Dir.mktmpdir do |tmp_dir| -# Dir.chdir(tmp_dir, &block) -# end -# end -# -# with_tmp_dir do |dir| -# puts "dir is accessible as a parameter and pwd is set: #{dir}" -# end -# -# # good -# def nine_times(&block) -# 9.times(&block) -# end -# -# source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#41 -class RuboCop::Cop::Style::ExplicitBlockArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # @return [ExplicitBlockArgument] a new instance of ExplicitBlockArgument - # - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#57 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#62 - def on_yield(node); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#49 - def yielding_block?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#108 - def add_block_argument(node, corrector, block_name); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#160 - def block_body_range(block_node, send_node); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#153 - def build_new_arguments_for_zsuper(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#125 - def call_like?(node); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#137 - def correct_call_node(node, corrector, block_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#120 - def empty_arguments?(node); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#87 - def extract_block_name(def_node); end - - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#129 - def insert_argument(node, corrector, block_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#95 - def yielding_arguments?(block_args, yield_args); end - - class << self - # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#53 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#45 -RuboCop::Cop::Style::ExplicitBlockArgument::MSG = T.let(T.unsafe(nil), String) - -# Enforces consistency when using exponential notation -# for numbers in the code (eg 1.2e4). Different styles are supported: -# -# * `scientific` which enforces a mantissa between 1 (inclusive) and 10 (exclusive). -# * `engineering` which enforces the exponent to be a multiple of 3 and the mantissa -# to be between 0.1 (inclusive) and 1000 (exclusive). -# * `integral` which enforces the mantissa to always be a whole number without -# trailing zeroes. -# -# @example EnforcedStyle: scientific (default) -# # Enforces a mantissa between 1 (inclusive) and 10 (exclusive). -# -# # bad -# 10e6 -# 0.3e4 -# 11.7e5 -# 3.14e0 -# -# # good -# 1e7 -# 3e3 -# 1.17e6 -# 3.14 -# @example EnforcedStyle: engineering -# # Enforces using multiple of 3 exponents, -# # mantissa should be between 0.1 (inclusive) and 1000 (exclusive) -# -# # bad -# 3.2e7 -# 0.1e5 -# 12e5 -# 1232e6 -# -# # good -# 32e6 -# 10e3 -# 1.2e6 -# 1.232e9 -# @example EnforcedStyle: integral -# # Enforces the mantissa to have no decimal part and no -# # trailing zeroes. -# -# # bad -# 3.2e7 -# 0.1e5 -# 120e4 -# -# # good -# 32e6 -# 1e4 -# 12e5 -# -# source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#60 -class RuboCop::Cop::Style::ExponentialNotation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#68 - def on_float(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#79 - def engineering?(node); end - - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#90 - def integral(node); end - - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#110 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#95 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#74 - def scientific?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#62 -RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash) - -# Suggests `ENV.fetch` for the replacement of `ENV[]`. -# `ENV[]` silently fails and returns `nil` when the environment variable is unset, -# which may cause unexpected behaviors when the developer forgets to set it. -# On the other hand, `ENV.fetch` raises `KeyError` or returns the explicitly -# specified default value. -# -# @example -# # bad -# ENV['X'] -# x = ENV['X'] -# -# # good -# ENV.fetch('X') -# x = ENV.fetch('X') -# -# # also good -# !ENV['X'] -# ENV['X'].some_method # (e.g. `.nil?`) -# -# source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#25 -class RuboCop::Cop::Style::FetchEnvVar < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#32 - def env_with_bracket?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#36 - def on_send(node); end - - private - - # The following are allowed cases: - # - # - Used as a flag (e.g., `if ENV['X']` or `!ENV['X']`) because - # it simply checks whether the variable is set. - # - Receiving a message with dot syntax, e.g. `ENV['X'].nil?`. - # - `ENV['key']` assigned by logical AND/OR assignment. - # - `ENV['key']` is the LHS of a `||`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#106 - def allowable_use?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#49 - def allowed_var?(node); end - - # The following are allowed cases: - # - # - `ENV['key']` is a receiver of `||=`, e.g. `ENV['X'] ||= y`. - # - `ENV['key']` is a receiver of `&&=`, e.g. `ENV['X'] &&= y`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#114 - def assigned?(node); end - - # Check if the node is a receiver and receives a message with dot syntax. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#90 - def message_chained_with_dot?(node); end - - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#127 - def new_code(name_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#85 - def offensive?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#121 - def or_lhs?(node); end - - # Avoid offending in the following cases: - # `ENV['key'] if ENV['key'] = x` - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#81 - def partial_matched?(node, condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#54 - def used_as_flag?(node); end - - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#61 - def used_if_condition_in_body(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#70 - def used_in_condition?(node, condition); end -end - -# source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#28 -RuboCop::Cop::Style::FetchEnvVar::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/fetch_env_var.rb#29 -RuboCop::Cop::Style::FetchEnvVar::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Prefer to use `File.empty?('path/to/file')` when checking if a file is empty. -# -# @example -# # bad -# File.zero?('path/to/file') -# File.size('path/to/file') == 0 -# File.size('path/to/file') >= 0 -# File.size('path/to/file').zero? -# File.read('path/to/file').empty? -# File.binread('path/to/file') == '' -# FileTest.zero?('path/to/file') -# -# # good -# File.empty?('path/to/file') -# FileTest.empty?('path/to/file') -# -# source://rubocop//lib/rubocop/cop/style/file_empty.rb#27 -class RuboCop::Cop::Style::FileEmpty < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/file_empty.rb#37 - def offensive?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_empty.rb#49 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/file_empty.rb#62 - def bang(node); end -end - -# source://rubocop//lib/rubocop/cop/style/file_empty.rb#31 -RuboCop::Cop::Style::FileEmpty::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/file_empty.rb#32 -RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Use `File::NULL` instead of hardcoding the null device (`/dev/null` on Unix-like -# OSes, `NUL` or `NUL:` on Windows), so that code is platform independent. -# Only looks for full string matches, substrings within a longer string are not -# considered. -# -# However, only files that use the string `'/dev/null'` are targeted for detection. -# This is because the string `'NUL'` is not limited to the null device. -# This behavior results in false negatives when the `'/dev/null'` string is not used, -# but it is a trade-off to avoid false positives. `NULL:` -# Unlike `'NUL'`, `'NUL:'` is regarded as something like `C:` and is always detected. -# -# NOTE: Uses inside arrays and hashes are ignored. -# -# @example -# # bad -# '/dev/null' -# 'NUL' -# 'NUL:' -# -# # good -# File::NULL -# -# # ok - inside an array -# null_devices = %w[/dev/null nul] -# -# # ok - inside a hash -# { unix: "/dev/null", windows: "nul" } -# -# source://rubocop//lib/rubocop/cop/style/file_null.rb#45 -class RuboCop::Cop::Style::FileNull < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/file_null.rb#51 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/style/file_null.rb#61 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_null.rb#79 - def acceptable?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_null.rb#75 - def valid_string?(value); end -end - -# source://rubocop//lib/rubocop/cop/style/file_null.rb#49 -RuboCop::Cop::Style::FileNull::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/file_null.rb#48 -RuboCop::Cop::Style::FileNull::REGEXP = T.let(T.unsafe(nil), Regexp) - -# Favor `File.(bin)read` convenience methods. -# -# @example -# # bad - text mode -# File.open(filename).read -# File.open(filename, &:read) -# File.open(filename) { |f| f.read } -# File.open(filename) do |f| -# f.read -# end -# File.open(filename, 'r').read -# File.open(filename, 'r', &:read) -# File.open(filename, 'r') do |f| -# f.read -# end -# -# # good -# File.read(filename) -# -# # bad - binary mode -# File.open(filename, 'rb').read -# File.open(filename, 'rb', &:read) -# File.open(filename, 'rb') do |f| -# f.read -# end -# -# # good -# File.binread(filename) -# -# source://rubocop//lib/rubocop/cop/style/file_read.rb#35 -class RuboCop::Cop::Style::FileRead < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#62 - def block_read?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#46 - def file_open?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#66 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#57 - def send_read?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#81 - def evidence(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_read.rb#97 - def file_open_read?(node); end - - # source://rubocop//lib/rubocop/cop/style/file_read.rb#103 - def read_method(mode); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_read.rb#89 - def read_node?(node, block_pass); end -end - -# source://rubocop//lib/rubocop/cop/style/file_read.rb#39 -RuboCop::Cop::Style::FileRead::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/file_read.rb#43 -RuboCop::Cop::Style::FileRead::READ_FILE_START_TO_FINISH_MODES = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/file_read.rb#41 -RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for usage of `File.open` in append mode with empty block. -# -# Such a usage only creates a new file, but it doesn't update -# timestamps for an existing file, which might have been the intention. -# -# For example, for an existing file `foo.txt`: -# -# ruby -e "puts File.mtime('foo.txt')" -# # 2024-11-26 12:17:23 +0100 -# -# ruby -e "File.open('foo.txt', 'a') {}" -# -# ruby -e "puts File.mtime('foo.txt')" -# # 2024-11-26 12:17:23 +0100 -> unchanged -# -# If the intention was to update timestamps, `FileUtils.touch('foo.txt')` -# should be used instead. -# -# @example -# # bad -# File.open(filename, 'a') {} -# File.open(filename, 'a+') {} -# -# # good -# FileUtils.touch(filename) -# -# source://rubocop//lib/rubocop/cop/style/file_touch.rb#36 -class RuboCop::Cop::Style::FileTouch < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/file_touch.rb#47 - def file_open?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_touch.rb#54 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_touch.rb#69 - def empty_block?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/file_touch.rb#44 -RuboCop::Cop::Style::FileTouch::APPEND_FILE_MODES = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/file_touch.rb#39 -RuboCop::Cop::Style::FileTouch::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/file_touch.rb#42 -RuboCop::Cop::Style::FileTouch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Favor `File.(bin)write` convenience methods. -# -# NOTE: There are different method signatures between `File.write` (class method) -# and `File#write` (instance method). The following case will be allowed because -# static analysis does not know the contents of the splat argument: -# -# [source,ruby] -# ---- -# File.open(filename, 'w') do |f| -# f.write(*objects) -# end -# ---- -# -# @example -# # bad - text mode -# File.open(filename, 'w').write(content) -# File.open(filename, 'w') do |f| -# f.write(content) -# end -# -# # good -# File.write(filename, content) -# -# # bad - binary mode -# File.open(filename, 'wb').write(content) -# File.open(filename, 'wb') do |f| -# f.write(content) -# end -# -# # good -# File.binwrite(filename, content) -# -# source://rubocop//lib/rubocop/cop/style/file_write.rb#38 -class RuboCop::Cop::Style::FileWrite < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#65 - def block_write?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#82 - def evidence(node); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#49 - def file_open?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#69 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#60 - def send_write?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # @yield [content] - # - # source://rubocop//lib/rubocop/cop/style/file_write.rb#92 - def file_open_write?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/file_write.rb#120 - def heredoc?(write_node); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#125 - def heredoc_range(first_argument); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#105 - def replacement(mode, filename, content, write_node); end - - # source://rubocop//lib/rubocop/cop/style/file_write.rb#101 - def write_method(mode); end -end - -# source://rubocop//lib/rubocop/cop/style/file_write.rb#42 -RuboCop::Cop::Style::FileWrite::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/file_write.rb#44 -RuboCop::Cop::Style::FileWrite::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/file_write.rb#46 -RuboCop::Cop::Style::FileWrite::TRUNCATING_WRITE_MODES = T.let(T.unsafe(nil), Set) - -# Checks for division with integers coerced to floats. -# It is recommended to either always use `fdiv` or coerce one side only. -# This cop also provides other options for code consistency. -# -# @example EnforcedStyle: single_coerce (default) -# # bad -# a.to_f / b.to_f -# -# # good -# a.to_f / b -# a / b.to_f -# @example EnforcedStyle: left_coerce -# # bad -# a / b.to_f -# a.to_f / b.to_f -# -# # good -# a.to_f / b -# @example EnforcedStyle: right_coerce -# # bad -# a.to_f / b -# a.to_f / b.to_f -# -# # good -# a / b.to_f -# @example EnforcedStyle: fdiv -# # bad -# a / b.to_f -# a.to_f / b -# a.to_f / b.to_f -# -# # good -# a.fdiv(b) -# -# source://rubocop//lib/rubocop/cop/style/float_division.rb#53 -class RuboCop::Cop::Style::FloatDivision < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#79 - def any_coerce?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#75 - def both_coerce?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#71 - def left_coerce?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#87 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#67 - def right_coerce?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#83 - def to_f_method?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#125 - def add_to_f_method(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#134 - def correct_from_slash_to_fdiv(corrector, node, receiver, argument); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#145 - def extract_receiver_source(node); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#121 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/float_division.rb#106 - def offense_condition?(node); end - - # source://rubocop//lib/rubocop/cop/style/float_division.rb#129 - def remove_to_f_method(corrector, send_node); end -end - -# source://rubocop//lib/rubocop/cop/style/float_division.rb#57 -RuboCop::Cop::Style::FloatDivision::MESSAGES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/float_division.rb#64 -RuboCop::Cop::Style::FloatDivision::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for uses of the `for` keyword or `each` method. The -# preferred alternative is set in the EnforcedStyle configuration -# parameter. An `each` call with a block on a single line is always -# allowed. -# -# @example EnforcedStyle: each (default) -# # bad -# def foo -# for n in [1, 2, 3] do -# puts n -# end -# end -# -# # good -# def foo -# [1, 2, 3].each do |n| -# puts n -# end -# end -# @example EnforcedStyle: for -# # bad -# def foo -# [1, 2, 3].each do |n| -# puts n -# end -# end -# -# # good -# def foo -# for n in [1, 2, 3] do -# puts n -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/for.rb#45 -class RuboCop::Cop::Style::For < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/for.rb#64 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/for.rb#53 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/style/for.rb#64 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/for.rb#64 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/for.rb#84 - def suspect_enumerable?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/for.rb#49 -RuboCop::Cop::Style::For::EACH_LENGTH = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/style/for.rb#50 -RuboCop::Cop::Style::For::PREFER_EACH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/for.rb#51 -RuboCop::Cop::Style::For::PREFER_FOR = T.let(T.unsafe(nil), String) - -# Enforces the use of a single string formatting utility. -# Valid options include `Kernel#format`, `Kernel#sprintf`, and `String#%`. -# -# The detection of `String#%` cannot be implemented in a reliable -# manner for all cases, so only two scenarios are considered - -# if the first argument is a string literal and if the second -# argument is an array literal. -# -# Autocorrection will be applied when using argument is a literal or known built-in conversion -# methods such as `to_d`, `to_f`, `to_h`, `to_i`, `to_r`, `to_s`, and `to_sym` on variables, -# provided that their return value is not an array. For example, when using `to_s`, -# `'%s' % [1, 2, 3].to_s` can be autocorrected without any incompatibility: -# -# [source,ruby] -# ---- -# '%s' % [1, 2, 3] #=> '1' -# format('%s', [1, 2, 3]) #=> '[1, 2, 3]' -# '%s' % [1, 2, 3].to_s #=> '[1, 2, 3]' -# ---- -# -# @example EnforcedStyle: format (default) -# # bad -# puts sprintf('%10s', 'foo') -# puts '%10s' % 'foo' -# -# # good -# puts format('%10s', 'foo') -# @example EnforcedStyle: sprintf -# # bad -# puts format('%10s', 'foo') -# puts '%10s' % 'foo' -# -# # good -# puts sprintf('%10s', 'foo') -# @example EnforcedStyle: percent -# # bad -# puts format('%10s', 'foo') -# puts sprintf('%10s', 'foo') -# -# # good -# puts '%10s' % 'foo' -# -# source://rubocop//lib/rubocop/cop/style/format_string.rb#50 -class RuboCop::Cop::Style::FormatString < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#61 - def formatter(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#74 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#70 - def variable_argument?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#102 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#118 - def autocorrect_from_percent(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#132 - def autocorrect_to_percent(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string.rb#88 - def autocorrectable?(node); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#145 - def format_single_parameter(arg); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#94 - def message(detected_style); end - - # source://rubocop//lib/rubocop/cop/style/format_string.rb#98 - def method_name(style_name); end -end - -# Known conversion methods whose return value is not an array. -# -# source://rubocop//lib/rubocop/cop/style/format_string.rb#58 -RuboCop::Cop::Style::FormatString::AUTOCORRECTABLE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/format_string.rb#54 -RuboCop::Cop::Style::FormatString::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/format_string.rb#55 -RuboCop::Cop::Style::FormatString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Use a consistent style for tokens within a format string. -# -# By default, all strings are evaluated. In some cases, this may be undesirable, -# as they could be used as arguments to a method that does not consider -# them to be tokens, but rather other identifiers or just part of the string. -# -# `AllowedMethods` or `AllowedPatterns` can be configured with in order to mark specific -# methods as always allowed, thereby avoiding an offense from the cop. By default, there -# are no allowed methods. -# -# Additionally, the cop can be made conservative by configuring it with -# `Mode: conservative` (default `aggressive`). In this mode, tokens (regardless -# of `EnforcedStyle`) are only considered if used in the format string argument to the -# methods `printf`, `sprintf`, `format` and `%`. -# -# NOTE: Tokens in the `unannotated` style (eg. `%s`) are always treated as if -# configured with `Conservative: true`. This is done in order to prevent false positives, -# because this format is very similar to encoded URLs or Date/Time formatting strings. -# -# It is allowed to contain unannotated token -# if the number of them is less than or equals to -# `MaxUnannotatedPlaceholdersAllowed`. -# -# @example Mode: conservative, EnforcedStyle: annotated -# # In `conservative` mode, offenses are only registered for strings -# # given to a known formatting method. -# -# # good -# "%{greeting}" -# foo("%{greeting}") -# -# # bad -# format("%{greeting}", greeting: 'Hello') -# printf("%{greeting}", greeting: 'Hello') -# sprintf("%{greeting}", greeting: 'Hello') -# "%{greeting}" % { greeting: 'Hello' } -# @example EnforcedStyle: template -# -# # bad -# format('%s', greeting: 'Hello') -# format('%s', 'Hello') -# -# # good -# format('%{greeting}', greeting: 'Hello') -# @example EnforcedStyle: unannotated -# -# # bad -# format('%s', greeting: 'Hello') -# format('%{greeting}', greeting: 'Hello') -# -# # good -# format('%s', 'Hello') -# @example MaxUnannotatedPlaceholdersAllowed: 0 -# -# # bad -# format('%06d', 10) -# format('%s %s.', 'Hello', 'world') -# -# # good -# format('%06d', number: 10) -# @example MaxUnannotatedPlaceholdersAllowed: 1 (default) -# -# # bad -# format('%s %s.', 'Hello', 'world') -# -# # good -# format('%06d', 10) -# @example AllowedMethods: [] (default) -# -# # bad -# redirect('foo/%{bar_id}') -# @example AllowedMethods: [redirect] -# -# # good -# redirect('foo/%{bar_id}') -# @example AllowedPatterns: [] (default) -# -# # bad -# redirect('foo/%{bar_id}') -# @example AllowedPatterns: ['redirect'] -# -# # good -# redirect('foo/%{bar_id}') -# @example EnforcedStyle: annotated (default) -# -# # bad -# format('%{greeting}', greeting: 'Hello') -# format('%s', 'Hello') -# -# # good -# format('%s', greeting: 'Hello') -# -# source://rubocop//lib/rubocop/cop/style/format_string_token.rb#107 -class RuboCop::Cop::Style::FormatStringToken < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#128 - def format_string_in_typical_context?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#113 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#178 - def allowed_string?(node, detected_style); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#236 - def allowed_unannotated?(detections); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#161 - def autocorrect_sequence(corrector, detected_sequence, token_range); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#146 - def check_sequence(detected_sequence, token_range); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#226 - def collect_detections(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#249 - def conservative?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#157 - def correctable_sequence?(detected_type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#135 - def format_string_token?(node); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#245 - def max_unannotated_placeholders_allowed; end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#183 - def message(detected_style); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#188 - def message_text(style); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#203 - def str_contents(source_map); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#213 - def token_ranges(contents); end - - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#197 - def tokens(str_node, &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#139 - def use_allowed_method?(node); end -end - -# Helps you transition from mutable string literals -# to frozen string literals. -# of files to enable frozen string literals. Frozen string literals may be -# default in future Ruby. The comment will be added below a shebang and -# encoding comment. The frozen string literal comment is only valid in Ruby 2.3+. -# -# Note that the cop will accept files where the comment exists but is set -# to `false` instead of `true`. -# -# To require a blank line after this comment, please see -# `Layout/EmptyLineAfterMagicComment` cop. -# -# @example EnforcedStyle: always (default) -# # The `always` style will always add the frozen string literal comment -# # to a file, regardless of the Ruby version or if `freeze` or `<<` are -# # called on a string literal. -# # bad -# module Bar -# # ... -# end -# -# # good -# # frozen_string_literal: true -# -# module Bar -# # ... -# end -# -# # good -# # frozen_string_literal: false -# -# module Bar -# # ... -# end -# @example EnforcedStyle: never -# # The `never` will enforce that the frozen string literal comment does -# # not exist in a file. -# # bad -# # frozen_string_literal: true -# -# module Baz -# # ... -# end -# -# # good -# module Baz -# # ... -# end -# @example EnforcedStyle: always_true -# # The `always_true` style enforces that the frozen string literal -# # comment is set to `true`. This is a stricter option than `always` -# # and forces projects to use frozen string literals. -# # bad -# # frozen_string_literal: false -# -# module Baz -# # ... -# end -# -# # bad -# module Baz -# # ... -# end -# -# # good -# # frozen_string_literal: true -# -# module Bar -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#84 -class RuboCop::Cop::Style::FrozenStringLiteralComment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::FrozenStringLiteral - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#99 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#178 - def disabled_offense(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#190 - def enable_comment(corrector); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#120 - def ensure_comment(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#126 - def ensure_enabled_comment(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#114 - def ensure_no_comment(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#215 - def following_comment; end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#152 - def frozen_string_literal_comment(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#197 - def insert_comment(corrector); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#137 - def last_special_comment(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#207 - def line_range(line); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#158 - def missing_offense(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#164 - def missing_true_offense(processed_source); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#211 - def preceding_comment; end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#186 - def remove_comment(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#170 - def unnecessary_comment_offense(processed_source); end -end - -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#96 -RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_DISABLED = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#94 -RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#93 -RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING_TRUE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#95 -RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#97 -RuboCop::Cop::Style::FrozenStringLiteralComment::SHEBANG = T.let(T.unsafe(nil), String) - -# Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`. -# `STDOUT/STDERR/STDIN` are constants, and while you can actually -# reassign (possibly to redirect some stream) constants in Ruby, you'll get -# an interpreter warning if you do so. -# -# Additionally, `$stdout/$stderr/$stdin` can safely be accessed in a Ractor because they -# are ractor-local, while `STDOUT/STDERR/STDIN` will raise `Ractor::IsolationError`. -# -# @example -# # bad -# STDOUT.puts('hello') -# -# hash = { out: STDOUT, key: value } -# -# def m(out = STDOUT) -# out.puts('hello') -# end -# -# # good -# $stdout.puts('hello') -# -# hash = { out: $stdout, key: value } -# -# def m(out = $stdout) -# out.puts('hello') -# end -# -# source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#37 -class RuboCop::Cop::Style::GlobalStdStream < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#45 - def const_to_gvar_assignment?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#49 - def on_const(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#73 - def gvar_name(const_name); end - - # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#65 - def message(const_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#69 - def namespaced?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#40 -RuboCop::Cop::Style::GlobalStdStream::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#42 -RuboCop::Cop::Style::GlobalStdStream::STD_STREAMS = T.let(T.unsafe(nil), Set) - -# Looks for uses of global variables. -# It does not report offenses for built-in global variables. -# Built-in global variables are allowed by default. Additionally -# users can allow additional variables via the AllowedVariables option. -# -# Note that backreferences like $1, $2, etc are not global variables. -# -# @example -# # bad -# $foo = 2 -# bar = $foo + 5 -# -# # good -# FOO = 2 -# foo = 2 -# $stdin.read -# -# source://rubocop//lib/rubocop/cop/style/global_vars.rb#22 -class RuboCop::Cop::Style::GlobalVars < ::RuboCop::Cop::Base - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/global_vars.rb#60 - def allowed_var?(global_var); end - - # source://rubocop//lib/rubocop/cop/style/global_vars.rb#72 - def check(node); end - - # source://rubocop//lib/rubocop/cop/style/global_vars.rb#64 - def on_gvar(node); end - - # source://rubocop//lib/rubocop/cop/style/global_vars.rb#68 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/global_vars.rb#56 - def user_vars; end -end - -# built-in global variables and their English aliases -# https://www.zenspider.com/ruby/quickref.html -# -# source://rubocop//lib/rubocop/cop/style/global_vars.rb#27 -RuboCop::Cop::Style::GlobalVars::BUILT_IN_VARS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/global_vars.rb#23 -RuboCop::Cop::Style::GlobalVars::MSG = T.let(T.unsafe(nil), String) - -# Use a guard clause instead of wrapping the code inside a conditional -# expression -# -# A condition with an `elsif` or `else` branch is allowed unless -# one of `return`, `break`, `next`, `raise`, or `fail` is used -# in the body of the conditional expression. -# -# NOTE: Autocorrect works in most cases except with if-else statements -# that contain logical operators such as `foo || raise('exception')` -# -# @example -# # bad -# def test -# if something -# work -# end -# end -# -# # good -# def test -# return unless something -# -# work -# end -# -# # also good -# def test -# work if something -# end -# -# # bad -# if something -# raise 'exception' -# else -# ok -# end -# -# # good -# raise 'exception' if something -# ok -# -# # bad -# if something -# foo || raise('exception') -# else -# ok -# end -# -# # good -# foo || raise('exception') if something -# ok -# -# # bad -# define_method(:test) do -# if something -# work -# end -# end -# -# # good -# define_method(:test) do -# return unless something -# -# work -# end -# -# # also good -# define_method(:test) do -# work if something -# end -# @example AllowConsecutiveConditionals: false (default) -# # bad -# def test -# if foo? -# work -# end -# -# if bar? # <- reports an offense -# work -# end -# end -# @example AllowConsecutiveConditionals: true -# # good -# def test -# if foo? -# work -# end -# -# if bar? -# work -# end -# end -# -# # bad -# def test -# if foo? -# work -# end -# -# do_something -# -# if bar? # <- reports an offense -# work -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#114 -class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MinBodyLength - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::StatementModifier - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#132 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#123 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#123 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#140 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#132 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#132 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#276 - def accepted_form?(node, ending: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#286 - def accepted_if?(node, ending); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#313 - def allowed_consecutive_conditionals?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#266 - def and_or_guard_clause?(guard_clause); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#297 - def assigned_lvar_used_in_if_branch?(node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#211 - def autocorrect(corrector, node, condition, replacement, guard); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#237 - def autocorrect_heredoc_argument(corrector, node, heredoc_branch, leave_branch, guard); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#160 - def check_ending_body(body); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#171 - def check_ending_if(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#181 - def consecutive_conditionals?(parent, node); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#258 - def guard_clause_source(guard_clause); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#233 - def heredoc?(argument); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#249 - def range_of_branch_to_remove(node, guard); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#189 - def register_offense(node, scope_exiting_keyword, conditional_keyword, guard = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#309 - def remove_whole_lines(corrector, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#271 - def too_long_for_single_line?(node, example); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#280 - def trivial?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/guard_clause.rb#120 -RuboCop::Cop::Style::GuardClause::MSG = T.let(T.unsafe(nil), String) - -# Checks for presence or absence of braces around hash literal as a last -# array item depending on configuration. -# -# NOTE: This cop will ignore arrays where all items are hashes, regardless of -# EnforcedStyle. -# -# @example EnforcedStyle: braces (default) -# # bad -# [1, 2, one: 1, two: 2] -# -# # good -# [1, 2, { one: 1, two: 2 }] -# -# # good -# [{ one: 1 }, { two: 2 }] -# @example EnforcedStyle: no_braces -# # bad -# [1, 2, { one: 1, two: 2 }] -# -# # good -# [1, 2, one: 1, two: 2] -# -# # good -# [{ one: 1 }, { two: 2 }] -# -# source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#31 -class RuboCop::Cop::Style::HashAsLastArrayItem < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#36 - def on_hash(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#85 - def braces_style?; end - - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#66 - def check_braces(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#74 - def check_no_braces(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#50 - def containing_array(hash_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#61 - def explicit_array?(array); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#55 - def last_array_item?(array, node); end - - # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#89 - def remove_last_element_trailing_comma(corrector, node); end -end - -# Checks the usage of pre-2.1 `Hash[args]` method of converting enumerables and -# sequences of values to hashes. -# -# Correction code from splat argument (`Hash[*ary]`) is not simply determined. For example, -# `Hash[*ary]` can be replaced with `ary.each_slice(2).to_h` but it will be complicated. -# So, `AllowSplatArgument` option is true by default to allow splat argument for simple code. -# -# @example -# # bad -# Hash[ary] -# -# # good -# ary.to_h -# -# # bad -# Hash[key1, value1, key2, value2] -# -# # good -# {key1 => value1, key2 => value2} -# @example AllowSplatArgument: true (default) -# # good -# Hash[*ary] -# @example AllowSplatArgument: false -# # bad -# Hash[*ary] -# -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#44 -class RuboCop::Cop::Style::HashConversion < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#54 - def hash_from_array?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#56 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#137 - def allowed_splat_argument?; end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#130 - def args_to_hash(args); end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#117 - def multi_argument(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#94 - def register_offense_for_hash(node, hash_argument); end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#103 - def register_offense_for_zip_method(node, zip_method); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#113 - def requires_parens?(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#71 - def single_argument(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#88 - def use_zip_method_without_argument?(first_argument); end -end - -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#49 -RuboCop::Cop::Style::HashConversion::MSG_LITERAL_HASH_ARG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#48 -RuboCop::Cop::Style::HashConversion::MSG_LITERAL_MULTI_ARG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#50 -RuboCop::Cop::Style::HashConversion::MSG_SPLAT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#47 -RuboCop::Cop::Style::HashConversion::MSG_TO_H = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_conversion.rb#51 -RuboCop::Cop::Style::HashConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of `each_key` and `each_value` `Hash` methods. -# -# NOTE: If you have an array of two-element arrays, you can put -# parentheses around the block arguments to indicate that you're not -# working with a hash, and suppress RuboCop offenses. -# -# @example -# # bad -# hash.keys.each { |k| p k } -# hash.each { |k, unused_value| p k } -# -# # good -# hash.each_key { |k| p k } -# -# # bad -# hash.values.each { |v| p v } -# hash.each { |unused_key, v| p v } -# -# # good -# hash.each_value { |v| p v } -# @example AllowedReceivers: ['execute'] -# # good -# execute(sql).keys.each { |v| p v } -# execute(sql).values.each { |v| p v } -# -# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#36 -class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedReceivers - include ::RuboCop::Cop::Lint::UnusedArgument - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#80 - def check_unused_block_args(node, key, value); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#51 - def each_arguments(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#61 - def hash_mutated?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#46 - def kv_each(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#56 - def kv_each_with_block_pass(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#65 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#101 - def on_block_pass(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#65 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#65 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#184 - def check_argument(variable); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#208 - def correct_args(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#194 - def correct_implicit(node, corrector, method_name); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#199 - def correct_key_value_each(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#180 - def format_message(method_name, current); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#109 - def handleable?(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#215 - def kv_range(outer_node); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#140 - def message(prefer, method_name, unused_code); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#146 - def register_each_args_offense(node, message, prefer, unused_range); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#117 - def register_kv_offense(target, method); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#153 - def register_kv_with_block_pass_offense(node, target, method); end - - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#171 - def root_receiver(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#128 - def unused_block_arg_exist?(node, block_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#164 - def use_array_converter_method_as_preceding?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#190 - def used?(arg); end -end - -# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#43 -RuboCop::Cop::Style::HashEachMethods::ARRAY_CONVERTER_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#41 -RuboCop::Cop::Style::HashEachMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#42 -RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil), String) - -# Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods -# that can be replaced with `Hash#except` method. -# -# This cop should only be enabled on Ruby version 3.0 or higher. -# (`Hash#except` was added in Ruby 3.0.) -# -# For safe detection, it is limited to commonly used string and symbol comparisons -# when using `==` or `!=`. -# -# This cop doesn't check for `Hash#delete_if` and `Hash#keep_if` because they -# modify the receiver. -# -# @example -# -# # bad -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| k != :bar } -# {foo: 1, bar: 2, baz: 3}.filter {|k, v| k != :bar } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k.eql?(:bar) } -# -# # bad -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[bar].include?(k) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.except(:bar) -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# -# # good -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !%i[bar].exclude?(k) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| %i[bar].exclude?(k) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k.in?(%i[bar]) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !k.in?(%i[bar]) } -# @example AllCops:ActiveSupportExtensionsEnabled: true -# -# # bad -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !%i[bar].exclude?(k) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| %i[bar].exclude?(k) } -# -# # bad -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k.in?(%i[bar]) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !k.in?(%i[bar]) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.except(:bar) -# -# source://rubocop//lib/rubocop/cop/style/hash_except.rb#61 -class RuboCop::Cop::Style::HashExcept < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::HashSubset - extend ::RuboCop::Cop::TargetRubyVersion - extend ::RuboCop::Cop::AutoCorrector - - private - - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#74 - def preferred_method_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#70 - def semantically_subset_method?(node); end -end - -# Use `Hash#dig` instead of chaining potentially null `fetch` calls. -# -# When `fetch(identifier, nil)` calls are chained on a hash, the expectation -# is that each step in the chain returns either `nil` or another hash, -# and in both cases, these can be simplified with a single call to `dig` with -# multiple arguments. -# -# If the 2nd parameter is `{}` or `Hash.new`, an offense will also be registered, -# as long as the final call in the chain is a nil value. If a non-nil value is given, -# the chain will not be registered as an offense, as the default value cannot be safely -# given with `dig`. -# -# NOTE: See `Style/DigChain` for replacing chains of `dig` calls with -# a single method call. -# -# @example -# # bad -# hash.fetch('foo', nil)&.fetch('bar', nil) -# -# # bad -# # earlier members of the chain can return `{}` as long as the final `fetch` -# # has `nil` as a default value -# hash.fetch('foo', {}).fetch('bar', nil) -# -# # good -# hash.dig('foo', 'bar') -# -# # ok - not handled by the cop since the final `fetch` value is non-nil -# hash.fetch('foo', {}).fetch('bar', {}) -# -# source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#40 -class RuboCop::Cop::Style::HashFetchChain < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#50 - def diggable?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#54 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#54 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#84 - def inspect_chain(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#74 - def last_fetch_non_nil?(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#97 - def replacement(arguments); end -end - -# source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#44 -RuboCop::Cop::Style::HashFetchChain::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_fetch_chain.rb#45 -RuboCop::Cop::Style::HashFetchChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where `case-when` represents a simple 1:1 -# mapping and can be replaced with a hash lookup. -# -# @example MinBranchesCount: 3 (default) -# # bad -# case country -# when 'europe' -# 'http://eu.example.com' -# when 'america' -# 'http://us.example.com' -# when 'australia' -# 'http://au.example.com' -# end -# -# # good -# SITES = { -# 'europe' => 'http://eu.example.com', -# 'america' => 'http://us.example.com', -# 'australia' => 'http://au.example.com' -# } -# SITES[country] -# @example MinBranchesCount: 4 -# # good -# case country -# when 'europe' -# 'http://eu.example.com' -# when 'america' -# 'http://us.example.com' -# when 'australia' -# 'http://au.example.com' -# end -# -# source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#39 -class RuboCop::Cop::Style::HashLikeCase < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MinBranchesCount - - # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#45 - def hash_like_case?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#53 - def on_case(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#65 - def nodes_of_same_type?(nodes); end -end - -# source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#42 -RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) - -# Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods -# that can be replaced with `Hash#slice` method. -# -# This cop should only be enabled on Ruby version 2.5 or higher. -# (`Hash#slice` was added in Ruby 2.5.) -# -# For safe detection, it is limited to commonly used string and symbol comparisons -# when using `==` or `!=`. -# -# This cop doesn't check for `Hash#delete_if` and `Hash#keep_if` because they -# modify the receiver. -# -# @example -# -# # bad -# {foo: 1, bar: 2, baz: 3}.select {|k, v| k == :bar } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| k != :bar } -# {foo: 1, bar: 2, baz: 3}.filter {|k, v| k == :bar } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| k.eql?(:bar) } -# -# # bad -# {foo: 1, bar: 2, baz: 3}.select {|k, v| %i[bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !%i[bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.filter {|k, v| %i[bar].include?(k) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.slice(:bar) -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# -# # good -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].exclude?(k) } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].exclude?(k) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.select {|k, v| k.in?(%i[bar]) } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !k.in?(%i[bar]) } -# @example AllCops:ActiveSupportExtensionsEnabled: true -# -# # bad -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].exclude?(k) } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].exclude?(k) } -# -# # bad -# {foo: 1, bar: 2, baz: 3}.select {|k, v| k.in?(%i[bar]) } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| !k.in?(%i[bar]) } -# -# # good -# {foo: 1, bar: 2, baz: 3}.slice(:bar) -# -# source://rubocop//lib/rubocop/cop/style/hash_slice.rb#61 -class RuboCop::Cop::Style::HashSlice < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::HashSubset - extend ::RuboCop::Cop::TargetRubyVersion - extend ::RuboCop::Cop::AutoCorrector - - private - - # source://rubocop//lib/rubocop/cop/style/hash_slice.rb#74 - def preferred_method_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_slice.rb#70 - def semantically_subset_method?(node); end -end - -# Checks hash literal syntax. -# -# It can enforce either the use of the class hash rocket syntax or -# the use of the newer Ruby 1.9 syntax (when applicable). -# -# A separate offense is registered for each problematic pair. -# -# The supported styles are: -# -# * ruby19 - forces use of the 1.9 syntax (e.g. `{a: 1}`) when hashes have -# all symbols for keys -# * hash_rockets - forces use of hash rockets for all hashes -# * no_mixed_keys - simply checks for hashes with mixed syntaxes -# * ruby19_no_mixed_keys - forces use of ruby 1.9 syntax and forbids mixed -# syntax hashes -# -# This cop has `EnforcedShorthandSyntax` option. -# It can enforce either the use of the explicit hash value syntax or -# the use of Ruby 3.1's hash value shorthand syntax. -# -# The supported styles are: -# -# * always - forces use of the 3.1 syntax (e.g. {foo:}) -# * never - forces use of explicit hash literal value -# * either - accepts both shorthand and explicit use of hash literal value -# * consistent - forces use of the 3.1 syntax only if all values can be omitted in the hash -# * either_consistent - accepts both shorthand and explicit use of hash literal value, -# but they must be consistent -# -# @example EnforcedShorthandSyntax: either_consistent -# -# # good - `foo` and `bar` values can be omitted, but they are consistent, so it's accepted -# {foo: foo, bar: bar} -# -# # bad - `bar` value can be omitted -# {foo:, bar: bar} -# -# # bad - mixed syntaxes -# {foo:, bar: baz} -# -# # good -# {foo:, bar:} -# -# # good - can't omit `baz` -# {foo: foo, bar: baz} -# @example EnforcedStyle: hash_rockets -# # bad -# {a: 1, b: 2} -# {c: 1, 'd' => 5} -# -# # good -# {:a => 1, :b => 2} -# @example EnforcedStyle: no_mixed_keys -# # bad -# {:a => 1, b: 2} -# {c: 1, 'd' => 2} -# -# # good -# {:a => 1, :b => 2} -# {c: 1, d: 2} -# @example EnforcedStyle: ruby19_no_mixed_keys -# # bad -# {:a => 1, :b => 2} -# {c: 2, 'd' => 3} # should just use hash rockets -# -# # good -# {a: 1, b: 2} -# {:c => 3, 'd' => 4} -# @example EnforcedShorthandSyntax: always -# -# # bad -# {foo: foo, bar: bar} -# -# # good -# {foo:, bar:} -# -# # good - allowed to mix syntaxes -# {foo:, bar: baz} -# @example EnforcedShorthandSyntax: never -# -# # bad -# {foo:, bar:} -# -# # good -# {foo: foo, bar: bar} -# @example EnforcedShorthandSyntax: either (default) -# -# # good -# {foo: foo, bar: bar} -# -# # good -# {foo: foo, bar:} -# -# # good -# {foo:, bar:} -# @example EnforcedShorthandSyntax: consistent -# -# # bad - `foo` and `bar` values can be omitted -# {foo: foo, bar: bar} -# -# # bad - `bar` value can be omitted -# {foo:, bar: bar} -# -# # bad - mixed syntaxes -# {foo:, bar: baz} -# -# # good -# {foo:, bar:} -# -# # good - can't omit `baz` -# {foo: foo, bar: baz} -# @example EnforcedStyle: ruby19 (default) -# # bad -# {:a => 2} -# {b: 1, :c => 2} -# -# # good -# {a: 2, b: 1} -# {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol -# {d: 1, 'e' => 2} # technically not forbidden -# -# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#134 -class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::HashShorthandSyntax - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#189 - def alternative_style; end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#167 - def hash_rockets_check(pairs); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#181 - def no_mixed_keys_check(pairs); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#145 - def on_hash(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#163 - def ruby19_check(pairs); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#171 - def ruby19_no_mixed_keys_check(pairs); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#221 - def acceptable_19_syntax_symbol?(sym_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#278 - def argument_without_space?(node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#200 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#284 - def autocorrect_hash_rockets(corrector, pair_node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#293 - def autocorrect_no_mixed_keys(corrector, pair_node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#257 - def autocorrect_ruby19(corrector, pair_node); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#242 - def check(pairs, delim, msg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#301 - def force_hash_rockets?(pairs); end - - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#270 - def range_for_autocorrect_ruby19(pair_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#210 - def sym_indices?(pairs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#214 - def word_symbol_pair?(pair); end -end - -# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#140 -RuboCop::Cop::Style::HashSyntax::MSG_19 = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#142 -RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#141 -RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#143 -RuboCop::Cop::Style::HashSyntax::NO_MIXED_KEYS_STYLES = T.let(T.unsafe(nil), Array) - -# Looks for uses of `+_.each_with_object({}) {...}+`, -# `+_.map {...}.to_h+`, and `+Hash[_.map {...}]+` that are actually just -# transforming the keys of a hash, and tries to use a simpler & faster -# call to `transform_keys` instead. -# It should only be enabled on Ruby version 2.5 or newer. -# (`transform_keys` was added in Ruby 2.5.) -# -# @example -# # bad -# {a: 1, b: 2}.each_with_object({}) { |(k, v), h| h[foo(k)] = v } -# Hash[{a: 1, b: 2}.collect { |k, v| [foo(k), v] }] -# {a: 1, b: 2}.map { |k, v| [k.to_s, v] }.to_h -# {a: 1, b: 2}.to_h { |k, v| [k.to_s, v] } -# -# # good -# {a: 1, b: 2}.transform_keys { |k| foo(k) } -# {a: 1, b: 2}.transform_keys { |k| k.to_s } -# -# source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#28 -class RuboCop::Cop::Style::HashTransformKeys < ::RuboCop::Cop::Base - include ::RuboCop::Cop::HashTransformMethod - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#36 - def on_bad_each_with_object(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#48 - def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#61 - def on_bad_map_to_h(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#73 - def on_bad_to_h(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#84 - def extract_captures(match); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#89 - def new_method_name; end -end - -# Looks for uses of `+_.each_with_object({}) {...}+`, -# `+_.map {...}.to_h+`, and `+Hash[_.map {...}]+` that are actually just -# transforming the values of a hash, and tries to use a simpler & faster -# call to `transform_values` instead. -# -# @example -# # bad -# {a: 1, b: 2}.each_with_object({}) { |(k, v), h| h[k] = foo(v) } -# Hash[{a: 1, b: 2}.collect { |k, v| [k, foo(v)] }] -# {a: 1, b: 2}.map { |k, v| [k, v * v] }.to_h -# {a: 1, b: 2}.to_h { |k, v| [k, v * v] } -# -# # good -# {a: 1, b: 2}.transform_values { |v| foo(v) } -# {a: 1, b: 2}.transform_values { |v| v * v } -# -# source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#26 -class RuboCop::Cop::Style::HashTransformValues < ::RuboCop::Cop::Base - include ::RuboCop::Cop::HashTransformMethod - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#34 - def on_bad_each_with_object(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#46 - def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#59 - def on_bad_map_to_h(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#71 - def on_bad_to_h(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#82 - def extract_captures(match); end - - # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#87 - def new_method_name; end -end - -# Checks for identical expressions at the beginning or end of -# each branch of a conditional expression. Such expressions should normally -# be placed outside the conditional expression - before or after it. -# -# NOTE: The cop is poorly named and some people might think that it actually -# checks for duplicated conditional branches. The name will probably be changed -# in a future major RuboCop release. -# -# @example -# # bad -# if condition -# do_x -# do_z -# else -# do_y -# do_z -# end -# -# # good -# if condition -# do_x -# else -# do_y -# end -# do_z -# -# # bad -# if condition -# do_z -# do_x -# else -# do_z -# do_y -# end -# -# # good -# do_z -# if condition -# do_x -# else -# do_y -# end -# -# # bad -# case foo -# when 1 -# do_x -# when 2 -# do_x -# else -# do_x -# end -# -# # good -# case foo -# when 1 -# do_x -# do_y -# when 2 -# # nothing -# else -# do_x -# do_z -# end -# -# # bad -# case foo -# in 1 -# do_x -# in 2 -# do_x -# else -# do_x -# end -# -# # good -# case foo -# in 1 -# do_x -# do_y -# in 2 -# # nothing -# else -# do_x -# do_z -# end -# -# source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#110 -class RuboCop::Cop::Style::IdenticalConditionalBranches < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#123 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#130 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#116 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#184 - def assignable_condition_value(node); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#140 - def check_branches(node, branches); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#193 - def check_expressions(node, expressions, insert_position); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#218 - def correct_assignment(corrector, node, expression, insert_position); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#228 - def correct_no_assignment(corrector, node, expression, insert_position); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#173 - def duplicated_expressions?(node, expressions); end - - # `elsif` branches show up in the if node as nested `else` branches. We - # need to recursively iterate over all `else` branches. - # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#252 - def expand_elses(branch); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#267 - def head(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#236 - def last_child_of_parent?(node); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#246 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#242 - def single_child_branch?(branch_node); end - - # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#263 - def tail(node); end -end - -# source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#114 -RuboCop::Cop::Style::IdenticalConditionalBranches::MSG = T.let(T.unsafe(nil), String) - -# Corrector to correct conditional assignment in `if` statements. -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#569 -class RuboCop::Cop::Style::IfCorrector - extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper - extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper - - class << self - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#574 - def correct(corrector, cop, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#578 - def move_assignment_inside_condition(corrector, node); end - - private - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#592 - def extract_tail_branches(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#599 - def move_branch_inside_condition(corrector, branch, condition, assignment, column); end - end -end - -# If the `else` branch of a conditional consists solely of an `if` node, -# it can be combined with the `else` to become an `elsif`. -# This helps to keep the nesting level from getting too deep. -# -# @example -# # bad -# if condition_a -# action_a -# else -# if condition_b -# action_b -# else -# action_c -# end -# end -# -# # good -# if condition_a -# action_a -# elsif condition_b -# action_b -# else -# action_c -# end -# @example AllowIfModifier: false (default) -# # bad -# if condition_a -# action_a -# else -# action_b if condition_b -# end -# -# # good -# if condition_a -# action_a -# elsif condition_b -# action_b -# end -# @example AllowIfModifier: true -# # good -# if condition_a -# action_a -# else -# action_b if condition_b -# end -# -# # good -# if condition_a -# action_a -# elsif condition_b -# action_b -# end -# -# source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#61 -class RuboCop::Cop::Style::IfInsideElse < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#68 - def on_if(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#146 - def allow_if_modifier?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#142 - def allow_if_modifier_in_else_branch?(else_branch); end - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#87 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#111 - def correct_to_elsif_from_if_inside_else_form(corrector, node, condition); end - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#102 - def correct_to_elsif_from_modifier_form(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#131 - def find_end_range(node); end - - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#138 - def if_condition_range(node, condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#127 - def then?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#65 -RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String) - -# Checks for `if` and `unless` statements that would fit on one line if -# written as modifier `if`/`unless`. The cop also checks for modifier -# `if`/`unless` lines that exceed the maximum line length. -# -# The maximum line length is configured in the `Layout/LineLength` -# cop. The tab size is configured in the `IndentationWidth` of the -# `Layout/IndentationStyle` cop. -# -# One-line pattern matching is always allowed. To ensure that there are few cases -# where the match variable is not used, and to prevent oversights. The variable `x` -# becomes undefined and raises `NameError` when the following example is changed to -# the modifier form: -# -# [source,ruby] -# ---- -# if [42] in [x] -# x # `x` is undefined when using modifier form. -# end -# ---- -# -# The code `def method_name = body if condition` is considered a bad case by -# `Style/AmbiguousEndlessMethodDefinition` cop. So, to respect the user's intention to use -# an endless method definition in the `if` body, the following code is allowed: -# -# [source,ruby] -# ---- -# if condition -# def method_name = body -# end -# ---- -# -# NOTE: It is allowed when `defined?` argument has an undefined value, -# because using the modifier form causes the following incompatibility: -# -# [source,ruby] -# ---- -# unless defined?(undefined_foo) -# undefined_foo = 'default_value' -# end -# undefined_foo # => 'default_value' -# -# undefined_bar = 'default_value' unless defined?(undefined_bar) -# undefined_bar # => nil -# ---- -# -# @example -# # bad -# if condition -# do_stuff(bar) -# end -# -# unless qux.empty? -# Foo.do_something -# end -# -# do_something_with_a_long_name(arg) if long_condition_that_prevents_code_fit_on_single_line -# -# # good -# do_stuff(bar) if condition -# Foo.do_something unless qux.empty? -# -# if long_condition_that_prevents_code_fit_on_single_line -# do_something_with_a_long_name(arg) -# end -# -# if short_condition # a long comment that makes it too long if it were just a single line -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#74 -class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::StatementModifier - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::CommentsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#92 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#191 - def allowed_patterns; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#251 - def another_statement_on_same_line?(node); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#152 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#305 - def comment_on_node_line(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#124 - def defined_argument_is_undefined?(if_node, defined_node); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#116 - def defined_nodes(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#112 - def endless_method?(body); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#292 - def extract_heredoc_from(last_argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#235 - def line_length_enabled_at_line?(line); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#144 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#239 - def named_capture_in_condition?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#243 - def non_eligible_node?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#247 - def non_simple_if_unless?(node); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#134 - def pattern_matching_nodes(condition); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#309 - def remove_comment(corrector, _node, comment); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#299 - def remove_heredoc(corrector, heredoc); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#161 - def replacement_for_modifier_form(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#285 - def to_modifier_form_with_move_comment(node, indentation, comment); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#265 - def to_normal_form(node, indentation); end - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#273 - def to_normal_form_with_heredoc(node, indentation, heredoc); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#185 - def too_long_due_to_comment_after_modifier?(node, comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#180 - def too_long_due_to_modifier?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#226 - def too_long_line_based_on_allow_uri?(line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#209 - def too_long_line_based_on_config?(range, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#218 - def too_long_line_based_on_ignore_cop_directives?(range, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#196 - def too_long_single_line?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#87 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#82 -RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_MODIFIER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#85 -RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_NORMAL = T.let(T.unsafe(nil), String) - -# Checks for if and unless statements used as modifiers of other if or -# unless statements. -# -# @example -# -# # bad -# tired? ? 'stop' : 'go faster' if running? -# -# # bad -# if tired? -# "please stop" -# else -# "keep going" -# end if running? -# -# # good -# if running? -# tired? ? 'stop' : 'go faster' -# end -# -# source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#25 -class RuboCop::Cop::Style::IfUnlessModifierOfIfUnless < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::StatementModifier - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#31 - def on_if(node); end -end - -# source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#29 -RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant `if` with boolean literal branches. -# It checks only conditions to return boolean value (`true` or `false`) for safe detection. -# The conditions to be checked are comparison methods, predicate methods, and -# double negation (!!). -# `nonzero?` method is allowed by default. -# These are customizable with `AllowedMethods` option. -# -# This cop targets only ``if``s with a single `elsif` or `else` branch. The following -# code will be allowed, because it has two `elsif` branches: -# -# [source,ruby] -# ---- -# if foo -# true -# elsif bar > baz -# true -# elsif qux > quux # Single `elsif` is warned, but two or more `elsif`s are not. -# true -# else -# false -# end -# ---- -# -# @example -# # bad -# if foo == bar -# true -# else -# false -# end -# -# # bad -# foo == bar ? true : false -# -# # good -# foo == bar -# -# # bad -# if foo.do_something? -# true -# else -# false -# end -# -# # good (but potentially an unsafe correction) -# foo.do_something? -# @example AllowedMethods: ['nonzero?'] (default) -# # good -# num.nonzero? ? true : false -# -# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#61 -class RuboCop::Cop::Style::IfWithBooleanLiteralBranches < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#73 - def double_negative?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#69 - def if_with_boolean_literal_branches?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#75 - def on_if(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#135 - def assume_boolean_value?(condition); end - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#113 - def message(node, keyword); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#95 - def multiple_elsif?(node); end - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#101 - def offense_range_with_keyword(node, condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#152 - def opposite_condition?(node); end - - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#142 - def replacement_condition(node, condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#157 - def require_parentheses?(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#121 - def return_boolean_value?(condition); end -end - -# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#65 -RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#66 -RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG_FOR_ELSIF = T.let(T.unsafe(nil), String) - -# Checks for uses of semicolon in if statements. -# -# @example -# -# # bad -# result = if some_condition; something else another_thing end -# -# # good -# result = some_condition ? something : another_thing -# -# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#16 -class RuboCop::Cop::Style::IfWithSemicolon < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OnNormalIfUnless - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#24 - def on_normal_if_unless(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#55 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#104 - def build_else_branch(second_condition); end - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#95 - def build_expression(expr); end - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#86 - def correct_elsif(node); end - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#42 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#77 - def replacement(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#124 - def require_argument_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#63 - def require_newline?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#67 - def use_masgn_or_block_in_branches?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#73 - def use_return_with_argument?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#20 -RuboCop::Cop::Style::IfWithSemicolon::MSG_IF_ELSE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#21 -RuboCop::Cop::Style::IfWithSemicolon::MSG_NEWLINE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#22 -RuboCop::Cop::Style::IfWithSemicolon::MSG_TERNARY = T.let(T.unsafe(nil), String) - -# Checks for `raise` or `fail` statements which do not specify an -# explicit exception class. (This raises a `RuntimeError`. Some projects -# might prefer to use exception classes which more precisely identify the -# nature of the error.) -# -# @example -# # bad -# raise 'Error message here' -# -# # good -# raise ArgumentError, 'Error message here' -# -# source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#17 -class RuboCop::Cop::Style::ImplicitRuntimeError < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#23 - def implicit_runtime_error_raise_or_fail(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#26 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#18 -RuboCop::Cop::Style::ImplicitRuntimeError::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#20 -RuboCop::Cop::Style::ImplicitRuntimeError::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `in;` uses in `case` expressions. -# -# @example -# # bad -# case expression -# in pattern_a; foo -# in pattern_b; bar -# end -# -# # good -# case expression -# in pattern_a then foo -# in pattern_b then bar -# end -# -# source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#21 -class RuboCop::Cop::Style::InPatternThen < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#29 - def on_in_pattern(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#46 - def alternative_pattern_source(pattern); end - - # source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#50 - def collect_alternative_patterns(pattern); end -end - -# source://rubocop//lib/rubocop/cop/style/in_pattern_then.rb#27 -RuboCop::Cop::Style::InPatternThen::MSG = T.let(T.unsafe(nil), String) - -# Use `Kernel#loop` for infinite loops. -# -# @example -# # bad -# while true -# work -# end -# -# # good -# loop do -# work -# end -# -# source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#23 -class RuboCop::Cop::Style::InfiniteLoop < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#35 - def after_leaving_scope(scope, _variable_table); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#44 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#44 - def on_until_post(node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#40 - def on_while(node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#40 - def on_while_post(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#84 - def assigned_before_loop?(var, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#80 - def assigned_inside_loop?(var, range); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#70 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#103 - def modifier_replacement(node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#114 - def non_modifier_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#89 - def referenced_after_loop?(var, range); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#94 - def replace_begin_end_with_modifier(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#99 - def replace_source(corrector, range, replacement); end - - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#53 - def while_or_until(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#31 - def joining_forces; end - end -end - -# source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#27 -RuboCop::Cop::Style::InfiniteLoop::LEADING_SPACE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#29 -RuboCop::Cop::Style::InfiniteLoop::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing inline comments. -# -# @example -# -# # good -# foo.each do |f| -# # Standalone comment -# f.bar -# end -# -# # bad -# foo.each do |f| -# f.bar # Trailing inline comment -# end -# -# source://rubocop//lib/rubocop/cop/style/inline_comment.rb#20 -class RuboCop::Cop::Style::InlineComment < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/inline_comment.rb#23 - def on_new_investigation; end -end - -# source://rubocop//lib/rubocop/cop/style/inline_comment.rb#21 -RuboCop::Cop::Style::InlineComment::MSG = T.let(T.unsafe(nil), String) - -# Check for usages of not (`not` or `!`) called on a method -# when an inverse of that method can be used instead. -# -# Methods that can be inverted by a not (`not` or `!`) should be defined -# in `InverseMethods`. -# -# Methods that are inverted by inverting the return -# of the block that is passed to the method should be defined in -# `InverseBlocks`. -# -# @example -# # bad -# !foo.none? -# !foo.any? { |f| f.even? } -# !foo.blank? -# !(foo == bar) -# foo.select { |f| !f.even? } -# foo.reject { |f| f != 7 } -# -# # good -# foo.none? -# foo.blank? -# foo.any? { |f| f.even? } -# foo != bar -# foo == bar -# !!('foo' =~ /^\w+$/) -# !(foo.class < Numeric) # Checking class hierarchy is allowed -# # Blocks with guard clauses are ignored: -# foo.select do |f| -# next if f.zero? -# f != 1 -# end -# -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#43 -class RuboCop::Cop::Style::InverseMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#70 - def inverse_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#61 - def inverse_candidate?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#92 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#78 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#92 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#92 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#78 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#180 - def camel_case_constant?(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#122 - def correct_inverse_block(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#113 - def correct_inverse_method(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#129 - def correct_inverse_selector(block, corrector); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#184 - def dot_range(loc); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#163 - def end_parentheses(node, method_call); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#151 - def inverse_blocks; end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#146 - def inverse_methods; end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#194 - def message(method, inverse); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#155 - def negated?(node); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#159 - def not_to_receiver(node, method_call); end - - # When comparing classes, `!(Integer < Numeric)` is not the same as - # `Integer > Numeric`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#175 - def possible_class_hierarchy_check?(lhs, rhs, method); end - - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#188 - def remove_end_parenthesis(corrector, node, method, method_call); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#167 - def safe_navigation_incompatible?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#56 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#52 -RuboCop::Cop::Style::InverseMethods::CAMEL_CASE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#48 -RuboCop::Cop::Style::InverseMethods::CLASS_COMPARISON_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#50 -RuboCop::Cop::Style::InverseMethods::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#47 -RuboCop::Cop::Style::InverseMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#51 -RuboCop::Cop::Style::InverseMethods::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#54 -RuboCop::Cop::Style::InverseMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#49 -RuboCop::Cop::Style::InverseMethods::SAFE_NAVIGATION_INCOMPATIBLE_METHODS = T.let(T.unsafe(nil), Array) - -# Checks for usages of `unless` which can be replaced by `if` with inverted condition. -# Code without `unless` is easier to read, but that is subjective, so this cop -# is disabled by default. -# -# Methods that can be inverted should be defined in `InverseMethods`. Note that -# the relationship of inverse methods needs to be defined in both directions. -# For example, -# -# [source,yaml] -# ---- -# InverseMethods: -# :!=: :== -# :even?: :odd? -# :odd?: :even? -# ---- -# -# will suggest both `even?` and `odd?` to be inverted, but only `!=` (and not `==`). -# -# @example -# # bad (simple condition) -# foo unless !bar -# foo unless x != y -# foo unless x >= 10 -# foo unless x.even? -# foo unless odd? -# -# # good -# foo if bar -# foo if x == y -# foo if x < 10 -# foo if x.odd? -# foo if even? -# -# # bad (complex condition) -# foo unless x != y || x.even? -# -# # good -# foo if x == y && x.odd? -# -# # good (if) -# foo if !condition -# -# source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#53 -class RuboCop::Cop::Style::InvertibleUnlessCondition < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#58 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#133 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#146 - def autocorrect_send_node(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#90 - def inheritance_check?(node); end - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#154 - def inverse_methods; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#75 - def invertible?(node); end - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#96 - def preferred_condition(node); end - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#126 - def preferred_logical_condition(node); end - - # source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#104 - def preferred_send_condition(node); end -end - -# source://rubocop//lib/rubocop/cop/style/invertible_unless_condition.rb#56 -RuboCop::Cop::Style::InvertibleUnlessCondition::MSG = T.let(T.unsafe(nil), String) - -# Checks for hardcoded IP addresses, which can make code -# brittle. IP addresses are likely to need to be changed when code -# is deployed to a different server or environment, which may break -# a deployment if forgotten. Prefer setting IP addresses in ENV or -# other configuration. -# -# @example -# -# # bad -# ip_address = '127.59.241.29' -# -# # good -# ip_address = ENV['DEPLOYMENT_IP_ADDRESS'] -# -# source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#21 -class RuboCop::Cop::Style::IpAddresses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::StringHelp - - # Dummy implementation of method in ConfigurableEnforcedStyle that is - # called from StringHelp. - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#46 - def correct_style_detected; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#27 - def offense?(node); end - - # Dummy implementation of method in ConfigurableEnforcedStyle that is - # called from StringHelp. - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#42 - def opposite_style_detected; end - - private - - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#50 - def allowed_addresses; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#55 - def potential_ip?(str); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#68 - def starts_with_hex_or_colon?(str); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#64 - def too_long?(str); end -end - -# IPv4-mapped IPv6 is the longest -# -# source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#24 -RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#25 -RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String) - -# Checks for assignments to a local `it` variable inside a block -# where `it` can refer to the first anonymous parameter as of Ruby 3.4. -# -# Although Ruby allows reassigning `it` in these cases, it could -# cause confusion if `it` is used as a block parameter elsewhere. -# For consistency, this also applies to numblocks and blocks with -# parameters, even though `it` cannot be used in those cases. -# -# @example -# # bad -# foo { it = 5 } -# foo { |bar| it = bar } -# foo { it = _2 } -# -# # good - use a different variable name -# foo { var = 5 } -# foo { |bar| var = bar } -# foo { bar = _2 } -# -# source://rubocop//lib/rubocop/cop/style/it_assignment.rb#24 -class RuboCop::Cop::Style::ItAssignment < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/it_assignment.rb#27 - def on_lvasgn(node); end -end - -# source://rubocop//lib/rubocop/cop/style/it_assignment.rb#25 -RuboCop::Cop::Style::ItAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for blocks with one argument where `it` block parameter can be used. -# -# It provides three `EnforcedStyle` options: -# -# 1. `only_numbered_parameters` (default) ... Detects only numbered block parameters. -# 2. `always` ... Always uses the `it` block parameter. -# 3. `disallow` ... Disallows the `it` block parameter. -# -# A single numbered parameter is detected when `only_numbered_parameters` or `always`. -# -# @example EnforcedStyle: only_numbered_parameters (default) -# # bad -# block { do_something(_1) } -# -# # good -# block { do_something(it) } -# block { |named_param| do_something(named_param) } -# @example EnforcedStyle: always -# # bad -# block { do_something(_1) } -# block { |named_param| do_something(named_param) } -# -# # good -# block { do_something(it) } -# @example EnforcedStyle: disallow -# # bad -# block { do_something(it) } -# -# # good -# block { do_something(_1) } -# block { |named_param| do_something(named_param) } -# -# source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#40 -class RuboCop::Cop::Style::ItBlockParameter < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::TargetRubyVersion - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#50 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#80 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#67 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#92 - def find_block_variables(node, block_argument_name); end -end - -# source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#46 -RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_BLOCK_PARAMETER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/it_block_parameter.rb#45 -RuboCop::Cop::Style::ItBlockParameter::MSG_USE_IT_BLOCK_PARAMETER = T.let(T.unsafe(nil), String) - -# When passing an existing hash as keyword arguments, provide additional arguments -# directly rather than using `merge`. -# -# Providing arguments directly is more performant than using `merge`, and -# also leads to shorter and simpler code. -# -# @example -# # bad -# some_method(**opts.merge(foo: true)) -# some_method(**opts.merge(other_opts)) -# -# # good -# some_method(**opts, foo: true) -# some_method(**opts, **other_opts) -# -# source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#21 -class RuboCop::Cop::Style::KeywordArgumentsMerging < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#27 - def merge_kwargs?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#36 - def on_kwsplat(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#48 - def autocorrect(corrector, kwsplat_node, hash_node, other_hash_node); end -end - -# source://rubocop//lib/rubocop/cop/style/keyword_arguments_merging.rb#24 -RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String) - -# Enforces that optional keyword parameters are placed at the -# end of the parameters list. -# -# This improves readability, because when looking through the source, -# it is expected to find required parameters at the beginning of parameters list -# and optional parameters at the end. -# -# @example -# # bad -# def some_method(first: false, second:, third: 10) -# # body omitted -# end -# -# # good -# def some_method(second:, first: false, third: 10) -# # body omitted -# end -# -# # bad -# do_something do |first: false, second:, third: 10| -# # body omitted -# end -# -# # good -# do_something do |second:, first: false, third: 10| -# # body omitted -# end -# -# source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#34 -class RuboCop::Cop::Style::KeywordParametersOrder < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#40 - def on_kwoptarg(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#64 - def append_newline_to_last_kwoptarg(arguments, corrector); end - - # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#55 - def autocorrect(corrector, node, defining_node, kwarg_nodes); end - - # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#72 - def remove_kwargs(kwarg_nodes, corrector); end -end - -# source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#38 -RuboCop::Cop::Style::KeywordParametersOrder::MSG = T.let(T.unsafe(nil), String) - -# (by default) checks for uses of the lambda literal syntax for -# single line lambdas, and the method call syntax for multiline lambdas. -# It is configurable to enforce one of the styles for both single line -# and multiline lambdas as well. -# -# @example EnforcedStyle: line_count_dependent (default) -# # bad -# f = lambda { |x| x } -# f = ->(x) do -# x -# end -# -# # good -# f = ->(x) { x } -# f = lambda do |x| -# x -# end -# @example EnforcedStyle: lambda -# # bad -# f = ->(x) { x } -# f = ->(x) do -# x -# end -# -# # good -# f = lambda { |x| x } -# f = lambda do |x| -# x -# end -# @example EnforcedStyle: literal -# # bad -# f = lambda { |x| x } -# f = lambda do |x| -# x -# end -# -# # good -# f = ->(x) { x } -# f = ->(x) do -# x -# end -# -# source://rubocop//lib/rubocop/cop/style/lambda.rb#49 -class RuboCop::Cop::Style::Lambda < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#64 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#64 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#64 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#116 - def arguments_with_whitespace(node); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#105 - def autocorrect_method_to_literal(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#120 - def lambda_arg_string(args); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#90 - def message(node, selector); end - - # source://rubocop//lib/rubocop/cop/style/lambda.rb#96 - def message_line_modifier(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/lambda.rb#84 - def offending_selector?(node, selector); end -end - -# source://rubocop//lib/rubocop/cop/style/lambda.rb#53 -RuboCop::Cop::Style::Lambda::LITERAL_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/lambda.rb#54 -RuboCop::Cop::Style::Lambda::METHOD_MESSAGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/lambda.rb#56 -RuboCop::Cop::Style::Lambda::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) - -# Checks for use of the lambda.(args) syntax. -# -# @example EnforcedStyle: call (default) -# # bad -# lambda.(x, y) -# -# # good -# lambda.call(x, y) -# @example EnforcedStyle: braces -# # bad -# lambda.call(x, y) -# -# # good -# lambda.(x, y) -# -# source://rubocop//lib/rubocop/cop/style/lambda_call.rb#21 -class RuboCop::Cop::Style::LambdaCall < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#28 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#28 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#73 - def explicit_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#69 - def implicit_style?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#51 - def offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#55 - def prefer(node); end -end - -# source://rubocop//lib/rubocop/cop/style/lambda_call.rb#25 -RuboCop::Cop::Style::LambdaCall::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/lambda_call.rb#26 -RuboCop::Cop::Style::LambdaCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for string literal concatenation at -# the end of a line. -# -# @example -# -# # bad -# some_str = 'ala' + -# 'bala' -# -# some_str = 'ala' << -# 'bala' -# -# # good -# some_str = 'ala' \ -# 'bala' -# -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#35 -class RuboCop::Cop::Style::LineEndConcatenation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#51 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#80 - def autocorrect(corrector, operator_range); end - - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#57 - def check_token_set(index); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#107 - def eligible_next_successor?(next_successor); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#103 - def eligible_operator?(operator); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#111 - def eligible_predecessor?(predecessor); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#99 - def eligible_successor?(successor); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#93 - def eligible_token_set?(predecessor, operator, successor); end - - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#72 - def register_offense(operator); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#130 - def standard_string_literal?(token); end - - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#115 - def token_after_last_string(successor, base_index); end - - class << self - # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#47 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#42 -RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_BEGIN_TOKEN = T.let(T.unsafe(nil), Symbol) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#43 -RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_END_TOKEN = T.let(T.unsafe(nil), Symbol) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#40 -RuboCop::Cop::Style::LineEndConcatenation::CONCAT_TOKEN_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#44 -RuboCop::Cop::Style::LineEndConcatenation::HIGH_PRECEDENCE_OP_TOKEN_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#39 -RuboCop::Cop::Style::LineEndConcatenation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#45 -RuboCop::Cop::Style::LineEndConcatenation::QUOTE_DELIMITERS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#41 -RuboCop::Cop::Style::LineEndConcatenation::SIMPLE_STRING_TOKEN_TYPE = T.let(T.unsafe(nil), Symbol) - -# Ensures magic comments are written consistently throughout your code base. -# Looks for discrepancies in separators (`-` vs `_`) and capitalization for -# both magic comment directives and values. -# -# Required capitalization can be set with the `DirectiveCapitalization` and -# `ValueCapitalization` configuration keys. -# -# NOTE: If one of these configuration is set to nil, any capitalization is allowed. -# -# @example ValueCapitalization: uppercase -# # bad -# # frozen-string-literal: true -# -# # good -# # frozen-string-literal: TRUE -# @example EnforcedStyle: kebab_case -# # The `kebab_case` style will enforce that the frozen string literal -# # comment is written in kebab case. (Words separated by hyphens) -# # bad -# # frozen_string_literal: true -# -# module Baz -# # ... -# end -# -# # good -# # frozen-string-literal: true -# -# module Baz -# # ... -# end -# @example DirectiveCapitalization: lowercase (default) -# # bad -# # FROZEN-STRING-LITERAL: true -# -# # good -# # frozen-string-literal: true -# @example DirectiveCapitalization: uppercase -# # bad -# # frozen-string-literal: true -# -# # good -# # FROZEN-STRING-LITERAL: true -# @example DirectiveCapitalization: nil -# # any capitalization is accepted -# -# # good -# # frozen-string-literal: true -# -# # good -# # FROZEN-STRING-LITERAL: true -# @example ValueCapitalization: nil (default) -# # any capitalization is accepted -# -# # good -# # frozen-string-literal: true -# -# # good -# # frozen-string-literal: TRUE -# @example ValueCapitalization: lowercase -# # when a value is not given, any capitalization is accepted -# -# # bad -# # frozen-string-literal: TRUE -# -# # good -# # frozen-string-literal: TRUE -# @example EnforcedStyle: snake_case (default) -# # The `snake_case` style will enforce that the frozen string literal -# # comment is written in snake case. (Words separated by underscores) -# # bad -# # frozen-string-literal: true -# -# module Bar -# # ... -# end -# -# # good -# # frozen_string_literal: false -# -# module Bar -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#97 -class RuboCop::Cop::Style::MagicCommentFormat < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#156 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#241 - def correct_separator; end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#279 - def directive_capitalization; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#197 - def directive_offends?(directive); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#233 - def expected_style; end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#183 - def find_issues(comment); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#207 - def fix_directives(issues); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#221 - def fix_values(issues); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#245 - def incorrect_separator?(text); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#173 - def leading_comment_lines; end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#275 - def line_range(line); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#167 - def magic_comments; end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#202 - def register_offenses(issues); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#264 - def replace_capitalization(text, style); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#260 - def replace_separator(text); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#301 - def supported_capitalizations; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#295 - def valid_capitalization?(style); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#287 - def value_capitalization; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#249 - def wrong_capitalization?(text, expected_case); end - - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#237 - def wrong_separator; end -end - -# Value object to extract source ranges for the different parts of a magic comment -# -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#107 -class RuboCop::Cop::Style::MagicCommentFormat::CommentRange - extend ::RuboCop::SimpleForwardable - - # @return [CommentRange] a new instance of CommentRange - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#119 - def initialize(comment); end - - # Returns the value of attribute comment. - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#117 - def comment; end - - # A magic comment can contain one directive (normal style) or - # multiple directives (emacs style) - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#125 - def directives; end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def loc(*_arg0, **_arg1, &_arg2); end - - # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 - def text(*_arg0, **_arg1, &_arg2); end - - # A magic comment can contain one value (normal style) or - # multiple directives (emacs style) - # - # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#141 - def values; end -end - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#110 -RuboCop::Cop::Style::MagicCommentFormat::CommentRange::DIRECTIVE_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#114 -RuboCop::Cop::Style::MagicCommentFormat::CommentRange::VALUE_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#102 -RuboCop::Cop::Style::MagicCommentFormat::KEBAB_SEPARATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#103 -RuboCop::Cop::Style::MagicCommentFormat::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#104 -RuboCop::Cop::Style::MagicCommentFormat::MSG_VALUE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#101 -RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), String) - -# Prefer `select` or `reject` over `map { ... }.compact`. -# This cop also handles `filter_map { ... }`, similar to `map { ... }.compact`. -# -# @example -# -# # bad -# array.map { |e| some_condition? ? e : next }.compact -# -# # bad -# array.filter_map { |e| some_condition? ? e : next } -# -# # bad -# array.map do |e| -# if some_condition? -# e -# else -# next -# end -# end.compact -# -# # bad -# array.map do |e| -# next if some_condition? -# -# e -# end.compact -# -# # bad -# array.map do |e| -# e if some_condition? -# end.compact -# -# # good -# array.select { |e| some_condition? } -# -# # good -# array.reject { |e| some_condition? } -# -# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#44 -class RuboCop::Cop::Style::MapCompactWithConditionalBlock < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#51 - def conditional_block(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#148 - def current(node); end - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#162 - def filter_map_range(node); end - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#96 - def inspect(node, block_argument_node, condition_node, return_value_node, range); end - - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#158 - def map_with_compact_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#114 - def returns_block_argument?(block_argument_node, return_value_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#118 - def truthy_branch?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#138 - def truthy_branch_for_guard?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#128 - def truthy_branch_for_if?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#47 -RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#48 -RuboCop::Cop::Style::MapCompactWithConditionalBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for usages of `each` with `<<`, `push`, or `append` which -# can be replaced by `map`. -# -# If `PreferredMethods` is configured for `map` in `Style/CollectionMethods`, -# this cop uses the specified method for replacement. -# -# NOTE: The return value of `Enumerable#each` is `self`, whereas the -# return value of `Enumerable#map` is an `Array`. They are not autocorrected -# when a return value could be used because these types differ. -# -# NOTE: It only detects when the mapping destination is either: -# * a local variable initialized as an empty array and referred to only by the -# pushing operation; -# * or, if it is the single block argument to a `[].tap` block. -# This is because, if not, it's challenging to statically guarantee that the -# mapping destination variable remains an empty array: -# -# [source,ruby] -# ---- -# ret = [] -# src.each { |e| ret << e * 2 } # `<<` method may mutate `ret` -# -# dest = [] -# src.each { |e| dest << transform(e, dest) } # `transform` method may mutate `dest` -# ---- -# -# @example -# # bad -# dest = [] -# src.each { |e| dest << e * 2 } -# dest -# -# # good -# dest = src.map { |e| e * 2 } -# -# # bad -# [].tap do |dest| -# src.each { |e| dest << e * 2 } -# end -# -# # good -# dest = src.map { |e| e * 2 } -# -# # good - contains another operation -# dest = [] -# src.each { |e| dest << e * 2; puts e } -# dest -# -# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#60 -class RuboCop::Cop::Style::MapIntoArray < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#109 - def after_leaving_scope(scope, _variable_table); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#72 - def each_block_with_push?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#81 - def empty_array_asgn?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#93 - def empty_array_tap(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#103 - def lvar_ref?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#113 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#113 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#113 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#67 - def suitable_argument_node?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#214 - def correct_push_node(corrector, push_node); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#224 - def correct_return_value_handling(corrector, block, dest_var); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#157 - def dest_used_only_for_mapping?(block, dest_var, asgn); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#151 - def find_closest_assignment(block, dest_var); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#134 - def find_dest_var(block); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#182 - def new_method_name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#142 - def offending_empty_array_tap?(node, dest_var); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#165 - def register_offense(block, dest_var, asgn); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#201 - def remove_assignment(corrector, asgn); end - - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#208 - def remove_tap(corrector, node, block_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#188 - def return_value_used?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#105 - def joining_forces; end - end -end - -# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#64 -RuboCop::Cop::Style::MapIntoArray::MSG = T.let(T.unsafe(nil), String) - -# Looks for uses of `map.to_h` or `collect.to_h` that could be -# written with just `to_h` in Ruby >= 2.6. -# -# NOTE: `Style/HashTransformKeys` and `Style/HashTransformValues` will -# also change this pattern if only hash keys or hash values are being -# transformed. -# -# @example -# # bad -# something.map { |v| [v, v * 2] }.to_h -# -# # good -# something.to_h { |v| [v, v * 2] } -# -# # bad -# {foo: bar}.collect { |k, v| [k.to_s, v.do_something] }.to_h -# -# # good -# {foo: bar}.to_h { |k, v| [k.to_s, v.do_something] } -# -# source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#30 -class RuboCop::Cop::Style::MapToHash < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#41 - def map_to_h(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#52 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#52 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#68 - def autocorrect(corrector, to_h, map); end - - class << self - # source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#48 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#37 -RuboCop::Cop::Style::MapToHash::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/map_to_hash.rb#38 -RuboCop::Cop::Style::MapToHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for uses of `map.to_set` or `collect.to_set` that could be -# written with just `to_set`. -# -# @example -# # bad -# something.map { |i| i * 2 }.to_set -# -# # good -# something.to_set { |i| i * 2 } -# -# # bad -# [1, 2, 3].collect { |i| i.to_s }.to_set -# -# # good -# [1, 2, 3].to_set { |i| i.to_s } -# -# source://rubocop//lib/rubocop/cop/style/map_to_set.rb#26 -class RuboCop::Cop::Style::MapToSet < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/map_to_set.rb#34 - def map_to_set?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/map_to_set.rb#41 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/map_to_set.rb#41 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/map_to_set.rb#56 - def autocorrect(corrector, to_set, map); end -end - -# source://rubocop//lib/rubocop/cop/style/map_to_set.rb#30 -RuboCop::Cop::Style::MapToSet::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/map_to_set.rb#31 -RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the presence (default) or absence of parentheses in -# method calls containing arguments. -# -# In the default style (require_parentheses), macro methods are allowed. -# Additional methods can be added to the `AllowedMethods` or -# `AllowedPatterns` list. These options are valid only in the default -# style. Macros can be included by either setting `IgnoreMacros` to false -# or adding specific macros to the `IncludedMacros` list. -# -# Precedence of options is as follows: -# -# 1. `AllowedMethods` -# 2. `AllowedPatterns` -# 3. `IncludedMacros` -# -# If a method is listed in both `IncludedMacros` and `AllowedMethods`, -# then the latter takes precedence (that is, the method is allowed). -# -# In the alternative style (omit_parentheses), there are three additional -# options. -# -# 1. `AllowParenthesesInChaining` is `false` by default. Setting it to -# `true` allows the presence of parentheses in the last call during -# method chaining. -# -# 2. `AllowParenthesesInMultilineCall` is `false` by default. Setting it -# to `true` allows the presence of parentheses in multi-line method -# calls. -# -# 3. `AllowParenthesesInCamelCaseMethod` is `false` by default. This -# allows the presence of parentheses when calling a method whose name -# begins with a capital letter and which has no arguments. Setting it -# to `true` allows the presence of parentheses in such a method call -# even with arguments. -# -# NOTE: The style of `omit_parentheses` allows parentheses in cases where -# omitting them results in ambiguous or syntactically incorrect code. -# -# Non-exhaustive list of examples: -# -# - Parentheses are required allowed in method calls with arguments inside -# literals, logical operators, setting default values in position and -# keyword arguments, chaining and more. -# - Parentheses are allowed in method calls with arguments inside -# operators to avoid ambiguity. -# triple-dot syntax introduced in Ruby 2.7 as omitting them starts an -# endless range. -# - Parentheses are allowed when forwarding arguments with the -# triple-dot syntax introduced in Ruby 2.7 as omitting them starts an -# endless range. -# - Parentheses are required in calls with arguments when inside an -# endless method definition introduced in Ruby 3.0. -# - Ruby 3.1's hash omission syntax allows parentheses if the method call -# is in conditionals and requires parentheses if the call -# is not the value-returning expression. See -# https://bugs.ruby-lang.org/issues/18396. -# - Parentheses are required in anonymous arguments, keyword arguments -# and block passing in Ruby 3.2. -# - Parentheses are required when the first argument is a beginless range or -# the last argument is an endless range. -# -# @example AllowParenthesesInStringInterpolation: true -# -# # good -# "#{t('this.is.good')}" -# -# # good -# "#{t 'this.is.also.good'}" -# @example EnforcedStyle: omit_parentheses -# -# # bad -# array.delete(e) -# -# # good -# array.delete e -# -# # bad -# action.enforce(strict: true) -# -# # good -# action.enforce strict: true -# -# # good -# # Parentheses are allowed for code that can be ambiguous without -# # them. -# action.enforce(condition) || other_condition -# -# # good -# # Parentheses are allowed for calls that won't produce valid Ruby -# # without them. -# yield path, File.basename(path) -# -# # good -# # Omitting the parentheses in Ruby 3.1 hash omission syntax can lead -# # to ambiguous code. We allow them in conditionals and non-last -# # expressions. See https://bugs.ruby-lang.org/issues/18396 -# if meets(criteria:, action:) -# safe_action(action) || dangerous_action(action) -# end -# @example IgnoreMacros: true (default) -# -# # good -# class Foo -# bar :baz -# end -# @example IgnoreMacros: false -# -# # bad -# class Foo -# bar :baz -# end -# @example AllowParenthesesInMultilineCall: false (default) -# -# # bad -# foo.enforce( -# strict: true -# ) -# -# # good -# foo.enforce \ -# strict: true -# @example AllowParenthesesInMultilineCall: true -# -# # good -# foo.enforce( -# strict: true -# ) -# -# # good -# foo.enforce \ -# strict: true -# @example AllowParenthesesInChaining: false (default) -# -# # bad -# foo().bar(1) -# -# # good -# foo().bar 1 -# @example AllowParenthesesInChaining: true -# -# # good -# foo().bar(1) -# -# # good -# foo().bar 1 -# @example AllowParenthesesInCamelCaseMethod: false (default) -# -# # bad -# Array(1) -# -# # good -# Array 1 -# @example AllowParenthesesInCamelCaseMethod: true -# -# # good -# Array(1) -# -# # good -# Array 1 -# @example AllowParenthesesInStringInterpolation: false (default) -# -# # bad -# "#{t('this.is.bad')}" -# -# # good -# "#{t 'this.is.better'}" -# @example EnforcedStyle: require_parentheses (default) -# -# # bad -# array.delete e -# -# # good -# array.delete(e) -# -# # good -# # Operators don't need parens -# foo == bar -# -# # good -# # Setter methods don't need parens -# foo.bar = baz -# -# # okay with `puts` listed in `AllowedMethods` -# puts 'test' -# -# # okay with `^assert` listed in `AllowedPatterns` -# assert_equal 'test', x -# -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#204 -class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 - def on_yield(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#227 - def args_begin(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#235 - def args_end(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#239 - def args_parenthesized?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#215 - def autocorrect_incompatible_with; end - end -end - -# Style omit_parentheses -# -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#9 -module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses - include ::RuboCop::Cop::RangeHelp - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#80 - def allowed_camel_case_method_call?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#191 - def allowed_chained_call_with_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#187 - def allowed_multiline_call_with_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#85 - def allowed_string_interpolation_method_call?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#200 - def ambiguous_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#180 - def ambiguous_range_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#232 - def assigned_before?(node, target); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#240 - def assignment_in_condition?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#34 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#162 - def call_as_argument_or_chain?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#155 - def call_in_argument_with_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#110 - def call_in_literals?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#119 - def call_in_logical_operators?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#167 - def call_in_match_pattern?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#128 - def call_in_optional_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#132 - def call_in_single_line_inheritance?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#137 - def call_with_ambiguous_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#151 - def call_with_braced_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#250 - def forwards_anonymous_rest_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#216 - def hash_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#173 - def hash_literal_in_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#50 - def inside_endless_method_def?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#236 - def inside_string_interpolation?(node); end - - # Require hash value omission be enclosed in parentheses to prevent the following issue: - # https://bugs.ruby-lang.org/issues/18396. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#64 - def last_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#97 - def legitimate_call_with_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#212 - def logical_operator?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#72 - def method_call_before_constant_resolution?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#46 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#18 - def omit_parentheses(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#90 - def parentheses_at_the_end_of_multiline_call?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#220 - def regexp_slash_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#55 - def require_parentheses_for_hash_value_omission?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#204 - def splat?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#76 - def super_call_without_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#68 - def syntax_like_method_call?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#208 - def ternary_if?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#224 - def unary_literal?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#13 -RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::OMIT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#12 -RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::TRAILING_WHITESPACE_REGEX = T.let(T.unsafe(nil), Regexp) - -# Style require_parentheses -# -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#8 -module RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#27 - def allowed_method_name?(name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#31 - def eligible_for_parentheses_omission?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#39 - def ignored_macro?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#35 - def included_macros_list; end - - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#14 - def require_parentheses(node); end -end - -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#9 -RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses::REQUIRE_MSG = T.let(T.unsafe(nil), String) - -# Checks for unwanted parentheses in parameterless method calls. -# -# This cop's allowed methods can be customized with `AllowedMethods`. -# By default, there are no allowed methods. -# -# NOTE: This cop allows the use of `it()` without arguments in blocks, -# as in `0.times { it() }`, following `Lint/ItWithoutArgumentsInBlock` cop. -# -# @example -# # bad -# object.some_method() -# -# # good -# object.some_method -# @example AllowedMethods: [] (default) -# # bad -# object.foo() -# @example AllowedMethods: [foo] -# # good -# object.foo() -# -# source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#29 -class RuboCop::Cop::Style::MethodCallWithoutArgsParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#37 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#37 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#67 - def allowed_method_name?(name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#97 - def any_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#63 - def default_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#59 - def ineligible_node?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#114 - def offense_range(node); end - - # Respects `Lint/ItWithoutArgumentsInBlock` cop and the following Ruby 3.3's warning: - # - # $ ruby -e '0.times { begin; it; end }' - # -e:1: warning: `it` calls without arguments will refer to the first block param in - # Ruby 3.4; use it() or self.it - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#89 - def parenthesized_it_method_in_block?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#52 - def register_offense(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#71 - def same_name_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#110 - def variable_in_mass_assignment?(variable_name, node); end -end - -# source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#34 -RuboCop::Cop::Style::MethodCallWithoutArgsParentheses::MSG = T.let(T.unsafe(nil), String) - -# Checks for methods called on a do...end block. The point of -# this check is that it's easy to miss the call tacked on to the block -# when reading code. -# -# @example -# # bad -# a do -# b -# end.c -# -# # good -# a { b }.c -# -# # good -# foo = a do -# b -# end -# foo.c -# -# source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#24 -class RuboCop::Cop::Style::MethodCalledOnDoEndBlock < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#29 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#41 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#29 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#29 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#41 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#27 -RuboCop::Cop::Style::MethodCalledOnDoEndBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for parentheses around the arguments in method -# definitions. Both instance and class/singleton methods are checked. -# -# Regardless of style, parentheses are necessary for: -# -# 1. Endless methods -# 2. Argument lists containing a `forward-arg` (`...`) -# 3. Argument lists containing an anonymous rest arguments forwarding (`*`) -# 4. Argument lists containing an anonymous keyword rest arguments forwarding (`**`) -# 5. Argument lists containing an anonymous block forwarding (`&`) -# -# Removing the parens would be a syntax error here. -# -# @example EnforcedStyle: require_parentheses (default) -# # The `require_parentheses` style requires method definitions -# # to always use parentheses -# -# # bad -# def bar num1, num2 -# num1 + num2 -# end -# -# def foo descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name -# do_something -# end -# -# # good -# def bar(num1, num2) -# num1 + num2 -# end -# -# def foo(descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name) -# do_something -# end -# @example EnforcedStyle: require_no_parentheses -# # The `require_no_parentheses` style requires method definitions -# # to never use parentheses -# -# # bad -# def bar(num1, num2) -# num1 + num2 -# end -# -# def foo(descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name) -# do_something -# end -# -# # good -# def bar num1, num2 -# num1 + num2 -# end -# -# def foo descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name -# do_something -# end -# @example EnforcedStyle: require_no_parentheses_except_multiline -# # The `require_no_parentheses_except_multiline` style prefers no -# # parentheses when method definition arguments fit on single line, -# # but prefers parentheses when arguments span multiple lines. -# -# # bad -# def bar(num1, num2) -# num1 + num2 -# end -# -# def foo descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name -# do_something -# end -# -# # good -# def bar num1, num2 -# num1 + num2 -# end -# -# def foo(descriptive_var_name, -# another_descriptive_var_name, -# last_descriptive_var_name) -# do_something -# end -# -# source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#97 -class RuboCop::Cop::Style::MethodDefParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#105 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#105 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#169 - def anonymous_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#147 - def arguments_without_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#126 - def correct_arguments(arg_node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#131 - def forced_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#151 - def missing_parentheses(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#142 - def require_parentheses?(args); end - - # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#161 - def unwanted_parentheses(args); end -end - -# source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#103 -RuboCop::Cop::Style::MethodDefParentheses::MSG_MISSING = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#102 -RuboCop::Cop::Style::MethodDefParentheses::MSG_PRESENT = T.let(T.unsafe(nil), String) - -# Checks for potential uses of `Enumerable#minmax`. -# -# @example -# -# # bad -# bar = [foo.min, foo.max] -# return foo.min, foo.max -# -# # good -# bar = foo.minmax -# return foo.minmax -# -# source://rubocop//lib/rubocop/cop/style/min_max.rb#17 -class RuboCop::Cop::Style::MinMax < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#38 - def min_max_candidate(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#22 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#22 - def on_return(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#55 - def argument_range(node); end - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#42 - def message(offender, receiver); end - - # source://rubocop//lib/rubocop/cop/style/min_max.rb#46 - def offending_range(node); end -end - -# source://rubocop//lib/rubocop/cop/style/min_max.rb#20 -RuboCop::Cop::Style::MinMax::MSG = T.let(T.unsafe(nil), String) - -# Enforces the use of `max` or `min` instead of comparison for greater or less. -# -# NOTE: It can be used if you want to present limit or threshold in Ruby 2.7+. -# That it is slow though. So autocorrection will apply generic `max` or `min`: -# -# [source,ruby] -# ---- -# a.clamp(b..) # Same as `[a, b].max` -# a.clamp(..b) # Same as `[a, b].min` -# ---- -# -# @example -# -# # bad -# a > b ? a : b -# a >= b ? a : b -# -# # good -# [a, b].max -# -# # bad -# a < b ? a : b -# a <= b ? a : b -# -# # good -# [a, b].min -# -# source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#37 -class RuboCop::Cop::Style::MinMaxComparison < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#46 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#72 - def autocorrect(corrector, node, replacement); end - - # source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#64 - def preferred_method(operator, lhs, rhs, if_branch, else_branch); end -end - -# source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#44 -RuboCop::Cop::Style::MinMaxComparison::COMPARISON_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#42 -RuboCop::Cop::Style::MinMaxComparison::GRATER_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#43 -RuboCop::Cop::Style::MinMaxComparison::LESS_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/min_max_comparison.rb#41 -RuboCop::Cop::Style::MinMaxComparison::MSG = T.let(T.unsafe(nil), String) - -# Checks for `if` expressions that do not have an `else` branch. -# -# NOTE: Pattern matching is allowed to have no `else` branch because unlike `if` and `case`, -# it raises `NoMatchingPatternError` if the pattern doesn't match and without having `else`. -# -# Supported styles are: if, case, both. -# -# @example EnforcedStyle: both (default) -# # warn when an `if` or `case` expression is missing an `else` branch. -# -# # bad -# if condition -# statement -# end -# -# # bad -# case var -# when condition -# statement -# end -# -# # good -# if condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# -# # good -# case var -# when condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# @example EnforcedStyle: if -# # warn when an `if` expression is missing an `else` branch. -# -# # bad -# if condition -# statement -# end -# -# # good -# if condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# -# # good -# case var -# when condition -# statement -# end -# -# # good -# case var -# when condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# @example EnforcedStyle: case -# # warn when a `case` expression is missing an `else` branch. -# -# # bad -# case var -# when condition -# statement -# end -# -# # good -# case var -# when condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# -# # good -# if condition -# statement -# end -# -# # good -# if condition -# statement -# else -# # the content of `else` branch will be determined by Style/EmptyElse -# end -# -# source://rubocop//lib/rubocop/cop/style/missing_else.rb#99 -class RuboCop::Cop::Style::MissingElse < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OnNormalIfUnless - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#115 - def on_case(node); end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#121 - def on_case_match(node); end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#108 - def on_normal_if_unless(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#146 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#161 - def case_style?; end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#127 - def check(node); end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#179 - def empty_else_config; end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#173 - def empty_else_style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#157 - def if_style?; end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#135 - def message_template; end - - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#169 - def unless_else_config; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#165 - def unless_else_cop_enabled?; end -end - -# source://rubocop//lib/rubocop/cop/style/missing_else.rb#104 -RuboCop::Cop::Style::MissingElse::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/missing_else.rb#106 -RuboCop::Cop::Style::MissingElse::MSG_EMPTY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/missing_else.rb#105 -RuboCop::Cop::Style::MissingElse::MSG_NIL = T.let(T.unsafe(nil), String) - -# Checks for the presence of `method_missing` without also -# defining `respond_to_missing?`. -# -# Not defining `respond_to_missing?` will cause metaprogramming -# methods like `respond_to?` to behave unexpectedly: -# -# [source,ruby] -# ---- -# class StringDelegator -# def initialize(string) -# @string = string -# end -# -# def method_missing(name, *args) -# @string.send(name, *args) -# end -# end -# -# delegator = StringDelegator.new("foo") -# # Claims to not respond to `upcase`. -# delegator.respond_to?(:upcase) # => false -# # But you can call it. -# delegator.upcase # => FOO -# ---- -# -# @example -# # bad -# def method_missing(name, *args) -# if @delegate.respond_to?(name) -# @delegate.send(name, *args) -# else -# super -# end -# end -# -# # good -# def respond_to_missing?(name, include_private) -# @delegate.respond_to?(name) || super -# end -# -# def method_missing(name, *args) -# if @delegate.respond_to?(name) -# @delegate.send(name, *args) -# else -# super -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#54 -class RuboCop::Cop::Style::MissingRespondToMissing < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#57 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#57 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#67 - def implements_respond_to_missing?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#55 -RuboCop::Cop::Style::MissingRespondToMissing::MSG = T.let(T.unsafe(nil), String) - -# Checks for grouping of mixins in `class` and `module` bodies. -# By default it enforces mixins to be placed in separate declarations, -# but it can be configured to enforce grouping them in one declaration. -# -# @example EnforcedStyle: separated (default) -# # bad -# class Foo -# include Bar, Qox -# end -# -# # good -# class Foo -# include Qox -# include Bar -# end -# @example EnforcedStyle: grouped -# # bad -# class Foo -# extend Bar -# extend Qox -# end -# -# # good -# class Foo -# extend Qox, Bar -# end -# -# source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#33 -class RuboCop::Cop::Style::MixinGrouping < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#40 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#40 - def on_module(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#64 - def check(send_node); end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#72 - def check_grouped_style(send_node); end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#91 - def check_separated_style(send_node); end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#127 - def group_mixins(node, mixins); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#110 - def grouped_style?; end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#53 - def range_to_remove_for_subsequent_mixin(mixins, node); end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#118 - def separate_mixins(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#114 - def separated_style?; end - - # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#104 - def sibling_mixins(send_node); end -end - -# source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#37 -RuboCop::Cop::Style::MixinGrouping::MIXIN_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#38 -RuboCop::Cop::Style::MixinGrouping::MSG = T.let(T.unsafe(nil), String) - -# Checks that `include`, `extend` and `prepend` statements appear -# inside classes and modules, not at the top level, so as to not affect -# the behavior of `Object`. -# -# @example -# # bad -# include M -# -# class C -# end -# -# # bad -# extend M -# -# class C -# end -# -# # bad -# prepend M -# -# class C -# end -# -# # good -# class C -# include M -# end -# -# # good -# class C -# extend M -# end -# -# # good -# class C -# prepend M -# end -# -# source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#43 -class RuboCop::Cop::Style::MixinUsage < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#54 - def in_top_level_scope?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#48 - def include_statement(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#62 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#44 -RuboCop::Cop::Style::MixinUsage::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#45 -RuboCop::Cop::Style::MixinUsage::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for use of `extend self` or `module_function` in a module. -# -# Supported styles are: `module_function` (default), `extend_self` and `forbidden`. -# -# A couple of things to keep in mind: -# -# - `forbidden` style prohibits the usage of both styles -# - in default mode (`module_function`), the cop won't be activated when the module -# contains any private methods -# -# @example EnforcedStyle: module_function (default) -# # bad -# module Test -# extend self -# # ... -# end -# -# # good -# module Test -# module_function -# # ... -# end -# -# # good -# module Test -# extend self -# # ... -# private -# # ... -# end -# -# # good -# module Test -# class << self -# # ... -# end -# end -# @example EnforcedStyle: extend_self -# # bad -# module Test -# module_function -# # ... -# end -# -# # good -# module Test -# extend self -# # ... -# end -# -# # good -# module Test -# class << self -# # ... -# end -# end -# @example EnforcedStyle: forbidden -# # bad -# module Test -# module_function -# # ... -# end -# -# # bad -# module Test -# extend self -# # ... -# end -# -# # bad -# module Test -# extend self -# # ... -# private -# # ... -# end -# -# # good -# module Test -# class << self -# # ... -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/module_function.rb#95 -class RuboCop::Cop::Style::ModuleFunction < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#107 - def extend_self_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#104 - def module_function_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#112 - def on_module(node); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#110 - def private_directive?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#149 - def check_extend_self(nodes); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#155 - def check_forbidden(nodes); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#141 - def check_module_function(nodes); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#130 - def each_wrong_style(nodes, &block); end - - # source://rubocop//lib/rubocop/cop/style/module_function.rb#162 - def message(_range); end -end - -# source://rubocop//lib/rubocop/cop/style/module_function.rb#100 -RuboCop::Cop::Style::ModuleFunction::EXTEND_SELF_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/module_function.rb#101 -RuboCop::Cop::Style::ModuleFunction::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/module_function.rb#99 -RuboCop::Cop::Style::ModuleFunction::MODULE_FUNCTION_MSG = T.let(T.unsafe(nil), String) - -# Checks for chaining of a block after another block that spans -# multiple lines. -# -# @example -# -# # bad -# Thread.list.select do |t| -# t.alive? -# end.map do |t| -# t.object_id -# end -# -# # good -# alive_threads = Thread.list.select do |t| -# t.alive? -# end -# alive_threads.map do |t| -# t.object_id -# end -# -# source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#25 -class RuboCop::Cop::Style::MultilineBlockChain < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - - # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#30 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#30 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#30 - def on_numblock(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#28 -RuboCop::Cop::Style::MultilineBlockChain::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of if/unless modifiers with multiple-lines bodies. -# -# @example -# -# # bad -# { -# result: 'this should not happen' -# } unless cond -# -# # good -# { result: 'ok' } if cond -# -# source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#17 -class RuboCop::Cop::Style::MultilineIfModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::StatementModifier - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#25 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#45 - def indented_body(body, node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#37 - def to_normal_if(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#22 -RuboCop::Cop::Style::MultilineIfModifier::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of the `then` keyword in multi-line if statements. -# -# @example -# # bad -# # This is considered bad practice. -# if cond then -# end -# -# # good -# # If statements can contain `then` on the same line. -# if cond then a -# elsif cond then b -# end -# -# source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#19 -class RuboCop::Cop::Style::MultilineIfThen < ::RuboCop::Cop::Base - include ::RuboCop::Cop::OnNormalIfUnless - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#28 - def on_normal_if_unless(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#38 - def non_modifier_then?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#26 -RuboCop::Cop::Style::MultilineIfThen::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#24 -RuboCop::Cop::Style::MultilineIfThen::NON_MODIFIER_THEN = T.let(T.unsafe(nil), Regexp) - -# Checks uses of the `then` keyword in multi-line `in` statement. -# -# @example -# # bad -# case expression -# in pattern then -# end -# -# # good -# case expression -# in pattern -# end -# -# # good -# case expression -# in pattern then do_something -# end -# -# # good -# case expression -# in pattern then do_something(arg1, -# arg2) -# end -# -# source://rubocop//lib/rubocop/cop/style/multiline_in_pattern_then.rb#30 -class RuboCop::Cop::Style::MultilineInPatternThen < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/multiline_in_pattern_then.rb#39 - def on_in_pattern(node); end - - private - - # Requires `then` for write `in` and its body on the same line. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_in_pattern_then.rb#51 - def require_then?(in_pattern_node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_in_pattern_then.rb#37 -RuboCop::Cop::Style::MultilineInPatternThen::MSG = T.let(T.unsafe(nil), String) - -# Checks expressions wrapping styles for multiline memoization. -# -# @example EnforcedStyle: keyword (default) -# # bad -# foo ||= ( -# bar -# baz -# ) -# -# # good -# foo ||= begin -# bar -# baz -# end -# @example EnforcedStyle: braces -# # bad -# foo ||= begin -# bar -# baz -# end -# -# # good -# foo ||= ( -# bar -# baz -# ) -# -# source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#33 -class RuboCop::Cop::Style::MultilineMemoization < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#56 - def message(_node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#41 - def on_or_asgn(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#62 - def bad_rhs?(rhs); end - - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#72 - def keyword_autocorrect(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#78 - def keyword_begin_str(node, node_buf); end - - # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#86 - def keyword_end_str(node, node_buf); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#39 -RuboCop::Cop::Style::MultilineMemoization::BRACES_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#38 -RuboCop::Cop::Style::MultilineMemoization::KEYWORD_MSG = T.let(T.unsafe(nil), String) - -# Checks for method signatures that span multiple lines. -# -# @example -# -# # good -# -# def foo(bar, baz) -# end -# -# # bad -# -# def foo(bar, -# baz) -# end -# -# source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#21 -class RuboCop::Cop::Style::MultilineMethodSignature < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#27 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#27 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#42 - def autocorrect(corrector, node, begin_of_arguments); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#73 - def closing_line(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#77 - def correction_exceeds_max_line_length?(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#85 - def definition_width(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#81 - def indentation_width(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#65 - def last_line_source_of_arguments(arguments); end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#89 - def max_line_length; end - - # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#69 - def opening_line(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#25 -RuboCop::Cop::Style::MultilineMethodSignature::MSG = T.let(T.unsafe(nil), String) - -# Checks for multi-line ternary op expressions. -# -# NOTE: `return if ... else ... end` is syntax error. If `return` is used before -# multiline ternary operator expression, it will be autocorrected to single-line -# ternary operator. The same is true for `break`, `next`, and method call. -# -# @example -# # bad -# a = cond ? -# b : c -# a = cond ? b : -# c -# a = cond ? -# b : -# c -# -# return cond ? -# b : -# c -# -# # good -# a = cond ? b : c -# a = if cond -# b -# else -# c -# end -# -# return cond ? b : c -# -# source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#36 -class RuboCop::Cop::Style::MultilineTernaryOperator < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#44 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#64 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#86 - def comments_in_condition(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#92 - def enforce_single_line_ternary_operator?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#60 - def offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#72 - def replacement(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#96 - def use_assignment_method?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#40 -RuboCop::Cop::Style::MultilineTernaryOperator::MSG_IF = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#41 -RuboCop::Cop::Style::MultilineTernaryOperator::MSG_SINGLE_LINE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#42 -RuboCop::Cop::Style::MultilineTernaryOperator::SINGLE_LINE_TYPES = T.let(T.unsafe(nil), Array) - -# Checks uses of the `then` keyword -# in multi-line when statements. -# -# @example -# # bad -# case foo -# when bar then -# end -# -# # good -# case foo -# when bar -# end -# -# # good -# case foo -# when bar then do_something -# end -# -# # good -# case foo -# when bar then do_something(arg1, -# arg2) -# end -# -# source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#31 -class RuboCop::Cop::Style::MultilineWhenThen < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#37 - def on_when(node); end - - private - - # Requires `then` for write `when` and its body on the same line. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#49 - def require_then?(when_node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#35 -RuboCop::Cop::Style::MultilineWhenThen::MSG = T.let(T.unsafe(nil), String) - -# Checks against comparing a variable with multiple items, where -# `Array#include?`, `Set#include?` or a `case` could be used instead -# to avoid code repetition. -# It accepts comparisons of multiple method calls to avoid unnecessary method calls -# by default. It can be configured by `AllowMethodComparison` option. -# -# @example -# # bad -# a = 'a' -# foo if a == 'a' || a == 'b' || a == 'c' -# -# # good -# a = 'a' -# foo if ['a', 'b', 'c'].include?(a) -# -# VALUES = Set['a', 'b', 'c'].freeze -# # elsewhere... -# foo if VALUES.include?(a) -# -# case foo -# when 'a', 'b', 'c' then foo -# # ... -# end -# -# # accepted (but consider `case` as above) -# foo if a == b.lightweight || a == b.heavyweight -# @example AllowMethodComparison: true (default) -# # good -# foo if a == b.lightweight || a == b.heavyweight -# @example AllowMethodComparison: false -# # bad -# foo if a == b.lightweight || a == b.heavyweight -# -# # good -# foo if [b.lightweight, b.heavyweight].include?(a) -# @example ComparisonsThreshold: 2 (default) -# # bad -# foo if a == 'a' || a == 'b' -# @example ComparisonsThreshold: 3 -# # good -# foo if a == 'a' || a == 'b' -# -# source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#52 -class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#74 - def on_or(node); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#64 - def simple_comparison_lhs(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#69 - def simple_comparison_rhs(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#59 - def simple_double_comparison?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#154 - def allow_method_comparison?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#132 - def comparison?(node); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#158 - def comparisons_threshold; end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#97 - def find_offending_var(node, variables = T.unsafe(nil), values = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#124 - def nested_comparison?(node); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#116 - def offense_range(values); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#144 - def root_of_or_node(or_node); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#136 - def simple_comparison(node); end - - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#120 - def variable_name(node); end -end - -# source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#55 -RuboCop::Cop::Style::MultipleComparison::MSG = T.let(T.unsafe(nil), String) - -# Checks whether some constant value isn't a -# mutable literal (e.g. array or hash). -# -# Strict mode can be used to freeze all constants, rather than -# just literals. -# Strict mode is considered an experimental feature. It has not been -# updated with an exhaustive list of all methods that will produce -# frozen objects so there is a decent chance of getting some false -# positives. Luckily, there is no harm in freezing an already -# frozen object. -# -# From Ruby 3.0, this cop honours the magic comment -# 'shareable_constant_value'. When this magic comment is set to any -# acceptable value other than none, it will suppress the offenses -# raised by this cop. It enforces frozen state. -# -# NOTE: `Regexp` and `Range` literals are frozen objects since Ruby 3.0. -# -# NOTE: From Ruby 3.0, interpolated strings are not frozen when -# `# frozen-string-literal: true` is used, so this cop enforces explicit -# freezing for such strings. -# -# NOTE: From Ruby 3.0, this cop allows explicit freezing of constants when -# the `shareable_constant_value` directive is used. -# -# @example EnforcedStyle: literals (default) -# # bad -# CONST = [1, 2, 3] -# -# # good -# CONST = [1, 2, 3].freeze -# -# # good -# CONST = <<~TESTING.freeze -# This is a heredoc -# TESTING -# -# # good -# CONST = Something.new -# @example EnforcedStyle: strict -# # bad -# CONST = Something.new -# -# # bad -# CONST = Struct.new do -# def foo -# puts 1 -# end -# end -# -# # good -# CONST = Something.new.freeze -# -# # good -# CONST = Struct.new do -# def foo -# puts 1 -# end -# end.freeze -# @example -# # Magic comment - shareable_constant_value: literal -# -# # bad -# CONST = [1, 2, 3] -# -# # good -# # shareable_constant_value: literal -# CONST = [1, 2, 3] -# -# source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#83 -class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Style::MutableConstant::ShareableConstantValue - include ::RuboCop::Cop::FrozenStringLiteral - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop-sorbet/0.10.0/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 - def on_assignment(value); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#127 - def on_casgn(node); end - - # Some of these patterns may not actually return an immutable object, - # but we want to consider them immutable for this cop. - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#223 - def operation_produces_immutable_object?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#240 - def range_enclosed_in_parentheses?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#216 - def splat_value(param0 = T.unsafe(nil)); end - - # source://rubocop-sorbet/0.10.0/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 - def t_let(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#168 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#157 - def check(value); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#207 - def correct_splat_expansion(corrector, expr, splat_value); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#199 - def frozen_regexp_or_range_literals?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#189 - def immutable_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#183 - def mutable_literal?(value); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#203 - def requires_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#193 - def shareable_constant_value?(node); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#148 - def strict_check(value); end -end - -# source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#125 -RuboCop::Cop::Style::MutableConstant::MSG = T.let(T.unsafe(nil), String) - -# Handles magic comment shareable_constant_value with O(n ^ 2) complexity -# n - number of lines in the source -# Iterates over all lines before a CONSTANT -# until it reaches shareable_constant_value -# -# source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#88 -module RuboCop::Cop::Style::MutableConstant::ShareableConstantValue - private - - # Identifies the most recent magic comment with valid shareable constant values - # that's in scope for this node - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#102 - def magic_comment_in_scope(node); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#110 - def processed_source_till_node(node); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#91 - def recent_shareable_value?(node); end - - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#114 - def shareable_constant_value_enabled?(value); end - - class << self - # Identifies the most recent magic comment with valid shareable constant values - # that's in scope for this node - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#102 - def magic_comment_in_scope(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#91 - def recent_shareable_value?(node); end - end -end - -# Checks for uses of if with a negated condition. Only ifs -# without else are considered. There are three different styles: -# -# * both -# * prefix -# * postfix -# -# @example EnforcedStyle: both (default) -# # enforces `unless` for `prefix` and `postfix` conditionals -# -# # bad -# -# if !foo -# bar -# end -# -# # good -# -# unless foo -# bar -# end -# -# # bad -# -# bar if !foo -# -# # good -# -# bar unless foo -# @example EnforcedStyle: prefix -# # enforces `unless` for just `prefix` conditionals -# -# # bad -# -# if !foo -# bar -# end -# -# # good -# -# unless foo -# bar -# end -# -# # good -# -# bar if !foo -# @example EnforcedStyle: postfix -# # enforces `unless` for just `postfix` conditionals -# -# # bad -# -# bar if !foo -# -# # good -# -# bar unless foo -# -# # good -# -# if !foo -# bar -# end -# -# source://rubocop//lib/rubocop/cop/style/negated_if.rb#71 -class RuboCop::Cop::Style::NegatedIf < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::NegativeConditional - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/negated_if.rb#76 - def on_if(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/negated_if.rb#92 - def correct_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_if.rb#88 - def message(node); end -end - -# Checks for uses of `if-else` and ternary operators with a negated condition -# which can be simplified by inverting condition and swapping branches. -# -# @example -# # bad -# if !x -# do_something -# else -# do_something_else -# end -# -# # good -# if x -# do_something_else -# else -# do_something -# end -# -# # bad -# !x ? do_something : do_something_else -# -# # good -# x ? do_something_else : do_something -# -# source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#30 -class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#39 - def double_negation?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#50 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#45 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#97 - def correct_negated_condition(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#93 - def corrected_ancestor?(node); end - - # Collect the entire else branch, including whitespace and comments - # - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#127 - def else_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#71 - def if_else?(node); end - - # Collect the entire if branch, including whitespace and comments - # - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#118 - def if_range(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#87 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#82 - def negated_condition?(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#109 - def swap_branches(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#76 - def unwrap_begin_nodes(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#41 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#34 -RuboCop::Cop::Style::NegatedIfElseCondition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/negated_if_else_condition.rb#36 -RuboCop::Cop::Style::NegatedIfElseCondition::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array) - -# Checks for uses of unless with a negated condition. Only unless -# without else are considered. There are three different styles: -# -# * both -# * prefix -# * postfix -# -# @example EnforcedStyle: both (default) -# # enforces `if` for `prefix` and `postfix` conditionals -# -# # bad -# unless !foo -# bar -# end -# -# # good -# if foo -# bar -# end -# -# # bad -# bar unless !foo -# -# # good -# bar if foo -# @example EnforcedStyle: prefix -# # enforces `if` for just `prefix` conditionals -# -# # bad -# unless !foo -# bar -# end -# -# # good -# if foo -# bar -# end -# -# # good -# bar unless !foo -# @example EnforcedStyle: postfix -# # enforces `if` for just `postfix` conditionals -# -# # bad -# bar unless !foo -# -# # good -# bar if foo -# -# # good -# unless !foo -# bar -# end -# -# source://rubocop//lib/rubocop/cop/style/negated_unless.rb#61 -class RuboCop::Cop::Style::NegatedUnless < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::NegativeConditional - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#66 - def on_if(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#82 - def correct_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#78 - def message(node); end -end - -# Checks for uses of while with a negated condition. -# -# @example -# # bad -# while !foo -# bar -# end -# -# # good -# until foo -# bar -# end -# -# # bad -# bar until !foo -# -# # good -# bar while foo -# bar while !foo && baz -# -# source://rubocop//lib/rubocop/cop/style/negated_while.rb#25 -class RuboCop::Cop::Style::NegatedWhile < ::RuboCop::Cop::Base - include ::RuboCop::Cop::NegativeConditional - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/negated_while.rb#29 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/negated_while.rb#29 - def on_while(node); end -end - -# Checks for nested `File.dirname`. -# It replaces nested `File.dirname` with the level argument introduced in Ruby 3.1. -# -# @example -# -# # bad -# File.dirname(File.dirname(path)) -# -# # good -# File.dirname(path, 2) -# -# source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#17 -class RuboCop::Cop::Style::NestedFileDirname < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#28 - def file_dirname?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#33 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#60 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#49 - def path_with_dir_level(node, level); end -end - -# source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#22 -RuboCop::Cop::Style::NestedFileDirname::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/nested_file_dirname.rb#23 -RuboCop::Cop::Style::NestedFileDirname::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for nested use of if, unless, while and until in their -# modifier form. -# -# @example -# -# # bad -# something if a if b -# -# # good -# something if b && a -# -# source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#16 -class RuboCop::Cop::Style::NestedModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 - def on_while(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#85 - def add_parentheses_to_method_arguments(send_node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#42 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#30 - def check(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#65 - def left_hand_operand(node, operator); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#38 - def modifier?(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#51 - def new_expression(inner_node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#61 - def replacement_operator(keyword); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#94 - def requires_parens?(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#71 - def right_hand_operand(node, left_hand_keyword); end -end - -# source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#20 -RuboCop::Cop::Style::NestedModifier::MSG = T.let(T.unsafe(nil), String) - -# Checks for unparenthesized method calls in the argument list -# of a parenthesized method call. -# `be`, `be_a`, `be_an`, `be_between`, `be_falsey`, `be_kind_of`, `be_instance_of`, -# `be_truthy`, `be_within`, `eq`, `eql`, `end_with`, `include`, `match`, `raise_error`, -# `respond_to`, and `start_with` methods are allowed by default. -# These are customizable with `AllowedMethods` option. -# -# @example -# # good -# method1(method2(arg)) -# -# # bad -# method1(method2 arg) -# @example AllowedMethods: [foo] -# # good -# method1(foo arg) -# -# source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#24 -class RuboCop::Cop::Style::NestedParenthesizedCalls < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#35 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#35 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#71 - def allowed?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#65 - def allowed_omission?(send_node); end - - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#51 - def autocorrect(corrector, nested); end - - class << self - # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#31 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#29 -RuboCop::Cop::Style::NestedParenthesizedCalls::MSG = T.let(T.unsafe(nil), String) - -# Checks for nested ternary op expressions. -# -# @example -# # bad -# a ? (b ? b1 : b2) : a2 -# -# # good -# if a -# b ? b1 : b2 -# else -# a2 -# end -# -# source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#18 -class RuboCop::Cop::Style::NestedTernaryOperator < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#24 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#39 - def autocorrect(corrector, if_node); end - - # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#46 - def remove_parentheses(source); end - - # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#54 - def replace_loc_and_whitespace(corrector, range, replacement); end -end - -# source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#22 -RuboCop::Cop::Style::NestedTernaryOperator::MSG = T.let(T.unsafe(nil), String) - -# Use `next` to skip iteration instead of a condition at the end. -# -# @example EnforcedStyle: skip_modifier_ifs (default) -# # bad -# [1, 2].each do |a| -# if a == 1 -# puts a -# end -# end -# -# # good -# [1, 2].each do |a| -# next unless a == 1 -# puts a -# end -# -# # good -# [1, 2].each do |a| -# puts a if a == 1 -# end -# @example EnforcedStyle: always -# # With `always` all conditions at the end of an iteration needs to be -# # replaced by next - with `skip_modifier_ifs` the modifier if like -# # this one are ignored: `[1, 2].each { |a| puts a if a == 1 }` -# -# # bad -# [1, 2].each do |a| -# puts a if a == 1 -# end -# -# # bad -# [1, 2].each do |a| -# if a == 1 -# puts a -# end -# end -# -# # good -# [1, 2].each do |a| -# next unless a == 1 -# puts a -# end -# @example AllowConsecutiveConditionals: false (default) -# # bad -# [1, 2].each do |a| -# if a == 1 -# puts a -# end -# if a == 2 -# puts a -# end -# end -# -# # good -# [1, 2].each do |a| -# if a == 1 -# puts a -# end -# next unless a == 2 -# puts a -# end -# @example AllowConsecutiveConditionals: true -# # good -# [1, 2].each do |a| -# if a == 1 -# puts a -# end -# if a == 2 -# puts a -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/next.rb#81 -class RuboCop::Cop::Style::Next < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::MinBodyLength - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/next.rb#100 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#109 - def on_for(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#100 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#94 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/style/next.rb#100 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#109 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#109 - def on_while(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/next.rb#249 - def actual_indent(lines, buffer); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#271 - def allowed_consecutive_conditionals?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#148 - def allowed_modifier_if?(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#191 - def autocorrect_block(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#181 - def autocorrect_modifier(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#117 - def check(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#206 - def cond_range(node, cond); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#267 - def consecutive_conditionals?(if_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#225 - def end_followed_by_whitespace_only?(source_buffer, end_pos); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#216 - def end_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#134 - def ends_with_condition?(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#164 - def exit_body_type?(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#253 - def heredoc_lines(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#156 - def if_else_children?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#160 - def if_without_else?(node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#176 - def offense_location(offense_node); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#170 - def offense_node(body); end - - # Adjust indentation of `lines` to match `node` - # - # source://rubocop//lib/rubocop/cop/style/next.rb#240 - def reindent(lines, node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#260 - def reindent_line(corrector, lineno, delta, buffer); end - - # source://rubocop//lib/rubocop/cop/style/next.rb#229 - def reindentable_lines(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/next.rb#140 - def simple_if_without_break?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/next.rb#90 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/next.rb#88 -RuboCop::Cop::Style::Next::EXIT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/next.rb#87 -RuboCop::Cop::Style::Next::MSG = T.let(T.unsafe(nil), String) - -# Checks for comparison of something with nil using `==` and -# `nil?`. -# -# Supported styles are: predicate, comparison. -# -# @example EnforcedStyle: predicate (default) -# -# # bad -# if x == nil -# end -# -# # good -# if x.nil? -# end -# @example EnforcedStyle: comparison -# -# # bad -# if x.nil? -# end -# -# # good -# if x == nil -# end -# -# source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#31 -class RuboCop::Cop::Style::NilComparison < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#44 - def nil_check?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#41 - def nil_comparison?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#46 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#67 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#79 - def prefer_comparison?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#71 - def style_check?(node, &block); end -end - -# source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#36 -RuboCop::Cop::Style::NilComparison::EXPLICIT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#35 -RuboCop::Cop::Style::NilComparison::PREDICATE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#38 -RuboCop::Cop::Style::NilComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for lambdas and procs that always return nil, -# which can be replaced with an empty lambda or proc instead. -# -# @example -# # bad -# -> { nil } -# -# lambda do -# next nil -# end -# -# proc { nil } -# -# Proc.new do -# break nil -# end -# -# # good -# -> {} -# -# lambda do -# end -# -# -> (x) { nil if x } -# -# proc {} -# -# Proc.new { nil if x } -# -# source://rubocop//lib/rubocop/cop/style/nil_lambda.rb#35 -class RuboCop::Cop::Style::NilLambda < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/nil_lambda.rb#42 - def nil_return?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/nil_lambda.rb#46 - def on_block(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/nil_lambda.rb#58 - def autocorrect(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/nil_lambda.rb#39 -RuboCop::Cop::Style::NilLambda::MSG = T.let(T.unsafe(nil), String) - -# Checks for non-nil checks, which are usually redundant. -# -# With `IncludeSemanticChanges` set to `false` by default, this cop -# does not report offenses for `!x.nil?` and does no changes that might -# change behavior. -# Also `IncludeSemanticChanges` set to `false` with `EnforcedStyle: comparison` of -# `Style/NilComparison` cop, this cop does not report offenses for `x != nil` and -# does no changes to `!x.nil?` style. -# -# With `IncludeSemanticChanges` set to `true`, this cop reports offenses -# for `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which -# is *usually* OK, but might change behavior. -# -# @example -# # bad -# if x != nil -# end -# -# # good -# if x -# end -# -# # Non-nil checks are allowed if they are the final nodes of predicate. -# # good -# def signed_in? -# !current_user.nil? -# end -# @example IncludeSemanticChanges: false (default) -# # good -# if !x.nil? -# end -# @example IncludeSemanticChanges: true -# # bad -# if !x.nil? -# end -# -# source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#44 -class RuboCop::Cop::Style::NonNilCheck < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#59 - def nil_check?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#62 - def not_and_nil_check?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#53 - def not_equal_to_nil?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#73 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#73 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#64 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#56 - def unless_check?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#93 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#123 - def autocorrect_comparison(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#137 - def autocorrect_non_nil(corrector, node, inner_node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#145 - def autocorrect_unless_nil(corrector, node, receiver); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#119 - def include_semantic_changes?; end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#110 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#150 - def nil_comparison_style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#88 - def register_offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#104 - def unless_and_nil_check?(send_node); end -end - -# source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#48 -RuboCop::Cop::Style::NonNilCheck::MSG_FOR_REDUNDANCY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#47 -RuboCop::Cop::Style::NonNilCheck::MSG_FOR_REPLACEMENT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#50 -RuboCop::Cop::Style::NonNilCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of the keyword `not` instead of `!`. -# -# @example -# -# # bad - parentheses are required because of op precedence -# x = (not something) -# -# # good -# x = !something -# -# source://rubocop//lib/rubocop/cop/style/not.rb#16 -class RuboCop::Cop::Style::Not < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/not.rb#32 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/not.rb#60 - def correct_opposite_method(corrector, range, child); end - - # source://rubocop//lib/rubocop/cop/style/not.rb#65 - def correct_with_parens(corrector, range, node); end - - # source://rubocop//lib/rubocop/cop/style/not.rb#70 - def correct_without_parens(corrector, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/not.rb#50 - def opposite_method?(child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/not.rb#54 - def requires_parens?(child); end -end - -# source://rubocop//lib/rubocop/cop/style/not.rb#20 -RuboCop::Cop::Style::Not::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/not.rb#23 -RuboCop::Cop::Style::Not::OPPOSITE_METHODS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/not.rb#21 -RuboCop::Cop::Style::Not::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for numbered parameters. -# -# It can either restrict the use of numbered parameters to -# single-lined blocks, or disallow completely numbered parameters. -# -# @example EnforcedStyle: allow_single_line (default) -# # bad -# collection.each do -# puts _1 -# end -# -# # good -# collection.each { puts _1 } -# @example EnforcedStyle: disallow -# # bad -# collection.each { puts _1 } -# -# # good -# collection.each { |item| puts item } -# -# source://rubocop//lib/rubocop/cop/style/numbered_parameters.rb#27 -class RuboCop::Cop::Style::NumberedParameters < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/numbered_parameters.rb#36 - def on_numblock(node); end -end - -# source://rubocop//lib/rubocop/cop/style/numbered_parameters.rb#31 -RuboCop::Cop::Style::NumberedParameters::MSG_DISALLOW = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numbered_parameters.rb#32 -RuboCop::Cop::Style::NumberedParameters::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) - -# Detects use of an excessive amount of numbered parameters in a -# single block. Having too many numbered parameters can make code too -# cryptic and hard to read. -# -# The cop defaults to registering an offense if there is more than 1 numbered -# parameter but this maximum can be configured by setting `Max`. -# -# @example Max: 1 (default) -# # bad -# use_multiple_numbered_parameters { _1.call(_2, _3, _4) } -# -# # good -# array.each { use_array_element_as_numbered_parameter(_1) } -# hash.each { use_only_hash_value_as_numbered_parameter(_2) } -# -# source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#20 -class RuboCop::Cop::Style::NumberedParametersLimit < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def max=(value); end - - # source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#32 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#49 - def max_count; end - - # source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#43 - def numbered_parameter_nodes(node); end -end - -# source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#24 -RuboCop::Cop::Style::NumberedParametersLimit::DEFAULT_MAX_VALUE = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#29 -RuboCop::Cop::Style::NumberedParametersLimit::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numbered_parameters_limit.rb#30 -RuboCop::Cop::Style::NumberedParametersLimit::NUMBERED_PARAMETER_PATTERN = T.let(T.unsafe(nil), Regexp) - -# Checks for octal, hex, binary, and decimal literals using -# uppercase prefixes and corrects them to lowercase prefix -# or no prefix (in case of decimals). -# -# @example EnforcedOctalStyle: zero_with_o (default) -# # bad - missing octal prefix -# num = 01234 -# -# # bad - uppercase prefix -# num = 0O1234 -# num = 0X12AB -# num = 0B10101 -# -# # bad - redundant decimal prefix -# num = 0D1234 -# num = 0d1234 -# -# # good -# num = 0o1234 -# num = 0x12AB -# num = 0b10101 -# num = 1234 -# @example EnforcedOctalStyle: zero_only -# # bad -# num = 0o1234 -# num = 0O1234 -# -# # good -# num = 01234 -# -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#36 -class RuboCop::Cop::Style::NumericLiteralPrefix < ::RuboCop::Cop::Base - include ::RuboCop::Cop::IntegerNode - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#52 - def on_int(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#109 - def format_binary(source); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#113 - def format_decimal(source); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#105 - def format_hex(source); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#97 - def format_octal(source); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#101 - def format_octal_zero_only(source); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#82 - def hex_bin_dec_literal_type(literal); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#68 - def literal_type(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#64 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#74 - def octal_literal_type(literal); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#93 - def octal_zero_only?; end -end - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#49 -RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#43 -RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#50 -RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#44 -RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#48 -RuboCop::Cop::Style::NumericLiteralPrefix::HEX_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#42 -RuboCop::Cop::Style::NumericLiteralPrefix::HEX_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#47 -RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#41 -RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#46 -RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#40 -RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_REGEX = T.let(T.unsafe(nil), Regexp) - -# Checks for big numeric literals without `_` between groups -# of digits in them. -# -# Additional allowed patterns can be added by adding regexps to -# the `AllowedPatterns` configuration. All regexps are treated -# as anchored even if the patterns do not contain anchors (so -# `\d{4}_\d{4}` will allow `1234_5678` but not `1234_5678_9012`). -# -# NOTE: Even if `AllowedPatterns` are given, autocorrection will -# only correct to the standard pattern of an `_` every 3 digits. -# -# @example -# -# # bad -# 1000000 -# 1_00_000 -# 1_0000 -# -# # good -# 1_000_000 -# 1000 -# @example Strict: false (default) -# -# # good -# 10_000_00 # typical representation of $10,000 in cents -# @example Strict: true -# -# # bad -# 10_000_00 # typical representation of $10,000 in cents -# @example AllowedNumbers: [3000] -# -# # good -# 3000 # You can specify allowed numbers. (e.g. port number) -# -# source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#43 -class RuboCop::Cop::Style::NumericLiterals < ::RuboCop::Cop::Base - include ::RuboCop::Cop::IntegerNode - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 - def min_digits=(value); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#60 - def on_float(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#56 - def on_int(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#118 - def allowed_numbers; end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#122 - def allowed_patterns; end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#66 - def check(node); end - - # @param int_part [String] - # - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#107 - def format_int_part(int_part); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#93 - def format_number(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#114 - def min_digits; end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#82 - def register_offense(node, &_block); end - - # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#89 - def short_group_regex; end -end - -# source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#49 -RuboCop::Cop::Style::NumericLiterals::DELIMITER_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#48 -RuboCop::Cop::Style::NumericLiterals::MSG = T.let(T.unsafe(nil), String) - -# Checks for usage of comparison operators (`==`, -# `>`, `<`) to test numbers as zero, positive, or negative. -# These can be replaced by their respective predicate methods. -# This cop can also be configured to do the reverse. -# -# This cop's allowed methods can be customized with `AllowedMethods`. -# By default, there are no allowed methods. -# -# This cop disregards `#nonzero?` as its value is truthy or falsey, -# but not `true` and `false`, and thus not always interchangeable with -# `!= 0`. -# -# This cop allows comparisons to global variables, since they are often -# populated with objects which can be compared with integers, but are -# not themselves `Integer` polymorphic. -# -# @example EnforcedStyle: predicate (default) -# # bad -# foo == 0 -# 0 > foo -# bar.baz > 0 -# -# # good -# foo.zero? -# foo.negative? -# bar.baz.positive? -# @example EnforcedStyle: comparison -# # bad -# foo.zero? -# foo.negative? -# bar.baz.positive? -# -# # good -# foo == 0 -# 0 > foo -# bar.baz > 0 -# @example AllowedMethods: [] (default) with EnforcedStyle: predicate -# # bad -# foo == 0 -# 0 > foo -# bar.baz > 0 -# @example AllowedMethods: [==] with EnforcedStyle: predicate -# # good -# foo == 0 -# -# # bad -# 0 > foo -# bar.baz > 0 -# @example AllowedPatterns: [] (default) with EnforcedStyle: comparison -# # bad -# foo.zero? -# foo.negative? -# bar.baz.positive? -# @example AllowedPatterns: ['zero'] with EnforcedStyle: predicate -# # good -# # bad -# foo.zero? -# -# # bad -# foo.negative? -# bar.baz.positive? -# -# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#78 -class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#174 - def comparison(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#179 - def inverted_comparison(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#90 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#169 - def predicate(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#107 - def allowed_method_name?(name); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#111 - def check(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#154 - def invert; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#162 - def negated?(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#134 - def parenthesized_source(node); end - - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#124 - def replacement(node, numeric, operation); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#146 - def replacement_supported?(operator); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#142 - def require_parentheses?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#84 -RuboCop::Cop::Style::NumericPredicate::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#86 -RuboCop::Cop::Style::NumericPredicate::REPLACEMENTS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#88 -RuboCop::Cop::Style::NumericPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the use of consistent method names -# `Object#yield_self` or `Object#then`. -# -# @example EnforcedStyle: then (default) -# -# # bad -# obj.yield_self { |x| x.do_something } -# -# # good -# obj.then { |x| x.do_something } -# @example EnforcedStyle: yield_self -# -# # bad -# obj.then { |x| x.do_something } -# -# # good -# obj.yield_self { |x| x.do_something } -# -# source://rubocop//lib/rubocop/cop/style/object_then.rb#25 -class RuboCop::Cop::Style::ObjectThen < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#35 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#43 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#35 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#35 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#43 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#52 - def check_method_node(node); end - - # source://rubocop//lib/rubocop/cop/style/object_then.rb#70 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/object_then.rb#66 - def preferred_method?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/object_then.rb#32 -RuboCop::Cop::Style::ObjectThen::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/object_then.rb#33 -RuboCop::Cop::Style::ObjectThen::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of if/then/else/end constructs on a single line. -# `AlwaysCorrectToMultiline` config option can be set to true to autocorrect all offenses to -# multi-line constructs. When `AlwaysCorrectToMultiline` is false (default case) the -# autocorrect will first try converting them to ternary operators. -# -# @example -# # bad -# if foo then bar else baz end -# -# # bad -# unless foo then baz else bar end -# -# # good -# foo ? bar : baz -# -# # good -# bar if foo -# -# # good -# if foo then bar end -# -# # good -# if foo -# bar -# else -# baz -# end -# @example AlwaysCorrectToMultiline: false (default) -# # bad -# if cond then run else dont end -# -# # good -# cond ? run : dont -# @example AlwaysCorrectToMultiline: true -# # bad -# if cond then run else dont end -# -# # good -# if cond -# run -# else -# dont -# end -# -# source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#52 -class RuboCop::Cop::Style::OneLineConditional < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::OnNormalIfUnless - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#61 - def on_normal_if_unless(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#100 - def always_multiline?; end - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#82 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#104 - def cannot_replace_to_ternary?(node); end - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#118 - def expr_replacement(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#139 - def keyword_with_changed_precedence?(node); end - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#78 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#132 - def method_call_with_changed_precedence?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#124 - def requires_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#90 - def ternary_correction(node); end - - # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#110 - def ternary_replacement(node); end -end - -# source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#58 -RuboCop::Cop::Style::OneLineConditional::MSG = T.let(T.unsafe(nil), String) - -# Flags uses of `OpenStruct`, as it is now officially discouraged -# to be used for performance, version compatibility, and potential security issues. -# -# @example -# -# # bad -# point = OpenStruct.new(x: 0, y: 1) -# -# # good -# Point = Struct.new(:x, :y) -# point = Point.new(0, 1) -# -# # also good -# point = { x: 0, y: 1 } -# -# # bad -# test_double = OpenStruct.new(a: 'b') -# -# # good (assumes test using rspec-mocks) -# test_double = double -# allow(test_double).to receive(:a).and_return('b') -# -# source://rubocop//lib/rubocop/cop/style/open_struct_use.rb#44 -class RuboCop::Cop::Style::OpenStructUse < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/open_struct_use.rb#52 - def on_const(node); end - - # source://rubocop//lib/rubocop/cop/style/open_struct_use.rb#48 - def uses_open_struct?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/open_struct_use.rb#61 - def custom_class_or_module_definition?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/open_struct_use.rb#45 -RuboCop::Cop::Style::OpenStructUse::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant dot before operator method call. -# The target operator methods are `|`, `^`, `&`, ``<=>``, `==`, `===`, `=~`, `>`, `>=`, `<`, -# ``<=``, `<<`, `>>`, `+`, `-`, `*`, `/`, `%`, `**`, `~`, `!`, `!=`, and `!~`. -# -# @example -# -# # bad -# foo.+ bar -# foo.& bar -# -# # good -# foo + bar -# foo & bar -# -# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#20 -class RuboCop::Cop::Style::OperatorMethodCall < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#30 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#74 - def insert_space_after?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#57 - def invalid_syntax_argument?(argument); end - - # Checks for an acceptable case of `foo.+(bar).baz`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#51 - def method_call_with_parenthesized_arg?(argument); end - - # source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#63 - def wrap_in_parentheses_if_chained(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#25 -RuboCop::Cop::Style::OperatorMethodCall::INVALID_SYNTAX_ARG_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#23 -RuboCop::Cop::Style::OperatorMethodCall::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/operator_method_call.rb#24 -RuboCop::Cop::Style::OperatorMethodCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for options hashes and discourages them if the -# current Ruby version supports keyword arguments. -# -# @example -# -# # bad -# def fry(options = {}) -# temperature = options.fetch(:temperature, 300) -# # ... -# end -# -# # good -# def fry(temperature: 300) -# # ... -# end -# -# source://rubocop//lib/rubocop/cop/style/option_hash.rb#22 -class RuboCop::Cop::Style::OptionHash < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/option_hash.rb#30 - def on_args(node); end - - # source://rubocop//lib/rubocop/cop/style/option_hash.rb#26 - def option_hash(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/option_hash.rb#39 - def allowlist; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/option_hash.rb#48 - def super_used?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/option_hash.rb#43 - def suspicious_name?(arg_name); end -end - -# source://rubocop//lib/rubocop/cop/style/option_hash.rb#23 -RuboCop::Cop::Style::OptionHash::MSG = T.let(T.unsafe(nil), String) - -# Checks for optional arguments to methods -# that do not come at the end of the argument list. -# -# @example -# # bad -# def foo(a = 1, b, c) -# end -# -# # good -# def baz(a, b, c = 1) -# end -# -# def foobar(a = 1, b = 2, c = 3) -# end -# -# source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#24 -class RuboCop::Cop::Style::OptionalArguments < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#27 - def on_def(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#45 - def argument_positions(arguments); end - - # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#33 - def each_misplaced_optional_arg(arguments); end -end - -# source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#25 -RuboCop::Cop::Style::OptionalArguments::MSG = T.let(T.unsafe(nil), String) - -# Checks for places where keyword arguments can be used instead of -# boolean arguments when defining methods. `respond_to_missing?` method is allowed by default. -# These are customizable with `AllowedMethods` option. -# -# @example -# # bad -# def some_method(bar = false) -# puts bar -# end -# -# # bad - common hack before keyword args were introduced -# def some_method(options = {}) -# bar = options.fetch(:bar, false) -# puts bar -# end -# -# # good -# def some_method(bar: false) -# puts bar -# end -# @example AllowedMethods: ['some_method'] -# # good -# def some_method(bar = false) -# puts bar -# end -# -# source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#37 -class RuboCop::Cop::Style::OptionalBooleanParameter < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - - # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#43 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#43 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#56 - def format_message(argument); end -end - -# source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#40 -RuboCop::Cop::Style::OptionalBooleanParameter::MSG = T.let(T.unsafe(nil), String) - -# Checks for potential usage of the `||=` operator. -# -# @example -# # bad -# name = name ? name : 'Bozhidar' -# -# # bad -# name = if name -# name -# else -# 'Bozhidar' -# end -# -# # bad -# unless name -# name = 'Bozhidar' -# end -# -# # bad -# name = 'Bozhidar' unless name -# -# # good - set name to 'Bozhidar', only if it's nil or false -# name ||= 'Bozhidar' -# -# source://rubocop//lib/rubocop/cop/style/or_assignment.rb#29 -class RuboCop::Cop::Style::OrAssignment < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#51 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#35 - def ternary_assignment?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#44 - def unless_assignment?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#70 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#80 - def take_variable_and_default_from_ternary(node); end - - # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#84 - def take_variable_and_default_from_unless(node); end -end - -# source://rubocop//lib/rubocop/cop/style/or_assignment.rb#32 -RuboCop::Cop::Style::OrAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for simple usages of parallel assignment. -# This will only complain when the number of variables -# being assigned matched the number of assigning variables. -# -# @example -# # bad -# a, b, c = 1, 2, 3 -# a, b, c = [1, 2, 3] -# -# # good -# one, two = *foo -# a, b = foo() -# a, b = b, a -# -# a = 1 -# b = 2 -# c = 3 -# -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#25 -class RuboCop::Cop::Style::ParallelAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RescueNode - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#115 - def implicit_self_getter?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#31 - def on_masgn(node); end - - private - - # Converts (send nil :something) nodes to (send (:self) :something). - # This makes the sorting algorithm work for expressions such as - # `self.a, self.b = b, a`. - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#108 - def add_self_to_getters(right_elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#61 - def allowed_lhs?(elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#55 - def allowed_masign?(lhs_elements, rhs_elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#67 - def allowed_rhs?(node); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#75 - def assignment_corrector(node, rhs, order); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#48 - def autocorrect(corrector, node, rhs); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#91 - def find_valid_order(left_elements, right_elements); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#174 - def modifier_statement?(node); end -end - -# Helper class necessitated by silly design of TSort prior to Ruby 2.1 -# Newer versions have a better API, but that doesn't help us -# -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#119 -class RuboCop::Cop::Style::ParallelAssignment::AssignmentSorter - include ::TSort - extend ::RuboCop::AST::NodePattern::Macros - - # @return [AssignmentSorter] a new instance of AssignmentSorter - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#132 - def initialize(assignments); end - - # `lhs` is an assignment method call like `obj.attr=` or `ary[idx]=`. - # Does `rhs` access the same value which is assigned by `lhs`? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#161 - def accesses?(rhs, lhs); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#154 - def dependency?(lhs, rhs); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#130 - def matching_calls(param0, param1, param2); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#140 - def tsort_each_child(assignment); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#136 - def tsort_each_node(*_arg0, **_arg1, &_arg2); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#127 - def uses_var?(param0, param1); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#124 - def var_name(param0 = T.unsafe(nil)); end -end - -# An internal class for correcting parallel assignment -# -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#181 -class RuboCop::Cop::Style::ParallelAssignment::GenericCorrector - include ::RuboCop::Cop::Alignment - - # @return [GenericCorrector] a new instance of GenericCorrector - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#186 - def initialize(node, rhs, modifier, config, new_elements); end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#184 - def config; end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#194 - def correction; end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#198 - def correction_range; end - - # Returns the value of attribute node. - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#184 - def node; end - - # Returns the value of attribute rescue_result. - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#184 - def rescue_result; end - - # Returns the value of attribute rhs. - # - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#184 - def rhs; end - - protected - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#204 - def assignment; end - - private - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#225 - def cop_config; end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#221 - def extract_sources(node); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#210 - def source(node, loc); end -end - -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#29 -RuboCop::Cop::Style::ParallelAssignment::MSG = T.let(T.unsafe(nil), String) - -# An internal class for correcting parallel assignment -# guarded by if, unless, while, or until -# -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#267 -class RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#268 - def correction; end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#277 - def correction_range; end - - private - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#283 - def modifier_range(node); end -end - -# An internal class for correcting parallel assignment -# protected by rescue -# -# source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#232 -class RuboCop::Cop::Style::ParallelAssignment::RescueCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#233 - def correction; end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#244 - def correction_range; end - - private - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#255 - def begin_correction(rescue_result); end - - # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#250 - def def_correction(rescue_result); end -end - -# Checks for the presence of superfluous parentheses around the -# condition of if/unless/while/until. -# -# `AllowSafeAssignment` option for safe assignment. -# By safe assignment we mean putting parentheses around -# an assignment to indicate "I know I'm using an assignment -# as a condition. It's not a mistake." -# -# @example -# # bad -# x += 1 while (x < 10) -# foo unless (bar || baz) -# -# if (x > 10) -# elsif (x < 3) -# end -# -# # good -# x += 1 while x < 10 -# foo unless bar || baz -# -# if x > 10 -# elsif x < 3 -# end -# @example AllowSafeAssignment: true (default) -# # good -# foo unless (bar = baz) -# @example AllowSafeAssignment: false -# # bad -# foo unless (bar = baz) -# @example AllowInMultilineConditions: false (default) -# # bad -# if (x > 10 && -# y > 10) -# end -# -# # good -# if x > 10 && -# y > 10 -# end -# @example AllowInMultilineConditions: true -# # good -# if (x > 10 && -# y > 10) -# end -# -# source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#56 -class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::SafeAssignment - include ::RuboCop::Cop::Parentheses - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#76 - def control_op_condition(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#62 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#68 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#68 - def on_while(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#130 - def allow_multiline_conditions?; end - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#118 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#111 - def modifier_op?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#124 - def parens_allowed?(node); end - - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#80 - def process_control_op(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#96 - def require_parentheses?(node, condition_body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#103 - def semicolon_separated_expressions?(first_exp, rest_exps); end -end - -# Enforces the consistent usage of `%`-literal delimiters. -# -# Specify the 'default' key to set all preferred delimiters at once. You -# can continue to specify individual preferred delimiters to override the -# default. -# -# @example -# # Style/PercentLiteralDelimiters: -# # PreferredDelimiters: -# # default: '[]' -# # '%i': '()' -# -# # good -# %w[alpha beta] + %i(gamma delta) -# -# # bad -# %W(alpha #{beta}) -# -# # bad -# %I(alpha beta) -# -# source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#26 -class RuboCop::Cop::Style::PercentLiteralDelimiters < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#30 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#38 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#34 - def on_regexp(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#38 - def on_str(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#43 - def on_sym(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#47 - def on_xstr(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#93 - def contains_delimiter?(node, delimiters); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#82 - def contains_preferred_delimiter?(node, type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#86 - def include_same_character_as_used_for_delimiter?(node, type); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#107 - def matchpairs(begin_delimiter); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#67 - def message(type); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#53 - def on_percent_literal(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#74 - def preferred_delimiters_for(type); end - - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#99 - def string_source(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#78 - def uses_preferred_delimiter?(node, type); end -end - -# Checks for usage of the %Q() syntax when %q() would do. -# -# @example EnforcedStyle: lower_case_q (default) -# # The `lower_case_q` style prefers `%q` unless -# # interpolation is needed. -# # bad -# %Q[Mix the foo into the baz.] -# %Q(They all said: 'Hooray!') -# -# # good -# %q[Mix the foo into the baz] -# %q(They all said: 'Hooray!') -# @example EnforcedStyle: upper_case_q -# # The `upper_case_q` style requires the sole use of `%Q`. -# # bad -# %q/Mix the foo into the baz./ -# %q{They all said: 'Hooray!'} -# -# # good -# %Q/Mix the foo into the baz./ -# %Q{They all said: 'Hooray!'} -# -# source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#28 -class RuboCop::Cop::Style::PercentQLiterals < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#36 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#55 - def correct_literal_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#64 - def corrected(src); end - - # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#60 - def message(_range); end - - # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#42 - def on_percent_literal(node); end -end - -# source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#33 -RuboCop::Cop::Style::PercentQLiterals::LOWER_CASE_Q_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#34 -RuboCop::Cop::Style::PercentQLiterals::UPPER_CASE_Q_MSG = T.let(T.unsafe(nil), String) - -# Looks for uses of Perl-style regexp match -# backreferences and their English versions like -# $1, $2, $&, &+, $MATCH, $PREMATCH, etc. -# -# @example -# # bad -# puts $1 -# -# # good -# puts Regexp.last_match(1) -# -# source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#16 -class RuboCop::Cop::Style::PerlBackrefs < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#21 - def on_back_ref(node); end - - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#25 - def on_gvar(node); end - - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#29 - def on_nth_ref(node); end - - private - - # @param node [RuboCop::AST::Node] - # @private - # @return [String] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#99 - def constant_prefix(node); end - - # @param node [RuboCop::AST::Node] - # @private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#38 - def derived_from_braceless_interpolation?(node); end - - # @param node [RuboCop::AST::Node] - # @param preferred_expression [String] - # @private - # @return [String] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#46 - def format_message(node:, preferred_expression:); end - - # @param node [RuboCop::AST::Node] - # @private - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#109 - def on_back_ref_or_gvar_or_nth_ref(node); end - - # @param node [RuboCop::AST::Node] - # @private - # @return [String] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#58 - def original_expression_of(node); end - - # @param node [RuboCop::AST::Node] - # @private - # @return [String, nil] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#70 - def preferred_expression_to(node); end - - # @param node [RuboCop::AST::Node] - # @private - # @return [String, nil] - # - # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#89 - def preferred_expression_to_node_with_constant_prefix(node); end -end - -# source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#19 -RuboCop::Cop::Style::PerlBackrefs::MESSAGE_FORMAT = T.let(T.unsafe(nil), String) - -# Checks for uses of methods `Hash#has_key?` and -# `Hash#has_value?`, and suggests using `Hash#key?` and `Hash#value?` instead. -# -# It is configurable to enforce the verbose method names, by using the -# `EnforcedStyle: verbose` configuration. -# -# @example EnforcedStyle: short (default) -# # bad -# Hash#has_key? -# Hash#has_value? -# -# # good -# Hash#key? -# Hash#value? -# @example EnforcedStyle: verbose -# # bad -# Hash#key? -# Hash#value? -# -# # good -# Hash#has_key? -# Hash#has_value? -# -# source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#33 -class RuboCop::Cop::Style::PreferredHashMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#43 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#43 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#56 - def message(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#68 - def offending_selector?(method_name); end - - # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#60 - def proper_method_name(method_name); end -end - -# source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#37 -RuboCop::Cop::Style::PreferredHashMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#39 -RuboCop::Cop::Style::PreferredHashMethods::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#41 -RuboCop::Cop::Style::PreferredHashMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of Proc.new where Kernel#proc -# would be more appropriate. -# -# @example -# # bad -# p = Proc.new { |n| puts n } -# -# # good -# p = proc { |n| puts n } -# -# source://rubocop//lib/rubocop/cop/style/proc.rb#16 -class RuboCop::Cop::Style::Proc < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/proc.rb#24 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/proc.rb#24 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/proc.rb#24 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/proc.rb#22 - def proc_new?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/style/proc.rb#19 -RuboCop::Cop::Style::Proc::MSG = T.let(T.unsafe(nil), String) - -# Checks if the quotes used for quoted symbols match the configured defaults. -# By default uses the same configuration as `Style/StringLiterals`; if that -# cop is not enabled, the default `EnforcedStyle` is `single_quotes`. -# -# String interpolation is always kept in double quotes. -# -# NOTE: `Lint/SymbolConversion` can be used in parallel to ensure that symbols -# are not quoted that don't need to be. This cop is for configuring the quoting -# style to use for symbols that require quotes. -# -# @example EnforcedStyle: same_as_string_literals (default) / single_quotes -# # bad -# :"abc-def" -# -# # good -# :'abc-def' -# :"#{str}" -# :"a\'b" -# @example EnforcedStyle: double_quotes -# # bad -# :'abc-def' -# -# # good -# :"abc-def" -# :"#{str}" -# :"a\'b" -# -# source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#33 -class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::SymbolHelp - include ::RuboCop::Cop::StringLiteralsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#44 - def on_sym(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#106 - def alternative_style; end - - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#71 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#88 - def correct_quotes(str); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#83 - def hash_colon_key?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#61 - def invalid_double_quotes?(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#110 - def quoted?(sym_node); end - - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#99 - def style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#114 - def wrong_quotes?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#41 -RuboCop::Cop::Style::QuotedSymbols::MSG_DOUBLE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/quoted_symbols.rb#39 -RuboCop::Cop::Style::QuotedSymbols::MSG_SINGLE = T.let(T.unsafe(nil), String) - -# Checks the args passed to `fail` and `raise`. -# -# Exploded style (default) enforces passing the exception class and message -# arguments separately, rather than constructing an instance of the error. -# -# Compact style enforces constructing an error instance. -# -# Both styles allow passing just a message, or an error instance when there is more -# than one argument. -# -# The exploded style has an `AllowedCompactTypes` configuration -# option that takes an `Array` of exception name Strings. -# -# @example EnforcedStyle: exploded (default) -# # bad -# raise StandardError.new('message') -# -# # good -# raise StandardError, 'message' -# fail 'message' -# raise MyCustomError -# raise MyCustomError.new(arg1, arg2, arg3) -# raise MyKwArgError.new(key1: val1, key2: val2) -# -# # With `AllowedCompactTypes` set to ['MyWrappedError'] -# raise MyWrappedError.new(obj) -# raise MyWrappedError.new(obj), 'message' -# @example EnforcedStyle: compact -# # bad -# raise StandardError, 'message' -# raise RuntimeError, arg1, arg2, arg3 -# -# # good -# raise StandardError.new('message') -# raise MyCustomError -# raise MyCustomError.new(arg1, arg2, arg3) -# fail 'message' -# -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#47 -class RuboCop::Cop::Style::RaiseArgs < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#59 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#135 - def acceptable_exploded_args?(args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#148 - def allowed_non_exploded_type?(arg); end - - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#98 - def check_compact(node); end - - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#114 - def check_exploded(node); end - - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#72 - def correction_compact_to_exploded(node); end - - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#84 - def correction_exploded_to_compact(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#154 - def requires_parens?(parent); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#131 - def use_new_method?(first_arg); end -end - -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#53 -RuboCop::Cop::Style::RaiseArgs::ACCEPTABLE_ARG_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#52 -RuboCop::Cop::Style::RaiseArgs::COMPACT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#51 -RuboCop::Cop::Style::RaiseArgs::EXPLODED_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#57 -RuboCop::Cop::Style::RaiseArgs::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of randomly generated numbers, -# added/subtracted with integer literals, as well as those with -# Integer#succ and Integer#pred methods. Prefer using ranges instead, -# as it clearly states the intentions. -# -# @example -# # bad -# rand(6) + 1 -# 1 + rand(6) -# rand(6) - 1 -# 1 - rand(6) -# rand(6).succ -# rand(6).pred -# Random.rand(6) + 1 -# Kernel.rand(6) + 1 -# rand(0..5) + 1 -# -# # good -# rand(1..6) -# rand(1...7) -# -# source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#26 -class RuboCop::Cop::Style::RandomWithOffset < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#33 - def integer_op_rand?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#63 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#54 - def rand_modified?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#43 - def rand_op_integer?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#73 - def random_call(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#147 - def to_int(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#78 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#135 - def boundaries_from_random_node(random_node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#88 - def corrected_integer_op_rand(node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#118 - def corrected_rand_modified(node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#103 - def corrected_rand_op_integer(node); end - - # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#131 - def prefix_from_prefix_node(node); end -end - -# source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#29 -RuboCop::Cop::Style::RandomWithOffset::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#30 -RuboCop::Cop::Style::RandomWithOffset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for a redundant argument passed to certain methods. -# -# NOTE: This cop is limited to methods with single parameter. -# -# Method names and their redundant arguments can be configured like this: -# -# [source,yaml] -# ---- -# Methods: -# join: '' -# sum: 0 -# split: ' ' -# chomp: "\n" -# chomp!: "\n" -# foo: 2 -# ---- -# -# @example -# # bad -# array.join('') -# [1, 2, 3].join("") -# array.sum(0) -# exit(true) -# exit!(false) -# string.split(" ") -# "first\nsecond".split(" ") -# string.chomp("\n") -# string.chomp!("\n") -# A.foo(2) -# -# # good -# array.join -# [1, 2, 3].join -# array.sum -# exit -# exit! -# string.split -# "first second".split -# string.chomp -# string.chomp! -# A.foo -# -# source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#57 -class RuboCop::Cop::Style::RedundantArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#64 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#64 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#108 - def argument_matched?(target_argument, redundant_argument); end - - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#100 - def argument_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#120 - def exclude_cntrl_character?(target_argument, redundant_argument); end - - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#93 - def redundant_arg_for_method(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#80 - def redundant_argument?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#61 -RuboCop::Cop::Style::RedundantArgument::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#62 -RuboCop::Cop::Style::RedundantArgument::NO_RECEIVER_METHODS = T.let(T.unsafe(nil), Array) - -# Checks for the instantiation of array using redundant `Array` constructor. -# Autocorrect replaces to array literal which is the simplest and fastest. -# -# @example -# -# # bad -# Array.new([]) -# Array[] -# Array([]) -# Array.new(['foo', 'foo', 'foo']) -# Array['foo', 'foo', 'foo'] -# Array(['foo', 'foo', 'foo']) -# -# # good -# [] -# ['foo', 'foo', 'foo'] -# Array.new(3, 'foo') -# Array.new(3) { 'foo' } -# -# source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#25 -class RuboCop::Cop::Style::RedundantArrayConstructor < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#47 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#33 - def redundant_array_constructor(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#69 - def register_offense(range, node, replacement); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#28 -RuboCop::Cop::Style::RedundantArrayConstructor::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_array_constructor.rb#30 -RuboCop::Cop::Style::RedundantArrayConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant assignment before returning. -# -# @example -# # bad -# def test -# x = foo -# x -# end -# -# # bad -# def test -# if x -# z = foo -# z -# elsif y -# z = bar -# z -# end -# end -# -# # good -# def test -# foo -# end -# -# # good -# def test -# if x -# foo -# elsif y -# bar -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#40 -class RuboCop::Cop::Style::RedundantAssignment < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#50 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#50 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#46 - def redundant_assignment?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#99 - def check_begin_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#58 - def check_branch(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#79 - def check_case_match_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#74 - def check_case_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#95 - def check_ensure_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#84 - def check_if_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#91 - def check_rescue_node(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#43 -RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant `begin` blocks. -# -# Currently it checks for code like this: -# -# @example -# -# # bad -# def redundant -# begin -# ala -# bala -# rescue StandardError => e -# something -# end -# end -# -# # good -# def preferred -# ala -# bala -# rescue StandardError => e -# something -# end -# -# # bad -# begin -# do_something -# end -# -# # good -# do_something -# -# # bad -# # When using Ruby 2.5 or later. -# do_something do -# begin -# something -# rescue => ex -# anything -# end -# end -# -# # good -# # In Ruby 2.5 or later, you can omit `begin` in `do-end` block. -# do_something do -# something -# rescue => ex -# anything -# end -# -# # good -# # Stabby lambdas don't support implicit `begin` in `do-end` blocks. -# -> do -# begin -# foo -# rescue Bar -# baz -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#65 -class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#76 - def offensive_kwbegins(param0); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#88 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#80 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#80 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#88 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#100 - def on_kwbegin(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#88 - def on_numblock(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#108 - def allowable_kwbegin?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#182 - def begin_block_has_multiline_statements?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#174 - def condition_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#186 - def contain_rescue_or_ensure?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#167 - def correct_modifier_form_after_multiline_begin_block(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#178 - def empty_begin?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#115 - def register_offense(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#144 - def remove_begin(corrector, offense_range, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#132 - def replace_begin_with_statement(corrector, offense_range, node); end - - # Restore comments that occur between "begin" and "first_child". - # These comments will be moved to above the assignment line. - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#154 - def restore_removed_comments(corrector, offense_range, node, first_child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#161 - def use_modifier_form_after_multiline_begin_block?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#199 - def valid_begin_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#192 - def valid_context_using_only_begin?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#71 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#69 -RuboCop::Cop::Style::RedundantBegin::MSG = T.let(T.unsafe(nil), String) - -# Checks for usage of the %W() syntax when %w() would do. -# -# @example -# # bad -# %W(cat dog pig) -# %W[door wall floor] -# -# # good -# %w/swim run bike/ -# %w[shirt pants shoes] -# %W(apple #{fruit} grape) -# -# source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#17 -class RuboCop::Cop::Style::RedundantCapitalW < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#23 - def on_array(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#29 - def on_percent_literal(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#38 - def requires_interpolation?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#21 -RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String) - -# Checks for unnecessary conditional expressions. -# -# NOTE: Since the intention of the comment cannot be automatically determined, -# autocorrection is not applied when a comment is used, as shown below: -# -# [source,ruby] -# ----- -# if b -# # Important note. -# b -# else -# c -# end -# ----- -# -# @example -# # bad -# a = b ? b : c -# -# # good -# a = b || c -# -# # bad -# if b -# b -# else -# c -# end -# -# # good -# b || c -# -# # good -# if b -# b -# elsif cond -# c -# end -# -# # bad -# a.nil? ? true : a -# -# # good -# a.nil? || a -# -# # bad -# if a.nil? -# true -# else -# a -# end -# -# # good -# a.nil? || a -# @example AllowedMethods: ['nonzero?'] (default) -# # good -# num.nonzero? ? true : false -# -# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#65 -class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::CommentsHelp - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#77 - def on_if(node); end - - private - - # If the argument is using an operator, it is an invalid syntax. - # e.g. `foo || *bar`, `foo || **bar`, and `foo || &bar`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#225 - def argument_with_operator?(argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#202 - def asgn_type?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#97 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#192 - def branches_have_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#206 - def branches_have_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#312 - def correct_ternary(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#259 - def else_source(else_branch, arithmetic_operation); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#285 - def else_source_if_has_assignment(else_branch); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#275 - def else_source_if_has_method(else_branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#181 - def if_branch_is_true_type_and_else_is_not?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#241 - def if_source(if_branch, arithmetic_operation); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#295 - def make_ternary_form(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#89 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#118 - def offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#111 - def range_of_offense(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#126 - def redundant_condition?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#327 - def require_braces?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#320 - def require_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#219 - def same_method?(if_branch, else_branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#213 - def single_argument_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#142 - def synonymous_condition_and_branch?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#331 - def use_arithmetic_operation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#138 - def use_hash_key_access?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#134 - def use_hash_key_assignment?(else_branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#130 - def use_if_branch?(else_branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#335 - def without_argument_parentheses_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#233 - def wrap_arguments_with_parens(condition); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#73 -RuboCop::Cop::Style::RedundantCondition::ARGUMENT_WITH_OPERATOR_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#71 -RuboCop::Cop::Style::RedundantCondition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#72 -RuboCop::Cop::Style::RedundantCondition::REDUNDANT_CONDITION = T.let(T.unsafe(nil), String) - -# Checks for redundant returning of true/false in conditionals. -# -# @example -# # bad -# x == y ? true : false -# -# # bad -# if x == y -# true -# else -# false -# end -# -# # good -# x == y -# -# # bad -# x == y ? false : true -# -# # good -# x != y -# -# source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#27 -class RuboCop::Cop::Style::RedundantConditional < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#36 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#56 - def redundant_condition?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#61 - def redundant_condition_inverted?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#78 - def indented_else_node(expression, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#48 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#65 - def offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#71 - def replacement_condition(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#32 -RuboCop::Cop::Style::RedundantConditional::COMPARISON_OPERATOR_MATCHER = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#34 -RuboCop::Cop::Style::RedundantConditional::MSG = T.let(T.unsafe(nil), String) - -# Avoid redundant `::` prefix on constant. -# -# How Ruby searches constant is a bit complicated, and it can often be difficult to -# understand from the code whether the `::` is intended or not. Where `Module.nesting` -# is empty, there is no need to prepend `::`, so it would be nice to consistently -# avoid such meaningless `::` prefix to avoid confusion. -# -# NOTE: This cop is disabled if `Lint/ConstantResolution` cop is enabled to prevent -# conflicting rules. Because it respects user configurations that want to enable -# `Lint/ConstantResolution` cop which is disabled by default. -# -# @example -# # bad -# ::Const -# -# # good -# Const -# -# # bad -# class << self -# ::Const -# end -# -# # good -# class << self -# Const -# end -# -# # good -# class A -# ::Const -# end -# -# # good -# module A -# ::Const -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#43 -class RuboCop::Cop::Style::RedundantConstantBase < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#48 - def on_cbase(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#67 - def bad?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#63 - def lint_constant_resolution_config; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#59 - def lint_constant_resolution_cop_enabled?; end - - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#71 - def module_nesting_ancestors_of(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#77 - def used_in_super_class_part?(node, class_node:); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#46 -RuboCop::Cop::Style::RedundantConstantBase::MSG = T.let(T.unsafe(nil), String) - -# Checks for paths given to `require_relative` that start with -# the current directory (`./`), which can be omitted. -# -# @example -# -# # bad -# require_relative './path/to/feature' -# -# # good -# require_relative 'path/to/feature' -# -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#17 -class RuboCop::Cop::Style::RedundantCurrentDirectoryInPath < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#26 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#42 - def redundant_path_length(path); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#23 -RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::CURRENT_DIRECTORY_PREFIX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#21 -RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#24 -RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::REDUNDANT_CURRENT_DIRECTORY_PREFIX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#22 -RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant uses of double splat hash braces. -# -# @example -# -# # bad -# do_something(**{foo: bar, baz: qux}) -# -# # good -# do_something(foo: bar, baz: qux) -# -# # bad -# do_something(**{foo: bar, baz: qux}.merge(options)) -# -# # good -# do_something(foo: bar, baz: qux, **options) -# -# source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#22 -class RuboCop::Cop::Style::RedundantDoubleSplatHashBraces < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#29 - def on_hash(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#45 - def allowed_double_splat_receiver?(kwsplat); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#55 - def autocorrect(corrector, node, kwsplat); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#89 - def autocorrect_merge_methods(corrector, merge_methods, kwsplat); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#85 - def closing_brace(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#107 - def convert_to_new_arguments(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#119 - def mergeable?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#81 - def opening_brace(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#100 - def range_of_merge_methods(merge_methods); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#66 - def root_receiver(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#75 - def select_merge_method_nodes(kwsplat); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#26 -RuboCop::Cop::Style::RedundantDoubleSplatHashBraces::MERGE_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb#25 -RuboCop::Cop::Style::RedundantDoubleSplatHashBraces::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant `each`. -# -# @example -# -# # bad -# array.each.each { |v| do_something(v) } -# -# # good -# array.each { |v| do_something(v) } -# -# # bad -# array.each.each_with_index { |v, i| do_something(v, i) } -# -# # good -# array.each.with_index { |v, i| do_something(v, i) } -# array.each_with_index { |v, i| do_something(v, i) } -# -# # bad -# array.each.each_with_object { |v, o| do_something(v, o) } -# -# # good -# array.each.with_object { |v, o| do_something(v, o) } -# array.each_with_object { |v, o| do_something(v, o) } -# -# source://rubocop//lib/rubocop/cop/style/redundant_each.rb#34 -class RuboCop::Cop::Style::RedundantEach < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#43 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#43 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#96 - def message(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#86 - def range(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#64 - def redundant_each_method(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_each.rb#107 - def remove_redundant_each(corrector, range, redundant_node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_each.rb#37 -RuboCop::Cop::Style::RedundantEach::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_each.rb#38 -RuboCop::Cop::Style::RedundantEach::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_each.rb#39 -RuboCop::Cop::Style::RedundantEach::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_each.rb#41 -RuboCop::Cop::Style::RedundantEach::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for `RuntimeError` as the argument of `raise`/`fail`. -# -# @example -# # bad -# raise RuntimeError, 'message' -# raise RuntimeError.new('message') -# -# # good -# raise 'message' -# -# # bad - message is not a string -# raise RuntimeError, Object.new -# raise RuntimeError.new(Object.new) -# -# # good -# raise Object.new.to_s -# -# source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#23 -class RuboCop::Cop::Style::RedundantException < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#79 - def compact?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#74 - def exploded?(param0 = T.unsafe(nil)); end - - # Switch `raise RuntimeError, 'message'` to `raise 'message'`, and - # `raise RuntimeError.new('message')` to `raise 'message'`. - # - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#33 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#57 - def fix_compact(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#39 - def fix_exploded(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#65 - def replaced_compact(message); end - - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#47 - def replaced_exploded(node, command, message); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#53 - def string_message?(message); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#26 -RuboCop::Cop::Style::RedundantException::MSG_1 = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#27 -RuboCop::Cop::Style::RedundantException::MSG_2 = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#29 -RuboCop::Cop::Style::RedundantException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies places where `fetch(key) { value }` can be replaced by `fetch(key, value)`. -# -# In such cases `fetch(key, value)` method is faster than `fetch(key) { value }`. -# -# NOTE: The block string `'value'` in `hash.fetch(:key) { 'value' }` is detected -# but not when disabled. -# -# @example SafeForConstants: false (default) -# # bad -# hash.fetch(:key) { 5 } -# hash.fetch(:key) { true } -# hash.fetch(:key) { nil } -# array.fetch(5) { :value } -# ENV.fetch(:key) { 'value' } -# -# # good -# hash.fetch(:key, 5) -# hash.fetch(:key, true) -# hash.fetch(:key, nil) -# array.fetch(5, :value) -# ENV.fetch(:key, 'value') -# @example SafeForConstants: true -# # bad -# ENV.fetch(:key) { VALUE } -# -# # good -# ENV.fetch(:key, VALUE) -# -# source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#40 -class RuboCop::Cop::Style::RedundantFetchBlock < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#55 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#89 - def rails_cache?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#48 - def redundant_fetch_block_candidate?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#74 - def basic_literal?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#104 - def build_bad_method(send, body); end - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#97 - def build_good_method(send, body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#111 - def check_for_constant?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#115 - def check_for_string?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#78 - def const_type?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#93 - def fetch_range(send, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#82 - def should_not_check?(send, body); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#45 -RuboCop::Cop::Style::RedundantFetchBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for the presence of superfluous `.rb` extension in -# the filename provided to `require` and `require_relative`. -# -# NOTE: If the extension is omitted, Ruby tries adding '.rb', '.so', -# and so on to the name until found. If the file named cannot be found, -# a `LoadError` will be raised. -# There is an edge case where `foo.so` file is loaded instead of a `LoadError` -# if `foo.so` file exists when `require 'foo.rb'` will be changed to `require 'foo'`, -# but that seems harmless. -# -# @example -# # bad -# require 'foo.rb' -# require_relative '../foo.rb' -# -# # good -# require 'foo' -# require 'foo.so' -# require_relative '../foo' -# require_relative '../foo.so' -# -# source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#27 -class RuboCop::Cop::Style::RedundantFileExtensionInRequire < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#39 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#35 - def require_call?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#53 - def extension_range(name_node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#31 -RuboCop::Cop::Style::RedundantFileExtensionInRequire::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#32 -RuboCop::Cop::Style::RedundantFileExtensionInRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies usages of `any?`, `empty?` or `none?` predicate methods -# chained to `select`/`filter`/`find_all` and change them to use predicate method instead. -# -# @example -# # bad -# arr.select { |x| x > 1 }.any? -# -# # good -# arr.any? { |x| x > 1 } -# -# # bad -# arr.select { |x| x > 1 }.empty? -# arr.select { |x| x > 1 }.none? -# -# # good -# arr.none? { |x| x > 1 } -# -# # good -# relation.select(:name).any? -# arr.select { |x| x > 1 }.any?(&:odd?) -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# # good -# arr.select { |x| x > 1 }.many? -# -# # good -# arr.select { |x| x > 1 }.present? -# @example AllCops:ActiveSupportExtensionsEnabled: true -# # bad -# arr.select { |x| x > 1 }.many? -# -# # good -# arr.many? { |x| x > 1 } -# -# # bad -# arr.select { |x| x > 1 }.present? -# -# # good -# arr.any? { |x| x > 1 } -# -# source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#53 -class RuboCop::Cop::Style::RedundantFilterChain < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#81 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#81 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#62 - def select_predicate?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#108 - def offense_range(select_node, predicate_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#112 - def predicate_range(predicate_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#94 - def register_offense(select_node, predicate_node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#56 -RuboCop::Cop::Style::RedundantFilterChain::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#58 -RuboCop::Cop::Style::RedundantFilterChain::RAILS_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#71 -RuboCop::Cop::Style::RedundantFilterChain::REPLACEMENT_METHODS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/redundant_filter_chain.rb#59 -RuboCop::Cop::Style::RedundantFilterChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for calls to `Kernel#format` or `Kernel#sprintf` that are redundant. -# -# Calling `format` with only a single string or constant argument is redundant, -# as it can be replaced by the string or constant itself. -# -# Also looks for `format` calls where the arguments are literals that can be -# inlined into a string easily. This applies to the `%s`, `%d`, `%i`, `%u`, and -# `%f` format specifiers. -# -# @example -# -# # bad -# format('the quick brown fox jumps over the lazy dog.') -# sprintf('the quick brown fox jumps over the lazy dog.') -# -# # good -# 'the quick brown fox jumps over the lazy dog.' -# -# # bad -# format(MESSAGE) -# sprintf(MESSAGE) -# -# # good -# MESSAGE -# -# # bad -# format('%s %s', 'foo', 'bar') -# sprintf('%s %s', 'foo', 'bar') -# -# # good -# 'foo bar' -# -# source://rubocop//lib/rubocop/cop/style/redundant_format.rb#54 -class RuboCop::Cop::Style::RedundantFormat < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#73 - def complex_number?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#78 - def find_hash_value_node(param0, param1); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#63 - def format_without_additional_args?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#90 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#68 - def rational_number?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#83 - def splatted_arguments?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#132 - def all_fields_literal?(string, arguments); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#219 - def argument_value(argument); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#215 - def argument_values(arguments); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#251 - def complex_value(complex_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#109 - def detect_unnecessary_fields(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#237 - def dsym_value(dsym_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#150 - def find_argument(sequence, arguments, hash); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#191 - def float?(argument); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#241 - def hash_value(hash_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#187 - def integer?(argument); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#163 - def matching_argument?(sequence, argument); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#105 - def message(node, prefer); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#181 - def numeric?(argument); end - - # Add correct quotes to the formatted string, preferring retaining the existing - # quotes if possible. - # - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#197 - def quote(string, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#247 - def rational_value(rational_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_format.rb#121 - def register_all_fields_literal(node, string, arguments); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_format.rb#60 -RuboCop::Cop::Style::RedundantFormat::ACCEPTABLE_LITERAL_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_format.rb#57 -RuboCop::Cop::Style::RedundantFormat::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_format.rb#59 -RuboCop::Cop::Style::RedundantFormat::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# Check for uses of `Object#freeze` on immutable objects. -# -# NOTE: `Regexp` and `Range` literals are frozen objects since Ruby 3.0. -# -# NOTE: From Ruby 3.0, this cop allows explicit freezing of interpolated -# string literals when `# frozen-string-literal: true` is used. -# -# @example -# # bad -# CONST = 1.freeze -# -# # good -# CONST = 1 -# -# source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#19 -class RuboCop::Cop::Style::RedundantFreeze < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#26 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#57 - def operation_produces_immutable_object?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#39 - def immutable_literal?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#48 - def strip_parenthesis(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#23 -RuboCop::Cop::Style::RedundantFreeze::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#24 -RuboCop::Cop::Style::RedundantFreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant heredoc delimiter quotes. -# -# @example -# -# # bad -# do_something(<<~'EOS') -# no string interpolation style text -# EOS -# -# # good -# do_something(<<~EOS) -# no string interpolation style text -# EOS -# -# do_something(<<~'EOS') -# #{string_interpolation_style_text_not_evaluated} -# EOS -# -# do_something(<<~'EOS') -# Preserve \ -# newlines -# EOS -# -# source://rubocop//lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb#29 -class RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Heredoc - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb#36 - def on_heredoc(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb#48 - def need_heredoc_delimiter_quotes?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb#33 -RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb#34 -RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::STRING_INTERPOLATION_OR_ESCAPED_CHARACTER_PATTERN = T.let(T.unsafe(nil), Regexp) - -# Checks for `initialize` methods that are redundant. -# -# An initializer is redundant if it does not do anything, or if it only -# calls `super` with the same arguments given to it. If the initializer takes -# an argument that accepts multiple values (`restarg`, `kwrestarg`, etc.) it -# will not register an offense, because it allows the initializer to take a different -# number of arguments as its superclass potentially does. -# -# NOTE: If an initializer takes any arguments and has an empty body, RuboCop -# assumes it to *not* be redundant. This is to prevent potential `ArgumentError`. -# -# NOTE: If an initializer argument has a default value, RuboCop assumes it -# to *not* be redundant. -# -# NOTE: Empty initializers are registered as offenses, but it is possible -# to purposely create an empty `initialize` method to override a superclass's -# initializer. -# -# @example -# # bad -# def initialize -# end -# -# # bad -# def initialize -# super -# end -# -# # bad -# def initialize(a, b) -# super -# end -# -# # bad -# def initialize(a, b) -# super(a, b) -# end -# -# # good -# def initialize -# do_something -# end -# -# # good -# def initialize -# do_something -# super -# end -# -# # good (different number of parameters) -# def initialize(a, b) -# super(a) -# end -# -# # good (default value) -# def initialize(a, b = 5) -# super -# end -# -# # good (default value) -# def initialize(a, b: 5) -# super -# end -# -# # good (changes the parameter requirements) -# def initialize(_) -# end -# -# # good (changes the parameter requirements) -# def initialize(*) -# end -# -# # good (changes the parameter requirements) -# def initialize(**) -# end -# -# # good (changes the parameter requirements) -# def initialize(...) -# end -# @example AllowComments: true (default) -# -# # good -# def initialize -# # Overriding to negate superclass `initialize` method. -# end -# @example AllowComments: false -# -# # bad -# def initialize -# # Overriding to negate superclass `initialize` method. -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#106 -class RuboCop::Cop::Style::RedundantInitialize < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#115 - def initialize_forwards?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#119 - def on_def(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#143 - def acceptable?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#151 - def allow_comments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#147 - def forwards?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#137 - def register_offense(node, message); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#157 - def same_args?(super_node, args); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#111 -RuboCop::Cop::Style::RedundantInitialize::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#112 -RuboCop::Cop::Style::RedundantInitialize::MSG_EMPTY = T.let(T.unsafe(nil), String) - -# Checks for strings that are just an interpolated expression. -# -# @example -# -# # bad -# "#{@var}" -# -# # good -# @var.to_s -# -# # good if @var is already a String -# @var -# -# source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#39 -class RuboCop::Cop::Style::RedundantInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::PercentLiteral - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#49 - def on_dstr(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#122 - def autocorrect_other(corrector, embedded_node, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#105 - def autocorrect_single_variable_interpolation(corrector, embedded_node, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#99 - def autocorrect_variable_interpolation(corrector, embedded_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#95 - def embedded_in_percent_array?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#91 - def implicit_concatenation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#83 - def interpolation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#132 - def require_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#67 - def single_interpolation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#74 - def single_variable_interpolation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#87 - def variable_interpolation?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#45 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#43 -RuboCop::Cop::Style::RedundantInterpolation::MSG = T.let(T.unsafe(nil), String) - -# Before Ruby 3.0, interpolated strings followed the frozen string literal -# magic comment which sometimes made it necessary to explicitly unfreeze them. -# Ruby 3.0 changed interpolated strings to always be unfrozen which makes -# unfreezing them redundant. -# -# @example -# # bad -# +"#{foo} bar" -# -# # bad -# "#{foo} bar".dup -# -# # good -# "#{foo} bar" -# -# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#21 -class RuboCop::Cop::Style::RedundantInterpolationUnfreeze < ::RuboCop::Cop::Base - include ::RuboCop::Cop::FrozenStringLiteral - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#32 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#26 -RuboCop::Cop::Style::RedundantInterpolationUnfreeze::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#28 -RuboCop::Cop::Style::RedundantInterpolationUnfreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Check for redundant line continuation. -# -# This cop marks a line continuation as redundant if removing the backslash -# does not result in a syntax error. -# However, a backslash at the end of a comment or -# for string concatenation is not redundant and is not considered an offense. -# -# @example -# # bad -# foo. \ -# bar -# foo \ -# &.bar \ -# .baz -# -# # good -# foo. -# bar -# foo -# &.bar -# .baz -# -# # bad -# [foo, \ -# bar] -# {foo: \ -# bar} -# -# # good -# [foo, -# bar] -# {foo: -# bar} -# -# # bad -# foo(bar, \ -# baz) -# -# # good -# foo(bar, -# baz) -# -# # also good - backslash in string concatenation is not redundant -# foo('bar' \ -# 'baz') -# -# # also good - backslash at the end of a comment is not redundant -# foo(bar, # \ -# baz) -# -# # also good - backslash at the line following the newline begins with a + or -, -# # it is not redundant -# 1 \ -# + 2 \ -# - 3 -# -# # also good - backslash with newline between the method name and its arguments, -# # it is not redundant. -# some_method \ -# (argument) -# -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#67 -class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MatchRange - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#86 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#218 - def argument_is_method?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#184 - def argument_newline?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#163 - def code_ends_with_continuation?(last_line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#111 - def ends_with_uncommented_backslash?(range); end - - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#198 - def find_node_for_line(last_line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#169 - def inside_string_literal?(range, token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#124 - def inside_string_literal_or_method_with_argument?(range); end - - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#151 - def inspect_end_of_ruby_code_line_continuation; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#135 - def leading_dot_method_chain_with_blank_line?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#225 - def method_call_with_arguments?(node); end - - # A method call without parentheses such as the following cannot remove `\`: - # - # do_something \ - # argument - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#177 - def method_with_argument?(line_range, current_token, next_token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#141 - def redundant_line_continuation?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#103 - def require_line_continuation?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#204 - def same_line?(node, line); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#229 - def start_with_arithmetic_operator?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#120 - def string_concatenation?(source_line); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#74 -RuboCop::Cop::Style::RedundantLineContinuation::ALLOWED_STRING_TOKENS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#81 -RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TAKING_FLOW_TOKEN_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#75 -RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#84 -RuboCop::Cop::Style::RedundantLineContinuation::ARITHMETIC_OPERATOR_TOKENS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#72 -RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#73 -RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#71 -RuboCop::Cop::Style::RedundantLineContinuation::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant parentheses. -# -# @example -# -# # bad -# (x) if ((y.z).nil?) -# -# # good -# x if y.z.nil? -# -# source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#16 -class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Parentheses - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#34 - def allowed_pin_operator?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#293 - def first_send_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#298 - def first_super_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#303 - def first_yield_argument?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#181 - def interpolation?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#28 - def method_node_and_args(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#36 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#31 - def rescue?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#23 - def square_brackets?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#197 - def allow_in_multiline_conditions?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#70 - def allowed_ancestor?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#63 - def allowed_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#75 - def allowed_multiple_expression?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#84 - def allowed_ternary?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#183 - def argument_of_parenthesized_method_call?(begin_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#307 - def call_chain_starts_with_int?(begin_node, send_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#133 - def check(begin_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#201 - def check_send(begin_node, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#211 - def check_unary(begin_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#235 - def disallowed_literal?(begin_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#313 - def do_end_block_in_method_chain?(begin_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#111 - def empty_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#148 - def find_offense_message(begin_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#116 - def first_arg_begins_with_hash_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#282 - def first_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#56 - def ignore_syntax?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#231 - def keyword_ancestor?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#256 - def keyword_with_redundant_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#97 - def like_method_argument_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#191 - def method_call_parentheses_required?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#269 - def method_call_with_redundant_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#125 - def method_chain_begins_with_hash_literal(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#104 - def multiline_control_flow_statements?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#221 - def offense(node, msg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#278 - def only_begin_arg?(args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#48 - def parens_allowed?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#245 - def raised_to_power_negative_numeric?(begin_node, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#227 - def suspect_unary?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#90 - def ternary_parentheses_required?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#44 - def variable?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#20 -RuboCop::Cop::Style::RedundantParentheses::ALLOWED_NODE_TYPES = T.let(T.unsafe(nil), Array) - -# Checks for usage of the %q/%Q syntax when '' or "" would do. -# -# @example -# -# # bad -# name = %q(Bruce Wayne) -# time = %q(8 o'clock) -# question = %q("What did you say?") -# -# # good -# name = 'Bruce Wayne' -# time = "8 o'clock" -# question = '"What did you say?"' -# -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#20 -class RuboCop::Cop::Style::RedundantPercentQ < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#34 - def on_dstr(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#40 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#99 - def acceptable_capital_q?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#91 - def acceptable_q?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#67 - def allowed_percent_q?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#51 - def check(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#63 - def interpolated_quotes?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#72 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#87 - def start_with_percent_q_variant?(string); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#82 - def string_literal?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#25 -RuboCop::Cop::Style::RedundantPercentQ::DYNAMIC_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#28 -RuboCop::Cop::Style::RedundantPercentQ::EMPTY = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#32 -RuboCop::Cop::Style::RedundantPercentQ::ESCAPED_NON_BACKSLASH = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#23 -RuboCop::Cop::Style::RedundantPercentQ::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#30 -RuboCop::Cop::Style::RedundantPercentQ::PERCENT_CAPITAL_Q = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#29 -RuboCop::Cop::Style::RedundantPercentQ::PERCENT_Q = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#27 -RuboCop::Cop::Style::RedundantPercentQ::QUOTE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#26 -RuboCop::Cop::Style::RedundantPercentQ::SINGLE_QUOTE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#31 -RuboCop::Cop::Style::RedundantPercentQ::STRING_INTERPOLATION_REGEXP = T.let(T.unsafe(nil), Regexp) - -# Identifies places where argument can be replaced from -# a deterministic regexp to a string. -# -# @example -# # bad -# 'foo'.byteindex(/f/) -# 'foo'.byterindex(/f/) -# 'foo'.gsub(/f/, 'x') -# 'foo'.gsub!(/f/, 'x') -# 'foo'.partition(/f/) -# 'foo'.rpartition(/f/) -# 'foo'.scan(/f/) -# 'foo'.split(/f/) -# 'foo'.start_with?(/f/) -# 'foo'.sub(/f/, 'x') -# 'foo'.sub!(/f/, 'x') -# -# # good -# 'foo'.byteindex('f') -# 'foo'.byterindex('f') -# 'foo'.gsub('f', 'x') -# 'foo'.gsub!('f', 'x') -# 'foo'.partition('f') -# 'foo'.rpartition('f') -# 'foo'.scan('f') -# 'foo'.split('f') -# 'foo'.start_with?('f') -# 'foo'.sub('f', 'x') -# 'foo'.sub!('f', 'x') -# -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#35 -class RuboCop::Cop::Style::RedundantRegexpArgument < ::RuboCop::Cop::Base - include ::RuboCop::Cop::StringLiteralsHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#48 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#48 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#65 - def determinist_regexp?(regexp_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#69 - def preferred_argument(regexp_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#88 - def replacement(regexp_node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#43 -RuboCop::Cop::Style::RedundantRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#39 -RuboCop::Cop::Style::RedundantRegexpArgument::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#40 -RuboCop::Cop::Style::RedundantRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#44 -RuboCop::Cop::Style::RedundantRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array) - -# Checks for unnecessary single-element `Regexp` character classes. -# -# @example -# -# # bad -# r = /[x]/ -# -# # good -# r = /x/ -# -# # bad -# r = /[\s]/ -# -# # good -# r = /\s/ -# -# # bad -# r = %r{/[b]} -# -# # good -# r = %r{/b} -# -# # good -# r = /[ab]/ -# -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#30 -class RuboCop::Cop::Style::RedundantRegexpCharacterClass < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#37 - def on_regexp(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#101 - def backslash_b?(elem); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#53 - def each_redundant_character_class(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#61 - def each_single_element_character_class(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#83 - def multiple_codepoints?(expression); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#107 - def octal_requiring_char_class?(elem); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#72 - def redundant_single_element_character_class?(node, char_class); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#113 - def requires_escape_outside_char_class?(elem); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#95 - def whitespace_in_free_space_mode?(node, elem); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#87 - def without_character_class(loc); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#34 -RuboCop::Cop::Style::RedundantRegexpCharacterClass::MSG_REDUNDANT_CHARACTER_CLASS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#33 -RuboCop::Cop::Style::RedundantRegexpCharacterClass::REQUIRES_ESCAPE_OUTSIDE_CHAR_CLASS_CHARS = T.let(T.unsafe(nil), Array) - -# Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`. -# Autocorrect replaces to regexp literal which is the simplest and fastest. -# -# @example -# -# # bad -# Regexp.new(/regexp/) -# Regexp.compile(/regexp/) -# -# # good -# /regexp/ -# Regexp.new('regexp') -# Regexp.compile('regexp') -# -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_constructor.rb#20 -class RuboCop::Cop::Style::RedundantRegexpConstructor < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_constructor.rb#33 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_constructor.rb#27 - def redundant_regexp_constructor(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_constructor.rb#23 -RuboCop::Cop::Style::RedundantRegexpConstructor::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_constructor.rb#24 -RuboCop::Cop::Style::RedundantRegexpConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant escapes inside `Regexp` literals. -# -# @example -# # bad -# %r{foo\/bar} -# -# # good -# %r{foo/bar} -# -# # good -# /foo\/bar/ -# -# # good -# %r/foo\/bar/ -# -# # good -# %r!foo\!bar! -# -# # bad -# /a\-b/ -# -# # good -# /a-b/ -# -# # bad -# /[\+\-]\d/ -# -# # good -# /[+\-]\d/ -# -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#35 -class RuboCop::Cop::Style::RedundantRegexpEscape < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#45 - def on_regexp(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#60 - def allowed_escape?(node, char, index, within_character_class); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#76 - def char_class_begins_or_ends_with_escaped_hyphen?(node, index); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#92 - def delimiter?(node, char); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#98 - def each_escape(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#110 - def escape_range_at_index(node, index); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#41 -RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_ALWAYS_ESCAPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#43 -RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_OUTSIDE_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#42 -RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_WITHIN_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#39 -RuboCop::Cop::Style::RedundantRegexpEscape::MSG_REDUNDANT_ESCAPE = T.let(T.unsafe(nil), String) - -# Checks for redundant `return` expressions. -# -# @example -# # These bad cases should be extended to handle methods whose body is -# # if/else or a case expression with a default branch. -# -# # bad -# def test -# return something -# end -# -# # bad -# def test -# one -# two -# three -# return something -# end -# -# # bad -# def test -# return something if something_else -# end -# -# # good -# def test -# something if something_else -# end -# -# # good -# def test -# if x -# elsif y -# else -# end -# end -# @example AllowMultipleReturnValues: false (default) -# # bad -# def test -# return x, y -# end -# @example AllowMultipleReturnValues: true -# # good -# def test -# return x, y -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_return.rb#55 -class RuboCop::Cop::Style::RedundantReturn < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#69 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#69 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#63 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#104 - def add_braces(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#99 - def add_brackets(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#175 - def allow_multiple_return_values?; end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#170 - def check_begin_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#110 - def check_branch(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#144 - def check_case_match_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#139 - def check_case_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#165 - def check_ensure_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#149 - def check_if_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#161 - def check_resbody_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#156 - def check_rescue_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#127 - def check_return_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#80 - def correct_with_arguments(return_node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#76 - def correct_without_arguments(return_node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#95 - def hash_without_braces?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#179 - def message(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_return.rb#59 -RuboCop::Cop::Style::RedundantReturn::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_return.rb#60 -RuboCop::Cop::Style::RedundantReturn::MULTI_RETURN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_return.rb#61 -RuboCop::Cop::Style::RedundantReturn::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for redundant uses of `self`. -# -# The usage of `self` is only needed when: -# -# * Sending a message to same object with zero arguments in -# presence of a method name clash with an argument or a local -# variable. -# -# * Calling an attribute writer to prevent a local variable assignment. -# -# Note, with using explicit self you can only send messages with public or -# protected scope, you cannot send private messages this way. -# -# Note we allow uses of `self` with operators because it would be awkward -# otherwise. Also allows the use of `self.it` without arguments in blocks, -# as in `0.times { self.it }`, following `Lint/ItWithoutArgumentsInBlock` cop. -# -# @example -# -# # bad -# def foo(bar) -# self.baz -# end -# -# # good -# def foo(bar) -# self.bar # Resolves name clash with the argument. -# end -# -# def foo -# bar = 1 -# self.bar # Resolves name clash with the local variable. -# end -# -# def foo -# %w[x y z].select do |bar| -# self.bar == bar # Resolves name clash with argument of the block. -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/redundant_self.rb#45 -class RuboCop::Cop::Style::RedundantSelf < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # @return [RedundantSelf] a new instance of RedundantSelf - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#60 - def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - - # Assignment of self.x - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#68 - def on_and_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#84 - def on_args(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#116 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#88 - def on_blockarg(node); end - - # Using self.x to distinguish from local variable x - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#79 - def on_def(node); end - - # Using self.x to distinguish from local variable x - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#79 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#123 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#100 - def on_in_pattern(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#116 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#96 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#92 - def on_masgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#116 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#73 - def on_op_asgn(node); end - - # Assignment of self.x - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#68 - def on_or_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#104 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#123 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#123 - def on_while(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#190 - def add_lhs_to_local_variables_scopes(rhs, lhs); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#198 - def add_masgn_lhs_variables(rhs, lhs); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#204 - def add_match_var_scopes(in_pattern_node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#139 - def add_scope(node, local_variables = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#184 - def allow_self(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#145 - def allowed_send_node?(node); end - - # Respects `Lint/ItWithoutArgumentsInBlock` cop and the following Ruby 3.3's warning: - # - # $ ruby -e '0.times { begin; it; end }' - # -e:1: warning: `it` calls without arguments will refer to the first block param in - # Ruby 3.4; use it() or self.it - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#160 - def it_method_in_block?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#176 - def on_argument(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#168 - def regular_method_call?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#56 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_self.rb#49 -RuboCop::Cop::Style::RedundantSelf::KERNEL_METHODS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_self.rb#50 -RuboCop::Cop::Style::RedundantSelf::KEYWORDS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/redundant_self.rb#48 -RuboCop::Cop::Style::RedundantSelf::MSG = T.let(T.unsafe(nil), String) - -# Checks for places where redundant assignments are made for in place -# modification methods. -# -# @example -# # bad -# args = args.concat(ary) -# hash = hash.merge!(other) -# -# # good -# args.concat(foo) -# args += foo -# hash.merge!(other) -# -# # good -# foo.concat(ary) -# -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#27 -class RuboCop::Cop::Style::RedundantSelfAssignment < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#77 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#59 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#59 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#59 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#59 - def on_lvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#77 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#49 - def redundant_self_assignment?(param0 = T.unsafe(nil), param1, param2); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#100 - def correction_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#90 - def method_returning_self?(method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#94 - def redundant_assignment?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#41 -RuboCop::Cop::Style::RedundantSelfAssignment::ASSIGNMENT_TYPE_TO_RECEIVER_TYPE = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#34 -RuboCop::Cop::Style::RedundantSelfAssignment::METHODS_RETURNING_SELF = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#31 -RuboCop::Cop::Style::RedundantSelfAssignment::MSG = T.let(T.unsafe(nil), String) - -# Checks for places where conditional branch makes redundant self-assignment. -# -# It only detects local variable because it may replace state of instance variable, -# class variable, and global variable that have state across methods with `nil`. -# -# @example -# -# # bad -# foo = condition ? bar : foo -# -# # good -# foo = bar if condition -# -# # bad -# foo = condition ? foo : bar -# -# # good -# foo = bar unless condition -# -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#25 -class RuboCop::Cop::Style::RedundantSelfAssignmentBranch < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#31 - def bad_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#35 - def on_lvasgn(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#59 - def inconvertible_to_modifier?(if_branch, else_branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#64 - def multiple_statements?(branch); end - - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#74 - def register_offense(if_node, offense_branch, opposite_branch, keyword); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#70 - def self_assign?(variable, branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#53 - def use_if_and_else_branch?(expression); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_self_assignment_branch.rb#28 -RuboCop::Cop::Style::RedundantSelfAssignmentBranch::MSG = T.let(T.unsafe(nil), String) - -# Identifies instances of sorting and then -# taking only the first or last element. The same behavior can -# be accomplished without a relatively expensive sort by using -# `Enumerable#min` instead of sorting and taking the first -# element and `Enumerable#max` instead of sorting and taking the -# last element. Similarly, `Enumerable#min_by` and -# `Enumerable#max_by` can replace `Enumerable#sort_by` calls -# after which only the first or last element is used. -# -# @example -# # bad -# [2, 1, 3].sort.first -# [2, 1, 3].sort[0] -# [2, 1, 3].sort.at(0) -# [2, 1, 3].sort.slice(0) -# -# # good -# [2, 1, 3].min -# -# # bad -# [2, 1, 3].sort.last -# [2, 1, 3].sort[-1] -# [2, 1, 3].sort.at(-1) -# [2, 1, 3].sort.slice(-1) -# -# # good -# [2, 1, 3].max -# -# # bad -# arr.sort_by(&:foo).first -# arr.sort_by(&:foo)[0] -# arr.sort_by(&:foo).at(0) -# arr.sort_by(&:foo).slice(0) -# -# # good -# arr.min_by(&:foo) -# -# # bad -# arr.sort_by(&:foo).last -# arr.sort_by(&:foo)[-1] -# arr.sort_by(&:foo).at(-1) -# arr.sort_by(&:foo).slice(-1) -# -# # good -# arr.max_by(&:foo) -# -# source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#79 -class RuboCop::Cop::Style::RedundantSort < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#104 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#104 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#88 - def redundant_sort?(param0 = T.unsafe(nil)); end - - private - - # This gets the start of the accessor whether it has a dot - # (e.g. `.first`) or doesn't (e.g. `[0]`) - # - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#193 - def accessor_start(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#183 - def arg_node(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#187 - def arg_value(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#148 - def autocorrect(corrector, node, sort_node, sorter, accessor); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#166 - def base(accessor, arg); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#115 - def find_redundant_sort(*nodes); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#136 - def message(node, sorter, accessor); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#132 - def offense_range(sort_node, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#125 - def register_offense(node, sort_node, sorter, accessor); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#157 - def replace_with_logical_operator(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#174 - def suffix(sorter); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#162 - def suggestion(sorter, accessor, arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#201 - def with_logical_operator?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#83 -RuboCop::Cop::Style::RedundantSort::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#85 -RuboCop::Cop::Style::RedundantSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Identifies places where `sort_by { ... }` can be replaced by -# `sort`. -# -# @example -# # bad -# array.sort_by { |x| x } -# array.sort_by do |var| -# var -# end -# -# # good -# array.sort -# -# source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#18 -class RuboCop::Cop::Style::RedundantSortBy < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#26 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#46 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#36 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#59 - def redundant_sort_by_block(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#69 - def redundant_sort_by_itblock(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#64 - def redundant_sort_by_numblock(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#73 - def sort_by_range(send, node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#22 -RuboCop::Cop::Style::RedundantSortBy::MSG_BLOCK = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#24 -RuboCop::Cop::Style::RedundantSortBy::MSG_ITBLOCK = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#23 -RuboCop::Cop::Style::RedundantSortBy::MSG_NUMBLOCK = T.let(T.unsafe(nil), String) - -# Checks for redundant escapes in string literals. -# -# @example -# # bad - no need to escape # without following {/$/@ -# "\#foo" -# -# # bad - no need to escape single quotes inside double quoted string -# "\'foo\'" -# -# # bad - heredocs are also checked for unnecessary escapes -# <<~STR -# \#foo \"foo\" -# STR -# -# # good -# "#foo" -# -# # good -# "\#{no_interpolation}" -# -# # good -# "'foo'" -# -# # good -# "foo\ -# bar" -# -# # good -# <<~STR -# #foo "foo" -# STR -# -# source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#37 -class RuboCop::Cop::Style::RedundantStringEscape < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::MatchRange - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#43 - def on_str(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#79 - def allowed_escape?(node, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#119 - def array_literal?(node, prefix); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#73 - def begin_loc_present?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#153 - def delimiter?(node, char); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#171 - def disabling_interpolation?(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#149 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#139 - def heredoc_with_disabled_interpolation?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#100 - def interpolation_not_enabled?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#167 - def literal_in_interpolated_or_multiline_string?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#59 - def message(range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#135 - def percent_array_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#111 - def percent_q_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#127 - def percent_w_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#131 - def percent_w_upper_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#107 - def single_quoted?(node); end - - # source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#63 - def str_contents_range(node); end -end - -# source://rubocop//lib/rubocop/cop/style/redundant_string_escape.rb#41 -RuboCop::Cop::Style::RedundantStringEscape::MSG = T.let(T.unsafe(nil), String) - -# Enforces using `//` or `%r` around regular expressions. -# -# NOTE: The following `%r` cases using a regexp starts with a blank or `=` -# as a method argument allowed to prevent syntax errors. -# -# [source,ruby] -# ---- -# do_something %r{ regexp} # `do_something / regexp/` is an invalid syntax. -# do_something %r{=regexp} # `do_something /=regexp/` is an invalid syntax. -# ---- -# -# @example EnforcedStyle: slashes (default) -# # bad -# snake_case = %r{^[\dA-Z_]+$} -# -# # bad -# regex = %r{ -# foo -# (bar) -# (baz) -# }x -# -# # good -# snake_case = /^[\dA-Z_]+$/ -# -# # good -# regex = / -# foo -# (bar) -# (baz) -# /x -# @example EnforcedStyle: percent_r -# # bad -# snake_case = /^[\dA-Z_]+$/ -# -# # bad -# regex = / -# foo -# (bar) -# (baz) -# /x -# -# # good -# snake_case = %r{^[\dA-Z_]+$} -# -# # good -# regex = %r{ -# foo -# (bar) -# (baz) -# }x -# @example EnforcedStyle: mixed -# # bad -# snake_case = %r{^[\dA-Z_]+$} -# -# # bad -# regex = / -# foo -# (bar) -# (baz) -# /x -# -# # good -# snake_case = /^[\dA-Z_]+$/ -# -# # good -# regex = %r{ -# foo -# (bar) -# (baz) -# }x -# @example AllowInnerSlashes: false (default) -# # If `false`, the cop will always recommend using `%r` if one or more -# # slashes are found in the regexp string. -# -# # bad -# x =~ /home\// -# -# # good -# x =~ %r{home/} -# @example AllowInnerSlashes: true -# # good -# x =~ /home\// -# -# source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#93 -class RuboCop::Cop::Style::RegexpLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#101 - def on_regexp(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#144 - def allow_inner_slashes?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#132 - def allowed_mixed_percent_r?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#122 - def allowed_mixed_slash?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#161 - def allowed_omit_parentheses_with_percent_r_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#126 - def allowed_percent_r_literal?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#118 - def allowed_slash_literal?(node); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#221 - def calculate_replacement(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#136 - def contains_disallowed_slash?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#140 - def contains_slash?(node); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#170 - def correct_delimiters(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#176 - def correct_inner_slashes(node, corrector); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#209 - def inner_slash_after_correction(node); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#205 - def inner_slash_before_correction(node); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#213 - def inner_slash_for(opening_delimiter); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#192 - def inner_slash_indices(node); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#148 - def node_body(node, include_begin_nodes: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#157 - def preferred_delimiters; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#153 - def slash_literal?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#99 -RuboCop::Cop::Style::RegexpLiteral::MSG_USE_PERCENT_R = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#98 -RuboCop::Cop::Style::RegexpLiteral::MSG_USE_SLASHES = T.let(T.unsafe(nil), String) - -# Sort `require` and `require_relative` in alphabetical order. -# -# @example -# # bad -# require 'b' -# require 'a' -# -# # good -# require 'a' -# require 'b' -# -# # bad -# require_relative 'b' -# require_relative 'a' -# -# # good -# require_relative 'a' -# require_relative 'b' -# -# # good (sorted within each section separated by a blank line) -# require 'a' -# require 'd' -# -# require 'b' -# require 'c' -# -# # good -# require 'b' -# require_relative 'c' -# require 'a' -# -# # bad -# require 'a' -# require 'c' if foo -# require 'b' -# -# # good -# require 'a' -# require 'b' -# require 'c' if foo -# -# # bad -# require 'c' -# if foo -# require 'd' -# require 'b' -# end -# require 'a' -# -# # good -# require 'c' -# if foo -# require 'b' -# require 'd' -# end -# require 'a' -# -# source://rubocop//lib/rubocop/cop/style/require_order.rb#66 -class RuboCop::Cop::Style::RequireOrder < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#76 - def if_inside_only_require(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#83 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#115 - def autocorrect(corrector, node, previous_older_sibling); end - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#101 - def find_previous_older_sibling(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/require_order.rb#133 - def in_same_section?(node1, node2); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/require_order.rb#97 - def not_modifier_form?(node); end - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#123 - def search_node(node); end - - # source://rubocop//lib/rubocop/cop/style/require_order.rb#127 - def sibling_node(node); end -end - -# source://rubocop//lib/rubocop/cop/style/require_order.rb#73 -RuboCop::Cop::Style::RequireOrder::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/require_order.rb#71 -RuboCop::Cop::Style::RequireOrder::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of `rescue` in its modifier form is added for following -# reasons: -# -# * The syntax of modifier form `rescue` can be misleading because it -# might lead us to believe that `rescue` handles the given exception -# but it actually rescue all exceptions to return the given rescue -# block. In this case, value returned by handle_error or -# SomeException. -# -# * Modifier form `rescue` would rescue all the exceptions. It would -# silently skip all exception or errors and handle the error. -# Example: If `NoMethodError` is raised, modifier form rescue would -# handle the exception. -# -# @example -# # bad -# some_method rescue handle_error -# -# # bad -# some_method rescue SomeException -# -# # good -# begin -# some_method -# rescue -# handle_error -# end -# -# # good -# begin -# some_method -# rescue SomeException -# handle_error -# end -# -# source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#40 -class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::RescueNode - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#52 - def on_resbody(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#71 - def correct_rescue_block(corrector, node, parenthesized); end - - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#98 - def heredoc_end(node); end - - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#88 - def indentation_and_offset(node, parenthesized); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#66 - def parenthesized?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#48 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#46 -RuboCop::Cop::Style::RescueModifier::MSG = T.let(T.unsafe(nil), String) - -# Checks for rescuing `StandardError`. There are two supported -# styles `implicit` and `explicit`. This cop will not register an offense -# if any error other than `StandardError` is specified. -# -# @example EnforcedStyle: explicit (default) -# # `explicit` will enforce using `rescue StandardError` -# # instead of `rescue`. -# -# # bad -# begin -# foo -# rescue -# bar -# end -# -# # good -# begin -# foo -# rescue StandardError -# bar -# end -# -# # good -# begin -# foo -# rescue OtherError -# bar -# end -# -# # good -# begin -# foo -# rescue StandardError, SecurityError -# bar -# end -# @example EnforcedStyle: implicit -# # `implicit` will enforce using `rescue` instead of -# # `rescue StandardError`. -# -# # bad -# begin -# foo -# rescue StandardError -# bar -# end -# -# # good -# begin -# foo -# rescue -# bar -# end -# -# # good -# begin -# foo -# rescue OtherError -# bar -# end -# -# # good -# begin -# foo -# rescue StandardError, SecurityError -# bar -# end -# -# source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#73 -class RuboCop::Cop::Style::RescueStandardError < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RescueNode - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#92 - def on_resbody(node); end - - # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#88 - def rescue_standard_error?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#83 - def rescue_without_error_class?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#118 - def offense_for_explicit_enforced_style(node); end - - # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#107 - def offense_for_implicit_enforced_style(node, error); end -end - -# source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#80 -RuboCop::Cop::Style::RescueStandardError::MSG_EXPLICIT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#79 -RuboCop::Cop::Style::RescueStandardError::MSG_IMPLICIT = T.let(T.unsafe(nil), String) - -# Enforces consistency between `return nil` and `return`. -# -# This cop is disabled by default. Because there seems to be a perceived semantic difference -# between `return` and `return nil`. The former can be seen as just halting evaluation, -# while the latter might be used when the return value is of specific concern. -# -# Supported styles are `return` and `return_nil`. -# -# @example EnforcedStyle: return (default) -# # bad -# def foo(arg) -# return nil if arg -# end -# -# # good -# def foo(arg) -# return if arg -# end -# @example EnforcedStyle: return_nil -# # bad -# def foo(arg) -# return if arg -# end -# -# # good -# def foo(arg) -# return nil if arg -# end -# -# source://rubocop//lib/rubocop/cop/style/return_nil.rb#35 -class RuboCop::Cop::Style::ReturnNil < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#90 - def chained_send?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#93 - def define_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#48 - def on_return(node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#46 - def return_nil_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#43 - def return_node?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#80 - def correct_style?(node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#76 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/return_nil.rb#85 - def scoped_node?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/return_nil.rb#39 -RuboCop::Cop::Style::ReturnNil::RETURN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/return_nil.rb#40 -RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) - -# Checks for predicate method definitions that return `nil`. -# A predicate method should only return a boolean value. -# -# @example -# # bad -# def foo? -# return if condition -# -# do_something? -# end -# -# # bad -# def foo? -# return nil if condition -# -# do_something? -# end -# -# # good -# def foo? -# return false if condition -# -# do_something? -# end -# -# # bad -# def foo? -# if condition -# nil -# else -# true -# end -# end -# -# # good -# def foo? -# if condition -# false -# else -# true -# end -# end -# @example AllowedMethods: ['foo?'] -# # good -# def foo? -# return if condition -# -# do_something? -# end -# @example AllowedPatterns: [/foo/] -# # good -# def foo? -# return if condition -# -# do_something? -# end -# -# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#69 -class RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#77 - def return_nil?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#128 - def handle_if(if_node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#113 - def handle_implicit_return_values(node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#122 - def handle_nil(nil_node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#118 - def handle_return(return_node); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#94 - def last_node_of_type(node, type); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#103 - def node_type?(node, type); end - - # source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#107 - def register_offense(offense_node, replacement); end -end - -# source://rubocop//lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#74 -RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Transforms usages of a method call safeguarded by a non `nil` -# check for the variable whose method is being called to -# safe navigation (`&.`). If there is a method chain, all of the methods -# in the chain need to be checked for safety, and all of the methods will -# need to be changed to use safe navigation. -# -# The default for `ConvertCodeThatCanStartToReturnNil` is `false`. -# When configured to `true`, this will -# check for code in the format `!foo.nil? && foo.bar`. As it is written, -# the return of this code is limited to `false` and whatever the return -# of the method is. If this is converted to safe navigation, -# `foo&.bar` can start returning `nil` as well as what the method -# returns. -# -# The default for `MaxChainLength` is `2`. -# We have limited the cop to not register an offense for method chains -# that exceed this option's value. -# -# NOTE: This cop will recognize offenses but not autocorrect code when the -# right hand side (RHS) of the `&&` statement is an `||` statement -# (eg. `foo && (foo.bar? || foo.baz?)`). It can be corrected -# manually by removing the `foo &&` and adding `&.` to each `foo` on the RHS. -# -# @example -# # bad -# foo.bar if foo -# foo.bar.baz if foo -# foo.bar(param1, param2) if foo -# foo.bar { |e| e.something } if foo -# foo.bar(param) { |e| e.something } if foo -# -# foo.bar if !foo.nil? -# foo.bar unless !foo -# foo.bar unless foo.nil? -# -# foo && foo.bar -# foo && foo.bar.baz -# foo && foo.bar(param1, param2) -# foo && foo.bar { |e| e.something } -# foo && foo.bar(param) { |e| e.something } -# -# foo ? foo.bar : nil -# foo.nil? ? nil : foo.bar -# !foo.nil? ? foo.bar : nil -# !foo ? nil : foo.bar -# -# # good -# foo&.bar -# foo&.bar&.baz -# foo&.bar(param1, param2) -# foo&.bar { |e| e.something } -# foo&.bar(param) { |e| e.something } -# foo && foo.bar.baz.qux # method chain with more than 2 methods -# foo && foo.nil? # method that `nil` responds to -# -# # Method calls that do not use `.` -# foo && foo < bar -# foo < bar if foo -# -# # When checking `foo&.empty?` in a conditional, `foo` being `nil` will actually -# # do the opposite of what the author intends. -# foo && foo.empty? -# -# # This could start returning `nil` as well as the return of the method -# foo.nil? || foo.bar -# !foo || foo.bar -# -# # Methods that are used on assignment, arithmetic operation or -# # comparison should not be converted to use safe navigation -# foo.baz = bar if foo -# foo.baz + bar if foo -# foo.bar > 2 if foo -# -# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#89 -class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::NilMethods - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#136 - def and_inside_begin?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#130 - def and_with_rhs_or?(param0 = T.unsafe(nil)); end - - # if format: (if checked_variable body nil) - # unless format: (if checked_variable nil body) - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#104 - def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#133 - def not_nil_check?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#157 - def on_and(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#141 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#184 - def report_offense(node, rhs, rhs_receiver, *removal_ranges, offense_range: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#139 - def strip_begin(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#119 - def ternary_safe_navigation_candidate(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#375 - def add_safe_nav_to_all_methods_in_chain(corrector, start_method, method_chain); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#282 - def allowed_if_condition?(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#227 - def and_parts(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#367 - def begin_range(node, method_call); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#329 - def chain_length(method_chain, method); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#209 - def collect_and_clauses(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#263 - def comments(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#221 - def concat_nodes(nodes, and_node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#371 - def end_range(node, method_call); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#301 - def extract_common_parts(method_chain, checked_variable); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#248 - def extract_if_body(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#286 - def extract_parts_from_if(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#309 - def find_matching_receiver_invocation(method_chain, checked_variable); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#203 - def find_method_chain(node); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#256 - def handle_comments(corrector, node, method_call); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#323 - def matching_call_nodes?(left, right); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#319 - def matching_nodes?(left, right); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#389 - def max_chain_length; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#363 - def method_called?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#355 - def negated?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#234 - def offending_node?(node, lhs_receiver, rhs, rhs_receiver); end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#269 - def relevant_comment_ranges(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#349 - def unsafe_method?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#337 - def unsafe_method_used?(method_chain, method); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#244 - def use_var_only_in_unless_modifier?(node, variable); end -end - -# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#97 -RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#95 -RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String) - -# Enforces safe navigation chains length to not exceed the configured maximum. -# The longer the chain is, the harder it becomes to track what on it could be -# returning `nil`. -# -# There is a potential interplay with `Style/SafeNavigation` - if both are enabled -# and their settings are "incompatible", one of the cops will complain about what -# the other proposes. -# -# E.g. if `Style/SafeNavigation` is configured with `MaxChainLength: 2` (default) -# and this cop is configured with `Max: 1`, then for `foo.bar.baz if foo` the former -# will suggest `foo&.bar&.baz`, which is an offense for the latter. -# -# @example Max: 2 (default) -# # bad -# user&.address&.zip&.upcase -# -# # good -# user&.address&.zip -# user.address.zip if user -# -# source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#26 -class RuboCop::Cop::Style::SafeNavigationChainLength < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#29 - def on_csend(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#46 - def max; end - - # source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#38 - def safe_navigation_chains(node); end -end - -# source://rubocop//lib/rubocop/cop/style/safe_navigation_chain_length.rb#27 -RuboCop::Cop::Style::SafeNavigationChainLength::MSG = T.let(T.unsafe(nil), String) - -# Identifies usages of `shuffle.first`, -# `shuffle.last`, and `shuffle[]` and change them to use -# `sample` instead. -# -# @example -# # bad -# [1, 2, 3].shuffle.first -# [1, 2, 3].shuffle.first(2) -# [1, 2, 3].shuffle.last -# [2, 1, 3].shuffle.at(0) -# [2, 1, 3].shuffle.slice(0) -# [1, 2, 3].shuffle[2] -# [1, 2, 3].shuffle[0, 2] # sample(2) will do the same -# [1, 2, 3].shuffle[0..2] # sample(3) will do the same -# [1, 2, 3].shuffle(random: Random.new).first -# -# # good -# [1, 2, 3].shuffle -# [1, 2, 3].sample -# [1, 2, 3].sample(3) -# [1, 2, 3].shuffle[1, 3] # sample(3) might return a longer Array -# [1, 2, 3].shuffle[1..3] # sample(3) might return a longer Array -# [1, 2, 3].shuffle[foo, bar] -# [1, 2, 3].shuffle(random: Random.new) -# -# source://rubocop//lib/rubocop/cop/style/sample.rb#30 -class RuboCop::Cop::Style::Sample < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/sample.rb#41 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#41 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#37 - def sample_candidate?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/sample.rb#122 - def correction(shuffle_arg, method, method_args); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#138 - def extract_source(args); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#116 - def message(shuffle_arg, method, method_args, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sample.rb#59 - def offensive?(method, method_args); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#96 - def range_size(range_node); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#129 - def sample_arg(method, method_args); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#70 - def sample_size(method_args); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#79 - def sample_size_for_one_arg(arg); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#89 - def sample_size_for_two_args(first, second); end - - # source://rubocop//lib/rubocop/cop/style/sample.rb#112 - def source_range(shuffle_node, node); end -end - -# source://rubocop//lib/rubocop/cop/style/sample.rb#33 -RuboCop::Cop::Style::Sample::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/sample.rb#34 -RuboCop::Cop::Style::Sample::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Looks for places where a subset of an Enumerable (array, -# range, set, etc.; see note below) is calculated based on a `Regexp` -# match, and suggests `grep` or `grep_v` instead. -# -# NOTE: Hashes do not behave as you may expect with `grep`, which -# means that `hash.grep` is not equivalent to `hash.select`. Although -# RuboCop is limited by static analysis, this cop attempts to avoid -# registering an offense when the receiver is a hash (hash literal, -# `Hash.new`, `Hash#[]`, or `to_h`/`to_hash`). -# -# NOTE: `grep` and `grep_v` were optimized when used without a block -# in Ruby 3.0, but may be slower in previous versions. -# See https://bugs.ruby-lang.org/issues/17030 -# -# @example -# # bad (select, filter, or find_all) -# array.select { |x| x.match? /regexp/ } -# array.select { |x| /regexp/.match?(x) } -# array.select { |x| x =~ /regexp/ } -# array.select { |x| /regexp/ =~ x } -# -# # bad (reject) -# array.reject { |x| x.match? /regexp/ } -# array.reject { |x| /regexp/.match?(x) } -# array.reject { |x| x =~ /regexp/ } -# array.reject { |x| /regexp/ =~ x } -# -# # good -# array.grep(regexp) -# array.grep_v(regexp) -# -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#45 -class RuboCop::Cop::Style::SelectByRegexp < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#82 - def calls_lvar?(param0 = T.unsafe(nil), param1); end - - # Returns true if a node appears to return a hash - # - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#68 - def creates_hash?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#77 - def env_const?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#91 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#91 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#58 - def regexp_match?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#137 - def extract_send_node(block_node); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#151 - def find_regexp(node, block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#163 - def match_predicate_without_receiver?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#147 - def opposite?(regexp_method_send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#111 - def receiver_allowed?(node); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#125 - def register_offense(node, block_node, regexp, replacement); end - - # source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#117 - def replacement(regexp_method_send_node, node); end -end - -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#49 -RuboCop::Cop::Style::SelectByRegexp::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#52 -RuboCop::Cop::Style::SelectByRegexp::OPPOSITE_REPLACEMENTS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#55 -RuboCop::Cop::Style::SelectByRegexp::REGEXP_METHODS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#51 -RuboCop::Cop::Style::SelectByRegexp::REPLACEMENTS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/select_by_regexp.rb#50 -RuboCop::Cop::Style::SelectByRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces the use the shorthand for self-assignment. -# -# @example -# -# # bad -# x = x + 1 -# -# # good -# x += 1 -# -# source://rubocop//lib/rubocop/cop/style/self_assignment.rb#15 -class RuboCop::Cop::Style::SelfAssignment < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#33 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#29 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#25 - def on_lvasgn(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#88 - def apply_autocorrect(corrector, node, rhs, operator, new_rhs); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#70 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#84 - def autocorrect_boolean_node(corrector, node, rhs); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#80 - def autocorrect_send_node(corrector, node, rhs); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#39 - def check(node, var_type); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#60 - def check_boolean_node(node, rhs, var_name, var_type); end - - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#49 - def check_send_node(node, rhs, var_name, var_type); end - - class << self - # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#21 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/self_assignment.rb#18 -RuboCop::Cop::Style::SelfAssignment::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/self_assignment.rb#19 -RuboCop::Cop::Style::SelfAssignment::OPS = T.let(T.unsafe(nil), Array) - -# Checks for multiple expressions placed on the same line. -# It also checks for lines terminated with a semicolon. -# -# This cop has `AllowAsExpressionSeparator` configuration option. -# It allows `;` to separate several expressions on the same line. -# -# @example -# # bad -# foo = 1; bar = 2; -# baz = 3; -# -# # good -# foo = 1 -# bar = 2 -# baz = 3 -# @example AllowAsExpressionSeparator: false (default) -# # bad -# foo = 1; bar = 2 -# @example AllowAsExpressionSeparator: true -# # good -# foo = 1; bar = 2 -# -# source://rubocop//lib/rubocop/cop/style/semicolon.rb#29 -class RuboCop::Cop::Style::Semicolon < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#45 - def on_begin(node); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#39 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#64 - def check_for_line_terminator_or_opener; end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#70 - def each_semicolon; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#106 - def exist_semicolon_after_left_curly_brace?(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#110 - def exist_semicolon_after_left_lambda_curly_brace?(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#118 - def exist_semicolon_after_left_string_interpolation_brace?(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#102 - def exist_semicolon_before_right_curly_brace?(tokens); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#114 - def exist_semicolon_before_right_string_interpolation_brace?(tokens); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#142 - def expressions_per_line(exprs); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#156 - def find_range_node(token_before_semicolon); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#148 - def find_semicolon_positions(line); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#162 - def range_nodes; end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#122 - def register_semicolon(line, column, after_expression, token_before_semicolon = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#84 - def semicolon_position(tokens); end - - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#79 - def tokens_for_lines; end - - class << self - # source://rubocop//lib/rubocop/cop/style/semicolon.rb#35 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/semicolon.rb#33 -RuboCop::Cop::Style::Semicolon::MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of the send method. -# -# @example -# # bad -# Foo.send(bar) -# quuz.send(fred) -# -# # good -# Foo.__send__(bar) -# quuz.public_send(fred) -# -# source://rubocop//lib/rubocop/cop/style/send.rb#16 -class RuboCop::Cop::Style::Send < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/send.rb#20 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/send.rb#20 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/send.rb#17 -RuboCop::Cop::Style::Send::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/send.rb#18 -RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Detects the use of the `public_send` method with a literal method name argument. -# Since the `send` method can be used to call private methods, by default, -# only the `public_send` method is detected. -# -# NOTE: Writer methods with names ending in `=` are always permitted because their -# behavior differs as follows: -# -# [source,ruby] -# ---- -# def foo=(foo) -# @foo = foo -# 42 -# end -# -# self.foo = 1 # => 1 -# send(:foo=, 1) # => 42 -# ---- -# -# @example -# # bad -# obj.public_send(:method_name) -# obj.public_send('method_name') -# -# # good -# obj.method_name -# @example AllowSend: true (default) -# # good -# obj.send(:method_name) -# obj.send('method_name') -# obj.__send__(:method_name) -# obj.__send__('method_name') -# @example AllowSend: false -# # bad -# obj.send(:method_name) -# obj.send('method_name') -# obj.__send__(:method_name) -# obj.__send__('method_name') -# -# # good -# obj.method_name -# -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#54 -class RuboCop::Cop::Style::SendWithLiteralMethodName < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#68 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#68 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#91 - def allow_send?; end - - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#95 - def offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#99 - def removal_argument_range(first_argument, second_argument); end -end - -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#60 -RuboCop::Cop::Style::SendWithLiteralMethodName::METHOD_NAME_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#57 -RuboCop::Cop::Style::SendWithLiteralMethodName::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#61 -RuboCop::Cop::Style::SendWithLiteralMethodName::RESERVED_WORDS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#58 -RuboCop::Cop::Style::SendWithLiteralMethodName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#59 -RuboCop::Cop::Style::SendWithLiteralMethodName::STATIC_METHOD_NAME_NODE_TYPES = T.let(T.unsafe(nil), Array) - -# Checks for uses of `fail` and `raise`. -# -# @example EnforcedStyle: only_raise (default) -# # The `only_raise` style enforces the sole use of `raise`. -# # bad -# begin -# fail -# rescue Exception -# # handle it -# end -# -# def watch_out -# fail -# rescue Exception -# # handle it -# end -# -# Kernel.fail -# -# # good -# begin -# raise -# rescue Exception -# # handle it -# end -# -# def watch_out -# raise -# rescue Exception -# # handle it -# end -# -# Kernel.raise -# @example EnforcedStyle: only_fail -# # The `only_fail` style enforces the sole use of `fail`. -# # bad -# begin -# raise -# rescue Exception -# # handle it -# end -# -# def watch_out -# raise -# rescue Exception -# # handle it -# end -# -# Kernel.raise -# -# # good -# begin -# fail -# rescue Exception -# # handle it -# end -# -# def watch_out -# fail -# rescue Exception -# # handle it -# end -# -# Kernel.fail -# @example EnforcedStyle: semantic -# # The `semantic` style enforces the use of `fail` to signal an -# # exception, then will use `raise` to trigger an offense after -# # it has been rescued. -# # bad -# begin -# raise -# rescue Exception -# # handle it -# end -# -# def watch_out -# # Error thrown -# rescue Exception -# fail -# end -# -# Kernel.fail -# Kernel.raise -# -# # good -# begin -# fail -# rescue Exception -# # handle it -# end -# -# def watch_out -# fail -# rescue Exception -# raise 'Preferably with descriptive message' -# end -# -# explicit_receiver.fail -# explicit_receiver.raise -# -# source://rubocop//lib/rubocop/cop/style/signal_exception.rb#107 -class RuboCop::Cop::Style::SignalException < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#120 - def custom_fail_methods(param0); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#117 - def kernel_call?(param0 = T.unsafe(nil), param1); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#122 - def on_rescue(node); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#133 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#205 - def allow(method_name, node); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#187 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#166 - def check_scope(method_name, node); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#179 - def check_send(method_name, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#199 - def command_or_kernel_call?(name, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#148 - def custom_fail_defined?; end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#209 - def each_command_or_kernel_call(method_name, node); end - - # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#155 - def message(method_name); end -end - -# source://rubocop//lib/rubocop/cop/style/signal_exception.rb#111 -RuboCop::Cop::Style::SignalException::FAIL_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/signal_exception.rb#112 -RuboCop::Cop::Style::SignalException::RAISE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/signal_exception.rb#114 -RuboCop::Cop::Style::SignalException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Sometimes using `dig` method ends up with just a single -# argument. In such cases, dig should be replaced with `[]`. -# -# Since replacing `hash&.dig(:key)` with `hash[:key]` could potentially lead to error, -# calls to the `dig` method using safe navigation will be ignored. -# -# @example -# # bad -# { key: 'value' }.dig(:key) -# [1, 2, 3].dig(0) -# -# # good -# { key: 'value' }[:key] -# [1, 2, 3][0] -# -# # good -# { key1: { key2: 'value' } }.dig(:key1, :key2) -# [1, [2, [3]]].dig(1, 1) -# -# # good -# keys = %i[key1 key2] -# { key1: { key2: 'value' } }.dig(*keys) -# -# source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#34 -class RuboCop::Cop::Style::SingleArgumentDig < ::RuboCop::Cop::Base - include ::RuboCop::Cop::DigHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#42 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#66 - def ignore_dig_chain?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#40 -RuboCop::Cop::Style::SingleArgumentDig::IGNORED_ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#38 -RuboCop::Cop::Style::SingleArgumentDig::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#39 -RuboCop::Cop::Style::SingleArgumentDig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks whether the block parameters of a single-line -# method accepting a block match the names specified via configuration. -# -# For instance one can configure `reduce`(`inject`) to use |a, e| as -# parameters. -# -# Configuration option: Methods -# Should be set to use this cop. `Array` of hashes, where each key is the -# method name and value - array of argument names. -# -# @example Methods: [{reduce: %w[a b]}] -# # bad -# foo.reduce { |c, d| c + d } -# foo.reduce { |_, _d| 1 } -# -# # good -# foo.reduce { |a, b| a + b } -# foo.reduce { |a, _b| a } -# foo.reduce { |a, (id, _)| a + id } -# foo.reduce { true } -# -# # good -# foo.reduce do |c, d| -# c + d -# end -# -# source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#31 -class RuboCop::Cop::Style::SingleLineBlockParams < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#36 - def on_block(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#105 - def args_match?(method_name, args); end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#69 - def autocorrect(corrector, node, preferred_block_arguments, joined_block_arguments); end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#57 - def build_preferred_arguments_map(node, preferred_arguments); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#79 - def eligible_arguments?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#83 - def eligible_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#95 - def method_name(method); end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#91 - def method_names; end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#87 - def methods; end - - # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#99 - def target_args(method_name); end -end - -# source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#34 -RuboCop::Cop::Style::SingleLineBlockParams::MSG = T.let(T.unsafe(nil), String) - -# Checks for single-line `do`...`end` block. -# -# In practice a single line `do`...`end` is autocorrected when `EnforcedStyle: semantic` -# is configured for `Style/BlockDelimiters`. The autocorrection maintains the -# `do` ... `end` syntax to preserve semantics and does not change it to `{`...`}` block. -# -# NOTE: If `InspectBlocks` is set to `true` for `Layout/RedundantLineBreak`, blocks will -# be autocorrected to be on a single line if possible. This cop respects that configuration -# by not registering an offense if it would subsequently cause a -# `Layout/RedundantLineBreak` offense. -# -# @example -# -# # bad -# foo do |arg| bar(arg) end -# -# # good -# foo do |arg| -# bar(arg) -# end -# -# # bad -# ->(arg) do bar(arg) end -# -# # good -# ->(arg) { bar(arg) } -# -# source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#33 -class RuboCop::Cop::Style::SingleLineDoEndBlock < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CheckSingleLineSuitability - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#40 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#40 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#40 - def on_numblock(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#63 - def do_line(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#72 - def single_line_blocks_preferred?; end -end - -# source://rubocop//lib/rubocop/cop/style/single_line_do_end_block.rb#37 -RuboCop::Cop::Style::SingleLineDoEndBlock::MSG = T.let(T.unsafe(nil), String) - -# Checks for single-line method definitions that contain a body. -# It will accept single-line methods with no body. -# -# Endless methods added in Ruby 3.0 are also accepted by this cop. -# -# If `Style/EndlessMethod` is enabled with `EnforcedStyle: allow_single_line`, `allow_always`, -# `require_single_line`, or `require_always`, single-line methods will be autocorrected -# to endless methods if there is only one statement in the body. -# -# @example -# # bad -# def some_method; body end -# def link_to(url); {:name => url}; end -# def @table.columns; super; end -# -# # good -# def self.resource_class=(klass); end -# def @table.columns; end -# def some_method() = body -# @example AllowIfMethodIsEmpty: true (default) -# # good -# def no_op; end -# @example AllowIfMethodIsEmpty: false -# # bad -# def no_op; end -# -# source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#34 -class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#41 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#41 - def on_defs(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#60 - def allow_empty?; end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#52 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#97 - def break_line_before(corrector, node, range, indent_steps: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#88 - def correct_to_endless(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#64 - def correct_to_endless?(body_node); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#74 - def correct_to_multiline(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#136 - def disallow_endless_method_style?; end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#104 - def each_part(body); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#121 - def method_body_source(method_body); end - - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#114 - def move_comment(node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#132 - def require_parentheses?(method_body); end -end - -# source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#38 -RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#39 -RuboCop::Cop::Style::SingleLineMethods::NOT_SUPPORTED_ENDLESS_METHOD_BODY_TYPES = T.let(T.unsafe(nil), Array) - -# Checks that arrays are not sliced with the redundant `ary[0..-1]`, replacing it with `ary`, -# and ensures arrays are sliced with endless ranges instead of `ary[start..-1]` on Ruby 2.6+, -# and with beginless ranges instead of `ary[nil..end]` on Ruby 2.7+. -# -# @example -# # bad -# items[0..-1] -# items[0..nil] -# items[0...nil] -# -# # good -# items -# -# # bad -# items[1..-1] # Ruby 2.6+ -# items[1..nil] # Ruby 2.6+ -# -# # good -# items[1..] # Ruby 2.6+ -# -# # bad -# items[nil..42] # Ruby 2.7+ -# -# # good -# items[..42] # Ruby 2.7+ -# items[0..42] # Ruby 2.7+ -# -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#46 -class RuboCop::Cop::Style::SlicingWithRange < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#77 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#77 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#73 - def range_from_zero?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#57 - def range_from_zero_till_minus_one?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#65 - def range_till_minus_one?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#140 - def arguments_source(node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#136 - def beginless(range_node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#132 - def endless(range_node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#102 - def find_offense_range(node); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#126 - def offense_message_for_partial_range(node, prefer, offense_range); end - - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#110 - def offense_message_with_removal_range(node, range_node, offense_range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#98 - def unparenthesized_call?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#52 -RuboCop::Cop::Style::SlicingWithRange::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#53 -RuboCop::Cop::Style::SlicingWithRange::MSG_USELESS_RANGE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#54 -RuboCop::Cop::Style::SlicingWithRange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# If the branch of a conditional consists solely of a conditional node, -# its conditions can be combined with the conditions of the outer branch. -# This helps to keep the nesting level from getting too deep. -# -# @example -# # bad -# if condition_a -# if condition_b -# do_something -# end -# end -# -# # bad -# if condition_b -# do_something -# end if condition_a -# -# # good -# if condition_a && condition_b -# do_something -# end -# @example AllowModifier: false (default) -# # bad -# if condition_a -# do_something if condition_b -# end -# -# # bad -# if condition_b -# do_something -# end if condition_a -# @example AllowModifier: true -# # good -# if condition_a -# do_something if condition_b -# end -# -# # good -# if condition_b -# do_something -# end if condition_a -# -# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#49 -class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#59 - def on_if(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#187 - def add_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#168 - def add_parentheses_if_needed(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#201 - def allow_modifier?; end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#81 - def assigned_variables(condition); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#98 - def autocorrect(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#106 - def autocorrect_outer_condition_basic(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#142 - def autocorrect_outer_condition_modify_form(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#160 - def chainable_condition(node); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#131 - def correct_for_basic_condition_style(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#151 - def correct_for_comment(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#122 - def correct_for_guard_condition_style(corrector, node, if_branch); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#117 - def correct_node(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#89 - def offending_branch?(node, branch); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#182 - def parenthesize_method?(node); end - - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#194 - def parenthesized_method_arguments(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#74 - def use_variable_assignment_in_condition?(condition, if_branch); end - - class << self - # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#55 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#53 -RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) - -# Looks for uses of Perl-style global variables. -# Correcting to global variables in the 'English' library -# will add a require statement to the top of the file if -# enabled by RequireEnglish config. -# -# @example EnforcedStyle: use_english_names (default) -# # good -# require 'English' # or this could be in another file. -# -# puts $LOAD_PATH -# puts $LOADED_FEATURES -# puts $PROGRAM_NAME -# puts $ERROR_INFO -# puts $ERROR_POSITION -# puts $FIELD_SEPARATOR # or $FS -# puts $OUTPUT_FIELD_SEPARATOR # or $OFS -# puts $INPUT_RECORD_SEPARATOR # or $RS -# puts $OUTPUT_RECORD_SEPARATOR # or $ORS -# puts $INPUT_LINE_NUMBER # or $NR -# puts $LAST_READ_LINE -# puts $DEFAULT_OUTPUT -# puts $DEFAULT_INPUT -# puts $PROCESS_ID # or $PID -# puts $CHILD_STATUS -# puts $LAST_MATCH_INFO -# puts $IGNORECASE -# puts $ARGV # or ARGV -# @example EnforcedStyle: use_perl_names -# # good -# puts $: -# puts $" -# puts $0 -# puts $! -# puts $@ -# puts $; -# puts $, -# puts $/ -# puts $\ -# puts $. -# puts $_ -# puts $> -# puts $< -# puts $$ -# puts $? -# puts $~ -# puts $= -# puts $* -# @example EnforcedStyle: use_builtin_english_names -# -# # good -# # Like `use_perl_names` but allows builtin global vars. -# puts $LOAD_PATH -# puts $LOADED_FEATURES -# puts $PROGRAM_NAME -# puts ARGV -# puts $: -# puts $" -# puts $0 -# puts $! -# puts $@ -# puts $; -# puts $, -# puts $/ -# puts $\ -# puts $. -# puts $_ -# puts $> -# puts $< -# puts $$ -# puts $? -# puts $~ -# puts $= -# puts $* -# -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#86 -class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::RequireLibrary - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#175 - def autocorrect(corrector, node, global_var); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#167 - def message(global_var); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#151 - def on_gvar(node); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#146 - def on_new_investigation; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#246 - def add_require_english?; end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#240 - def english_name_replacement(preferred_name, node); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#189 - def format_english_message(global_var); end - - # For now, we assume that lists are 2 items or less. Easy grammar! - # - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#211 - def format_list(items); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#197 - def format_message(english, regular, global); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#234 - def matching_styles(global); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#226 - def preferred_names(global); end - - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#215 - def replacement(node, global_var); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#250 - def should_require_english?(global_var); end -end - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#127 -RuboCop::Cop::Style::SpecialGlobalVars::BUILTIN_VARS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#99 -RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#144 -RuboCop::Cop::Style::SpecialGlobalVars::LIBRARY_NAME = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#92 -RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#95 -RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#97 -RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String) - -# Anything *not* in this set is provided by the English library. -# -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#121 -RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#123 -RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#138 -RuboCop::Cop::Style::SpecialGlobalVars::STYLE_VARS_MAP = T.let(T.unsafe(nil), Hash) - -# Check for parentheses around stabby lambda arguments. -# There are two different styles. Defaults to `require_parentheses`. -# -# @example EnforcedStyle: require_parentheses (default) -# # bad -# ->a,b,c { a + b + c } -# -# # good -# ->(a,b,c) { a + b + c} -# @example EnforcedStyle: require_no_parentheses -# # bad -# ->(a,b,c) { a + b + c } -# -# # good -# ->a,b,c { a + b + c} -# -# source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#22 -class RuboCop::Cop::Style::StabbyLambdaParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#28 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#54 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#46 - def missing_parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#58 - def missing_parentheses_corrector(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#73 - def parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#50 - def redundant_parentheses?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#69 - def stabby_lambda_with_args?(node); end - - # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#62 - def unwanted_parentheses_corrector(corrector, node); end -end - -# source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#27 -RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_NO_REQUIRE = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#26 -RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_REQUIRE = T.let(T.unsafe(nil), String) - -# Checks for places where classes with only class methods can be -# replaced with a module. Classes should be used only when it makes sense to create -# instances out of them. -# -# @example -# # bad -# class SomeClass -# def self.some_method -# # body omitted -# end -# -# def self.some_other_method -# # body omitted -# end -# end -# -# # good -# module SomeModule -# module_function -# -# def some_method -# # body omitted -# end -# -# def some_other_method -# # body omitted -# end -# end -# -# # good - has instance method -# class SomeClass -# def instance_method; end -# def self.class_method; end -# end -# -# source://rubocop//lib/rubocop/cop/style/static_class.rb#46 -class RuboCop::Cop::Style::StaticClass < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::VisibilityHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/static_class.rb#53 - def on_class(class_node); end - - private - - # source://rubocop//lib/rubocop/cop/style/static_class.rb#64 - def autocorrect(corrector, class_node); end - - # source://rubocop//lib/rubocop/cop/style/static_class.rb#77 - def autocorrect_def(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/static_class.rb#83 - def autocorrect_sclass(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/static_class.rb#90 - def class_convertible_to_module?(class_node); end - - # source://rubocop//lib/rubocop/cop/style/static_class.rb#114 - def class_elements(class_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/static_class.rb#102 - def extend_call?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/static_class.rb#106 - def sclass_convertible_to_module?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/static_class.rb#51 -RuboCop::Cop::Style::StaticClass::MSG = T.let(T.unsafe(nil), String) - -# Identifies places where `$stderr.puts` can be replaced by -# `warn`. The latter has the advantage of easily being disabled by, -# the `-W0` interpreter flag or setting `$VERBOSE` to `nil`. -# -# @example -# # bad -# $stderr.puts('hello') -# -# # good -# warn('hello') -# -# source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#17 -class RuboCop::Cop::Style::StderrPuts < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#32 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#25 - def stderr_puts?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#43 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#47 - def stderr_gvar?(sym); end - - # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#51 - def stderr_puts_range(send); end -end - -# source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#21 -RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#22 -RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for uses of `String#split` with empty string or regexp literal argument. -# -# @example -# # bad -# string.split(//) -# string.split('') -# -# # good -# string.chars -# -# source://rubocop//lib/rubocop/cop/style/string_chars.rb#21 -class RuboCop::Cop::Style::StringChars < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_chars.rb#29 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/string_chars.rb#29 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/string_chars.rb#27 -RuboCop::Cop::Style::StringChars::BAD_ARGUMENTS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/string_chars.rb#25 -RuboCop::Cop::Style::StringChars::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/string_chars.rb#26 -RuboCop::Cop::Style::StringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for places where string concatenation -# can be replaced with string interpolation. -# -# The cop can autocorrect simple cases but will skip autocorrecting -# more complex cases where the resulting code would be harder to read. -# In those cases, it might be useful to extract statements to local -# variables or methods which you can then interpolate in a string. -# -# NOTE: When concatenation between two strings is broken over multiple -# lines, this cop does not register an offense; instead, -# `Style/LineEndConcatenation` will pick up the offense if enabled. -# -# Two modes are supported: -# 1. `aggressive` style checks and corrects all occurrences of `+` where -# either the left or right side of `+` is a string literal. -# 2. `conservative` style on the other hand, checks and corrects only if -# left side (receiver of `+` method call) is a string literal. -# This is useful when the receiver is some expression that returns string like `Pathname` -# instead of a string literal. -# -# @example Mode: aggressive (default) -# # bad -# email_with_name = user.name + ' <' + user.email + '>' -# Pathname.new('/') + 'test' -# -# # good -# email_with_name = "#{user.name} <#{user.email}>" -# email_with_name = format('%s <%s>', user.name, user.email) -# "#{Pathname.new('/')}test" -# -# # accepted, line-end concatenation -# name = 'First' + -# 'Last' -# @example Mode: conservative -# # bad -# 'Hello' + user.name -# -# # good -# "Hello #{user.name}" -# user.name + '!!' -# Pathname.new('/') + 'test' -# -# source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#53 -class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#67 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#71 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#60 - def string_concatenation?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#158 - def adjust_str(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#114 - def collect_parts(node, parts = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#139 - def corrected_ancestor?(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#106 - def find_topmost_plus_node(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#162 - def handle_quotes(parts); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#133 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#96 - def line_end_concatenation?(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#172 - def mode; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#125 - def plus_node?(node); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#84 - def register_offense(topmost_plus_node, parts); end - - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#143 - def replacement(parts); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#168 - def single_quoted?(str_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#129 - def uncorrectable?(part); end -end - -# source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#56 -RuboCop::Cop::Style::StringConcatenation::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#57 -RuboCop::Cop::Style::StringConcatenation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for the use of strings as keys in hashes. The use of -# symbols is preferred instead. -# -# @example -# # bad -# { 'one' => 1, 'two' => 2, 'three' => 3 } -# -# # good -# { one: 1, two: 2, three: 3 } -# -# source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#19 -class RuboCop::Cop::Style::StringHashKeys < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#42 - def on_pair(node); end - - # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#30 - def receive_environments_method?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#25 - def string_hash_key?(param0 = T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#22 -RuboCop::Cop::Style::StringHashKeys::MSG = T.let(T.unsafe(nil), String) - -# Checks if uses of quotes match the configured preference. -# -# @example EnforcedStyle: single_quotes (default) -# # bad -# "No special symbols" -# "No string interpolation" -# "Just text" -# -# # good -# 'No special symbols' -# 'No string interpolation' -# 'Just text' -# "Wait! What's #{this}!" -# @example EnforcedStyle: double_quotes -# # bad -# 'Just some text' -# 'No special chars or interpolation' -# -# # good -# "Just some text" -# "No special chars or interpolation" -# "Every string in #{project} uses double_quotes" -# -# source://rubocop//lib/rubocop/cop/style/string_literals.rb#29 -class RuboCop::Cop::Style::StringLiterals < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::StringLiteralsHelp - include ::RuboCop::Cop::StringHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#37 - def on_dstr(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#123 - def accept_child_double_quotes?(nodes); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#71 - def all_string_literals?(nodes); end - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#61 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#105 - def check_multiline_quote_style(node, quote); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#101 - def consistent_multiline?; end - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#75 - def detect_quote_styles(node); end - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#87 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#97 - def offense?(node); end - - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#65 - def register_offense(node, message: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#119 - def unexpected_double_quotes?(quote); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals.rb#115 - def unexpected_single_quotes?(quote); end -end - -# source://rubocop//lib/rubocop/cop/style/string_literals.rb#35 -RuboCop::Cop::Style::StringLiterals::MSG_INCONSISTENT = T.let(T.unsafe(nil), String) - -# Checks that quotes inside string, symbol, and regexp interpolations -# match the configured preference. -# -# @example EnforcedStyle: single_quotes (default) -# # bad -# string = "Tests #{success ? "PASS" : "FAIL"}" -# symbol = :"Tests #{success ? "PASS" : "FAIL"}" -# heredoc = <<~TEXT -# Tests #{success ? "PASS" : "FAIL"} -# TEXT -# regexp = /Tests #{success ? "PASS" : "FAIL"}/ -# -# # good -# string = "Tests #{success ? 'PASS' : 'FAIL'}" -# symbol = :"Tests #{success ? 'PASS' : 'FAIL'}" -# heredoc = <<~TEXT -# Tests #{success ? 'PASS' : 'FAIL'} -# TEXT -# regexp = /Tests #{success ? 'PASS' : 'FAIL'}/ -# @example EnforcedStyle: double_quotes -# # bad -# string = "Tests #{success ? 'PASS' : 'FAIL'}" -# symbol = :"Tests #{success ? 'PASS' : 'FAIL'}" -# heredoc = <<~TEXT -# Tests #{success ? 'PASS' : 'FAIL'} -# TEXT -# regexp = /Tests #{success ? 'PASS' : 'FAIL'}/ -# -# # good -# string = "Tests #{success ? "PASS" : "FAIL"}" -# symbol = :"Tests #{success ? "PASS" : "FAIL"}" -# heredoc = <<~TEXT -# Tests #{success ? "PASS" : "FAIL"} -# TEXT -# regexp = /Tests #{success ? "PASS" : "FAIL"}/ -# -# source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#42 -class RuboCop::Cop::Style::StringLiteralsInInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::StringLiteralsHelp - include ::RuboCop::Cop::StringHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#48 - def autocorrect(corrector, node); end - - # Cop classes that include the StringHelp module usually ignore regexp - # nodes. Not so for this cop, which is why we override the on_regexp - # definition with an empty one. - # - # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#55 - def on_regexp(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#59 - def message(_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#66 - def offense?(node); end -end - -# Enforces the use of consistent method names -# from the `String` class. -# -# @example -# # bad -# 'name'.intern -# 'var'.unfavored_method -# -# # good -# 'name'.to_sym -# 'var'.preferred_method -# -# source://rubocop//lib/rubocop/cop/style/string_methods.rb#17 -class RuboCop::Cop::Style::StringMethods < ::RuboCop::Cop::Base - include ::RuboCop::Cop::MethodPreference - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/string_methods.rb#23 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/string_methods.rb#23 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/string_methods.rb#21 -RuboCop::Cop::Style::StringMethods::MSG = T.let(T.unsafe(nil), String) - -# Identifies places where `lstrip.rstrip` can be replaced by -# `strip`. -# -# @example -# # bad -# 'abc'.lstrip.rstrip -# 'abc'.rstrip.lstrip -# -# # good -# 'abc'.strip -# -# source://rubocop//lib/rubocop/cop/style/strip.rb#16 -class RuboCop::Cop::Style::Strip < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/strip.rb#24 - def lstrip_rstrip(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/strip.rb#31 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/strip.rb#31 - def on_send(node); end -end - -# source://rubocop//lib/rubocop/cop/style/strip.rb#20 -RuboCop::Cop::Style::Strip::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/strip.rb#21 -RuboCop::Cop::Style::Strip::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for inheritance from `Struct.new`. Inheriting from `Struct.new` -# adds a superfluous level in inheritance tree. -# -# @example -# # bad -# class Person < Struct.new(:first_name, :last_name) -# def age -# 42 -# end -# end -# -# Person.ancestors -# # => [Person, #, Struct, (...)] -# -# # good -# Person = Struct.new(:first_name, :last_name) do -# def age -# 42 -# end -# end -# -# Person.ancestors -# # => [Person, Struct, (...)] -# -# source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#33 -class RuboCop::Cop::Style::StructInheritance < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#40 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#52 - def struct_constructor?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#59 - def correct_parent(parent, corrector); end - - # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#69 - def range_for_empty_class_body(class_node, struct_new); end -end - -# source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#37 -RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) - -# Checks for redundant argument forwarding when calling super with arguments identical to -# the method definition. -# -# Using zero arity `super` within a `define_method` block results in `RuntimeError`: -# -# [source,ruby] -# ---- -# def m -# define_method(:foo) { super() } # => OK -# end -# -# def m -# define_method(:foo) { super } # => RuntimeError -# end -# ---- -# -# Furthermore, any arguments accompanied by a block may potentially be delegating to -# `define_method`, therefore, `super` used within these blocks will be allowed. -# This approach might result in false negatives, yet ensuring safe detection takes precedence. -# -# NOTE: When forwarding the same arguments but replacing the block argument with a new inline -# block, it is not necessary to explicitly list the non-block arguments. As such, an offense -# will be registered in this case. -# -# @example -# # bad -# def method(*args, **kwargs) -# super(*args, **kwargs) -# end -# -# # good - implicitly passing all arguments -# def method(*args, **kwargs) -# super -# end -# -# # good - forwarding a subset of the arguments -# def method(*args, **kwargs) -# super(*args) -# end -# -# # good - forwarding no arguments -# def method(*args, **kwargs) -# super() -# end -# -# # bad - forwarding with overridden block -# def method(*args, **kwargs, &block) -# super(*args, **kwargs) { do_something } -# end -# -# # good - implicitly passing all non-block arguments -# def method(*args, **kwargs, &block) -# super { do_something } -# end -# -# # good - assigning to the block variable before calling super -# def method(&block) -# # Assigning to the block variable would pass the old value to super, -# # under this circumstance the block must be referenced explicitly. -# block ||= proc { 'fallback behavior' } -# super(&block) -# end -# -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#68 -class RuboCop::Cop::Style::SuperArguments < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#77 - def on_super(super_node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#125 - def argument_list_size_differs?(def_args, super_args, super_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#107 - def arguments_identical?(def_node, super_node, def_args, super_args); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#180 - def block_arg_same?(def_node, super_node, def_arg, super_arg); end - - # Reassigning the block argument will still pass along the original block to super - # https://bugs.ruby-lang.org/issues/20505 - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#194 - def block_reassigned?(def_node, block_arg_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#134 - def block_sends_to_super?(super_node, parent_node = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#95 - def find_def_node(super_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#205 - def forward_arg_same?(def_arg, super_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#160 - def keyword_arg_same?(def_arg, super_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#170 - def keyword_rest_arg_same?(def_arg, super_arg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#143 - def positional_arg_same?(def_arg, super_arg); end - - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#150 - def positional_rest_arg_same(def_arg, super_arg); end - - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#209 - def preprocess_super_args(super_args); end -end - -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#71 -RuboCop::Cop::Style::SuperArguments::ASSIGN_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#73 -RuboCop::Cop::Style::SuperArguments::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#74 -RuboCop::Cop::Style::SuperArguments::MSG_INLINE_BLOCK = T.let(T.unsafe(nil), String) - -# Enforces the presence of parentheses in `super` containing arguments. -# -# `super` is a keyword and is provided as a distinct cop from those designed for method call. -# -# @example -# -# # bad -# super name, age -# -# # good -# super(name, age) -# -# source://rubocop//lib/rubocop/cop/style/super_with_args_parentheses.rb#18 -class RuboCop::Cop::Style::SuperWithArgsParentheses < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/super_with_args_parentheses.rb#23 - def on_super(node); end -end - -# source://rubocop//lib/rubocop/cop/style/super_with_args_parentheses.rb#21 -RuboCop::Cop::Style::SuperWithArgsParentheses::MSG = T.let(T.unsafe(nil), String) - -# Enforces the use of shorthand-style swapping of 2 variables. -# -# @example -# # bad -# tmp = x -# x = y -# y = tmp -# -# # good -# x, y = y, x -# -# source://rubocop//lib/rubocop/cop/style/swap_values.rb#21 -class RuboCop::Cop::Style::SwapValues < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_asgn(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_casgn(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_cvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_gvasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_ivasgn(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#30 - def on_lvasgn(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#47 - def allowed_assignment?(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#93 - def correction_range(tmp_assign, y_assign); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#81 - def lhs(node); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#66 - def message(x_assign, y_assign); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#75 - def replacement(x_assign); end - - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#89 - def rhs(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#60 - def simple_assignment?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/swap_values.rb#51 - def swapping_values?(tmp_assign, x_assign, y_assign); end -end - -# source://rubocop//lib/rubocop/cop/style/swap_values.rb#25 -RuboCop::Cop::Style::SwapValues::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/swap_values.rb#28 -RuboCop::Cop::Style::SwapValues::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Set) - -# Checks for array literals made up of symbols that are not -# using the %i() syntax. -# -# Alternatively, it checks for symbol arrays using the %i() syntax on -# projects which do not want to use that syntax, perhaps because they -# support a version of Ruby lower than 2.0. -# -# Configuration option: MinSize -# If set, arrays with fewer elements than this value will not trigger the -# cop. For example, a `MinSize` of `3` will not enforce a style on an -# array of 2 or fewer elements. -# -# @example EnforcedStyle: percent (default) -# # good -# %i[foo bar baz] -# -# # bad -# [:foo, :bar, :baz] -# -# # bad (contains spaces) -# %i[foo\ bar baz\ quux] -# -# # bad (contains [] with spaces) -# %i[foo \[ \]] -# -# # bad (contains () with spaces) -# %i(foo \( \)) -# @example EnforcedStyle: brackets -# # good -# [:foo, :bar, :baz] -# -# # bad -# %i[foo bar baz] -# -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#40 -class RuboCop::Cop::Style::SymbolArray < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ArrayMinSize - include ::RuboCop::Cop::ArraySyntax - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::PercentArray - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#66 - def on_array(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#96 - def build_bracketed_array(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#78 - def complex_content?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#92 - def invalid_percent_array_contents?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#119 - def symbol_without_quote?(string); end - - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#111 - def to_symbol_literal(string); end - - class << self - # Returns the value of attribute largest_brackets. - # - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#63 - def largest_brackets; end - - # Sets the attribute largest_brackets - # - # @param value the value to set the attribute largest_brackets to. - # - # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#63 - def largest_brackets=(_arg0); end - end -end - -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#51 -RuboCop::Cop::Style::SymbolArray::ARRAY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#52 -RuboCop::Cop::Style::SymbolArray::DELIMITERS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#50 -RuboCop::Cop::Style::SymbolArray::PERCENT_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#57 -RuboCop::Cop::Style::SymbolArray::REDEFINABLE_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/symbol_array.rb#53 -RuboCop::Cop::Style::SymbolArray::SPECIAL_GVARS = T.let(T.unsafe(nil), Array) - -# Checks symbol literal syntax. -# -# @example -# -# # bad -# :"symbol" -# -# # good -# :symbol -# -# source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#15 -class RuboCop::Cop::Style::SymbolLiteral < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#20 - def on_sym(node); end -end - -# source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#18 -RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) - -# Use symbols as procs when possible. -# -# If you prefer a style that allows block for method with arguments, -# please set `true` to `AllowMethodsWithArguments`. -# `define_method?` methods are allowed by default. -# These are customizable with `AllowedMethods` option. -# -# @example AllCops:ActiveSupportExtensionsEnabled: true -# # good -# ->(x) { x.foo } -# proc { |x| x.foo } -# Proc.new { |x| x.foo } -# @example AllowMethodsWithArguments: false (default) -# # bad -# something.do_something(foo) { |o| o.bar } -# -# # good -# something.do_something(foo, &:bar) -# @example AllowMethodsWithArguments: true -# # good -# something.do_something(foo) { |o| o.bar } -# @example AllowComments: false (default) -# # bad -# something.do_something do |s| # some comment -# # some comment -# s.upcase # some comment -# # some comment -# end -# @example AllowComments: true -# # good - if there are comment in either position -# something.do_something do |s| # some comment -# # some comment -# s.upcase # some comment -# # some comment -# end -# @example AllowedMethods: [define_method] (default) -# # good -# define_method(:foo) { |foo| foo.bar } -# @example AllowedPatterns: [] (default) -# # bad -# something.map { |s| s.upcase } -# @example AllowedPatterns: ['map'] (default) -# # good -# something.map { |s| s.upcase } -# @example AllCops:ActiveSupportExtensionsEnabled: false (default) -# # bad -# ->(x) { x.foo } -# proc { |x| x.foo } -# Proc.new { |x| x.foo } -# -# # good -# lambda(&:foo) -# proc(&:foo) -# Proc.new(&:foo) -# @example -# # bad -# something.map { |s| s.upcase } -# something.map { _1.upcase } -# -# # good -# something.map(&:upcase) -# -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#140 -class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base - include ::RuboCop::Cop::CommentsHelp - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::AllowedMethods - include ::RuboCop::Cop::AllowedPattern - extend ::RuboCop::Cop::AutoCorrector - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#191 - def destructuring_block_argument?(argument_node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#171 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#171 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#171 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#152 - def proc_node?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#158 - def symbol_proc?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#155 - def symbol_proc_receiver?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#276 - def allow_comments?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#272 - def allow_if_method_has_argument?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#206 - def allowed_method_name?(name); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#219 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#249 - def autocorrect_lambda_block(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#240 - def autocorrect_with_args(corrector, node, args, method_name); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#227 - def autocorrect_without_args(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#262 - def begin_pos_for_replacement(node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#257 - def block_range_with_space(node); end - - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#210 - def register_offense(node, method_name, block_method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#202 - def unsafe_array_usage?(node); end - - # See: https://github.com/rubocop/rubocop/issues/10864 - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#198 - def unsafe_hash_usage?(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#166 - def autocorrect_incompatible_with; end - end -end - -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#149 -RuboCop::Cop::Style::SymbolProc::LAMBDA_OR_PROC = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#147 -RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#148 -RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array) - -# Corrector to correct conditional assignment in ternary conditions. -# -# source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#509 -class RuboCop::Cop::Style::TernaryCorrector - extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper - extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper - - class << self - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#514 - def correct(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#518 - def move_assignment_inside_condition(corrector, node); end - - private - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#532 - def correction(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#545 - def element_assignment?(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#549 - def extract_branches(node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#562 - def move_branch_inside_condition(corrector, branch, assignment); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#557 - def remove_parentheses(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#536 - def ternary(node); end - end -end - -# Checks for the presence of parentheses around ternary -# conditions. It is configurable to enforce inclusion or omission of -# parentheses using `EnforcedStyle`. Omission is only enforced when -# removing the parentheses won't cause a different behavior. -# -# `AllowSafeAssignment` option for safe assignment. -# By safe assignment we mean putting parentheses around -# an assignment to indicate "I know I'm using an assignment -# as a condition. It's not a mistake." -# -# @example EnforcedStyle: require_no_parentheses (default) -# # bad -# foo = (bar?) ? a : b -# foo = (bar.baz?) ? a : b -# foo = (bar && baz) ? a : b -# -# # good -# foo = bar? ? a : b -# foo = bar.baz? ? a : b -# foo = bar && baz ? a : b -# @example EnforcedStyle: require_parentheses -# # bad -# foo = bar? ? a : b -# foo = bar.baz? ? a : b -# foo = bar && baz ? a : b -# -# # good -# foo = (bar?) ? a : b -# foo = (bar.baz?) ? a : b -# foo = (bar && baz) ? a : b -# @example EnforcedStyle: require_parentheses_when_complex -# # bad -# foo = (bar?) ? a : b -# foo = (bar.baz?) ? a : b -# foo = bar && baz ? a : b -# -# # good -# foo = bar? ? a : b -# foo = bar.baz? ? a : b -# foo = (bar && baz) ? a : b -# @example AllowSafeAssignment: true (default) -# # good -# foo = (bar = baz) ? a : b -# @example AllowSafeAssignment: false -# # bad -# foo = (bar = baz) ? a : b -# -# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#57 -class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base - include ::RuboCop::Cop::SafeAssignment - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#191 - def method_name(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#69 - def on_if(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#100 - def autocorrect(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#181 - def below_ternary_precedence?(child); end - - # If the condition is parenthesized we recurse and check for any - # complex expressions within it. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#131 - def complex_condition?(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#89 - def condition_as_parenthesized_one_line_pattern_matching?(condition); end - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#196 - def correct_parenthesized(corrector, condition); end - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#210 - def correct_unparenthesized(corrector, condition); end - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#151 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#227 - def node_args_need_parens?(send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#234 - def node_with_args?(node); end - - # Anything that is not a variable, constant, or method/.method call - # will be counted as a complex expression. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#141 - def non_complex_expression?(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#145 - def non_complex_send?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#113 - def offense?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#85 - def only_closing_parenthesis_is_last_line?(condition); end - - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#214 - def parenthesize_condition_arguments(corrector, send_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#169 - def parenthesized?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#161 - def require_parentheses?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#165 - def require_parentheses_when_complex?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#177 - def unparenthesized_method_call?(child); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#173 - def unsafe_autocorrect?(condition); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#222 - def whitespace_after?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#66 -RuboCop::Cop::Style::TernaryParentheses::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#67 -RuboCop::Cop::Style::TernaryParentheses::MSG_COMPLEX = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#64 -RuboCop::Cop::Style::TernaryParentheses::NON_COMPLEX_TYPES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#63 -RuboCop::Cop::Style::TernaryParentheses::VARIABLE_TYPES = T.let(T.unsafe(nil), Set) - -# Newcomers to ruby applications may write top-level methods, -# when ideally they should be organized in appropriate classes or modules. -# This cop looks for definitions of top-level methods and warns about them. -# -# However for ruby scripts it is perfectly fine to use top-level methods. -# Hence this cop is disabled by default. -# -# @example -# # bad -# def some_method -# end -# -# # bad -# def self.some_method -# end -# -# # bad -# define_method(:foo) { puts 1 } -# -# # good -# module Foo -# def some_method -# end -# end -# -# # good -# class Foo -# def self.some_method -# end -# end -# -# # good -# Struct.new do -# def some_method -# end -# end -# -# # good -# class Foo -# define_method(:foo) { puts 1 } -# end -# -# source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#47 -class RuboCop::Cop::Style::TopLevelMethodDefinition < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#80 - def define_method_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#60 - def on_block(node); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#52 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#52 - def on_defs(node); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#60 - def on_itblock(node); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#60 - def on_numblock(node); end - - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#52 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#71 - def top_level_method_definition?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#48 -RuboCop::Cop::Style::TopLevelMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/top_level_method_definition.rb#50 -RuboCop::Cop::Style::TopLevelMethodDefinition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for trailing code after the class definition. -# -# @example -# # bad -# class Foo; def foo; end -# end -# -# # good -# class Foo -# def foo; end -# end -# -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#18 -class RuboCop::Cop::Style::TrailingBodyOnClass < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::TrailingBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#25 - def on_class(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#25 - def on_sclass(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#23 -RuboCop::Cop::Style::TrailingBodyOnClass::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing code after the method definition. -# -# NOTE: It always accepts endless method definitions that are basically on the same line. -# -# @example -# # bad -# def some_method; do_stuff -# end -# -# def f(x); b = foo -# b[c: x] -# end -# -# # good -# def some_method -# do_stuff -# end -# -# def f(x) -# b = foo -# b[c: x] -# end -# -# def endless_method = do_stuff -# -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#31 -class RuboCop::Cop::Style::TrailingBodyOnMethodDefinition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::TrailingBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#38 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#38 - def on_defs(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#36 -RuboCop::Cop::Style::TrailingBodyOnMethodDefinition::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing code after the module definition. -# -# @example -# # bad -# module Foo extend self -# end -# -# # good -# module Foo -# extend self -# end -# -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#18 -class RuboCop::Cop::Style::TrailingBodyOnModule < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::TrailingBody - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#25 - def on_module(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#23 -RuboCop::Cop::Style::TrailingBodyOnModule::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing comma in argument lists. -# The supported styles are: -# -# * `consistent_comma`: Requires a comma after the last argument, -# for all parenthesized multi-line method calls with arguments. -# * `comma`: Requires a comma after the last argument, but only for -# parenthesized method calls where each argument is on its own line. -# * `no_comma`: Requires that there is no comma after the last -# argument. -# -# Regardless of style, trailing commas are not allowed in -# single-line method calls. -# -# @example EnforcedStyleForMultiline: consistent_comma -# # bad -# method(1, 2,) -# -# # good -# method(1, 2) -# -# # good -# method( -# 1, 2, -# 3, -# ) -# -# # good -# method( -# 1, 2, 3, -# ) -# -# # good -# method( -# 1, -# 2, -# ) -# @example EnforcedStyleForMultiline: comma -# # bad -# method(1, 2,) -# -# # good -# method(1, 2) -# -# # bad -# method( -# 1, 2, -# 3, -# ) -# -# # good -# method( -# 1, 2, -# 3 -# ) -# -# # bad -# method( -# 1, 2, 3, -# ) -# -# # good -# method( -# 1, 2, 3 -# ) -# -# # good -# method( -# 1, -# 2, -# ) -# @example EnforcedStyleForMultiline: no_comma (default) -# # bad -# method(1, 2,) -# -# # bad -# object[1, 2,] -# -# # good -# method(1, 2) -# -# # good -# object[1, 2] -# -# # good -# method( -# 1, -# 2 -# ) -# -# source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#96 -class RuboCop::Cop::Style::TrailingCommaInArguments < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::TrailingComma - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#104 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#104 - def on_send(node); end - - class << self - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#100 - def autocorrect_incompatible_with; end - end -end - -# Checks for trailing comma in array literals. -# The configuration options are: -# -# * `consistent_comma`: Requires a comma after the last item of all non-empty, multiline array -# literals. -# * `comma`: Requires a comma after the last item in an array, but only when each item is on -# its own line. -# * `diff_comma`: Requires a comma after the last item in an array, but only when that item is -# followed by an immediate newline, even if there is an inline comment on the same line. -# * `no_comma`: Does not require a comma after the last item in an array -# -# @example EnforcedStyleForMultiline: consistent_comma -# # bad -# a = [1, 2,] -# -# # good -# a = [1, 2] -# -# # good -# a = [ -# 1, 2, -# 3, -# ] -# -# # good -# a = [ -# 1, 2, 3, -# ] -# -# # good -# a = [ -# 1, -# 2, -# ] -# -# # bad -# a = [1, 2, -# 3, 4] -# -# # good -# a = [1, 2, -# 3, 4,] -# @example EnforcedStyleForMultiline: comma -# # bad -# a = [1, 2,] -# -# # good -# a = [1, 2] -# -# # bad -# a = [ -# 1, 2, -# 3, -# ] -# -# # good -# a = [ -# 1, 2, -# 3 -# ] -# -# # bad -# a = [ -# 1, 2, 3, -# ] -# -# # good -# a = [ -# 1, 2, 3 -# ] -# -# # good -# a = [ -# 1, -# 2, -# ] -# @example EnforcedStyleForMultiline: diff_comma -# # bad -# a = [1, 2,] -# -# # good -# a = [1, 2] -# -# # good -# a = [ -# 1, 2, -# 3, -# ] -# -# # good -# a = [ -# 1, 2, 3, -# ] -# -# # good -# a = [ -# 1, -# 2, -# ] -# -# # bad -# a = [1, 2, -# 3, 4,] -# -# # good -# a = [1, 2, -# 3, 4] -# @example EnforcedStyleForMultiline: no_comma (default) -# # bad -# a = [1, 2,] -# -# # good -# a = [ -# 1, -# 2 -# ] -# -# source://rubocop//lib/rubocop/cop/style/trailing_comma_in_array_literal.rb#125 -class RuboCop::Cop::Style::TrailingCommaInArrayLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::TrailingComma - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_array_literal.rb#129 - def on_array(node); end -end - -# Checks whether trailing commas in block arguments are -# required. Blocks with only one argument and a trailing comma require -# that comma to be present. Blocks with more than one argument never -# require a trailing comma. -# -# @example -# # bad -# add { |foo, bar,| foo + bar } -# -# # good -# add { |foo, bar| foo + bar } -# -# # good -# add { |foo,| foo } -# -# # good -# add { foo } -# -# # bad -# add do |foo, bar,| -# foo + bar -# end -# -# # good -# add do |foo, bar| -# foo + bar -# end -# -# # good -# add do |foo,| -# foo -# end -# -# # good -# add do -# foo + bar -# end -# -# source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#62 -class RuboCop::Cop::Style::TrailingCommaInBlockArgs < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#67 - def on_block(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#83 - def arg_count(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#95 - def argument_tokens(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#91 - def last_comma(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#87 - def trailing_comma?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#79 - def useless_trailing_comma?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#65 -RuboCop::Cop::Style::TrailingCommaInBlockArgs::MSG = T.let(T.unsafe(nil), String) - -# Checks for trailing comma in hash literals. -# The configuration options are: -# -# * `consistent_comma`: Requires a comma after the last item of all non-empty, multiline hash -# literals. -# * `comma`: Requires a comma after the last item in a hash, but only when each item is on its -# own line. -# * `diff_comma`: Requires a comma after the last item in a hash, but only when that item is -# followed by an immediate newline, even if there is an inline comment on the same line. -# * `no_comma`: Does not require a comma after the last item in a hash -# -# @example EnforcedStyleForMultiline: consistent_comma -# -# # bad -# a = { foo: 1, bar: 2, } -# -# # good -# a = { foo: 1, bar: 2 } -# -# # good -# a = { -# foo: 1, bar: 2, -# qux: 3, -# } -# -# # good -# a = { -# foo: 1, bar: 2, qux: 3, -# } -# -# # good -# a = { -# foo: 1, -# bar: 2, -# } -# -# # bad -# a = { foo: 1, bar: 2, -# baz: 3, qux: 4 } -# -# # good -# a = { foo: 1, bar: 2, -# baz: 3, qux: 4, } -# @example EnforcedStyleForMultiline: comma -# -# # bad -# a = { foo: 1, bar: 2, } -# -# # good -# a = { foo: 1, bar: 2 } -# -# # bad -# a = { -# foo: 1, bar: 2, -# qux: 3, -# } -# -# # good -# a = { -# foo: 1, bar: 2, -# qux: 3 -# } -# -# # bad -# a = { -# foo: 1, bar: 2, qux: 3, -# } -# -# # good -# a = { -# foo: 1, bar: 2, qux: 3 -# } -# -# # good -# a = { -# foo: 1, -# bar: 2, -# } -# @example EnforcedStyleForMultiline: diff_comma -# -# # bad -# a = { foo: 1, bar: 2, } -# -# # good -# a = { foo: 1, bar: 2 } -# -# # good -# a = { -# foo: 1, bar: 2, -# qux: 3, -# } -# -# # good -# a = { -# foo: 1, bar: 2, qux: 3, -# } -# -# # good -# a = { -# foo: 1, -# bar: 2, -# } -# -# # bad -# a = { foo: 1, bar: 2, -# baz: 3, qux: 4, } -# -# # good -# a = { foo: 1, bar: 2, -# baz: 3, qux: 4 } -# @example EnforcedStyleForMultiline: no_comma (default) -# -# # bad -# a = { foo: 1, bar: 2, } -# -# # good -# a = { -# foo: 1, -# bar: 2 -# } -# -# source://rubocop//lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb#129 -class RuboCop::Cop::Style::TrailingCommaInHashLiteral < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::TrailingComma - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb#133 - def on_hash(node); end -end - -# Checks for trailing code after the method definition. -# -# @example -# # bad -# def some_method -# do_stuff; end -# -# def do_this(x) -# baz.map { |b| b.this(x) } end -# -# def foo -# block do -# bar -# end end -# -# # good -# def some_method -# do_stuff -# end -# -# def do_this(x) -# baz.map { |b| b.this(x) } -# end -# -# def foo -# block do -# bar -# end -# end -# -# source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#36 -class RuboCop::Cop::Style::TrailingMethodEndStatement < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#41 - def on_def(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#55 - def body_and_end_on_same_line?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#51 - def trailing_end?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#39 -RuboCop::Cop::Style::TrailingMethodEndStatement::MSG = T.let(T.unsafe(nil), String) - -# Checks for extra underscores in variable assignment. -# -# @example -# # bad -# a, b, _ = foo() -# a, b, _, = foo() -# a, _, _ = foo() -# a, _, _, = foo() -# -# # good -# a, b, = foo() -# a, = foo() -# *a, b, _ = foo() -# # => We need to know to not include 2 variables in a -# a, *b, _ = foo() -# # => The correction `a, *b, = foo()` is a syntax error -# @example AllowNamedUnderscoreVariables: true (default) -# # good -# a, b, _something = foo() -# @example AllowNamedUnderscoreVariables: false -# # bad -# a, b, _something = foo() -# -# source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#31 -class RuboCop::Cop::Style::TrailingUnderscoreVariable < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - include ::RuboCop::Cop::SurroundingSpace - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#41 - def on_masgn(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#92 - def allow_named_underscore_variables; end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#125 - def children_offenses(variables); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#57 - def find_first_offense(variables); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#66 - def find_first_possible_offense(variables); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#108 - def main_node_offense(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#146 - def range_for_parentheses(offense, left); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#88 - def reverse_index(collection, item); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#80 - def splat_variable_before?(first_offense, variables); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#96 - def unneeded_ranges(node); end - - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#133 - def unused_range(node_type, mlhs_node, right); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#129 - def unused_variables_only?(offense, variables); end -end - -# source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#38 -RuboCop::Cop::Style::TrailingUnderscoreVariable::DISALLOW = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#36 -RuboCop::Cop::Style::TrailingUnderscoreVariable::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#37 -RuboCop::Cop::Style::TrailingUnderscoreVariable::UNDERSCORE = T.let(T.unsafe(nil), String) - -# Looks for trivial reader/writer methods, that could -# have been created with the attr_* family of functions automatically. -# `to_ary`, `to_a`, `to_c`, `to_enum`, `to_h`, `to_hash`, `to_i`, `to_int`, `to_io`, -# `to_open`, `to_path`, `to_proc`, `to_r`, `to_regexp`, `to_str`, `to_s`, and `to_sym` methods -# are allowed by default. These are customizable with `AllowedMethods` option. -# -# @example AllowedMethods: ['allowed_method'] -# # good -# def allowed_method -# @foo -# end -# @example ExactNameMatch: true (default) -# # good -# def name -# @other_name -# end -# @example ExactNameMatch: false -# # bad -# def name -# @other_name -# end -# @example AllowPredicates: true (default) -# # good -# def foo? -# @foo -# end -# @example AllowPredicates: false -# # bad -# def foo? -# @foo -# end -# -# # good -# attr_reader :foo -# @example AllowDSLWriters: true (default) -# # good -# def on_exception(action) -# @on_exception=action -# end -# @example AllowDSLWriters: false -# # bad -# def on_exception(action) -# @on_exception=action -# end -# -# # good -# attr_writer :on_exception -# @example IgnoreClassMethods: false (default) -# # bad -# def self.foo -# @foo -# end -# -# # good -# class << self -# attr_reader :foo -# end -# @example IgnoreClassMethods: true -# # good -# def self.foo -# @foo -# end -# @example -# # bad -# def foo -# @foo -# end -# -# def bar=(val) -# @bar = val -# end -# -# def self.baz -# @baz -# end -# -# # good -# attr_reader :foo -# attr_writer :bar -# -# class << self -# attr_reader :baz -# end -# -# source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#98 -class RuboCop::Cop::Style::TrivialAccessors < ::RuboCop::Cop::Base - include ::RuboCop::Cop::AllowedMethods - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#190 - def looks_like_trivial_writer?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#104 - def on_def(node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#104 - def on_defs(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#222 - def accessor(kind, method_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#161 - def allow_dsl_writers?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#157 - def allow_predicates?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#195 - def allowed_method_name?(node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#169 - def allowed_method_names; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#204 - def allowed_reader?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#200 - def allowed_writer?(node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#142 - def autocorrect(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#234 - def autocorrect_class(corrector, node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#226 - def autocorrect_instance(corrector, node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#173 - def dsl_writer?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#153 - def exact_name_match?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#165 - def ignore_class_methods?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#115 - def in_module_or_instance_eval?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#181 - def looks_like_trivial_reader?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#208 - def names_match?(node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#129 - def on_method_def(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#248 - def top_level_node?(node); end - - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#214 - def trivial_accessor_kind(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#177 - def trivial_reader?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#185 - def trivial_writer?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#102 -RuboCop::Cop::Style::TrivialAccessors::MSG = T.let(T.unsafe(nil), String) - -# Looks for `unless` expressions with `else` clauses. -# -# @example -# # bad -# unless foo_bar.nil? -# # do something... -# else -# # do a different thing... -# end -# -# # good -# if foo_bar.present? -# # do something... -# else -# # do a different thing... -# end -# -# source://rubocop//lib/rubocop/cop/style/unless_else.rb#22 -class RuboCop::Cop::Style::UnlessElse < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/unless_else.rb#28 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/unless_else.rb#45 - def range_between_condition_and_else(node, condition); end - - # source://rubocop//lib/rubocop/cop/style/unless_else.rb#49 - def range_between_else_and_end(node); end -end - -# source://rubocop//lib/rubocop/cop/style/unless_else.rb#26 -RuboCop::Cop::Style::UnlessElse::MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of logical operators in an `unless` condition. -# It discourages such code, as the condition becomes more difficult -# to read and understand. -# -# This cop supports two styles: -# -# - `forbid_mixed_logical_operators` (default) -# - `forbid_logical_operators` -# -# `forbid_mixed_logical_operators` style forbids the use of more than one type -# of logical operators. This makes the `unless` condition easier to read -# because either all conditions need to be met or any condition need to be met -# in order for the expression to be truthy or falsey. -# -# `forbid_logical_operators` style forbids any use of logical operator. -# This makes it even more easy to read the `unless` condition as -# there is only one condition in the expression. -# -# @example EnforcedStyle: forbid_mixed_logical_operators (default) -# # bad -# return unless a || b && c -# return unless a && b || c -# return unless a && b and c -# return unless a || b or c -# return unless a && b or c -# return unless a || b and c -# -# # good -# return unless a && b && c -# return unless a || b || c -# return unless a and b and c -# return unless a or b or c -# return unless a? -# @example EnforcedStyle: forbid_logical_operators -# # bad -# return unless a || b -# return unless a && b -# return unless a or b -# return unless a and b -# -# # good -# return unless a -# return unless a? -# -# source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#50 -class RuboCop::Cop::Style::UnlessLogicalOperators < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#62 - def and_with_or?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#67 - def logical_operator?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#71 - def on_if(node); end - - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#57 - def or_with_and?(param0 = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#83 - def mixed_logical_operator?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#90 - def mixed_precedence_and?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#97 - def mixed_precedence_or?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#54 -RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/unless_logical_operators.rb#53 -RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_MIXED_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) - -# Checks for accessing the first element of `String#unpack` -# which can be replaced with the shorter method `unpack1`. -# -# @example -# -# # bad -# 'foo'.unpack('h*').first -# 'foo'.unpack('h*')[0] -# 'foo'.unpack('h*').slice(0) -# 'foo'.unpack('h*').at(0) -# -# # good -# 'foo'.unpack1('h*') -# -# source://rubocop//lib/rubocop/cop/style/unpack_first.rb#20 -class RuboCop::Cop::Style::UnpackFirst < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - extend ::RuboCop::Cop::TargetRubyVersion - - # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#37 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#37 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#30 - def unpack_and_first_element?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#53 - def first_element_range(node, unpack_call); end -end - -# source://rubocop//lib/rubocop/cop/style/unpack_first.rb#26 -RuboCop::Cop::Style::UnpackFirst::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/unpack_first.rb#27 -RuboCop::Cop::Style::UnpackFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for variable interpolation (like "#@ivar"). -# -# @example -# # bad -# "His name is #$name" -# /check #$pattern/ -# "Let's go to the #@store" -# -# # good -# "His name is #{$name}" -# /check #{$pattern}/ -# "Let's go to the #{@store}" -# -# source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#18 -class RuboCop::Cop::Style::VariableInterpolation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Interpolation - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#24 - def on_node_with_interpolations(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#34 - def message(range); end - - # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#38 - def var_nodes(nodes); end -end - -# source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#22 -RuboCop::Cop::Style::VariableInterpolation::MSG = T.let(T.unsafe(nil), String) - -# Checks for `when;` uses in `case` expressions. -# -# @example -# # bad -# case foo -# when 1; 'baz' -# when 2; 'bar' -# end -# -# # good -# case foo -# when 1 then 'baz' -# when 2 then 'bar' -# end -# -# source://rubocop//lib/rubocop/cop/style/when_then.rb#20 -class RuboCop::Cop::Style::WhenThen < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/when_then.rb#25 - def on_when(node); end -end - -# source://rubocop//lib/rubocop/cop/style/when_then.rb#23 -RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String) - -# Checks for uses of `do` in multi-line `while/until` statements. -# -# @example -# -# # bad -# while x.any? do -# do_something(x.pop) -# end -# -# # good -# while x.any? -# do_something(x.pop) -# end -# -# # bad -# until x.empty? do -# do_something(x.pop) -# end -# -# # good -# until x.empty? -# do_something(x.pop) -# end -# -# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#29 -class RuboCop::Cop::Style::WhileUntilDo < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34 - def on_while(node); end -end - -# source://rubocop//lib/rubocop/cop/style/while_until_do.rb#32 -RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) - -# Checks for while and until statements that would fit on one line -# if written as a modifier while/until. The maximum line length is -# configured in the `Layout/LineLength` cop. -# -# @example -# # bad -# while x < 10 -# x += 1 -# end -# -# # good -# x += 1 while x < 10 -# -# # bad -# until x > 10 -# x += 1 -# end -# -# # good -# x += 1 until x > 10 -# -# # bad -# x += 100 while x < 500 # a long comment that makes code too long if it were a single line -# -# # good -# while x < 500 # a long comment that makes code too long if it were a single line -# x += 100 -# end -# -# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#34 -class RuboCop::Cop::Style::WhileUntilModifier < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::StatementModifier - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#40 - def on_until(node); end - - # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#40 - def on_while(node); end -end - -# source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#38 -RuboCop::Cop::Style::WhileUntilModifier::MSG = T.let(T.unsafe(nil), String) - -# Checks for array literals made up of word-like -# strings, that are not using the %w() syntax. -# -# Alternatively, it can check for uses of the %w() syntax, in projects -# which do not want to include that syntax. -# -# NOTE: When using the `percent` style, %w() arrays containing a space -# will be registered as offenses. -# -# Configuration option: MinSize -# If set, arrays with fewer elements than this value will not trigger the -# cop. For example, a `MinSize` of `3` will not enforce a style on an -# array of 2 or fewer elements. -# -# @example EnforcedStyle: percent (default) -# # good -# %w[foo bar baz] -# -# # bad -# ['foo', 'bar', 'baz'] -# -# # bad (contains spaces) -# %w[foo\ bar baz\ quux] -# -# # bad -# [ -# ['one', 'One'], -# ['two', 'Two'] -# ] -# -# # good -# [ -# %w[one One], -# %w[two Two] -# ] -# -# # good (2d array containing spaces) -# [ -# ['one', 'One'], -# ['two', 'Two'], -# ['forty two', 'Forty Two'] -# ] -# @example EnforcedStyle: brackets -# # good -# ['foo', 'bar', 'baz'] -# -# # bad -# %w[foo bar baz] -# -# # good (contains spaces) -# ['foo bar', 'baz quux'] -# -# # good -# [ -# ['one', 'One'], -# ['two', 'Two'] -# ] -# -# # bad -# [ -# %w[one One], -# %w[two Two] -# ] -# -# source://rubocop//lib/rubocop/cop/style/word_array.rb#71 -class RuboCop::Cop::Style::WordArray < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ArrayMinSize - include ::RuboCop::Cop::ArraySyntax - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::PercentArray - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/word_array.rb#94 - def on_array(node); end - - # source://rubocop//lib/rubocop/cop/style/word_array.rb#85 - def on_new_investigation; end - - private - - # source://rubocop//lib/rubocop/cop/style/word_array.rb#138 - def build_bracketed_array(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#118 - def complex_content?(strings, complex_regex: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#129 - def invalid_percent_array_contents?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#113 - def matrix_of_complex_content?(array); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#107 - def within_matrix_of_complex_content?(node); end - - # source://rubocop//lib/rubocop/cop/style/word_array.rb#134 - def word_regex; end - - class << self - # Returns the value of attribute largest_brackets. - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#82 - def largest_brackets; end - - # Sets the attribute largest_brackets - # - # @param value the value to set the attribute largest_brackets to. - # - # source://rubocop//lib/rubocop/cop/style/word_array.rb#82 - def largest_brackets=(_arg0); end - end -end - -# source://rubocop//lib/rubocop/cop/style/word_array.rb#79 -RuboCop::Cop::Style::WordArray::ARRAY_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/word_array.rb#78 -RuboCop::Cop::Style::WordArray::PERCENT_MSG = T.let(T.unsafe(nil), String) - -# Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with -# `File.read` argument. -# -# NOTE: `YAML.safe_load_file` was introduced in Ruby 3.0. -# -# @example -# -# # bad -# YAML.load(File.read(path)) -# YAML.parse(File.read(path)) -# -# # good -# YAML.load_file(path) -# YAML.parse_file(path) -# -# # bad -# YAML.safe_load(File.read(path)) # Ruby 3.0 and newer -# -# # good -# YAML.safe_load_file(path) # Ruby 3.0 and newer -# -# source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#27 -class RuboCop::Cop::Style::YAMLFileRead < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#41 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#34 - def yaml_file_read?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#60 - def offense_range(node); end -end - -# source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#30 -RuboCop::Cop::Style::YAMLFileRead::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/yaml_file_read.rb#31 -RuboCop::Cop::Style::YAMLFileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Enforces or forbids Yoda conditions, -# i.e. comparison operations where the order of expression is reversed. -# eg. `5 == x` -# -# @example EnforcedStyle: forbid_for_all_comparison_operators (default) -# # bad -# 99 == foo -# "bar" != foo -# 42 >= foo -# 10 < bar -# 99 == CONST -# -# # good -# foo == 99 -# foo == "bar" -# foo <= 42 -# bar > 10 -# CONST == 99 -# "#{interpolation}" == foo -# /#{interpolation}/ == foo -# @example EnforcedStyle: forbid_for_equality_operators_only -# # bad -# 99 == foo -# "bar" != foo -# -# # good -# 99 >= foo -# 3 < a && a < 5 -# @example EnforcedStyle: require_for_all_comparison_operators -# # bad -# foo == 99 -# foo == "bar" -# foo <= 42 -# bar > 10 -# -# # good -# 99 == foo -# "bar" != foo -# 42 >= foo -# 10 < bar -# @example EnforcedStyle: require_for_equality_operators_only -# # bad -# 99 >= foo -# 3 < a && a < 5 -# -# # good -# 99 == foo -# "bar" != foo -# -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#77 -class RuboCop::Cop::Style::YodaCondition < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#96 - def file_constant_equal_program_name?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#100 - def on_send(node); end - - private - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#153 - def actual_code_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#149 - def constant_portion?(node); end - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#142 - def corrected_code(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#113 - def enforce_yoda?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#117 - def equality_only?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#177 - def interpolation?(node); end - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#138 - def message(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#161 - def non_equality_operator?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#165 - def noncommutative_operator?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#173 - def program_name?(name); end - - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#157 - def reverse_comparison(operator); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#169 - def source_file_path_constant?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#126 - def valid_yoda?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#121 - def yoda_compatible_condition?(node); end -end - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#88 -RuboCop::Cop::Style::YodaCondition::ENFORCE_YODA_STYLES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#91 -RuboCop::Cop::Style::YodaCondition::EQUALITY_ONLY_STYLES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#84 -RuboCop::Cop::Style::YodaCondition::EQUALITY_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#82 -RuboCop::Cop::Style::YodaCondition::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#85 -RuboCop::Cop::Style::YodaCondition::NONCOMMUTATIVE_OPERATORS = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#86 -RuboCop::Cop::Style::YodaCondition::PROGRAM_NAMES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#87 -RuboCop::Cop::Style::YodaCondition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) - -# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#83 -RuboCop::Cop::Style::YodaCondition::REVERSE_COMPARISON = T.let(T.unsafe(nil), Hash) - -# Forbids Yoda expressions, i.e. binary operations (using `*`, `+`, `&`, `|`, -# and `^` operators) where the order of expression is reversed, eg. `1 + x`. -# This cop complements `Style/YodaCondition` cop, which has a similar purpose. -# -# This cop is disabled by default to respect user intentions such as: -# -# [source,ruby] -# ---- -# config.server_port = 9000 + ENV["TEST_ENV_NUMBER"].to_i -# ---- -# -# @example SupportedOperators: ['*', '+', '&', '|', '^'] (default) -# # bad -# 10 * y -# 1 + x -# 1 & z -# 1 | x -# 1 ^ x -# 1 + CONST -# -# # good -# y * 10 -# x + 1 -# z & 1 -# x | 1 -# x ^ 1 -# CONST + 1 -# 60 * 24 -# -# source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#40 -class RuboCop::Cop::Style::YodaExpression < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#47 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#51 - def on_send(node); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#74 - def constant_portion?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#82 - def offended_ancestor?(node); end - - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#86 - def offended_nodes; end - - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#78 - def supported_operators; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#70 - def yoda_expression_constant?(lhs, rhs); end -end - -# source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#43 -RuboCop::Cop::Style::YodaExpression::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#45 -RuboCop::Cop::Style::YodaExpression::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# Checks for numeric comparisons that can be replaced -# by a predicate method, such as `receiver.length == 0`, -# `receiver.length > 0`, and `receiver.length != 0`, -# `receiver.length < 1` and `receiver.size == 0` that can be -# replaced by `receiver.empty?` and `!receiver.empty?`. -# -# NOTE: `File`, `Tempfile`, and `StringIO` do not have `empty?` -# so allow `size == 0` and `size.zero?`. -# -# @example -# # bad -# [1, 2, 3].length == 0 -# 0 == "foobar".length -# array.length < 1 -# {a: 1, b: 2}.length != 0 -# string.length > 0 -# hash.size > 0 -# -# # good -# [1, 2, 3].empty? -# "foobar".empty? -# array.empty? -# !{a: 1, b: 2}.empty? -# !string.empty? -# !hash.empty? -# -# source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#37 -class RuboCop::Cop::Style::ZeroLengthPredicate < ::RuboCop::Cop::Base - extend ::RuboCop::Cop::AutoCorrector - - # Some collection like objects in the Ruby standard library - # implement `#size`, but not `#empty`. We ignore those to - # reduce false positives. - # - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#147 - def non_polymorphic_collection?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#114 - def nonzero_length_comparison(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#51 - def on_csend(node); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#45 - def on_send(node); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#138 - def other_length_node(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#106 - def zero_length_comparison(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#130 - def zero_length_node(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#101 - def zero_length_predicate?(param0 = T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#85 - def check_nonzero_length_comparison(node); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#70 - def check_zero_length_comparison(node); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#58 - def check_zero_length_predicate(node); end - - # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#119 - def replacement(node); end -end - -# source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#41 -RuboCop::Cop::Style::ZeroLengthPredicate::NONZERO_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#43 -RuboCop::Cop::Style::ZeroLengthPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#40 -RuboCop::Cop::Style::ZeroLengthPredicate::ZERO_MSG = T.let(T.unsafe(nil), String) - -# Common functionality for checking and correcting surrounding whitespace. -# -# source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#6 -module RuboCop::Cop::SurroundingSpace - include ::RuboCop::Cop::RangeHelp - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#110 - def empty_brackets?(left_bracket_token, right_bracket_token, tokens: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#104 - def empty_offense(node, range, message, command); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#94 - def empty_offenses(node, left, right, message); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#68 - def extra_space?(token, side); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#129 - def no_character_between?(left_bracket_token, right_bracket_token); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#38 - def no_space_offenses(node, left_token, right_token, message, start_ok: T.unsafe(nil), end_ok: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#120 - def offending_empty_no_space?(config, left_token, right_token); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#116 - def offending_empty_space?(config, left_token, right_token); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#33 - def on_new_investigation; end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#78 - def reposition(src, pos, step, include_newlines: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#16 - def side_space_range(range:, side:, include_newlines: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#124 - def space_between?(left_bracket_token, right_bracket_token); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#85 - def space_offense(node, token, side, message, command); end - - # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#53 - def space_offenses(node, left_token, right_token, message, start_ok: T.unsafe(nil), end_ok: T.unsafe(nil)); end -end - -# source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#9 -RuboCop::Cop::SurroundingSpace::NO_SPACE_COMMAND = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#12 -RuboCop::Cop::SurroundingSpace::SINGLE_SPACE_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#10 -RuboCop::Cop::SurroundingSpace::SPACE_COMMAND = T.let(T.unsafe(nil), String) - -# Classes that include this module just implement functions for working -# with symbol nodes. -# -# source://rubocop//lib/rubocop/cop/mixin/symbol_help.rb#7 -module RuboCop::Cop::SymbolHelp - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/symbol_help.rb#8 - def hash_key?(node); end -end - -# Common functionality for checking target ruby version. -# -# source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#6 -module RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#19 - def maximum_target_ruby_version(version); end - - # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#15 - def minimum_target_ruby_version(version); end - - # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#11 - def required_maximum_ruby_version; end - - # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#7 - def required_minimum_ruby_version; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#23 - def support_target_ruby_version?(version); end -end - -# A group of cops, ready to be called on duty to inspect files. -# Team is responsible for selecting only relevant cops to be sent on duty, -# as well as insuring that the needed forces are sent along with them. -# -# For performance reasons, Team will first dispatch cops & forces in two groups, -# first the ones needed for autocorrection (if any), then the rest -# (unless autocorrections happened). -# -# source://rubocop//lib/rubocop/cop/team.rb#13 -class RuboCop::Cop::Team - # @return [Team] a new instance of Team - # - # source://rubocop//lib/rubocop/cop/team.rb#61 - def initialize(cops, config = T.unsafe(nil), options = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/team.rb#72 - def autocorrect?; end - - # Returns the value of attribute cops. - # - # source://rubocop//lib/rubocop/cop/team.rb#57 - def cops; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/team.rb#76 - def debug?; end - - # Returns the value of attribute errors. - # - # source://rubocop//lib/rubocop/cop/team.rb#57 - def errors; end - - # source://rubocop//lib/rubocop/cop/team.rb#128 - def external_dependency_checksum; end - - # @deprecated - # - # source://rubocop//lib/rubocop/cop/team.rb#120 - def forces; end - - # source://rubocop//lib/rubocop/cop/team.rb#82 - def inspect_file(processed_source); end - - # @return [Commissioner::InvestigationReport] - # - # source://rubocop//lib/rubocop/cop/team.rb#91 - def investigate(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end - - # Returns the value of attribute updated_source_file. - # - # source://rubocop//lib/rubocop/cop/team.rb#57 - def updated_source_file; end - - # Returns the value of attribute updated_source_file. - # - # source://rubocop//lib/rubocop/cop/team.rb#57 - def updated_source_file?; end - - # Returns the value of attribute warnings. - # - # source://rubocop//lib/rubocop/cop/team.rb#57 - def warnings; end - - private - - # source://rubocop//lib/rubocop/cop/team.rb#139 - def autocorrect(processed_source, report, original:, offset:); end - - # source://rubocop//lib/rubocop/cop/team.rb#203 - def autocorrect_report(report, offset:, original:); end - - # source://rubocop//lib/rubocop/cop/team.rb#158 - def be_ready; end - - # source://rubocop//lib/rubocop/cop/team.rb#209 - def collate_corrections(report, offset:, original:); end - - # source://rubocop//lib/rubocop/cop/team.rb#225 - def each_corrector(report); end - - # source://rubocop//lib/rubocop/cop/team.rb#277 - def handle_error(error, location, cop); end - - # source://rubocop//lib/rubocop/cop/team.rb#269 - def handle_warning(error, location); end - - # @return [Commissioner::InvestigationReport] - # - # source://rubocop//lib/rubocop/cop/team.rb#172 - def investigate_partial(cops, processed_source, offset:, original:); end - - # source://rubocop//lib/rubocop/cop/team.rb#252 - def process_errors(file, errors); end - - # source://rubocop//lib/rubocop/cop/team.rb#166 - def reset; end - - # @return [Array] - # - # source://rubocop//lib/rubocop/cop/team.rb#178 - def roundup_relevant_cops(processed_source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/team.rb#194 - def support_target_rails_version?(cop); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/team.rb#188 - def support_target_ruby_version?(cop); end - - # source://rubocop//lib/rubocop/cop/team.rb#240 - def suppress_clobbering; end - - # source://rubocop//lib/rubocop/cop/team.rb#246 - def validate_config; end - - class << self - # @return [Array] needed for the given cops - # - # source://rubocop//lib/rubocop/cop/team.rb#43 - def forces_for(cops); end - - # @return [Team] with cops assembled from the given `cop_classes` - # - # source://rubocop//lib/rubocop/cop/team.rb#28 - def mobilize(cop_classes, config, options = T.unsafe(nil)); end - - # @return [Array] - # - # source://rubocop//lib/rubocop/cop/team.rb#34 - def mobilize_cops(cop_classes, config, options = T.unsafe(nil)); end - - # @return [Team] - # - # source://rubocop//lib/rubocop/cop/team.rb#15 - def new(cop_or_classes, config, options = T.unsafe(nil)); end - end -end - -# Common methods shared by TrailingBody cops -# -# source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#6 -module RuboCop::Cop::TrailingBody - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#12 - def body_on_first_line?(node, body); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#16 - def first_part_of(body); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#7 - def trailing_body?(node); end -end - -# Common methods shared by Style/TrailingCommaInArguments, -# Style/TrailingCommaInArrayLiteral and Style/TrailingCommaInHashLiteral -# -# source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#8 -module RuboCop::Cop::TrailingComma - include ::RuboCop::Cop::ConfigurableEnforcedStyle - include ::RuboCop::Cop::RangeHelp - - private - - # A single argument with the closing bracket on the same line as the end - # of the argument is not considered multiline, even if the argument - # itself might span multiple lines. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#109 - def allowed_multiline_argument?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#182 - def any_heredoc?(items); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#174 - def autocorrect_range(item); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#148 - def avoid_comma(kind, comma_begin_pos, extra_info); end - - # Returns true if the node has round/square/curly brackets. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#87 - def brackets?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#20 - def check(node, items, kind, begin_pos, end_pos); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#38 - def check_comma(node, kind, comma_pos); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#44 - def check_literal(node, kind); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#31 - def comma_offset(items, range); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#113 - def elements(node); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#55 - def extra_avoid_comma_info; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#186 - def heredoc?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#204 - def heredoc_send?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#81 - def inside_comment?(range, comma_offset); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#142 - def last_item_precedes_newline?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#98 - def method_name_and_arguments_on_same_line?(node); end - - # Returns true if the round/square/curly brackets of the given node are - # on different lines, each item within is on its own line, and the - # closing bracket is on its own line. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#94 - def multiline?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#128 - def no_elements_on_same_line?(node); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#134 - def node_end_location(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#138 - def on_same_line?(range1, range2); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#162 - def put_comma(items, kind); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#68 - def should_have_comma?(style, node); end - - # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#16 - def style_parameter_name; end -end - -# source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#12 -RuboCop::Cop::TrailingComma::MSG = T.let(T.unsafe(nil), String) - -# Common functionality shared by Uncommunicative cops -# -# source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#6 -module RuboCop::Cop::UncommunicativeName - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#12 - def check(node, args); end - - private - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#95 - def allow_nums; end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#87 - def allowed_names; end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#78 - def arg_range(arg, length); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#45 - def case_offense(node, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#64 - def ends_with_num?(name); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#91 - def forbidden_names; end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#83 - def forbidden_offense(node, range, name); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#36 - def issue_offenses(node, range, name); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#68 - def length_offense(node, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#74 - def long_enough?(name); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#99 - def min_length; end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#53 - def name_type(node); end - - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#60 - def num_offense(node, range); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#49 - def uppercase?(name); end -end - -# source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#7 -RuboCop::Cop::UncommunicativeName::CASE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#10 -RuboCop::Cop::UncommunicativeName::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#9 -RuboCop::Cop::UncommunicativeName::LENGTH_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#8 -RuboCop::Cop::UncommunicativeName::NUM_MSG = T.let(T.unsafe(nil), String) - -# This autocorrects unused arguments. -# -# source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#6 -class RuboCop::Cop::UnusedArgCorrector - extend ::RuboCop::Cop::RangeHelp - - class << self - # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#12 - def correct(corrector, processed_source, node); end - - # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#31 - def correct_for_blockarg_type(corrector, node); end - - # Returns the value of attribute processed_source. - # - # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#10 - def processed_source; end - end -end - -# This module contains a collection of useful utility methods. -# -# source://rubocop//lib/rubocop/cop/util.rb#7 -module RuboCop::Cop::Util - include ::RuboCop::PathUtil - - private - - # source://rubocop//lib/rubocop/cop/util.rb#39 - def add_parentheses(node, corrector); end - - # source://rubocop//lib/rubocop/cop/util.rb#60 - def any_descendant?(node, *types); end - - # source://rubocop//lib/rubocop/cop/util.rb#75 - def args_begin(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#87 - def args_end(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#108 - def begins_its_line?(range); end - - # This is a bad API - # - # source://rubocop//lib/rubocop/cop/util.rb#17 - def comment_line?(line_source); end - - # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar - # - # source://rubocop//lib/rubocop/cop/util.rb#22 - def comment_lines?(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#206 - def compatible_external_encoding_for?(src); end - - # If converting a string to Ruby string literal source code, must - # double quotes be used? - # - # source://rubocop//lib/rubocop/cop/util.rb#134 - def double_quotes_required?(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#148 - def escape_string(string); end - - # Returns, for example, a bare `if` node if the given node is an `if` - # with calls chained to the end of it. - # - # source://rubocop//lib/rubocop/cop/util.rb#118 - def first_part_of_call_chain(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#210 - def include_or_equal?(source, target); end - - # source://rubocop//lib/rubocop/cop/util.rb#185 - def indent(node, offset: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/util.rb#165 - def interpret_string_escapes(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#169 - def line(node_or_range); end - - # source://rubocop//lib/rubocop/cop/util.rb#30 - def line_range(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#144 - def needs_escaping?(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#91 - def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end - - # source://rubocop//lib/rubocop/cop/util.rb#34 - def parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#196 - def parse_regexp(text); end - - # source://rubocop//lib/rubocop/cop/util.rb#177 - def same_line?(node1, node2); end - - # source://rubocop//lib/rubocop/cop/util.rb#152 - def to_string_literal(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#191 - def to_supported_styles(enforced_style); end - - # source://rubocop//lib/rubocop/cop/util.rb#161 - def trim_string_interpolation_escape_character(str); end - - class << self - # source://rubocop//lib/rubocop/cop/util.rb#39 - def add_parentheses(node, corrector); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#60 - def any_descendant?(node, *types); end - - # source://rubocop//lib/rubocop/cop/util.rb#75 - def args_begin(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#87 - def args_end(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#108 - def begins_its_line?(range); end - - # This is a bad API - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#17 - def comment_line?(line_source); end - - # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#22 - def comment_lines?(node); end - - # If converting a string to Ruby string literal source code, must - # double quotes be used? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#134 - def double_quotes_required?(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#148 - def escape_string(string); end - - # Returns, for example, a bare `if` node if the given node is an `if` - # with calls chained to the end of it. - # - # source://rubocop//lib/rubocop/cop/util.rb#118 - def first_part_of_call_chain(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#185 - def indent(node, offset: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/util.rb#165 - def interpret_string_escapes(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#169 - def line(node_or_range); end - - # source://rubocop//lib/rubocop/cop/util.rb#30 - def line_range(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#144 - def needs_escaping?(string); end - - # @yield [sexp] - # - # source://rubocop//lib/rubocop/cop/util.rb#91 - def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#34 - def parentheses?(node); end - - # source://rubocop//lib/rubocop/cop/util.rb#196 - def parse_regexp(text); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/util.rb#177 - def same_line?(node1, node2); end - - # source://rubocop//lib/rubocop/cop/util.rb#152 - def to_string_literal(string); end - - # source://rubocop//lib/rubocop/cop/util.rb#191 - def to_supported_styles(enforced_style); end - - # source://rubocop//lib/rubocop/cop/util.rb#161 - def trim_string_interpolation_escape_character(str); end - end -end - -# source://rubocop//lib/rubocop/cop/util.rb#103 -RuboCop::Cop::Util::LINE_BEGINS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) - -# Match literal regex characters, not including anchors, character -# classes, alternatives, groups, repetitions, references, etc -# -# source://rubocop//lib/rubocop/cop/util.rb#12 -RuboCop::Cop::Util::LITERAL_REGEX = T.let(T.unsafe(nil), Regexp) - -# Arbitrarily chosen value, should be enough to cover -# the most nested source code in real world projects. -# -# source://rubocop//lib/rubocop/cop/util.rb#102 -RuboCop::Cop::Util::MAX_LINE_BEGINS_REGEX_INDEX = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#5 -module RuboCop::Cop::Utils; end - -# Parses {Kernel#sprintf} format strings. -# -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#7 -class RuboCop::Cop::Utils::FormatString - # @return [FormatString] a new instance of FormatString - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#94 - def initialize(string); end - - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#98 - def format_sequences; end - - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#110 - def max_digit_dollar_num; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#106 - def named_interpolation?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#102 - def valid?; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#122 - def mixed_formats?; end - - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#116 - def parse; end -end - -# Escaping the `#` in `INTERPOLATION` and `TEMPLATE_NAME` is necessary to -# avoid a bug in Ruby 3.2.0 -# See: https://bugs.ruby-lang.org/issues/19379 -# -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#11 -RuboCop::Cop::Utils::FormatString::DIGIT_DOLLAR = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#13 -RuboCop::Cop::Utils::FormatString::FLAG = T.let(T.unsafe(nil), Regexp) - -# The syntax of a format sequence is as follows. -# -# ``` -# %[flags][width][.precision]type -# ``` -# -# A format sequence consists of a percent sign, followed by optional -# flags, width, and precision indicators, then terminated with a field -# type character. -# -# For more complex formatting, Ruby supports a reference by name. -# -# @see https://ruby-doc.org/core-2.6.3/Kernel.html#method-i-format -# -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#47 -class RuboCop::Cop::Utils::FormatString::FormatSequence - # @return [FormatSequence] a new instance of FormatSequence - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#50 - def initialize(match); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#66 - def annotated?; end - - # Returns the value of attribute arg_number. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def arg_number; end - - # Number of arguments required for the format sequence - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#75 - def arity; end - - # Returns the value of attribute begin_pos. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def begin_pos; end - - # Returns the value of attribute end_pos. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def end_pos; end - - # Returns the value of attribute flags. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def flags; end - - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#79 - def max_digit_dollar_num; end - - # Returns the value of attribute name. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def name; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#62 - def percent?; end - - # Returns the value of attribute precision. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def precision; end - - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#83 - def style; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#70 - def template?; end - - # Returns the value of attribute type. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def type; end - - # Returns the value of attribute width. - # - # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 - def width; end -end - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#12 -RuboCop::Cop::Utils::FormatString::INTERPOLATION = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#19 -RuboCop::Cop::Utils::FormatString::NAME = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#15 -RuboCop::Cop::Utils::FormatString::NUMBER = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#14 -RuboCop::Cop::Utils::FormatString::NUMBER_ARG = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#17 -RuboCop::Cop::Utils::FormatString::PRECISION = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#22 -RuboCop::Cop::Utils::FormatString::SEQUENCE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#20 -RuboCop::Cop::Utils::FormatString::TEMPLATE_NAME = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#18 -RuboCop::Cop::Utils::FormatString::TYPE = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/cop/utils/format_string.rb#16 -RuboCop::Cop::Utils::FormatString::WIDTH = T.let(T.unsafe(nil), Regexp) - -# This force provides a way to track local variables and scopes of Ruby. -# Cops interact with this force need to override some of the hook methods. -# -# def before_entering_scope(scope, variable_table) -# end -# -# def after_entering_scope(scope, variable_table) -# end -# -# def before_leaving_scope(scope, variable_table) -# end -# -# def after_leaving_scope(scope, variable_table) -# end -# -# def before_declaring_variable(variable, variable_table) -# end -# -# def after_declaring_variable(variable, variable_table) -# end -# -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#27 -class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force - # Starting point. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#79 - def investigate(processed_source); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#88 - def process_node(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#74 - def variable_table; end - - private - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def after_declaring_variable(arg); end - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def after_entering_scope(arg); end - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def after_leaving_scope(arg); end - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def before_declaring_variable(arg); end - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def before_entering_scope(arg); end - - # source://rubocop//lib/rubocop/cop/variable_force.rb#374 - def before_leaving_scope(arg); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#346 - def descendant_reference(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#336 - def each_descendant_reference(loop_node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#321 - def find_variables_in_loop(loop_node); end - - # This is called for each scope recursively. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#97 - def inspect_variables_in_scope(scope_node); end - - # Mark all assignments which are referenced in the same loop - # as referenced by ignoring AST order since they would be referenced - # in next iteration. - # - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#302 - def mark_assignments_as_referenced_in_loop(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#130 - def node_handler_method_name(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#103 - def process_children(origin_node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#238 - def process_loop(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#182 - def process_pattern_match_variable(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#164 - def process_regexp_named_captures(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#253 - def process_rescue(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#272 - def process_scope(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#291 - def process_send(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#146 - def process_variable_assignment(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#134 - def process_variable_declaration(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#226 - def process_variable_multiple_assignment(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#196 - def process_variable_operator_assignment(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#233 - def process_variable_referencing(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#264 - def process_zero_arity_super(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#190 - def regexp_captured_names(node); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#357 - def scanned_node?(node); end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#361 - def scanned_nodes; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#111 - def skip_children!; end - - # @api private - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#285 - def twisted_nodes(node); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#35 -RuboCop::Cop::VariableForce::ARGUMENT_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) - -# This class represents each assignment of a variable. -# -# source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#7 -class RuboCop::Cop::VariableForce::Assignment - include ::RuboCop::Cop::VariableForce::Branchable - - # @return [Assignment] a new instance of Assignment - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#17 - def initialize(node, variable); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#58 - def exception_assignment?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#80 - def for_assignment?; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#91 - def meta_assignment_node; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#68 - def multiple_assignment?; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#31 - def name; end - - # Returns the value of attribute node. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def node; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#86 - def operator; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#62 - def operator_assignment?; end - - # Returns the value of attribute reassigned. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def reassigned; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#44 - def reassigned!; end - - # Returns the value of attribute reassigned. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def reassigned?; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#39 - def reference!(node); end - - # Returns the value of attribute referenced. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def referenced; end - - # Returns the value of attribute referenced. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def referenced?; end - - # Returns the value of attribute references. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def references; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#54 - def regexp_named_capture?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#74 - def rest_assignment?; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#35 - def scope; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#50 - def used?; end - - # Returns the value of attribute variable. - # - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 - def variable; end - - private - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#140 - def find_multiple_assignment_node(grandparent_node); end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#130 - def for_assignment_node; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#112 - def multiple_assignment_node; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#104 - def operator_assignment_node; end - - # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#123 - def rest_assignment_node; end -end - -# source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#10 -RuboCop::Cop::VariableForce::Assignment::MULTIPLE_LEFT_HAND_SIDE_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#68 -class RuboCop::Cop::VariableForce::AssignmentReference < ::Struct - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#69 - def assignment?; end - - # Returns the value of attribute node - # - # @return [Object] the current value of node - def node; end - - # Sets the attribute node - # - # @param value [Object] the value to set the attribute node to. - # @return [Object] the newly set value - def node=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Namespace for branch classes for each control structure. -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#7 -module RuboCop::Cop::VariableForce::Branch - class << self - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#8 - def of(target_node, scope: T.unsafe(nil)); end - end -end - -# left_body && right_body -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#265 -class RuboCop::Cop::VariableForce::Branch::And < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::LogicalOperator - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def left_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def right_body?; end -end - -# Abstract base class for branch classes. -# A branch represents a conditional branch in a scope. -# -# @example -# def some_scope -# do_something # no branch -# -# if foo -# do_something # branch A -# do_something # branch A -# else -# do_something # branch B -# if bar -# do_something # branch C (whose parent is branch B) -# end -# end -# -# do_something # no branch -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#42 -class RuboCop::Cop::VariableForce::Branch::Base < ::Struct - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#121 - def ==(other); end - - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#92 - def always_run?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#88 - def branched?; end - - # Returns the value of attribute child_node - # - # @return [Object] the current value of child_node - def child_node; end - - # Sets the attribute child_node - # - # @param value [Object] the value to set the attribute child_node to. - # @return [Object] the newly set value - def child_node=(_); end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#70 - def control_node; end - - # @yield [_self] - # @yieldparam _self [RuboCop::Cop::VariableForce::Branch::Base] the object that the method was called on - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#80 - def each_ancestor(include_self: T.unsafe(nil), &block); end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#121 - def eql?(other); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#104 - def exclusive_with?(other); end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#129 - def hash; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#96 - def may_jump_to_other_branch?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#100 - def may_run_incompletely?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#74 - def parent; end - - # Returns the value of attribute scope - # - # @return [Object] the current value of scope - def scope; end - - # Sets the attribute scope - # - # @param value [Object] the value to set the attribute scope to. - # @return [Object] the newly set value - def scope=(_); end - - private - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#135 - def scan_ancestors; end - - class << self - def [](*_arg0); end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#43 - def classes; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#56 - def define_predicate(name, child_index: T.unsafe(nil)); end - - # @private - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#47 - def inherited(subclass); end - - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#52 - def type; end - end -end - -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#325 -RuboCop::Cop::VariableForce::Branch::CLASSES_BY_TYPE = T.let(T.unsafe(nil), Hash) - -# case target -# when /pattern/ # when_clause -# else -# else_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#219 -class RuboCop::Cop::VariableForce::Branch::Case < ::RuboCop::Cop::VariableForce::Branch::Base - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#224 - def always_run?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def else_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def target?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def when_clause?; end -end - -# case target -# in pattern # in_pattern -# else -# else_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#234 -class RuboCop::Cop::VariableForce::Branch::CaseMatch < ::RuboCop::Cop::VariableForce::Branch::Base - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#239 - def always_run?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def else_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def in_pattern?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def target?; end -end - -# begin -# main_body -# ensure -# ensure_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#314 -class RuboCop::Cop::VariableForce::Branch::Ensure < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::ExceptionHandler - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#320 - def always_run?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def ensure_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def main_body?; end -end - -# Mix-in module for exception handling control structures. -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#281 -module RuboCop::Cop::VariableForce::Branch::ExceptionHandler - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#282 - def may_jump_to_other_branch?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#286 - def may_run_incompletely?; end -end - -# for element in collection -# loop_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#247 -class RuboCop::Cop::VariableForce::Branch::For < ::RuboCop::Cop::VariableForce::Branch::Base - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#252 - def always_run?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def collection?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def element?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def loop_body?; end -end - -# if conditional_clause -# truthy_body -# else -# falsey_body -# end -# -# unless conditional_clause -# falsey_body -# else -# truthy_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#166 -class RuboCop::Cop::VariableForce::Branch::If < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def conditional_clause?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def falsey_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def truthy_body?; end -end - -# Mix-in module for logical operator control structures. -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#258 -module RuboCop::Cop::VariableForce::Branch::LogicalOperator - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#259 - def always_run?; end -end - -# left_body || right_body -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#273 -class RuboCop::Cop::VariableForce::Branch::Or < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::LogicalOperator - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def left_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def right_body?; end -end - -# begin -# main_body -# rescue StandardError => error # rescue_clause -# else -# else_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#297 -class RuboCop::Cop::VariableForce::Branch::Rescue < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::ExceptionHandler - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#304 - def always_run?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def else_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def main_body?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def rescue_clause?; end -end - -# Mix-in module for simple conditional control structures. -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#145 -module RuboCop::Cop::VariableForce::Branch::SimpleConditional - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#150 - def always_run?; end - - # @raise [NotImplementedError] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#146 - def conditional_clause?; end -end - -# until conditional_clause -# loop_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#187 -class RuboCop::Cop::VariableForce::Branch::Until < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def conditional_clause?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def loop_body?; end -end - -# begin -# loop_body -# end until conditional_clause -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#207 -class RuboCop::Cop::VariableForce::Branch::UntilPost < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def conditional_clause?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def loop_body?; end -end - -# while conditional_clause -# loop_body -# end -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#177 -class RuboCop::Cop::VariableForce::Branch::While < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def conditional_clause?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def loop_body?; end -end - -# begin -# loop_body -# end while conditional_clause -# -# source://rubocop//lib/rubocop/cop/variable_force/branch.rb#197 -class RuboCop::Cop::VariableForce::Branch::WhilePost < ::RuboCop::Cop::VariableForce::Branch::Base - include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def conditional_clause?; end - - # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 - def loop_body?; end -end - -# Mix-in module for classes which own a node and need branch information -# of the node. The user classes must implement #node and #scope. -# -# source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#8 -module RuboCop::Cop::VariableForce::Branchable - # source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#9 - def branch; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#15 - def run_exclusively_with?(other); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#42 -RuboCop::Cop::VariableForce::LOGICAL_OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#51 -RuboCop::Cop::VariableForce::LOOP_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#45 -RuboCop::Cop::VariableForce::MULTIPLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#115 -RuboCop::Cop::VariableForce::NODE_HANDLER_METHOD_NAMES = T.let(T.unsafe(nil), Hash) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#43 -RuboCop::Cop::VariableForce::OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#30 -RuboCop::Cop::VariableForce::PATTERN_MATCH_VARIABLE_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#50 -RuboCop::Cop::VariableForce::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#29 -RuboCop::Cop::VariableForce::REGEXP_NAMED_CAPTURE_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#53 -RuboCop::Cop::VariableForce::RESCUE_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#46 -RuboCop::Cop::VariableForce::REST_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) - -# This class represents each reference of a variable. -# -# source://rubocop//lib/rubocop/cop/variable_force/reference.rb#7 -class RuboCop::Cop::VariableForce::Reference - include ::RuboCop::Cop::VariableForce::Branchable - - # @return [Reference] a new instance of Reference - # - # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#16 - def initialize(node, scope); end - - # There's an implicit variable reference by the zero-arity `super`: - # - # def some_method(foo) - # super - # end - # - # Another case is `binding`: - # - # def some_method(foo) - # do_something(binding) - # end - # - # In these cases, the variable `foo` is not explicitly referenced, - # but it can be considered used implicitly by the `super` or `binding`. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#41 - def explicit?; end - - # Returns the value of attribute node. - # - # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#14 - def node; end - - # Returns the value of attribute scope. - # - # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#14 - def scope; end -end - -# source://rubocop//lib/rubocop/cop/variable_force/reference.rb#10 -RuboCop::Cop::VariableForce::Reference::VARIABLE_REFERENCE_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#58 -RuboCop::Cop::VariableForce::SCOPE_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#60 -RuboCop::Cop::VariableForce::SEND_TYPE = T.let(T.unsafe(nil), Symbol) - -# A Scope represents a context of local variable visibility. -# This is a place where local variables belong to. -# A scope instance holds a scope node and variable entries. -# -# source://rubocop//lib/rubocop/cop/variable_force/scope.rb#9 -class RuboCop::Cop::VariableForce::Scope - # @return [Scope] a new instance of Scope - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#22 - def initialize(node); end - - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#35 - def ==(other); end - - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#43 - def body_node; end - - # @yield [node] - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#61 - def each_node(&block); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#57 - def include?(target_node); end - - # Returns the value of attribute naked_top_level. - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 - def naked_top_level; end - - # Returns the value of attribute naked_top_level. - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 - def naked_top_level?; end - - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#39 - def name; end - - # Returns the value of attribute node. - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 - def node; end - - # Returns the value of attribute variables. - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 - def variables; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#100 - def ancestor_node?(target_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#90 - def belong_to_inner_scope?(target_node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#79 - def belong_to_outer_scope?(target_node); end - - # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#70 - def scan_node(node, &block); end -end - -# source://rubocop//lib/rubocop/cop/variable_force/scope.rb#10 -RuboCop::Cop::VariableForce::Scope::OUTER_SCOPE_CHILD_INDICES = T.let(T.unsafe(nil), Hash) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#57 -RuboCop::Cop::VariableForce::TWISTED_SCOPE_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#28 -RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#31 -RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#48 -RuboCop::Cop::VariableForce::VARIABLE_REFERENCE_TYPE = T.let(T.unsafe(nil), Symbol) - -# A Variable represents existence of a local variable. -# This holds a variable declaration node and some states of the variable. -# -# source://rubocop//lib/rubocop/cop/variable_force/variable.rb#8 -class RuboCop::Cop::VariableForce::Variable - # @return [Variable] a new instance of Variable - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#15 - def initialize(name, declaration_node, scope); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#105 - def argument?; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#31 - def assign(node); end - - # Returns the value of attribute assignments. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def assignments; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#113 - def block_argument?; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#85 - def capture_with_block!; end - - # Returns the value of attribute captured_by_block. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def captured_by_block; end - - # Returns the value of attribute captured_by_block. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def captured_by_block?; end - - # Returns the value of attribute declaration_node. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def declaration_node; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#121 - def explicit_block_local_variable?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#77 - def in_modifier_conditional?(assignment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#117 - def keyword_argument?; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#39 - def mark_last_as_reassigned!(assignment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#109 - def method_argument?; end - - # Returns the value of attribute name. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def name; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#51 - def reference!(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#46 - def referenced?; end - - # Returns the value of attribute references. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def references; end - - # Returns the value of attribute scope. - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#11 - def scope; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#101 - def should_be_unused?; end - - # This is a convenient way to check whether the variable is used - # in its entire variable lifetime. - # For more precise usage check, refer Assignment#used?. - # - # Once the variable is captured by a block, we have no idea - # when, where, and how many times the block would be invoked. - # This means we cannot track the usage of the variable. - # So we consider it's used to suppress false positive offenses. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#97 - def used?; end -end - -# source://rubocop//lib/rubocop/cop/variable_force/variable.rb#9 -RuboCop::Cop::VariableForce::Variable::VARIABLE_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#62 -class RuboCop::Cop::VariableForce::VariableReference < ::Struct - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force.rb#63 - def assignment?; end - - # Returns the value of attribute name - # - # @return [Object] the current value of name - def name; end - - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value - def name=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# A VariableTable manages the lifetime of all scopes and local variables -# in a program. -# This holds scopes as stack structure, provides a way to add local -# variables to current scope, and find local variables by considering -# variable visibility of the current scope. -# -# source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#11 -class RuboCop::Cop::VariableForce::VariableTable - # @return [VariableTable] a new instance of VariableTable - # - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#12 - def initialize(hook_receiver = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#113 - def accessible_variables; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#56 - def assign_to_variable(name, node); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#40 - def current_scope; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#44 - def current_scope_level; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#48 - def declare_variable(name, node); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#94 - def find_variable(name); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#16 - def invoke_hook(hook_name, *args); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#32 - def pop_scope; end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#24 - def push_scope(scope_node); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#68 - def reference_variable(name, node); end - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#20 - def scope_stack; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#109 - def variable_exist?(name); end - - private - - # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#122 - def mark_variable_as_captured_by_block_if_so(variable); end -end - -# @api private -# -# source://rubocop//lib/rubocop/cop/variable_force.rb#55 -RuboCop::Cop::VariableForce::ZERO_ARITY_SUPER_TYPE = T.let(T.unsafe(nil), Symbol) - -# Help methods for determining node visibility. -# -# source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#8 -module RuboCop::Cop::VisibilityHelp - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#57 - def visibility_block?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#62 - def visibility_inline_on_def?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#67 - def visibility_inline_on_method_name?(param0 = T.unsafe(nil), method_name:); end - - private - - # Navigate to find the last protected method - # - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#48 - def find_visibility_end(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#43 - def find_visibility_start(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#15 - def node_visibility(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#39 - def node_visibility_from_visibility_block(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#21 - def node_visibility_from_visibility_inline(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#28 - def node_visibility_from_visibility_inline_on_def(node); end - - # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#33 - def node_visibility_from_visibility_inline_on_method_name(node); end -end - -# source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#11 -RuboCop::Cop::VisibilityHelp::VISIBILITY_SCOPES = T.let(T.unsafe(nil), Set) - -# This class wraps the `Parser::Source::Comment` object that represents a -# cops it contains. -# -# source://rubocop//lib/rubocop/directive_comment.rb#7 -class RuboCop::DirectiveComment - # @return [DirectiveComment] a new instance of DirectiveComment - # - # source://rubocop//lib/rubocop/directive_comment.rb#46 - def initialize(comment, cop_registry = T.unsafe(nil)); end - - # Checks if all cops specified in this directive - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#115 - def all_cops?; end - - # Returns the value of attribute comment. - # - # source://rubocop//lib/rubocop/directive_comment.rb#44 - def comment; end - - # Returns array of specified in this directive cop names - # - # source://rubocop//lib/rubocop/directive_comment.rb#120 - def cop_names; end - - # Returns the value of attribute cop_registry. - # - # source://rubocop//lib/rubocop/directive_comment.rb#44 - def cop_registry; end - - # Returns the value of attribute cops. - # - # source://rubocop//lib/rubocop/directive_comment.rb#44 - def cops; end - - # Returns array of specified in this directive department names - # when all department disabled - # - # source://rubocop//lib/rubocop/directive_comment.rb#131 - def department_names; end - - # source://rubocop//lib/rubocop/directive_comment.rb#145 - def directive_count; end - - # Checks if this directive disables cops - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#95 - def disabled?; end - - # Checks if this directive disables all cops - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#110 - def disabled_all?; end - - # Checks if this directive enables cops - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#100 - def enabled?; end - - # Checks if this directive enables all cops - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#105 - def enabled_all?; end - - # Checks if directive departments include cop - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#136 - def in_directive_department?(cop); end - - # Returns line number for directive - # - # source://rubocop//lib/rubocop/directive_comment.rb#150 - def line_number; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#59 - def malformed?; end - - # Checks if this directive contains all the given cop names - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#77 - def match?(cop_names); end - - # Returns match captures to directive comment pattern - # - # source://rubocop//lib/rubocop/directive_comment.rb#90 - def match_captures; end - - # Checks if the directive comment is missing a cop name - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#67 - def missing_cop_name?; end - - # Returns the value of attribute mode. - # - # source://rubocop//lib/rubocop/directive_comment.rb#44 - def mode; end - - # Checks if cop department has already used in directive comment - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#141 - def overridden_by_department?(cop); end - - # source://rubocop//lib/rubocop/directive_comment.rb#81 - def range; end - - # Returns an array of cops for this directive comment, without resolving departments - # - # source://rubocop//lib/rubocop/directive_comment.rb#125 - def raw_cop_names; end - - # Checks if this directive relates to single line - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#72 - def single_line?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#54 - def start_with_marker?; end - - private - - # source://rubocop//lib/rubocop/directive_comment.rb#167 - def all_cop_names; end - - # source://rubocop//lib/rubocop/directive_comment.rb#171 - def cop_names_for_department(department); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/directive_comment.rb#163 - def department?(name); end - - # source://rubocop//lib/rubocop/directive_comment.rb#176 - def exclude_lint_department_cops(cops); end - - # source://rubocop//lib/rubocop/directive_comment.rb#156 - def parsed_cop_names; end - - class << self - # source://rubocop//lib/rubocop/directive_comment.rb#40 - def before_comment(line); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#21 -RuboCop::DirectiveComment::AVAILABLE_MODES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#19 -RuboCop::DirectiveComment::COPS_PATTERN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#17 -RuboCop::DirectiveComment::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#15 -RuboCop::DirectiveComment::COP_NAME_PATTERN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#29 -RuboCop::DirectiveComment::DIRECTIVE_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#27 -RuboCop::DirectiveComment::DIRECTIVE_HEADER_PATTERN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#23 -RuboCop::DirectiveComment::DIRECTIVE_MARKER_PATTERN = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#25 -RuboCop::DirectiveComment::DIRECTIVE_MARKER_REGEXP = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#9 -RuboCop::DirectiveComment::LINT_DEPARTMENT = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#11 -RuboCop::DirectiveComment::LINT_REDUNDANT_DIRECTIVE_COP = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#13 -RuboCop::DirectiveComment::LINT_SYNTAX_COP = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#36 -RuboCop::DirectiveComment::MALFORMED_DIRECTIVE_WITHOUT_COP_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/directive_comment.rb#34 -RuboCop::DirectiveComment::TRAILING_COMMENT_MARKER = T.let(T.unsafe(nil), String) - -# An Error exception is different from an Offense with severity 'error' -# When this exception is raised, it means that RuboCop is unable to perform -# a requested action (probably due to misconfiguration) and must stop -# immediately, rather than carrying on -# -# source://rubocop//lib/rubocop/error.rb#8 -class RuboCop::Error < ::StandardError; end - -# A wrapper to display errored location of analyzed file. -# -# source://rubocop//lib/rubocop/error.rb#13 -class RuboCop::ErrorWithAnalyzedFileLocation < ::RuboCop::Error - # @return [ErrorWithAnalyzedFileLocation] a new instance of ErrorWithAnalyzedFileLocation - # - # source://rubocop//lib/rubocop/error.rb#14 - def initialize(cause:, node:, cop:); end - - # Returns the value of attribute cause. - # - # source://rubocop//lib/rubocop/error.rb#21 - def cause; end - - # source://rubocop//lib/rubocop/error.rb#27 - def column; end - - # Returns the value of attribute cop. - # - # source://rubocop//lib/rubocop/error.rb#21 - def cop; end - - # source://rubocop//lib/rubocop/error.rb#23 - def line; end - - # source://rubocop//lib/rubocop/error.rb#31 - def message; end -end - -# Allows specified configuration options to have an exclude limit -# ie. a maximum value tracked that it can be used by `--auto-gen-config`. -# -# source://rubocop//lib/rubocop/cop/exclude_limit.rb#6 -module RuboCop::ExcludeLimit - # Sets up a configuration option to have an exclude limit tracked. - # The parameter name given is transformed into a method name (eg. `Max` - # becomes `self.max=` and `MinDigits` becomes `self.min_digits=`). - # - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#10 - def exclude_limit(parameter_name, method_name: T.unsafe(nil)); end - - private - - # source://rubocop//lib/rubocop/cop/exclude_limit.rb#22 - def transform(parameter_name); end -end - -# source://rubocop//lib/rubocop/ext/comment.rb#4 -module RuboCop::Ext; end - -# Extensions to `Parser::Source::Comment`. -# -# source://rubocop//lib/rubocop/ext/comment.rb#6 -module RuboCop::Ext::Comment - # source://rubocop//lib/rubocop/ext/comment.rb#7 - def source; end - - # source://rubocop//lib/rubocop/ext/comment.rb#11 - def source_range; end -end - -# Extensions to AST::ProcessedSource for our cached comment_config -# -# source://rubocop//lib/rubocop/ext/processed_source.rb#6 -module RuboCop::Ext::ProcessedSource - # source://rubocop//lib/rubocop/ext/processed_source.rb#9 - def comment_config; end - - # Returns the value of attribute config. - # - # source://rubocop//lib/rubocop/ext/processed_source.rb#7 - def config; end - - # Sets the attribute config - # - # @param value the value to set the attribute config to. - # - # source://rubocop//lib/rubocop/ext/processed_source.rb#7 - def config=(_arg0); end - - # source://rubocop//lib/rubocop/ext/processed_source.rb#13 - def disabled_line_ranges; end - - # Returns the value of attribute registry. - # - # source://rubocop//lib/rubocop/ext/processed_source.rb#7 - def registry; end - - # Sets the attribute registry - # - # @param value the value to set the attribute registry to. - # - # source://rubocop//lib/rubocop/ext/processed_source.rb#7 - def registry=(_arg0); end -end - -# Extensions to Parser::Source::Range -# -# source://rubocop//lib/rubocop/ext/range.rb#6 -module RuboCop::Ext::Range - # Adds `Range#single_line?` to parallel `Node#single_line?` - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/ext/range.rb#8 - def single_line?; end -end - -# Extensions to AST::RegexpNode for our cached parsed regexp info -# -# source://rubocop//lib/rubocop/ext/regexp_node.rb#6 -module RuboCop::Ext::RegexpNode - # source://rubocop//lib/rubocop/ext/regexp_node.rb#18 - def assign_properties(*_arg0); end - - # source://rubocop//lib/rubocop/ext/regexp_node.rb#31 - def each_capture(named: T.unsafe(nil)); end - - # Note: we extend Regexp nodes to provide `loc` and `expression` - # see `ext/regexp_parser`. - # - # @return [Regexp::Expression::Root, nil] - # - # source://rubocop//lib/rubocop/ext/regexp_node.rb#16 - def parsed_tree; end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/ext/regexp_node.rb#43 - def named_capturing?(exp, event, named); end - - # source://rubocop//lib/rubocop/ext/regexp_node.rb#50 - def with_interpolations_blanked; end -end - -# source://rubocop//lib/rubocop/ext/regexp_node.rb#7 -RuboCop::Ext::RegexpNode::ANY = T.let(T.unsafe(nil), Object) - -# Extensions for `regexp_parser` gem -# -# source://rubocop//lib/rubocop/ext/regexp_parser.rb#6 -module RuboCop::Ext::RegexpParser; end - -# source://rubocop//lib/rubocop/ext/regexp_parser.rb#20 -module RuboCop::Ext::RegexpParser::Expression; end - -# Add `expression` and `loc` to all `regexp_parser` nodes -# -# source://rubocop//lib/rubocop/ext/regexp_parser.rb#22 -module RuboCop::Ext::RegexpParser::Expression::Base - # Shortcut to `loc.expression` - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#26 - def expression; end - - # E.g. - # [a-z]{2,} - # ^^^^^^^^^ expression - # ^^^^ quantifier - # ^^^^^ body - # ^ begin - # ^ end - # - # Please open issue if you need other locations - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#44 - def loc; end - - # Returns the value of attribute origin. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#23 - def origin; end - - # Sets the attribute origin - # - # @param value the value to set the attribute origin to. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#23 - def origin=(_arg0); end - - private - - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#50 - def build_location; end -end - -# Provide `CharacterSet` with `begin` and `end` locations. -# -# source://rubocop//lib/rubocop/ext/regexp_parser.rb#62 -module RuboCop::Ext::RegexpParser::Expression::CharacterSet - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#63 - def build_location; end -end - -# Source map for RegexpParser nodes -# -# source://rubocop//lib/rubocop/ext/regexp_parser.rb#8 -class RuboCop::Ext::RegexpParser::Map < ::Parser::Source::Map - # @return [Map] a new instance of Map - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#11 - def initialize(expression, body:, quantifier: T.unsafe(nil), begin_l: T.unsafe(nil), end_l: T.unsafe(nil)); end - - # Returns the value of attribute begin. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#9 - def begin; end - - # Returns the value of attribute body. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#9 - def body; end - - # Returns the value of attribute end. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#9 - def end; end - - # Returns the value of attribute quantifier. - # - # source://rubocop//lib/rubocop/ext/regexp_parser.rb#9 - def quantifier; end -end - -# This class handles loading files (a.k.a. features in Ruby) specified -# by `--require` command line option and `require` directive in the config. -# -# Normally, the given string is directly passed to `require`. If a string -# beginning with `.` is given, it is assumed to be relative to the given -# directory. -# -# If a string containing `-` is given, it will be used as is, but if we -# cannot find the file to load, we will replace `-` with `/` and try it -# again as when Bundler loads gems. -# -# @api private -# -# source://rubocop//lib/rubocop/feature_loader.rb#16 -class RuboCop::FeatureLoader - # @api private - # @param config_directory_path [String] - # @param feature [String] - # @return [FeatureLoader] a new instance of FeatureLoader - # - # source://rubocop//lib/rubocop/feature_loader.rb#27 - def initialize(config_directory_path:, feature:); end - - # @api private - # - # source://rubocop//lib/rubocop/feature_loader.rb#32 - def load; end - - private - - # @api private - # @return [String] - # - # source://rubocop//lib/rubocop/feature_loader.rb#55 - def namespaced_feature; end - - # @api private - # @return [String] - # - # source://rubocop//lib/rubocop/feature_loader.rb#60 - def namespaced_target; end - - # @api private - # @param [String] - # @return [String] - # - # source://rubocop//lib/rubocop/feature_loader.rb#70 - def relative(feature); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/feature_loader.rb#75 - def relative?; end - - # @api private - # @param error [LoadError] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/feature_loader.rb#81 - def seems_cannot_load_such_file_error?(error); end - - # @api private - # @return [String] - # - # source://rubocop//lib/rubocop/feature_loader.rb#86 - def target; end - - class << self - # @api private - # @param config_directory_path [String] - # @param feature [String] - # - # source://rubocop//lib/rubocop/feature_loader.rb#20 - def load(config_directory_path:, feature:); end - end -end - -# Common methods for finding files. -# -# @api private -# -# source://rubocop//lib/rubocop/file_finder.rb#8 -module RuboCop::FileFinder - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#13 - def find_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#20 - def find_last_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#26 - def traverse_directories_upwards(start_dir, stop_dir = T.unsafe(nil)); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#36 - def traverse_files_upwards(filename, start_dir, stop_dir); end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#10 - def root_level; end - - # @api private - # - # source://rubocop//lib/rubocop/file_finder.rb#10 - def root_level=(_arg0); end - end -end - -# A wrapper around patterns array to perform optimized search. -# -# For projects with a large set of rubocop todo files, most items in `Exclude`/`Include` -# are exact file names. It is wasteful to linearly check the list of patterns over and over -# to check if the file is relevant to the cop. -# -# This class partitions an array of patterns into a set of exact match strings and the rest -# of the patterns. This way we can firstly do a cheap check in the set and then proceed via -# the costly patterns check, if needed. -# -# @api private -# -# source://rubocop//lib/rubocop/file_patterns.rb#14 -class RuboCop::FilePatterns - # @api private - # @return [FilePatterns] a new instance of FilePatterns - # - # source://rubocop//lib/rubocop/file_patterns.rb#21 - def initialize(patterns); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/file_patterns.rb#27 - def match?(path); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/file_patterns.rb#33 - def partition_patterns(patterns); end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/file_patterns.rb#17 - def from(patterns); end - end -end - -# The bootstrap module for formatter. -# -# source://rubocop//lib/rubocop/formatter.rb#5 -module RuboCop::Formatter; end - -# Does not show individual offenses in the console. -# -# source://rubocop//lib/rubocop/formatter/auto_gen_config_formatter.rb#6 -class RuboCop::Formatter::AutoGenConfigFormatter < ::RuboCop::Formatter::ProgressFormatter - # source://rubocop//lib/rubocop/formatter/auto_gen_config_formatter.rb#7 - def finished(inspected_files); end -end - -# Abstract base class for formatter, implements all public API methods. -# -# ## Creating Custom Formatter -# -# You can create a custom formatter by subclassing -# `RuboCop::Formatter::BaseFormatter` and overriding some methods -# or by implementing all the methods by duck typing. -# -# ## Using Custom Formatter in Command Line -# -# You can tell RuboCop to use your custom formatter with a combination of -# `--format` and `--require` option. -# For example, when you have defined `MyCustomFormatter` in -# `./path/to/my_custom_formatter.rb`, you would type this command: -# -# rubocop --require ./path/to/my_custom_formatter --format MyCustomFormatter -# -# Note: The path passed to `--require` is directly passed to -# `Kernel.require`. -# If your custom formatter file is not in `$LOAD_PATH`, -# you need to specify the path as relative path prefixed with `./` -# explicitly or absolute path. -# -# ## Method Invocation Order -# -# For example, when RuboCop inspects 2 files, -# the invocation order should be like this: -# -# * `#initialize` -# * `#started` -# * `#file_started` -# * `#file_finished` -# * `#file_started` -# * `#file_finished` -# * `#finished` -# -# source://rubocop//lib/rubocop/formatter/base_formatter.rb#41 -class RuboCop::Formatter::BaseFormatter - # @api public - # @param output [IO] `$stdout` or opened file - # @return [BaseFormatter] a new instance of BaseFormatter - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#63 - def initialize(output, options = T.unsafe(nil)); end - - # Invoked at the end of inspecting each files. - # - # @api public - # @param file [String] the file path - # @param offenses [Array(RuboCop::Cop::Offense)] all detected offenses for the file - # @return [void] - # @see RuboCop::Cop::Offense - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#104 - def file_finished(file, offenses); end - - # Invoked at the beginning of inspecting each files. - # - # @api public - # @param file [String] the file path - # @param options [Hash] file specific information, currently this is always empty. - # @return [void] - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#89 - def file_started(file, options); end - - # Invoked after all files are inspected or interrupted by user. - # - # @api public - # @param inspected_files [Array(String)] the inspected file paths. - # This would be same as `target_files` passed to `#started` - # unless RuboCop is interrupted by user. - # @return [void] - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#116 - def finished(inspected_files); end - - # @api public - # @return [Hash] - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#57 - def options; end - - # @api public - # @return [IO] the IO object passed to `#initialize` - # @see #initialize - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#50 - def output; end - - # Invoked once before any files are inspected. - # - # @api public - # @param target_files [Array(String)] all target file paths to be inspected - # @return [void] - # - # source://rubocop//lib/rubocop/formatter/base_formatter.rb#76 - def started(target_files); end -end - -# This formatter formats report data in clang style. -# The precise location of the problem is shown together with the -# relevant source code. -# -# source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#8 -class RuboCop::Formatter::ClangStyleFormatter < ::RuboCop::Formatter::SimpleTextFormatter - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#11 - def report_file(file, offenses); end - - private - - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#47 - def report_highlighted_area(highlighted_area); end - - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#37 - def report_line(location); end - - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#17 - def report_offense(file, offense); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#33 - def valid_line?(offense); end -end - -# source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#9 -RuboCop::Formatter::ClangStyleFormatter::ELLIPSES = T.let(T.unsafe(nil), String) - -# This mix-in module provides string coloring methods for terminals. -# It automatically disables coloring if coloring is disabled in the process -# globally or the formatter's output is not a terminal. -# -# source://rubocop//lib/rubocop/formatter/colorizable.rb#8 -module RuboCop::Formatter::Colorizable - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def black(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def blue(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#21 - def colorize(string, *args); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def cyan(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def green(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def magenta(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#9 - def rainbow; end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def red(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def white(string); end - - # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 - def yellow(string); end -end - -# This formatter displays a YAML configuration file where all cops that -# detected any offenses are configured to not detect the offense. -# -# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#7 -class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFormatter - include ::RuboCop::PathUtil - - # @return [DisabledConfigFormatter] a new instance of DisabledConfigFormatter - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#27 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#40 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#33 - def file_started(_file, options); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#48 - def finished(_inspected_files); end - - private - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#69 - def auto_gen_enforced_style?; end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#73 - def command; end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#165 - def cop_config_params(default_cfg, cfg); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#186 - def default_config(cop_name); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#230 - def excludes(offending_files, cop_name, parent); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#201 - def filtered_config(cfg); end - - # Returns true if the given arr include the given elm or if any of the - # given arr is a regexp that matches the given elm. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#278 - def include_or_match?(arr, elm); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#251 - def merge_mode_for_exclude?(cfg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#272 - def no_exclude_limit?; end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#102 - def output_cop(cop_name, offense_count); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#137 - def output_cop_comments(output_buffer, cfg, cop_name, offense_count); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#190 - def output_cop_config(output_buffer, cfg, cop_name); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#172 - def output_cop_param_comments(output_buffer, params, default_cfg); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#220 - def output_exclude_list(output_buffer, offending_files, cop_name); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#255 - def output_exclude_path(output_buffer, exclude_path, parent); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#209 - def output_offending_files(output_buffer, cfg, cop_name); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#96 - def output_offenses; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#268 - def safe_autocorrect?(config); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#116 - def set_max(cfg, cop_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#125 - def should_set_max?(cop_name); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#65 - def show_offense_counts?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#61 - def show_timestamp?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#157 - def supports_safe_autocorrect?(cop_class, default_cfg); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#161 - def supports_unsafe_autocorrect?(cop_class, default_cfg); end - - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#92 - def timestamp; end - - class << self - # Returns the value of attribute config_to_allow_offenses. - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#24 - def config_to_allow_offenses; end - - # Sets the attribute config_to_allow_offenses - # - # @param value the value to set the attribute config_to_allow_offenses to. - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#24 - def config_to_allow_offenses=(_arg0); end - - # Returns the value of attribute detected_styles. - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#24 - def detected_styles; end - - # Sets the attribute detected_styles - # - # @param value the value to set the attribute detected_styles to. - # - # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#24 - def detected_styles=(_arg0); end - end -end - -# source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#10 -RuboCop::Formatter::DisabledConfigFormatter::HEADING = T.let(T.unsafe(nil), String) - -# This formatter displays the report data in format that's -# easy to process in the Emacs text editor. -# The output is machine-parsable. -# -# source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#8 -class RuboCop::Formatter::EmacsStyleFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#9 - def file_finished(file, offenses); end - - private - - # source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#24 - def message(offense); end -end - -# This formatter displays just a list of the files with offenses in them, -# separated by newlines. The output is machine-parsable. -# -# Here's the format: -# -# /some/file -# /some/other/file -# -# source://rubocop//lib/rubocop/formatter/file_list_formatter.rb#12 -class RuboCop::Formatter::FileListFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/file_list_formatter.rb#13 - def file_finished(file, offenses); end -end - -# This is a collection of formatters. A FormatterSet can hold multiple -# formatter instances and provides transparent formatter API methods -# which invoke same method of each formatters. -# -# source://rubocop//lib/rubocop/formatter/formatter_set.rb#10 -class RuboCop::Formatter::FormatterSet < ::Array - # @return [FormatterSet] a new instance of FormatterSet - # - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#40 - def initialize(options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#56 - def add_formatter(formatter_type, output_path = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#68 - def close_output_files; end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#51 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#45 - def file_started(file, options); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#35 - def finished(*args); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#35 - def started(*args); end - - private - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#87 - def builtin_formatter_class(specified_key); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#105 - def custom_formatter_class(specified_class_name); end - - # source://rubocop//lib/rubocop/formatter/formatter_set.rb#76 - def formatter_class(formatter_type); end -end - -# source://rubocop//lib/rubocop/formatter/formatter_set.rb#11 -RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/formatter/formatter_set.rb#30 -RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTER_NAMES = T.let(T.unsafe(nil), Array) - -# source://rubocop//lib/rubocop/formatter/formatter_set.rb#32 -RuboCop::Formatter::FormatterSet::FORMATTER_APIS = T.let(T.unsafe(nil), Array) - -# This formatter displays a progress bar and shows details of offenses as -# soon as they are detected. -# This is inspired by the Fuubar formatter for RSpec by Jeff Kreeftmeijer. -# https://github.com/jeffkreeftmeijer/fuubar -# -# source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#11 -class RuboCop::Formatter::FuubarStyleFormatter < ::RuboCop::Formatter::ClangStyleFormatter - # @return [FuubarStyleFormatter] a new instance of FuubarStyleFormatter - # - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#14 - def initialize(*output); end - - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#51 - def count_stats(offenses); end - - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#40 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#71 - def progressbar_color; end - - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#20 - def started(target_files); end - - # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#61 - def with_color; end -end - -# source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#12 -RuboCop::Formatter::FuubarStyleFormatter::RESET_SEQUENCE = T.let(T.unsafe(nil), String) - -# This formatter formats report data as GitHub Workflow commands resulting -# in GitHub check annotations when run within GitHub Actions. -# -# source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#7 -class RuboCop::Formatter::GitHubActionsFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#14 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#18 - def finished(_inspected_files); end - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#10 - def started(_target_files); end - - private - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#29 - def github_escape(string); end - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#41 - def github_severity(offense); end - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#33 - def minimum_severity_to_fail; end - - # source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#45 - def report_offense(file, offense); end -end - -# source://rubocop//lib/rubocop/formatter/github_actions_formatter.rb#8 -RuboCop::Formatter::GitHubActionsFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) - -# This formatter saves the output as an html file. -# -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#9 -class RuboCop::Formatter::HTMLFormatter < ::RuboCop::Formatter::BaseFormatter - # @return [HTMLFormatter] a new instance of HTMLFormatter - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#29 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#39 - def file_finished(file, offenses); end - - # Returns the value of attribute files. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#27 - def files; end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#44 - def finished(inspected_files); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#50 - def render_html; end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#35 - def started(target_files); end - - # Returns the value of attribute summary. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#27 - def summary; end -end - -# This class provides helper methods used in the ERB CSS template. -# -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#137 -class RuboCop::Formatter::HTMLFormatter::CSSContext - # Make Kernel#binding public. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#148 - def binding; end -end - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#138 -RuboCop::Formatter::HTMLFormatter::CSSContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#12 -RuboCop::Formatter::HTMLFormatter::CSS_PATH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#14 -class RuboCop::Formatter::HTMLFormatter::Color < ::Struct - # Returns the value of attribute alpha - # - # @return [Object] the current value of alpha - def alpha; end - - # Sets the attribute alpha - # - # @param value [Object] the value to set the attribute alpha to. - # @return [Object] the newly set value - def alpha=(_); end - - # Returns the value of attribute blue - # - # @return [Object] the current value of blue - def blue; end - - # Sets the attribute blue - # - # @param value [Object] the value to set the attribute blue to. - # @return [Object] the newly set value - def blue=(_); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#19 - def fade_out(amount); end - - # Returns the value of attribute green - # - # @return [Object] the current value of green - def green; end - - # Sets the attribute green - # - # @param value [Object] the value to set the attribute green to. - # @return [Object] the newly set value - def green=(_); end - - # Returns the value of attribute red - # - # @return [Object] the current value of red - def red; end - - # Sets the attribute red - # - # @param value [Object] the value to set the attribute red to. - # @return [Object] the newly set value - def red=(_); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#15 - def to_s; end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#10 -RuboCop::Formatter::HTMLFormatter::ELLIPSES = T.let(T.unsafe(nil), String) - -# This class provides helper methods used in the ERB template. -# -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#63 -class RuboCop::Formatter::HTMLFormatter::ERBContext - include ::RuboCop::PathUtil - include ::RuboCop::Formatter::TextUtil - - # @return [ERBContext] a new instance of ERBContext - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#71 - def initialize(files, summary); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#118 - def base64_encoded_logo_image; end - - # Make Kernel#binding public. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#78 - def binding; end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#83 - def decorated_message(offense); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#114 - def escape(string); end - - # Returns the value of attribute files. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#69 - def files; end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#94 - def highlight_source_tag(offense); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#87 - def highlighted_source_line(offense); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#110 - def possible_ellipses(location); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#126 - def render_css; end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#105 - def source_after_highlight(offense); end - - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#100 - def source_before_highlight(offense); end - - # Returns the value of attribute summary. - # - # source://rubocop//lib/rubocop/formatter/html_formatter.rb#69 - def summary; end -end - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#67 -RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#25 -class RuboCop::Formatter::HTMLFormatter::FileOffenses < ::Struct - # Returns the value of attribute offenses - # - # @return [Object] the current value of offenses - def offenses; end - - # Sets the attribute offenses - # - # @param value [Object] the value to set the attribute offenses to. - # @return [Object] the newly set value - def offenses=(_); end - - # Returns the value of attribute path - # - # @return [Object] the current value of path - def path; end - - # Sets the attribute path - # - # @param value [Object] the value to set the attribute path to. - # @return [Object] the newly set value - def path=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#24 -class RuboCop::Formatter::HTMLFormatter::Summary < ::Struct - # Returns the value of attribute inspected_files - # - # @return [Object] the current value of inspected_files - def inspected_files; end - - # Sets the attribute inspected_files - # - # @param value [Object] the value to set the attribute inspected_files to. - # @return [Object] the newly set value - def inspected_files=(_); end - - # Returns the value of attribute offense_count - # - # @return [Object] the current value of offense_count - def offense_count; end - - # Sets the attribute offense_count - # - # @param value [Object] the value to set the attribute offense_count to. - # @return [Object] the newly set value - def offense_count=(_); end - - # Returns the value of attribute target_files - # - # @return [Object] the current value of target_files - def target_files; end - - # Sets the attribute target_files - # - # @param value [Object] the value to set the attribute target_files to. - # @return [Object] the newly set value - def target_files=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# source://rubocop//lib/rubocop/formatter/html_formatter.rb#11 -RuboCop::Formatter::HTMLFormatter::TEMPLATE_PATH = T.let(T.unsafe(nil), String) - -# This formatter formats the report data in JSON format. -# -# source://rubocop//lib/rubocop/formatter/json_formatter.rb#8 -class RuboCop::Formatter::JSONFormatter < ::RuboCop::Formatter::BaseFormatter - include ::RuboCop::PathUtil - - # @return [JSONFormatter] a new instance of JSONFormatter - # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#13 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#22 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#27 - def finished(inspected_files); end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#42 - def hash_for_file(file, offenses); end - - # TODO: Consider better solution for Offense#real_column. - # The minimum value of `start_column: real_column` is 1. - # So, the minimum value of `last_column` should be 1. - # And non-zero value of `last_column` should be used as is. - # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#64 - def hash_for_location(offense); end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#49 - def hash_for_offense(offense); end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#32 - def metadata_hash; end - - # Returns the value of attribute output_hash. - # - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#11 - def output_hash; end - - # source://rubocop//lib/rubocop/formatter/json_formatter.rb#18 - def started(target_files); end -end - -# This formatter formats the report data in JUnit format. -# -# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#15 -class RuboCop::Formatter::JUnitFormatter < ::RuboCop::Formatter::BaseFormatter - # @return [JUnitFormatter] a new instance of JUnitFormatter - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#24 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#32 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#51 - def finished(_inspected_files); end - - private - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#106 - def add_failure_to(testcase, offenses, cop_name); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#85 - def add_testcase_element_to_testsuite_element(file, target_offenses, cop); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#94 - def classname_attribute_value(file); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#81 - def offenses_for_cop(all_offenses, cop); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#77 - def relevant_for_output?(options, target_offenses); end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#101 - def reset_count; end - - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#118 - def xml_escape(string); end -end - -# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#16 -RuboCop::Formatter::JUnitFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#132 -class RuboCop::Formatter::JUnitFormatter::FailureElement - # @return [FailureElement] a new instance of FailureElement - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#135 - def initialize(type:, message:, text:); end - - # Returns the value of attribute message. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133 - def message; end - - # Returns the value of attribute text. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133 - def text; end - - # Returns the value of attribute type. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#133 - def type; end -end - -# source://rubocop//lib/rubocop/formatter/junit_formatter.rb#122 -class RuboCop::Formatter::JUnitFormatter::TestCaseElement - # @return [TestCaseElement] a new instance of TestCaseElement - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#125 - def initialize(classname:, name:); end - - # Returns the value of attribute classname. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123 - def classname; end - - # Returns the value of attribute failures. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123 - def failures; end - - # Returns the value of attribute name. - # - # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#123 - def name; end -end - -# This formatter displays the report data in markdown -# -# source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#6 -class RuboCop::Formatter::MarkdownFormatter < ::RuboCop::Formatter::BaseFormatter - include ::RuboCop::Formatter::TextUtil - include ::RuboCop::PathUtil - - # @return [MarkdownFormatter] a new instance of MarkdownFormatter - # - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#11 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#21 - def file_finished(file, offenses); end - - # Returns the value of attribute files. - # - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#9 - def files; end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#26 - def finished(inspected_files); end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#17 - def started(target_files); end - - # Returns the value of attribute summary. - # - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#9 - def summary; end - - private - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#73 - def possible_ellipses(location); end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#33 - def render_markdown; end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#67 - def write_code(offense); end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#61 - def write_context(offense); end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#42 - def write_file_messages; end - - # source://rubocop//lib/rubocop/formatter/markdown_formatter.rb#54 - def write_heading(file); end -end - -# This formatter displays the list of offended cops with a count of how -# many offenses of their kind were found. Ordered by desc offense count -# -# Here's the format: -# -# 26 LineLength -# 3 OneLineConditional -# -- -# 29 Total in 5 files -# -# source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#16 -class RuboCop::Formatter::OffenseCountFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#81 - def cop_information(cop_name); end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#42 - def file_finished(_file, offenses); end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#51 - def finished(_inspected_files); end - - # Returns the value of attribute offense_counts. - # - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#17 - def offense_counts; end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#73 - def ordered_offense_counts(offense_counts); end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#56 - def report_summary(offense_counts, offending_files_count); end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#19 - def started(target_files); end - - # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#77 - def total_offense_count(offense_counts); end -end - -# This formatter prints a PACDOT per every file to be analyzed. -# Pacman will "eat" one PACDOT per file when no offense is detected. -# Otherwise it will print a Ghost. -# This is inspired by the Pacman formatter for RSpec by Carlos Rojas. -# https://github.com/go-labs/rspec_pacman_formatter -# -# source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#10 -class RuboCop::Formatter::PacmanFormatter < ::RuboCop::Formatter::ClangStyleFormatter - include ::RuboCop::Formatter::TextUtil - - # @return [PacmanFormatter] a new instance of PacmanFormatter - # - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#19 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#50 - def cols; end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#37 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#33 - def file_started(_file, _options); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#43 - def next_step(offenses); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#64 - def pacdots(number); end - - # Returns the value of attribute progress_line. - # - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#12 - def progress_line; end - - # Sets the attribute progress_line - # - # @param value the value to set the attribute progress_line to. - # - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#12 - def progress_line=(_arg0); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#26 - def started(target_files); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#68 - def step(character); end - - # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#57 - def update_progress_line; end -end - -# source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#14 -RuboCop::Formatter::PacmanFormatter::FALLBACK_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) - -# source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#15 -RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#17 -RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::NullPresenter) - -# source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#16 -RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::NullPresenter) - -# This formatter display dots for files with no offenses and -# letters for files with problems in the them. In the end it -# appends the regular report data in the clang style format. -# -# source://rubocop//lib/rubocop/formatter/progress_formatter.rb#8 -class RuboCop::Formatter::ProgressFormatter < ::RuboCop::Formatter::ClangStyleFormatter - include ::RuboCop::Formatter::TextUtil - - # @return [ProgressFormatter] a new instance of ProgressFormatter - # - # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#13 - def initialize(output, options = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#24 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#33 - def finished(inspected_files); end - - # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#50 - def report_file_as_mark(offenses); end - - # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#18 - def started(target_files); end -end - -# source://rubocop//lib/rubocop/formatter/progress_formatter.rb#11 -RuboCop::Formatter::ProgressFormatter::DOT = T.let(T.unsafe(nil), String) - -# If no offenses are found, no output is displayed. -# Otherwise, SimpleTextFormatter's output is displayed. -# -# source://rubocop//lib/rubocop/formatter/quiet_formatter.rb#7 -class RuboCop::Formatter::QuietFormatter < ::RuboCop::Formatter::SimpleTextFormatter - # source://rubocop//lib/rubocop/formatter/quiet_formatter.rb#8 - def report_summary(file_count, offense_count, correction_count, correctable_count); end -end - -# A basic formatter that displays only files with offenses. -# Offenses are displayed at compact form - just the -# location of the problem and the associated message. -# -# source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#10 -class RuboCop::Formatter::SimpleTextFormatter < ::RuboCop::Formatter::BaseFormatter - include ::RuboCop::Formatter::Colorizable - include ::RuboCop::PathUtil - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#29 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#36 - def finished(inspected_files); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#43 - def report_file(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#57 - def report_summary(file_count, offense_count, correction_count, correctable_count); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#23 - def started(_target_files); end - - private - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#85 - def annotate_message(msg); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#80 - def colored_severity_code(offense); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#73 - def count_stats(offenses); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#89 - def message(offense); end -end - -# source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#14 -RuboCop::Formatter::SimpleTextFormatter::COLOR_FOR_SEVERITY = T.let(T.unsafe(nil), Hash) - -# A helper class for building the report summary text. -# -# source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#105 -class RuboCop::Formatter::SimpleTextFormatter::Report - include ::RuboCop::Formatter::Colorizable - include ::RuboCop::Formatter::TextUtil - - # @return [Report] a new instance of Report - # - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#110 - def initialize(file_count, offense_count, correction_count, correctable_count, rainbow, safe_autocorrect: T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#123 - def summary; end - - private - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#160 - def correctable; end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#153 - def corrections; end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#142 - def files; end - - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#146 - def offenses; end - - # Returns the value of attribute rainbow. - # - # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#140 - def rainbow; end -end - -# This formatter formats report data using the Test Anything Protocol. -# TAP allows for to communicate tests results in a language agnostics way. -# -# source://rubocop//lib/rubocop/formatter/tap_formatter.rb#7 -class RuboCop::Formatter::TapFormatter < ::RuboCop::Formatter::ClangStyleFormatter - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#14 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#8 - def started(target_files); end - - private - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#62 - def annotate_message(msg); end - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#66 - def message(offense); end - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#39 - def report_highlighted_area(highlighted_area); end - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#29 - def report_line(location); end - - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#46 - def report_offense(file, offense); end -end - -# Common logic for UI texts. -# -# source://rubocop//lib/rubocop/formatter/text_util.rb#6 -module RuboCop::Formatter::TextUtil - private - - # source://rubocop//lib/rubocop/formatter/text_util.rb#9 - def pluralize(number, thing, options = T.unsafe(nil)); end - - class << self - # source://rubocop//lib/rubocop/formatter/text_util.rb#9 - def pluralize(number, thing, options = T.unsafe(nil)); end - end -end - -# This formatter displays the list of offensive files, sorted by number of -# offenses with the worst offenders first. -# -# Here's the format: -# -# 26 this/file/is/really/bad.rb -# 3 just/ok.rb -# -- -# 29 Total in 2 files -# -# source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#16 -class RuboCop::Formatter::WorstOffendersFormatter < ::RuboCop::Formatter::BaseFormatter - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#24 - def file_finished(file, offenses); end - - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#31 - def finished(_inspected_files); end - - # Returns the value of attribute offense_counts. - # - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#17 - def offense_counts; end - - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#55 - def ordered_offense_counts(offense_counts); end - - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#36 - def report_summary(offense_counts); end - - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#19 - def started(target_files); end - - # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#59 - def total_offense_count(offense_counts); end -end - -# source://rubocop//lib/rubocop/options.rb#8 -class RuboCop::IncorrectCopNameError < ::StandardError; end - -# The RuboCop's built-in LSP module. -# -# source://rubocop//lib/rubocop/lsp.rb#5 -module RuboCop::LSP - private - - # Disable LSP. - # - # @return [void] - # - # source://rubocop//lib/rubocop/lsp.rb#25 - def disable(&block); end - - # Enable LSP. - # - # @return [void] - # - # source://rubocop//lib/rubocop/lsp.rb#18 - def enable; end - - # Returns true when LSP is enabled, false when disabled. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/lsp.rb#11 - def enabled?; end - - class << self - # Disable LSP. - # - # @return [void] - # - # source://rubocop//lib/rubocop/lsp.rb#25 - def disable(&block); end - - # Enable LSP. - # - # @return [void] - # - # source://rubocop//lib/rubocop/lsp.rb#18 - def enable; end - - # Returns true when LSP is enabled, false when disabled. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/lsp.rb#11 - def enabled?; end - end -end - -# Encapsulation of a lockfile for use when checking for gems. -# Does not actually resolve gems, just parses the lockfile. -# -# @api private -# -# source://rubocop//lib/rubocop/lockfile.rb#15 -class RuboCop::Lockfile - # @api private - # @param lockfile_path [String, Pathname, nil] - # @return [Lockfile] a new instance of Lockfile - # - # source://rubocop//lib/rubocop/lockfile.rb#17 - def initialize(lockfile_path = T.unsafe(nil)); end - - # Gems that the bundle directly depends on. - # - # @api private - # @return [Array, nil] - # - # source://rubocop//lib/rubocop/lockfile.rb#29 - def dependencies; end - - # Returns the locked versions of gems from this lockfile. - # - # @api private - # @param include_transitive_dependencies: [Boolean] When false, only direct dependencies - # are returned, i.e. those listed explicitly in the `Gemfile`. - # - # source://rubocop//lib/rubocop/lockfile.rb#49 - def gem_versions(include_transitive_dependencies: T.unsafe(nil)); end - - # All activated gems, including transitive dependencies. - # - # @api private - # @return [Array, nil] - # - # source://rubocop//lib/rubocop/lockfile.rb#37 - def gems; end - - # Whether this lockfile includes the named gem, directly or indirectly. - # - # @api private - # @param name [String] - # @return [Boolean] - # - # source://rubocop//lib/rubocop/lockfile.rb#65 - def includes_gem?(name); end - - private - - # @api private - # @return [Bundler::LockfileParser, nil] - # - # source://rubocop//lib/rubocop/lockfile.rb#72 - def parser; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/lockfile.rb#85 - def use_bundler_lock_parser?; end -end - -# Parse different formats of magic comments. -# -# @abstract parent of three different magic comment handlers -# -# source://rubocop//lib/rubocop/magic_comment.rb#7 -class RuboCop::MagicComment - # @return [MagicComment] a new instance of MagicComment - # - # source://rubocop//lib/rubocop/magic_comment.rb#32 - def initialize(comment); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#36 - def any?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#104 - def encoding_specified?; end - - # Expose the `frozen_string_literal` value coerced to a boolean if possible. - # - # @return [Boolean] if value is `true` or `false` in any case - # @return [nil] if frozen_string_literal comment isn't found - # @return [String] if comment is found but isn't true or false - # - # source://rubocop//lib/rubocop/magic_comment.rb#86 - def frozen_string_literal; end - - # Does the magic comment enable the frozen string literal feature. - # - # Test whether the frozen string literal value is `true`. Cannot - # just return `frozen_string_literal` since an invalid magic comment - # `'yes'` does not actually enable the feature - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#55 - def frozen_string_literal?; end - - # Was a magic comment for the frozen string literal found? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#70 - def frozen_string_literal_specified?; end - - # Expose the `shareable_constant_value` value coerced to a boolean if possible. - # - # @return [String] for shareable_constant_value config - # - # source://rubocop//lib/rubocop/magic_comment.rb#100 - def shareable_constant_value; end - - # Was a shareable_constant_value specified? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#77 - def shareable_constant_value_specified?; end - - # source://rubocop//lib/rubocop/magic_comment.rb#115 - def typed; end - - # Was the Sorbet `typed` sigil specified? - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#111 - def typed_specified?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#43 - def valid?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#59 - def valid_literal_value?; end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#63 - def valid_shareable_constant_value?; end - - private - - # Match the entire comment string with a pattern and take the first capture. - # - # @param pattern [Regexp] - # @return [String] if pattern matched - # @return [nil] otherwise - # - # source://rubocop//lib/rubocop/magic_comment.rb#131 - def extract(pattern); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/magic_comment.rb#121 - def specified?(value); end - - class << self - # Detect magic comment format and pass it to the appropriate wrapper. - # - # @param comment [String] - # @return [RuboCop::MagicComment] - # - # source://rubocop//lib/rubocop/magic_comment.rb#23 - def parse(comment); end - end -end - -# Parent to Vim and Emacs magic comment handling. -# -# @abstract -# -# source://rubocop//lib/rubocop/magic_comment.rb#138 -class RuboCop::MagicComment::EditorComment < ::RuboCop::MagicComment - # source://rubocop//lib/rubocop/magic_comment.rb#139 - def encoding; end - - # Rewrite the comment without a given token type - # - # source://rubocop//lib/rubocop/magic_comment.rb#144 - def without(type); end - - private - - # Find a token starting with the provided keyword and extract its value. - # - # @param keyword [String] - # @return [String] extracted value if it is found - # @return [nil] otherwise - # - # source://rubocop//lib/rubocop/magic_comment.rb#159 - def match(keyword); end - - # Individual tokens composing an editor specific comment string. - # - # @return [Array] - # - # source://rubocop//lib/rubocop/magic_comment.rb#174 - def tokens; end -end - -# Wrapper for Emacs style magic comments. -# -# @example Emacs style comment -# comment = RuboCop::MagicComment.parse( -# '# -*- encoding: ASCII-8BIT -*-' -# ) -# -# comment.encoding # => 'ascii-8bit' -# @see https://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html -# @see https://github.com/ruby/ruby/blob/3f306dc/parse.y#L6873-L6892 Emacs handling in parse.y -# -# source://rubocop//lib/rubocop/magic_comment.rb#190 -class RuboCop::MagicComment::EmacsComment < ::RuboCop::MagicComment::EditorComment - # source://rubocop//lib/rubocop/magic_comment.rb#196 - def new_frozen_string_literal(value); end - - private - - # source://rubocop//lib/rubocop/magic_comment.rb#202 - def extract_frozen_string_literal; end - - # source://rubocop//lib/rubocop/magic_comment.rb#206 - def extract_shareable_constant_value; end - - # Emacs comments cannot specify Sorbet typechecking behavior. - # - # source://rubocop//lib/rubocop/magic_comment.rb#211 - def extract_typed; end -end - -# source://rubocop//lib/rubocop/magic_comment.rb#192 -RuboCop::MagicComment::EmacsComment::FORMAT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/magic_comment.rb#194 -RuboCop::MagicComment::EmacsComment::OPERATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/magic_comment.rb#191 -RuboCop::MagicComment::EmacsComment::REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/magic_comment.rb#193 -RuboCop::MagicComment::EmacsComment::SEPARATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/magic_comment.rb#11 -RuboCop::MagicComment::KEYWORDS = T.let(T.unsafe(nil), Hash) - -# Wrapper for regular magic comments not bound to an editor. -# -# Simple comments can only specify one setting per comment. -# -# @example frozen string literal comments -# comment1 = RuboCop::MagicComment.parse('# frozen_string_literal: true') -# comment1.frozen_string_literal # => true -# comment1.encoding # => nil -# @example encoding comments -# comment2 = RuboCop::MagicComment.parse('# encoding: utf-8') -# comment2.frozen_string_literal # => nil -# comment2.encoding # => 'utf-8' -# -# source://rubocop//lib/rubocop/magic_comment.rb#265 -class RuboCop::MagicComment::SimpleComment < ::RuboCop::MagicComment - # Match `encoding` or `coding` - # - # source://rubocop//lib/rubocop/magic_comment.rb#269 - def encoding; end - - # source://rubocop//lib/rubocop/magic_comment.rb#282 - def new_frozen_string_literal(value); end - - # Rewrite the comment without a given token type - # - # source://rubocop//lib/rubocop/magic_comment.rb#274 - def without(type); end - - private - - # Extract `frozen_string_literal`. - # - # The `frozen_string_literal` magic comment only works if it - # is the only text in the comment. - # - # Case-insensitive and dashes/underscores are acceptable. - # - # @see https://github.com/ruby/ruby/blob/78b95b49f8/parse.y#L7134-L7138 - # - # source://rubocop//lib/rubocop/magic_comment.rb#295 - def extract_frozen_string_literal; end - - # source://rubocop//lib/rubocop/magic_comment.rb#299 - def extract_shareable_constant_value; end - - # source://rubocop//lib/rubocop/magic_comment.rb#303 - def extract_typed; end -end - -# source://rubocop//lib/rubocop/magic_comment.rb#266 -RuboCop::MagicComment::SimpleComment::FSTRING_LITERAL_COMMENT = T.let(T.unsafe(nil), String) - -# IRB's pattern for matching magic comment tokens. -# -# @see https://github.com/ruby/ruby/blob/b4a55c1/lib/irb/magic-file.rb#L5 -# -# source://rubocop//lib/rubocop/magic_comment.rb#10 -RuboCop::MagicComment::TOKEN = T.let(T.unsafe(nil), String) - -# Wrapper for Vim style magic comments. -# -# @example Vim style comment -# comment = RuboCop::MagicComment.parse( -# '# vim: filetype=ruby, fileencoding=ascii-8bit' -# ) -# -# comment.encoding # => 'ascii-8bit' -# -# source://rubocop//lib/rubocop/magic_comment.rb#222 -class RuboCop::MagicComment::VimComment < ::RuboCop::MagicComment::EditorComment - # For some reason the fileencoding keyword only works if there - # is at least one other token included in the string. For example - # - # # works - # # vim: foo=bar, fileencoding=ascii-8bit - # - # # does nothing - # # vim: foo=bar, fileencoding=ascii-8bit - # - # source://rubocop//lib/rubocop/magic_comment.rb#238 - def encoding; end - - # Vim comments cannot specify Sorbet typechecking behavior. - # - # source://rubocop//lib/rubocop/magic_comment.rb#249 - def extract_typed; end - - # Vim comments cannot specify frozen string literal behavior. - # - # source://rubocop//lib/rubocop/magic_comment.rb#243 - def frozen_string_literal; end - - # Vim comments cannot specify shareable constant values behavior. - # - # source://rubocop//lib/rubocop/magic_comment.rb#246 - def shareable_constant_value; end -end - -# source://rubocop//lib/rubocop/magic_comment.rb#224 -RuboCop::MagicComment::VimComment::FORMAT = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/magic_comment.rb#227 -RuboCop::MagicComment::VimComment::KEYWORDS = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/magic_comment.rb#226 -RuboCop::MagicComment::VimComment::OPERATOR = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/magic_comment.rb#223 -RuboCop::MagicComment::VimComment::REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/magic_comment.rb#225 -RuboCop::MagicComment::VimComment::SEPARATOR = T.let(T.unsafe(nil), String) - -# Common functionality for finding names that are similar to a given name. -# -# @api private -# -# source://rubocop//lib/rubocop/name_similarity.rb#6 -module RuboCop::NameSimilarity - private - - # @api private - # - # source://rubocop//lib/rubocop/name_similarity.rb#9 - def find_similar_name(target_name, names); end - - # @api private - # - # source://rubocop//lib/rubocop/name_similarity.rb#15 - def find_similar_names(target_name, names); end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/name_similarity.rb#9 - def find_similar_name(target_name, names); end - - # @api private - # - # source://rubocop//lib/rubocop/name_similarity.rb#15 - def find_similar_names(target_name, names); end - end -end - -# source://rubocop//lib/rubocop/ast_aliases.rb#5 -RuboCop::NodePattern = RuboCop::AST::NodePattern - -# source://rubocop//lib/rubocop/options.rb#10 -class RuboCop::OptionArgumentError < ::StandardError; end - -# This class handles command line options. -# -# @api private -# -# source://rubocop//lib/rubocop/options.rb#14 -class RuboCop::Options - # @api private - # @return [Options] a new instance of Options - # - # source://rubocop//lib/rubocop/options.rb#22 - def initialize; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#27 - def parse(command_line_args); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#229 - def add_additional_modes(opts); end - - # the autocorrect command-line arguments map to the autocorrect @options values like so: - # :fix_layout :autocorrect :safe_autocorrect :autocorrect_all - # -x, --fix-layout true true - - - # -a, --auto-correct - true true - - # --safe-auto-correct - true true - - # -A, --auto-correct-all - true - true - # - # @api private - # - # source://rubocop//lib/rubocop/options.rb#140 - def add_autocorrection_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#205 - def add_cache_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#73 - def add_check_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#163 - def add_config_generation_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#181 - def add_cop_selection_csv_option(option, opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#241 - def add_general_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#212 - def add_lsp_option(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#105 - def add_output_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#254 - def add_profile_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#218 - def add_server_options(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#196 - def add_severity_option(opts); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#53 - def define_options; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#264 - def handle_deprecated_option(old_option, new_option); end - - # Finds the option in `args` starting with -- and converts it to a symbol, - # e.g. [..., '--autocorrect', ...] to :autocorrect. - # - # @api private - # - # source://rubocop//lib/rubocop/options.rb#298 - def long_opt_symbol(args); end - - # Sets a value in the @options hash, based on the given long option and its - # value, in addition to calling the block if a block is given. - # - # @api private - # - # source://rubocop//lib/rubocop/options.rb#287 - def option(opts, *args); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#303 - def plugin_feature(file); end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#269 - def rainbow; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#309 - def require_feature(file); end - - # Creates a section of options in order to separate them visually when - # using `--help`. - # - # @api private - # - # source://rubocop//lib/rubocop/options.rb#279 - def section(opts, heading, &_block); end -end - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#20 -RuboCop::Options::DEFAULT_MAXIMUM_EXCLUSION_ITEMS = T.let(T.unsafe(nil), Integer) - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#19 -RuboCop::Options::EXITING_OPTIONS = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#15 -RuboCop::Options::E_STDIN_NO_PATH = T.let(T.unsafe(nil), String) - -# This module contains help texts for command line options. -# -# @api private -# -# source://rubocop//lib/rubocop/options.rb#512 -module RuboCop::OptionsHelp; end - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#514 -RuboCop::OptionsHelp::FORMATTER_OPTION_LIST = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#513 -RuboCop::OptionsHelp::MAX_EXCL = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/options.rb#516 -RuboCop::OptionsHelp::TEXT = T.let(T.unsafe(nil), Hash) - -# Validates option arguments and the options' compatibility with each other. -# -# @api private -# -# source://rubocop//lib/rubocop/options.rb#327 -class RuboCop::OptionsValidator - # @api private - # @return [OptionsValidator] a new instance of OptionsValidator - # - # source://rubocop//lib/rubocop/options.rb#365 - def initialize(options); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/options.rb#486 - def boolean_or_empty_cache?; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#456 - def disable_parallel_when_invalid_option_combo; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/options.rb#482 - def except_syntax?; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#490 - def incompatible_options; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#469 - def invalid_arguments_for_parallel; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/options.rb#477 - def only_includes_redundant_disable?; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#397 - def validate_auto_gen_config; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#442 - def validate_autocorrect; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#502 - def validate_cache_enabled_for_cache_root; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#374 - def validate_compatibility; end - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#369 - def validate_cop_options; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#418 - def validate_display_only_correctable_and_autocorrect; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#410 - def validate_display_only_failed; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#427 - def validate_display_only_failed_and_display_only_correctable; end - - # @api private - # @raise [OptionParser::MissingArgument] - # - # source://rubocop//lib/rubocop/options.rb#494 - def validate_exclude_limit_option; end - - # @api private - # @raise [OptionArgumentError] - # - # source://rubocop//lib/rubocop/options.rb#436 - def validate_lsp_and_editor_mode; end - - class << self - # Cop name validation must be done later than option parsing, so it's not - # called from within Options. - # - # @api private - # - # source://rubocop//lib/rubocop/options.rb#334 - def validate_cop_list(names); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/options.rb#351 - def format_message_from(name, cop_names); end - end -end - -# Common methods and behaviors for dealing with paths. -# -# source://rubocop//lib/rubocop/path_util.rb#5 -module RuboCop::PathUtil - private - - # Returns true for an absolute Unix or Windows path. - # - # source://rubocop//lib/rubocop/path_util.rb#83 - def absolute?(path); end - - # Returns true for a glob - # - # source://rubocop//lib/rubocop/path_util.rb#88 - def glob?(path); end - - # source://rubocop//lib/rubocop/path_util.rb#118 - def hidden_dir?(path); end - - # source://rubocop//lib/rubocop/path_util.rb#101 - def hidden_file?(path); end - - # source://rubocop//lib/rubocop/path_util.rb#92 - def hidden_file_in_not_hidden_dir?(pattern, path); end - - # source://rubocop//lib/rubocop/path_util.rb#55 - def match_path?(pattern, path); end - - # Loose check to reduce memory allocations - # - # source://rubocop//lib/rubocop/path_util.rb#108 - def maybe_hidden_file?(path); end - - # source://rubocop//lib/rubocop/path_util.rb#13 - def relative_path(path, base_dir = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/path_util.rb#31 - def remote_file?(uri); end - - # source://rubocop//lib/rubocop/path_util.rb#38 - def smart_path(path); end - - class << self - # Returns true for an absolute Unix or Windows path. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#83 - def absolute?(path); end - - # Returns true for a glob - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#88 - def glob?(path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#118 - def hidden_dir?(path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#101 - def hidden_file?(path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#92 - def hidden_file_in_not_hidden_dir?(pattern, path); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#55 - def match_path?(pattern, path); end - - # Loose check to reduce memory allocations - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#108 - def maybe_hidden_file?(path); end - - # source://rubocop//lib/rubocop/path_util.rb#13 - def relative_path(path, base_dir = T.unsafe(nil)); end - - # Returns the value of attribute relative_paths_cache. - # - # source://rubocop//lib/rubocop/path_util.rb#7 - def relative_paths_cache; end - - # Sets the attribute relative_paths_cache - # - # @param value the value to set the attribute relative_paths_cache to. - # - # source://rubocop//lib/rubocop/path_util.rb#7 - def relative_paths_cache=(_arg0); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/path_util.rb#31 - def remote_file?(uri); end - - # source://rubocop//lib/rubocop/path_util.rb#38 - def smart_path(path); end - end -end - -# source://rubocop//lib/rubocop/path_util.rb#105 -RuboCop::PathUtil::HIDDEN_FILE_PATTERN = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/path_util.rb#35 -RuboCop::PathUtil::SMART_PATH_CACHE = T.let(T.unsafe(nil), Hash) - -# This module provides information on the platform that RuboCop is being run -# on. -# -# source://rubocop//lib/rubocop/platform.rb#6 -module RuboCop::Platform - class << self - # @return [Boolean] - # - # source://rubocop//lib/rubocop/platform.rb#7 - def windows?; end - end -end - -# Provides a plugin for RuboCop extensions that conform to lint_roller. -# https://github.com/standardrb/lint_roller -# -# @api private -# -# source://rubocop//lib/rubocop/plugin/not_supported_error.rb#4 -module RuboCop::Plugin - class << self - # @api private - # - # source://rubocop//lib/rubocop/plugin.rb#37 - def integrate_plugins(rubocop_config, plugins); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/plugin.rb#22 - def plugin_capable?(feature_name); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/plugin.rb#11 -RuboCop::Plugin::BUILTIN_INTERNAL_PLUGINS = T.let(T.unsafe(nil), Hash) - -# A class for integrating plugin configurations into RuboCop. -# Handles configuration merging, validation, and compatibility for plugins. -# -# @api private -# -# source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#11 -class RuboCop::Plugin::ConfigurationIntegrator - class << self - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#13 - def integrate_plugins_into_rubocop_config(rubocop_config, plugins); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#44 - def combine_rubocop_configs(default_config, runner_context, plugins); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#27 - def create_context(rubocop_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#81 - def fake_out_rubocop_default_configuration(default_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#92 - def load_plugin_rubocop_config(plugin, runner_context); end - - # This is how we ensure "first-in wins": plugins can override AllCops settings that are - # set by RuboCop's default configuration, but once a plugin sets an AllCop setting, they - # have exclusive first-in-wins rights to that setting. - # - # The one exception to this are array fields, because we don't want to - # overwrite the AllCops defaults but rather munge the arrays (`existing | - # new`) to allow plugins to add to the array, for example Include and - # Exclude paths and patterns. - # - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#118 - def merge_all_cop_settings(existing_all_cops, new_all_cops, already_configured_keys); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#67 - def merge_plugin_config_into_all_cops!(rubocop_config, plugin_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#71 - def merge_plugin_config_into_default_config!(default_config, plugin_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#137 - def resolver; end - - # @api private - # @raise [Plugin::NotSupportedError] - # - # source://rubocop//lib/rubocop/plugin/configuration_integrator.rb#37 - def validate_plugins!(plugins, runner_context); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/plugin.rb#18 -RuboCop::Plugin::INTERNAL_AFFAIRS_PLUGIN_NAME = T.let(T.unsafe(nil), String) - -# An exception raised when a plugin fails to load. -# -# @api private -# -# source://rubocop//lib/rubocop/plugin/load_error.rb#7 -class RuboCop::Plugin::LoadError < ::RuboCop::Error - # @api private - # @return [LoadError] a new instance of LoadError - # - # source://rubocop//lib/rubocop/plugin/load_error.rb#8 - def initialize(plugin_name); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/load_error.rb#14 - def message; end -end - -# A class for loading and resolving plugins. -# -# @api private -# -# source://rubocop//lib/rubocop/plugin/loader.rb#10 -class RuboCop::Plugin::Loader - class << self - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#20 - def load(plugins); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#70 - def constantize(plugin_name, plugin_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#61 - def constantize_plugin_from(plugin_name, plugin_config); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#90 - def constantize_plugin_from_gemspec_metadata(plugin_name); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#34 - def normalize(plugin_configs); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/loader.rb#86 - def require_plugin(require_path); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/plugin/loader.rb#12 -RuboCop::Plugin::Loader::DEFAULT_PLUGIN_CONFIG = T.let(T.unsafe(nil), Hash) - -# An exception raised when a plugin is not supported by the RuboCop engine. -# -# @api private -# -# source://rubocop//lib/rubocop/plugin/not_supported_error.rb#7 -class RuboCop::Plugin::NotSupportedError < ::RuboCop::Error - # @api private - # @return [NotSupportedError] a new instance of NotSupportedError - # - # source://rubocop//lib/rubocop/plugin/not_supported_error.rb#8 - def initialize(unsupported_plugins); end - - # @api private - # - # source://rubocop//lib/rubocop/plugin/not_supported_error.rb#14 - def message; end -end - -# @api private -# -# source://rubocop//lib/rubocop/plugin.rb#19 -RuboCop::Plugin::OBSOLETE_INTERNAL_AFFAIRS_PLUGIN_NAME = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/ast_aliases.rb#6 -RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource - -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#4 -module RuboCop::RSpec; end - -# Mixin for `expect_offense` and `expect_no_offenses` -# -# This mixin makes it easier to specify strict offense expectations -# in a declarative and visual fashion. Just type out the code that -# should generate an offense, annotate code by writing '^'s -# underneath each character that should be highlighted, and follow -# the carets with a string (separated by a space) that is the -# message of the offense. You can include multiple offenses in -# one code snippet. -# -# Autocorrection can be tested using `expect_correction` after -# `expect_offense`. -# -# If you do not want to specify an offense then use the -# companion method `expect_no_offenses`. This method is a much -# simpler assertion since it just inspects the source and checks -# that there were no offenses. The `expect_offense` method has -# to do more work by parsing out lines that contain carets. -# -# If the code produces an offense that could not be autocorrected, you can -# use `expect_no_corrections` after `expect_offense`. -# -# If your code has variables of different lengths, you can use `%{foo}`, -# `^{foo}`, and `_{foo}` to format your template; you can also abbreviate -# offense messages with `[...]`: -# -# %w[raise fail].each do |keyword| -# expect_offense(<<~RUBY, keyword: keyword) -# %{keyword}(RuntimeError, msg) -# ^{keyword}^^^^^^^^^^^^^^^^^^^ Redundant `RuntimeError` argument [...] -# RUBY -# -# %w[has_one has_many].each do |type| -# expect_offense(<<~RUBY, type: type) -# class Book -# %{type} :chapter, foreign_key: 'book_id' -# _{type} ^^^^^^^^^^^^^^^^^^^^^^ Specifying the default [...] -# end -# RUBY -# end -# -# If you need to specify an offense on a blank line, use the empty `^{}` marker: -# -# @example Usage -# -# expect_offense(<<~RUBY) -# a do -# b -# end.c -# ^^^^^ Avoid chaining a method call on a do...end block. -# RUBY -# @example Equivalent assertion without `expect_offense` -# -# inspect_source(<<~RUBY) -# a do -# b -# end.c -# RUBY -# -# expect(cop.offenses.size).to be(1) -# -# offense = cop.offenses.first -# expect(offense.line).to be(3) -# expect(offense.column_range).to be(0...5) -# expect(offense.message).to eql( -# 'Avoid chaining a method call on a do...end block.' -# ) -# @example `expect_offense` and `expect_correction` -# -# expect_offense(<<~RUBY) -# x % 2 == 0 -# ^^^^^^^^^^ Replace with `Integer#even?`. -# RUBY -# -# expect_correction(<<~RUBY) -# x.even? -# RUBY -# @example `expect_offense` and `expect_no_corrections` -# -# expect_offense(<<~RUBY) -# a do -# b -# end.c -# ^^^^^ Avoid chaining a method call on a do...end block. -# RUBY -# -# expect_no_corrections -# @example `^{}` empty line offense -# -# expect_offense(<<~RUBY) -# -# ^{} Missing frozen string literal comment. -# puts 1 -# RUBY -# -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#103 -module RuboCop::RSpec::ExpectOffense - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#138 - def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end - - # @raise [RuboCop::Runner::InfiniteCorrectionLoop] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#176 - def expect_no_corrections; end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#190 - def expect_no_offenses(source, file = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#115 - def expect_offense(source, file = T.unsafe(nil), severity: T.unsafe(nil), chomp: T.unsafe(nil), **replacements); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#104 - def format_offense(source, **replacements); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#201 - def parse_annotations(source, raise_error: T.unsafe(nil), **replacements); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#211 - def parse_processed_source(source, file = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#219 - def set_formatter_options; end -end - -# Parsed representation of code annotated with the `^^^ Message` style -# -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#226 -class RuboCop::RSpec::ExpectOffense::AnnotatedSource - # @note annotations are sorted so that reconstructing the annotation - # text via {#to_s} is deterministic - # @param lines [Array] - # @param annotations [Array<(Integer, String)>] each entry is the annotated line number and the annotation text - # @return [AnnotatedSource] a new instance of AnnotatedSource - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#259 - def initialize(lines, annotations); end - - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#264 - def ==(other); end - - # Construct annotated source string (like what we parse) - # - # Reconstruct a deterministic annotated source string. This is - # useful for eliminating semantically irrelevant annotation - # ordering differences. - # - # @example standardization - # source1 = AnnotatedSource.parse(<<-RUBY) - # line1 - # ^ Annotation 1 - # ^^ Annotation 2 - # RUBY - # - # source2 = AnnotatedSource.parse(<<-RUBY) - # line1 - # ^^ Annotation 2 - # ^ Annotation 1 - # RUBY - # - # source1.to_s == source2.to_s # => true - # @return [String] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#306 - def inspect; end - - # Dirty hack: expectations with [...] are rewritten when they match - # This way the diff is clean. - # - # @return [Boolean] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#270 - def match_annotations?(other); end - - # Return the plain source code without annotations - # - # @return [String] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#320 - def plain_source; end - - # Construct annotated source string (like what we parse) - # - # Reconstruct a deterministic annotated source string. This is - # useful for eliminating semantically irrelevant annotation - # ordering differences. - # - # @example standardization - # - # source1 = AnnotatedSource.parse(<<-RUBY) - # line1 - # ^ Annotation 1 - # ^^ Annotation 2 - # RUBY - # - # source2 = AnnotatedSource.parse(<<-RUBY) - # line1 - # ^^ Annotation 2 - # ^ Annotation 1 - # RUBY - # - # source1.to_s == source2.to_s # => true - # @return [String] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#306 - def to_s; end - - # Annotate the source code with the RuboCop offenses provided - # - # @param offenses [Array] - # @return [self] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#329 - def with_offense_annotations(offenses); end - - protected - - # Returns the value of attribute annotations. - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#344 - def annotations; end - - # Returns the value of attribute lines. - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#344 - def lines; end - - class << self - # Separates annotation lines from source lines. Tracks the real - # source line number that each annotation corresponds to. - # - # @param annotated_source [String] string passed to the matchers - # @return [AnnotatedSource] - # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#237 - def parse(annotated_source); end - end -end - -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#229 -RuboCop::RSpec::ExpectOffense::AnnotatedSource::ABBREV = T.let(T.unsafe(nil), String) - -# Ignore escaped carets, don't treat as annotations -# -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#228 -RuboCop::RSpec::ExpectOffense::AnnotatedSource::ANNOTATION_PATTERN = T.let(T.unsafe(nil), Regexp) - -# Common methods and behaviors for dealing with remote config files. -# -# @api private -# -# source://rubocop//lib/rubocop/remote_config.rb#9 -class RuboCop::RemoteConfig - # @api private - # @return [RemoteConfig] a new instance of RemoteConfig - # - # source://rubocop//lib/rubocop/remote_config.rb#14 - def initialize(url, base_dir); end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#23 - def file; end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#36 - def inherit_from_remote(file, path); end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#10 - def uri; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#99 - def cache_name_from_uri; end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#82 - def cache_path; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/remote_config.rb#86 - def cache_path_exists?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/remote_config.rb#90 - def cache_path_expired?; end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#105 - def cloned_url; end - - # @api private - # @yield [request] - # - # source://rubocop//lib/rubocop/remote_config.rb#57 - def generate_request(uri); end - - # @api private - # - # source://rubocop//lib/rubocop/remote_config.rb#66 - def handle_response(response, limit, &block); end - - # @api private - # @raise [ArgumentError] - # - # source://rubocop//lib/rubocop/remote_config.rb#44 - def request(uri = T.unsafe(nil), limit = T.unsafe(nil), &block); end -end - -# @api private -# -# source://rubocop//lib/rubocop/remote_config.rb#12 -RuboCop::RemoteConfig::CACHE_LIFETIME = T.let(T.unsafe(nil), Integer) - -# Provides functionality for caching RuboCop runs. -# -# @api private -# -# source://rubocop//lib/rubocop/result_cache.rb#11 -class RuboCop::ResultCache - # @api private - # @return [ResultCache] a new instance of ResultCache - # - # source://rubocop//lib/rubocop/result_cache.rb#87 - def initialize(file, team, options, config_store, cache_root_override = T.unsafe(nil)); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#100 - def debug?; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#108 - def load; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#85 - def path; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#113 - def save(offenses); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#104 - def valid?; end - - private - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#146 - def any_symlink?(path); end - - # We combine team and options into a single "context" checksum to avoid - # making file names that are too long for some filesystems to handle. - # This context is for anything that's not (1) the RuboCop executable - # checksum or (2) the inspected file checksum. - # - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#229 - def context_checksum(team, options); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#189 - def digest(path); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#157 - def file_checksum(file, config_store); end - - # Return a hash of the options given at invocation, minus the ones that have - # no effect on which offenses and disabled line ranges are found, and thus - # don't affect caching. - # - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#220 - def relevant_options_digest(options); end - - # The checksum of the RuboCop program running the inspection. - # - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#174 - def rubocop_checksum; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#200 - def rubocop_extra_features; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#142 - def symlink_protection_triggered?(path); end - - class << self - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#81 - def allow_symlinks_in_cache_location?(config_store); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#75 - def cache_root(config_store, cache_root_override = T.unsafe(nil)); end - - # Remove old files so that the cache doesn't grow too big. When the - # threshold MaxFilesInCache has been exceeded, the oldest 50% of all the - # files in the cache are removed. The reason for removing so much is that - # cleaning should be done relatively seldom, since there is a slight risk - # that some other RuboCop process was just about to read the file, when - # there's parallel execution and the cache is shared. - # - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#28 - def cleanup(config_store, verbose, cache_root_override = T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#170 - def inhibit_cleanup; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#170 - def inhibit_cleanup=(_arg0); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#42 - def rubocop_required_features; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#42 - def rubocop_required_features=(_arg0); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#170 - def source_checksum; end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#170 - def source_checksum=(_arg0); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#65 - def remove_files(files, dirs, remove_count); end - - # @api private - # - # source://rubocop//lib/rubocop/result_cache.rb#52 - def remove_oldest_files(files, dirs, rubocop_cache_dir, verbose); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/result_cache.rb#48 - def requires_file_removal?(file_count, config_store); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/result_cache.rb#16 -RuboCop::ResultCache::DL_EXTENSIONS = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/result_cache.rb#12 -RuboCop::ResultCache::NON_CHANGING = T.let(T.unsafe(nil), Array) - -# This class handles the processing of files, which includes dealing with -# formatters and letting cops inspect the files. -# -# source://rubocop//lib/rubocop/runner.rb#8 -class RuboCop::Runner - # @return [Runner] a new instance of Runner - # - # source://rubocop//lib/rubocop/runner.rb#59 - def initialize(options, config_store); end - - # Sets the attribute aborting - # - # @param value the value to set the attribute aborting to. - # - # source://rubocop//lib/rubocop/runner.rb#57 - def aborting=(_arg0); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#83 - def aborting?; end - - # Returns the value of attribute errors. - # - # source://rubocop//lib/rubocop/runner.rb#56 - def errors; end - - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#50 - def file_finished(file, offenses); end - - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#44 - def file_offense_cache(file); end - - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#36 - def get_processed_source(*args); end - - # source://rubocop//lib/rubocop/runner.rb#67 - def run(paths); end - - # Returns the value of attribute warnings. - # - # source://rubocop//lib/rubocop/runner.rb#56 - def warnings; end - - private - - # source://rubocop//lib/rubocop/runner.rb#199 - def add_redundant_disables(file, offenses, source); end - - # source://rubocop//lib/rubocop/runner.rb#173 - def cached_result(file, team); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#253 - def cached_run?; end - - # Check whether a run created source identical to a previous run, which - # means that we definitely have an infinite loop. - # - # source://rubocop//lib/rubocop/runner.rb#331 - def check_for_infinite_loop(processed_source, offenses_by_iteration); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#225 - def check_for_redundant_disables?(source); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#433 - def considered_failure?(offense); end - - # source://rubocop//lib/rubocop/runner.rb#470 - def default_config(cop_name); end - - # source://rubocop//lib/rubocop/runner.rb#275 - def do_inspection_loop(file); end - - # source://rubocop//lib/rubocop/runner.rb#133 - def each_inspected_file(files); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#239 - def except_redundant_cop_disable_directive?; end - - # source://rubocop//lib/rubocop/runner.rb#360 - def extract_ruby_sources(processed_source); end - - # source://rubocop//lib/rubocop/runner.rb#165 - def file_offenses(file); end - - # source://rubocop//lib/rubocop/runner.rb#243 - def file_started(file); end - - # source://rubocop//lib/rubocop/runner.rb#413 - def filter_cop_classes(cop_classes, config); end - - # source://rubocop//lib/rubocop/runner.rb#104 - def find_target_files(paths); end - - # source://rubocop//lib/rubocop/runner.rb#424 - def formatter_set; end - - # source://rubocop//lib/rubocop/runner.rb#345 - def inspect_file(processed_source, team = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/runner.rb#115 - def inspect_files(files); end - - # source://rubocop//lib/rubocop/runner.rb#306 - def iterate_until_no_changes(source, offenses_by_iteration); end - - # source://rubocop//lib/rubocop/runner.rb#148 - def list_files(paths); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#466 - def mark_as_safe_by_config?(config); end - - # source://rubocop//lib/rubocop/runner.rb#474 - def minimum_severity_to_fail; end - - # source://rubocop//lib/rubocop/runner.rb#374 - def mobilize_team(processed_source); end - - # source://rubocop//lib/rubocop/runner.rb#379 - def mobilized_cop_classes(config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#442 - def offense_displayed?(offense); end - - # source://rubocop//lib/rubocop/runner.rb#454 - def offenses_to_report(offenses); end - - # source://rubocop//lib/rubocop/runner.rb#152 - def process_file(file); end - - # source://rubocop//lib/rubocop/runner.rb#403 - def qualify_option_cop_names; end - - # @yield [cop] - # - # source://rubocop//lib/rubocop/runner.rb#231 - def redundant_cop_disable_directive(file); end - - # source://rubocop//lib/rubocop/runner.rb#265 - def save_in_cache(cache, offenses); end - - # A Cop::Team instance is stateful and may change when inspecting. - # The "standby" team for a given config is an initialized but - # otherwise dormant team that can be used for config- and option- - # level caching in ResultCache. - # - # source://rubocop//lib/rubocop/runner.rb#517 - def standby_team(config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#420 - def style_guide_cops_only?(config); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/runner.rb#458 - def supports_safe_autocorrect?(offense); end - - # @yield [team] - # - # source://rubocop//lib/rubocop/runner.rb#214 - def team_for_redundant_disables(file, offenses, source); end - - # Warms up the RuboCop cache by forking a suitable number of RuboCop - # instances that each inspects its allotted group of files. - # - # source://rubocop//lib/rubocop/runner.rb#91 - def warm_cache(target_files); end - - class << self - # @return [Array<#call>] - # - # source://rubocop//lib/rubocop/runner.rb#29 - def ruby_extractors; end - - private - - # @return [#call] - # - # source://rubocop//lib/rubocop/runner.rb#36 - def default_ruby_extractor; end - end -end - -# An exception indicating that the inspection loop got stuck correcting -# offenses back and forth. -# -# source://rubocop//lib/rubocop/runner.rb#11 -class RuboCop::Runner::InfiniteCorrectionLoop < ::StandardError - # @return [InfiniteCorrectionLoop] a new instance of InfiniteCorrectionLoop - # - # source://rubocop//lib/rubocop/runner.rb#14 - def initialize(path, offenses_by_iteration, loop_start: T.unsafe(nil)); end - - # Returns the value of attribute offenses. - # - # source://rubocop//lib/rubocop/runner.rb#12 - def offenses; end -end - -# @api private -# -# source://rubocop//lib/rubocop/runner.rb#49 -RuboCop::Runner::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) - -# @api private -# -# source://rubocop//lib/rubocop/runner.rb#52 -RuboCop::Runner::REDUNDANT_COP_DISABLE_DIRECTIVE_RULES = T.let(T.unsafe(nil), Array) - -# Take a string with embedded escapes, and convert the escapes as the Ruby -# interpreter would when reading a double-quoted string literal. -# For example, "\\n" will be converted to "\n". -# -# source://rubocop//lib/rubocop/string_interpreter.rb#7 -class RuboCop::StringInterpreter - class << self - # source://rubocop//lib/rubocop/string_interpreter.rb#24 - def interpret(string); end - - private - - # source://rubocop//lib/rubocop/string_interpreter.rb#51 - def interpret_hex(escape); end - - # source://rubocop//lib/rubocop/string_interpreter.rb#55 - def interpret_octal(escape); end - - # source://rubocop//lib/rubocop/string_interpreter.rb#33 - def interpret_string_escape(escape); end - - # source://rubocop//lib/rubocop/string_interpreter.rb#43 - def interpret_unicode(escape); end - end -end - -# source://rubocop//lib/rubocop/string_interpreter.rb#8 -RuboCop::StringInterpreter::STRING_ESCAPES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/string_interpreter.rb#12 -RuboCop::StringInterpreter::STRING_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) - -# This class finds target files to inspect by scanning the directory tree and picking ruby files. -# -# @api private -# -# source://rubocop//lib/rubocop/target_finder.rb#6 -class RuboCop::TargetFinder - # @api private - # @return [TargetFinder] a new instance of TargetFinder - # - # source://rubocop//lib/rubocop/target_finder.rb#9 - def initialize(config_store, options = T.unsafe(nil)); end - - # Generate a list of target files by expanding globbing patterns (if any). If args is empty, - # recursively find all Ruby source files under the current directory - # - # @api private - # @return [Array] array of file paths - # - # source://rubocop//lib/rubocop/target_finder.rb#17 - def find(args, mode); end - - # Search for files recursively starting at the given base directory using the given flags that - # determine how the match is made. Excluded files will be removed later by the caller, but as an - # optimization find_files removes the top level directories that are excluded in configuration - # in the normal way (dir/**/*). - # - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#62 - def find_files(base_dir, flags); end - - # @api private - # @return [Boolean] - # - # source://rubocop-md/2.0.1/lib/rubocop/markdown/rubocop_ext.rb#78 - def ruby_file?(file); end - - # Finds all Ruby source files under the current or other supplied directory. A Ruby source file - # is defined as a file with the `.rb` extension or a file with no extension that has a ruby - # shebang line as its first line. - # It is possible to specify includes and excludes using the config file, so you can include - # other Ruby files like Rakefiles and gemspecs. - # - # @api private - # @param base_dir Root directory under which to search for - # ruby source files - # @return [Array] Array of filenames - # - # source://rubocop//lib/rubocop/target_finder.rb#41 - def target_files_in_dir(base_dir = T.unsafe(nil)); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#124 - def all_cops_include; end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#110 - def combined_exclude_glob_patterns(base_dir); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#177 - def configured_include?(file); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#213 - def debug?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#217 - def fail_fast?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#205 - def force_exclusion?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#209 - def ignore_parent_exclusion?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#150 - def included_file?(file); end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#196 - def order; end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#128 - def process_explicit_path(path, mode); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#181 - def ruby_executable?(file); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#162 - def ruby_extension?(file); end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#166 - def ruby_extensions; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#173 - def ruby_filename?(file); end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#117 - def ruby_filenames; end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#192 - def ruby_interpreters(file); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#158 - def stdin?; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#102 - def symlink_excluded_or_infinite_loop?(base_dir, current_dir, exclude_pattern, flags); end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_finder.rb#77 - def to_inspect?(file, hidden_files, base_dir_config); end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#86 - def wanted_dir_patterns(base_dir, exclude_pattern, flags); end - - # @api private - # - # source://rubocop//lib/rubocop/target_finder.rb#139 - def without_excluded(files); end -end - -# @api private -# -# source://rubocop//lib/rubocop/target_finder.rb#7 -RuboCop::TargetFinder::HIDDEN_PATH_SUBSTRING = T.let(T.unsafe(nil), String) - -# The kind of Ruby that code inspected by RuboCop is written in. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#6 -class RuboCop::TargetRuby - # @api private - # @return [TargetRuby] a new instance of TargetRuby - # - # source://rubocop//lib/rubocop/target_ruby.rb#273 - def initialize(config); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#289 - def rubocop_version_with_support; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#277 - def source; end - - # @api private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/target_ruby.rb#285 - def supported?; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#281 - def version; end - - class << self - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#258 - def supported_versions; end - end -end - -# The lock file of Bundler may identify the target ruby version. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#205 -class RuboCop::TargetRuby::BundlerLockFile < ::RuboCop::TargetRuby::Source - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#206 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#239 - def bundler_lock_file_path; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#212 - def find_version; end -end - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#8 -RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float) - -# If all else fails, a default version will be picked. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#246 -class RuboCop::TargetRuby::Default < ::RuboCop::TargetRuby::Source - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#247 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#253 - def find_version; end -end - -# The target ruby version may be found in a .gemspec file. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#67 -class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source - extend ::RuboCop::AST::NodePattern::Macros - - # source://rubocop//lib/rubocop/target_ruby.rb#76 - def gem_requirement_versions(param0 = T.unsafe(nil)); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#82 - def name; end - - # source://rubocop//lib/rubocop/target_ruby.rb#71 - def required_ruby_version(param0); end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#137 - def find_minimal_known_ruby(right_hand_side); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#88 - def find_version; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#98 - def gemspec_filepath; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#133 - def version_from_array(array); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#112 - def version_from_gemspec_file(file); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#121 - def version_from_right_hand_side(right_hand_side); end -end - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#7 -RuboCop::TargetRuby::KNOWN_RUBIES = T.let(T.unsafe(nil), Array) - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#10 -RuboCop::TargetRuby::OBSOLETE_RUBIES = T.let(T.unsafe(nil), Hash) - -# The target ruby version may be configured in RuboCop's config. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#53 -class RuboCop::TargetRuby::RuboCopConfig < ::RuboCop::TargetRuby::Source - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#54 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#60 - def find_version; end -end - -# The target ruby version may be configured by setting the -# `RUBOCOP_TARGET_RUBY_VERSION` environment variable. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#39 -class RuboCop::TargetRuby::RuboCopEnvVar < ::RuboCop::TargetRuby::Source - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#40 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#46 - def find_version; end -end - -# The target ruby version may be found in a .ruby-version file. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#151 -class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#155 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#161 - def filename; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#169 - def find_version; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#165 - def pattern; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#176 - def version_file; end -end - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#152 -RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#153 -RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#262 -RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array) - -# A place where information about a target ruby version is found. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#24 -class RuboCop::TargetRuby::Source - # @api private - # @return [Source] a new instance of Source - # - # source://rubocop//lib/rubocop/target_ruby.rb#27 - def initialize(config); end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#25 - def name; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#32 - def to_s; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#25 - def version; end -end - -# The target ruby version may be found in a .tool-versions file, in a line -# starting with `ruby`. -# -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#184 -class RuboCop::TargetRuby::ToolVersionsFile < ::RuboCop::TargetRuby::RubyVersionFile - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#188 - def name; end - - private - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#194 - def filename; end - - # @api private - # - # source://rubocop//lib/rubocop/target_ruby.rb#198 - def pattern; end -end - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#185 -RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String) - -# @api private -# -# source://rubocop//lib/rubocop/target_ruby.rb#186 -RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rubocop//lib/rubocop/ast_aliases.rb#7 -RuboCop::Token = RuboCop::AST::Token - -# This module contains a collection of useful utility methods. -# -# source://rubocop//lib/rubocop/util.rb#5 -module RuboCop::Util - class << self - # source://rubocop//lib/rubocop/util.rb#6 - def silence_warnings; end - end -end - -# source://rubocop//lib/rubocop/error.rb#10 -class RuboCop::ValidationError < ::RuboCop::Error; end - -# This module holds the RuboCop version information. -# -# source://rubocop//lib/rubocop/version.rb#5 -module RuboCop::Version - class << self - # @api private - # - # source://rubocop//lib/rubocop/version.rb#121 - def config_for_pwd(env); end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#151 - def document_version; end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#74 - def extension_versions(env); end - - # Returns feature version in one of two ways: - # - # * Find by RuboCop core version style (e.g. rubocop-performance, rubocop-rspec) - # * Find by `bundle gem` version style (e.g. rubocop-rake) - # - # @api private - # - # source://rubocop//lib/rubocop/version.rb#135 - def feature_version(feature); end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#57 - def parser_version(target_ruby_version); end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#156 - def server_mode; end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#112 - def target_ruby_version(env); end - - # @api private - # - # source://rubocop//lib/rubocop/version.rb#52 - def verbose(env: T.unsafe(nil)); end - - # NOTE: Marked as private but used by gems like standard. - # - # @api private - # - # source://rubocop//lib/rubocop/version.rb#26 - def version(debug: T.unsafe(nil), env: T.unsafe(nil)); end - end -end - -# source://rubocop//lib/rubocop/version.rb#15 -RuboCop::Version::CANONICAL_FEATURE_NAMES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/version.rb#19 -RuboCop::Version::EXTENSION_PATH_NAMES = T.let(T.unsafe(nil), Hash) - -# source://rubocop//lib/rubocop/version.rb#13 -RuboCop::Version::MINIMUM_PARSABLE_PRISM_VERSION = T.let(T.unsafe(nil), Float) - -# source://rubocop//lib/rubocop/version.rb#8 -RuboCop::Version::MSG = T.let(T.unsafe(nil), String) - -# source://rubocop//lib/rubocop/version.rb#6 -RuboCop::Version::STRING = T.let(T.unsafe(nil), String) - -# A Warning exception is different from an Offense with severity 'warning' -# When a Warning is raised, this means that RuboCop was unable to perform a -# requested operation (such as inspecting or correcting a source file) due to -# user error -# For example, a configuration value in .rubocop.yml might be malformed -# -# source://rubocop//lib/rubocop/warning.rb#9 -class RuboCop::Warning < ::StandardError; end - -# Find duplicated keys from YAML. -# -# @api private -# -# source://rubocop//lib/rubocop/yaml_duplication_checker.rb#6 -module RuboCop::YAMLDuplicationChecker - class << self - # @api private - # - # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#7 - def check(yaml_string, filename, &on_duplicated); end - end -end - -# @api private -# -# source://rubocop//lib/rubocop/yaml_duplication_checker.rb#14 -class RuboCop::YAMLDuplicationChecker::DuplicationCheckHandler < ::Psych::TreeBuilder - # @api private - # @return [DuplicationCheckHandler] a new instance of DuplicationCheckHandler - # - # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#15 - def initialize(&block); end - - # @api private - # - # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#20 - def end_mapping; end -end - -# Extensions to the core String class -# -# source://rubocop//lib/rubocop/core_ext/string.rb#4 -class String - include ::Comparable - - # Checks whether a string is blank. A string is considered blank if it - # is either empty or contains only whitespace characters. - # - # @example - # ''.blank? #=> true - # ' '.blank? #=> true - # ' test'.blank? #=> false - # @return [Boolean] true is the string is blank, false otherwise - # - # source://rubocop//lib/rubocop/core_ext/string.rb#15 - def blank?; end -end diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.77.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.77.0.rbi new file mode 100644 index 0000000000..60b8bb82b5 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.77.0.rbi @@ -0,0 +1,7513 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop` gem. +# Please instead update this file by running `bin/tapioca gem rubocop`. + + +class Parser::Source::Comment + include ::RuboCop::Ext::Comment +end + +class Parser::Source::Range + include ::RuboCop::Ext::Range +end + +class RuboCop::AST::ProcessedSource + include ::RuboCop::Ext::ProcessedSource +end + +class RuboCop::CLI + # @return [CLI] a new instance of CLI + # + # source://rubocop//lib/rubocop/cli.rb#24 + def initialize; end + + # Returns the value of attribute config_store. + # + # source://rubocop//lib/rubocop/cli.rb#22 + def config_store; end + + # Returns the value of attribute options. + # + # source://rubocop//lib/rubocop/cli.rb#22 + def options; end + + # Entry point for the application logic. Here we + # do the command line arguments processing and inspect + # the target files. + # + # + # @api public + # @param args [Array] command line arguments + # @return [Integer] UNIX exit code + # + # source://rubocop//lib/rubocop/cli.rb#39 + def run(args = T.unsafe(nil)); end + + private + + # source://rubocop//lib/rubocop/cli.rb#156 + def act_on_options; end + + # source://rubocop//lib/rubocop/cli.rb#198 + def apply_default_formatter; end + + # source://rubocop//lib/rubocop/cli.rb#125 + def execute_runners; end + + # source://rubocop//lib/rubocop/cli.rb#182 + def handle_editor_mode; end + + # @raise [Finished] + # + # source://rubocop//lib/rubocop/cli.rb#187 + def handle_exiting_options; end + + # source://rubocop//lib/rubocop/cli.rb#144 + def parallel_by_default!; end + + # source://rubocop//lib/rubocop/cli.rb#80 + def profile_if_needed; end + + # source://rubocop//lib/rubocop/cli.rb#113 + def require_gem(name); end + + # source://rubocop//lib/rubocop/cli.rb#121 + def run_command(name); end + + # source://rubocop//lib/rubocop/cli.rb#174 + def set_options_to_config_loader; end + + # source://rubocop//lib/rubocop/cli.rb#133 + def suggest_extensions; end + + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/cli.rb#137 + def validate_options_vs_config; end +end + +module RuboCop::CLI::Command + class << self + # Find the command with a given name and run it in an environment. + # + # @api private + # + # source://rubocop//lib/rubocop/cli/command.rb#10 + def run(env, name); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command.rb#16 + def class_for(name); end + end +end + +class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#25 + def run; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#107 + def add_formatter; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#115 + def add_inheritance_from_auto_generated_file(config_file); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#111 + def execute_runner; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#136 + def existing_configuration(config_file); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#65 + def line_length_cop(config); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#53 + def line_length_enabled?(config); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#61 + def max_line_length(config); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#34 + def maybe_run_line_length_cop; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#73 + def only_exclude?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#69 + def options_has_only_flag?; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#153 + def relative_path_to_todo_from_options_config; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#100 + def reset_config_and_auto_gen_file; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#91 + def run_all_cops(line_length_contents); end + + # Do an initial run with only Layout/LineLength so that cops that + # depend on Layout/LineLength:Max get the correct value for that + # parameter. + # + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#80 + def run_line_length_cop; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#57 + def same_max_line_length?(config1, config2); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#48 + def skip_line_length_cop(reason); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/auto_generate_config.rb#142 + def write_config_file(file_name, file_string, rubocop_yml_contents); end +end + +RuboCop::CLI::Command::AutoGenerateConfig::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1 = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_DISABLED = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_OVERRIDDEN = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_COPS = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_SKIPPED_ONLY_EXCLUDE = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PHASE_2 = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::PLACEHOLDER = T.let(T.unsafe(nil), String) + +RuboCop::CLI::Command::AutoGenerateConfig::YAML_OPTIONAL_DOC_START = T.let(T.unsafe(nil), Regexp) + +class RuboCop::CLI::Command::Base + # @api private + # @return [Base] a new instance of Base + # + # source://rubocop//lib/rubocop/cli/command/base.rb#26 + def initialize(env); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/base.rb#9 + def env; end + + class << self + # @api private + # + # source://rubocop//lib/rubocop/cli/command/base.rb#21 + def by_command_name(name); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/base.rb#14 + def command_name; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/base.rb#14 + def command_name=(_arg0); end + + # @api private + # @private + # + # source://rubocop//lib/rubocop/cli/command/base.rb#16 + def inherited(subclass); end + end +end + +class RuboCop::CLI::Command::ExecuteRunner < ::RuboCop::CLI::Command::Base + include ::RuboCop::Formatter::TextUtil + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#16 + def run; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#85 + def bug_tracker_uri; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#69 + def display_error_summary(errors); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#56 + def display_summary(runner); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#61 + def display_warning_summary(warnings); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#22 + def execute_runner(paths); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#91 + def maybe_print_corrected_source; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#42 + def with_redirect; end +end + +RuboCop::CLI::Command::ExecuteRunner::INTEGRATION_FORMATTERS = T.let(T.unsafe(nil), Array) + +class RuboCop::CLI::Command::InitDotfile < ::RuboCop::CLI::Command::Base + # @api private + # + # source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#13 + def run; end +end + +RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String) + +class RuboCop::CLI::Command::LSP < ::RuboCop::CLI::Command::Base + # @api private + # + # source://rubocop//lib/rubocop/cli/command/lsp.rb#11 + def run; end +end + +class RuboCop::CLI::Command::ShowCops < ::RuboCop::CLI::Command::Base + # @api private + # @return [ShowCops] a new instance of ShowCops + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#24 + def initialize(env); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#39 + def run; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#89 + def config_lines(cop); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#85 + def cops_of_department(cops, department); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#45 + def print_available_cops; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#68 + def print_cop_details(cops); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#56 + def print_cops_of_department(registry, department, show_all); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#77 + def selected_cops_of_department(cops, department); end +end + +class RuboCop::CLI::Command::ShowCops::ExactMatcher < ::Struct + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#13 + def match?(name); end + + # Returns the value of attribute pattern + # + # @return [Object] the current value of pattern + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def pattern; end + + # Sets the attribute pattern + # + # @param value [Object] the value to set the attribute pattern to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def pattern=(_); end + + class << self + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def [](*_arg0); end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def inspect; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def keyword_init?; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def members; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 + def new(*_arg0); end + end +end + +class RuboCop::CLI::Command::ShowCops::WildcardMatcher < ::Struct + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#19 + def match?(name); end + + # Returns the value of attribute pattern + # + # @return [Object] the current value of pattern + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def pattern; end + + # Sets the attribute pattern + # + # @param value [Object] the value to set the attribute pattern to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def pattern=(_); end + + class << self + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def [](*_arg0); end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def inspect; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def keyword_init?; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def members; end + + # source://rubocop//lib/rubocop/cli/command/show_cops.rb#18 + def new(*_arg0); end + end +end + +class RuboCop::CLI::Command::ShowDocsUrl < ::RuboCop::CLI::Command::Base + # @api private + # @return [ShowDocsUrl] a new instance of ShowDocsUrl + # + # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#12 + def initialize(env); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#18 + def run; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#38 + def cops_array; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#24 + def print_documentation_url; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/show_docs_url.rb#42 + def registry_hash; end +end + +class RuboCop::CLI::Command::SuggestExtensions < ::RuboCop::CLI::Command::Base + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#17 + def run; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#73 + def all_extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#69 + def current_formatter; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#117 + def dependent_gems; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#87 + def extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#109 + def installed_and_not_loaded_extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#91 + def installed_extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#121 + def installed_gems; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#99 + def loaded_extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#113 + def lockfile; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#95 + def not_installed_extensions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#41 + def print_install_suggestions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#51 + def print_load_suggestions; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#60 + def print_opt_out_instruction; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#125 + def puts(*args); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cli/command/suggest_extensions.rb#30 + def skip?; end +end + +RuboCop::CLI::Command::SuggestExtensions::INCLUDED_FORMATTERS = T.let(T.unsafe(nil), Array) + +class RuboCop::CLI::Command::Version < ::RuboCop::CLI::Command::Base + # @api private + # + # source://rubocop//lib/rubocop/cli/command/version.rb#11 + def run; end +end + +RuboCop::CLI::DEFAULT_PARALLEL_OPTIONS = T.let(T.unsafe(nil), Array) + +class RuboCop::CLI::Environment + # @api private + # @return [Environment] a new instance of Environment + # + # source://rubocop//lib/rubocop/cli/environment.rb#10 + def initialize(options, config_store, paths); end + + # @api private + # + # source://rubocop//lib/rubocop/cli/environment.rb#8 + def config_store; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/environment.rb#8 + def options; end + + # @api private + # + # source://rubocop//lib/rubocop/cli/environment.rb#8 + def paths; end + + # Run a command in this environment. + # + # @api private + # + # source://rubocop//lib/rubocop/cli/environment.rb#17 + def run(name); end +end + +class RuboCop::CLI::Finished < ::StandardError; end + +RuboCop::CLI::STATUS_ERROR = T.let(T.unsafe(nil), Integer) + +RuboCop::CLI::STATUS_INTERRUPTED = T.let(T.unsafe(nil), Integer) + +RuboCop::CLI::STATUS_OFFENSES = T.let(T.unsafe(nil), Integer) + +RuboCop::CLI::STATUS_SUCCESS = T.let(T.unsafe(nil), Integer) + +RuboCop::CommentConfig::CONFIG_DISABLED_LINE_RANGE_MIN = T.let(T.unsafe(nil), Float) + +class RuboCop::Config + include ::RuboCop::PathUtil + include ::RuboCop::FileFinder + extend ::RuboCop::SimpleForwardable + + # @return [Config] a new instance of Config + # + # source://rubocop//lib/rubocop/config.rb#31 + def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/config.rb#97 + def [](*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def []=(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#212 + def active_support_extensions_enabled?; end + + # source://rubocop//lib/rubocop/config.rb#127 + def add_excludes_from_higher_level(highest_config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#239 + def allowed_camel_case_file?(file); end + + # Paths specified in configuration files starting with .rubocop are + # relative to the directory where that file is. Paths in other config files + # are relative to the current directory. This is so that paths in + # config/default.yml, for example, are not relative to RuboCop's config + # directory since that wouldn't work. + # + # source://rubocop//lib/rubocop/config.rb#283 + def base_dir_for_path_parameters; end + + # @return [String, nil] + # + # source://rubocop//lib/rubocop/config.rb#313 + def bundler_lock_file_path; end + + # source://rubocop//lib/rubocop/config.rb#85 + def check; end + + # @api private + # @return [Boolean] whether config for this badge has 'Include' or 'Exclude' keys + # + # source://rubocop//lib/rubocop/config.rb#180 + def clusivity_config_for_badge?(badge); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#200 + def cop_enabled?(name); end + + # source://rubocop//lib/rubocop/config.rb#97 + def delete(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#139 + def deprecation_check; end + + # source://rubocop//lib/rubocop/config.rb#97 + def dig(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#204 + def disabled_new_cops?; end + + # source://rubocop//lib/rubocop/config.rb#97 + def each(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def each_key(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#208 + def enabled_new_cops?; end + + # source://rubocop//lib/rubocop/config.rb#97 + def fetch(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#261 + def file_to_exclude?(file); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#220 + def file_to_include?(file); end + + # source://rubocop//lib/rubocop/config.rb#196 + def for_all_cops; end + + # Note: the 'Enabled' attribute is same as that returned by `for_cop` + # + # @return [Config] for the given cop merged with that of its department (if any) + # + # source://rubocop//lib/rubocop/config.rb#166 + def for_badge(badge); end + + # Note: the 'Enabled' attribute is calculated according to the department's + # and 'AllCops' configuration; other attributes are not inherited. + # + # @return [Config] for the given cop / cop name. + # + # source://rubocop//lib/rubocop/config.rb#153 + def for_cop(cop); end + + # Note: the 'Enabled' attribute will be present only if specified + # at the department's level + # + # @return [Config] for the given department name. + # + # source://rubocop//lib/rubocop/config.rb#191 + def for_department(department_name); end + + # If the given cop is enabled, returns its configuration hash. + # Otherwise, returns an empty hash. + # + # @return [Config, Hash] for the given cop / cop name. + # + # source://rubocop//lib/rubocop/config.rb#160 + def for_enabled_cop(cop); end + + # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) + # + # source://rubocop//lib/rubocop/config.rb#338 + def gem_versions_in_target; end + + # source://rubocop//lib/rubocop/config.rb#342 + def inspect; end + + # True if this is a config file that is shipped with RuboCop + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#110 + def internal?; end + + # source://rubocop//lib/rubocop/config.rb#97 + def key?(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def keys(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#81 + def loaded_features; end + + # Returns the value of attribute loaded_path. + # + # source://rubocop//lib/rubocop/config.rb#21 + def loaded_path; end + + # source://rubocop//lib/rubocop/config.rb#77 + def loaded_plugins; end + + # source://rubocop//lib/rubocop/config.rb#115 + def make_excludes_absolute; end + + # source://rubocop//lib/rubocop/config.rb#97 + def map(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def merge(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#293 + def parser_engine; end + + # source://rubocop//lib/rubocop/config.rb#274 + def path_relative_to_config(path); end + + # source://rubocop//lib/rubocop/config.rb#270 + def patterns_to_exclude; end + + # source://rubocop//lib/rubocop/config.rb#266 + def patterns_to_include; end + + # source://rubocop//lib/rubocop/config.rb#324 + def pending_cops; end + + # Returns true if there's a chance that an Include pattern matches hidden + # files, false if that's definitely not possible. + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#253 + def possibly_include_hidden?; end + + # source://rubocop//lib/rubocop/config.rb#97 + def replace(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#105 + def signature; end + + # source://rubocop//lib/rubocop/config.rb#308 + def smart_loaded_path; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#216 + def string_literals_frozen_by_default?; end + + # source://rubocop//lib/rubocop/config.rb#297 + def target_rails_version; end + + # source://rubocop//lib/rubocop/config.rb#99 + def target_ruby_version(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def to_h(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#97 + def to_hash(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#101 + def to_s; end + + # source://rubocop//lib/rubocop/config.rb#97 + def transform_values(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#99 + def validate(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config.rb#92 + def validate_after_resolution; end + + private + + # source://rubocop//lib/rubocop/config.rb#392 + def department_of(qualified_cop_name); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#380 + def enable_cop?(qualified_cop_name, cop_options); end + + # @param gem_version [Gem::Version] an object like `Gem::Version.new("7.1.2.3")` + # @return [Float] The major and minor version, like `7.1` + # + # source://rubocop//lib/rubocop/config.rb#367 + def gem_version_to_major_minor_float(gem_version); end + + # source://rubocop//lib/rubocop/config.rb#373 + def read_gem_versions_from_target_lockfile; end + + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # source://rubocop//lib/rubocop/config.rb#354 + def read_rails_version_from_bundler_lock_file; end + + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # source://rubocop//lib/rubocop/config.rb#349 + def target_rails_version_from_bundler_lock_file; end + + class << self + # source://rubocop//lib/rubocop/config.rb#23 + def create(hash, path, check: T.unsafe(nil)); end + end +end + +class RuboCop::Config::CopConfig < ::Struct + # Returns the value of attribute metadata + # + # @return [Object] the current value of metadata + # + # source://rubocop//lib/rubocop/config.rb#17 + def metadata; end + + # Sets the attribute metadata + # + # @param value [Object] the value to set the attribute metadata to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/config.rb#17 + def metadata=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://rubocop//lib/rubocop/config.rb#17 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/config.rb#17 + def name=(_); end + + class << self + # source://rubocop//lib/rubocop/config.rb#17 + def [](*_arg0); end + + # source://rubocop//lib/rubocop/config.rb#17 + def inspect; end + + # source://rubocop//lib/rubocop/config.rb#17 + def keyword_init?; end + + # source://rubocop//lib/rubocop/config.rb#17 + def members; end + + # source://rubocop//lib/rubocop/config.rb#17 + def new(*_arg0); end + end +end + +RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) + +RuboCop::Config::EMPTY_CONFIG = T.let(T.unsafe(nil), Hash) + +class RuboCop::ConfigFinder + extend ::RuboCop::FileFinder + + class << self + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#19 + def find_config_path(target_dir); end + + # Returns the path RuboCop inferred as the root of the project. No file + # searches will go past this directory. + # + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#26 + def project_root; end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#17 + def project_root=(_arg0); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#69 + def expand_path(path); end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#40 + def find_project_dotfile(target_dir); end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#32 + def find_project_root; end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#44 + def find_project_root_dot_config; end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#54 + def find_user_dotfile; end + + # @api private + # + # source://rubocop//lib/rubocop/config_finder.rb#62 + def find_user_xdg_config; end + end +end + +RuboCop::ConfigFinder::DEFAULT_FILE = T.let(T.unsafe(nil), String) + +RuboCop::ConfigFinder::DOTFILE = T.let(T.unsafe(nil), String) + +RuboCop::ConfigFinder::RUBOCOP_HOME = T.let(T.unsafe(nil), String) + +RuboCop::ConfigFinder::XDG_CONFIG = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigLoader + extend ::RuboCop::FileFinder + + class << self + # source://rubocop//lib/rubocop/config_loader.rb#152 + def add_excludes_from_files(config, config_file); end + + # Used to add features that were required inside a config or from + # the CLI using `--require`. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader.rb#241 + def add_loaded_features(loaded_features); end + + # Used to add plugins that were required inside a config or from + # the CLI using `--plugin`. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader.rb#234 + def add_loaded_plugins(loaded_plugins); end + + # source://rubocop//lib/rubocop/config_loader.rb#91 + def add_missing_namespaces(path, hash); end + + # source://rubocop//lib/rubocop/config_loader.rb#41 + def clear_options; end + + # Returns the path of .rubocop.yml searching upwards in the + # directory structure starting at the given directory where the + # inspected file is. If no .rubocop.yml is found there, the + # user's home directory is checked. If there's no .rubocop.yml + # there either, the path to the default file is returned. + # + # source://rubocop//lib/rubocop/config_loader.rb#119 + def configuration_file_for(target_dir); end + + # source://rubocop//lib/rubocop/config_loader.rb#123 + def configuration_from_file(config_file, check: T.unsafe(nil)); end + + # Returns the value of attribute debug. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def debug; end + + # Sets the attribute debug + # + # @param value the value to set the attribute debug to. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def debug=(_arg0); end + + # Returns the value of attribute debug. + # + # source://rubocop//lib/rubocop/config_loader.rb#38 + def debug?; end + + # source://rubocop//lib/rubocop/config_loader.rb#162 + def default_configuration; end + + # Sets the attribute default_configuration + # + # @param value the value to set the attribute default_configuration to. + # + # source://rubocop//lib/rubocop/config_loader.rb#35 + def default_configuration=(_arg0); end + + # Returns the value of attribute disable_pending_cops. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def disable_pending_cops; end + + # Sets the attribute disable_pending_cops + # + # @param value the value to set the attribute disable_pending_cops to. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def disable_pending_cops=(_arg0); end + + # Returns the value of attribute enable_pending_cops. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def enable_pending_cops; end + + # Sets the attribute enable_pending_cops + # + # @param value the value to set the attribute enable_pending_cops to. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def enable_pending_cops=(_arg0); end + + # Returns the value of attribute ignore_parent_exclusion. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def ignore_parent_exclusion; end + + # Sets the attribute ignore_parent_exclusion + # + # @param value the value to set the attribute ignore_parent_exclusion to. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def ignore_parent_exclusion=(_arg0); end + + # Returns the value of attribute ignore_parent_exclusion. + # + # source://rubocop//lib/rubocop/config_loader.rb#39 + def ignore_parent_exclusion?; end + + # Returns the value of attribute ignore_unrecognized_cops. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def ignore_unrecognized_cops; end + + # Sets the attribute ignore_unrecognized_cops + # + # @param value the value to set the attribute ignore_unrecognized_cops to. + # + # source://rubocop//lib/rubocop/config_loader.rb#33 + def ignore_unrecognized_cops=(_arg0); end + + # This API is primarily intended for testing and documenting plugins. + # When testing a plugin using `rubocop/rspec/support`, the plugin is loaded automatically, + # so this API is usually not needed. It is intended to be used only when implementing tests + # that do not use `rubocop/rspec/support`. + # + # source://rubocop//lib/rubocop/config_loader.rb#174 + def inject_defaults!(config_yml_path); end + + # source://rubocop//lib/rubocop/config_loader.rb#53 + def load_file(file, check: T.unsafe(nil)); end + + # @raise [TypeError] + # + # source://rubocop//lib/rubocop/config_loader.rb#78 + def load_yaml_configuration(absolute_path); end + + # Returns the value of attribute loaded_features. + # + # source://rubocop//lib/rubocop/config_loader.rb#36 + def loaded_features; end + + # Returns the value of attribute loaded_plugins. + # + # source://rubocop//lib/rubocop/config_loader.rb#36 + def loaded_plugins; end + + # Return a recursive merge of two hashes. That is, a normal hash merge, + # with the addition that any value that is a hash, and occurs in both + # arguments, will also be merged. And so on. + # + # source://rubocop//lib/rubocop/config_loader.rb#110 + def merge(base_hash, derived_hash); end + + # Merges the given configuration with the default one. + # + # source://rubocop//lib/rubocop/config_loader.rb#227 + def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/config_loader.rb#143 + def pending_cops_only_qualified(pending_cops); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader.rb#147 + def possible_new_cops?(config); end + + # Returns the path RuboCop inferred as the root of the project. No file + # searches will go past this directory. + # + # @deprecated Use `RuboCop::ConfigFinder.project_root` instead. + # + # source://rubocop//lib/rubocop/config_loader.rb#202 + def project_root; end + + # source://rubocop//lib/rubocop/config_loader.rb#211 + def warn_on_pending_cops(pending_cops); end + + # source://rubocop//lib/rubocop/config_loader.rb#219 + def warn_pending_cop(cop); end + + private + + # source://rubocop//lib/rubocop/config_loader.rb#255 + def check_duplication(yaml_code, absolute_path); end + + # source://rubocop//lib/rubocop/config_loader.rb#247 + def file_path(file); end + + # Read the specified file, or exit with a friendly, concise message on + # stderr. Care is taken to use the standard OS exit code for a "file not + # found" error. + # + # source://rubocop//lib/rubocop/config_loader.rb#275 + def read_file(absolute_path); end + + # source://rubocop//lib/rubocop/config_loader.rb#251 + def resolver; end + + # source://rubocop//lib/rubocop/config_loader.rb#281 + def yaml_tree_to_hash(yaml_tree); end + + # source://rubocop//lib/rubocop/config_loader.rb#291 + def yaml_tree_to_hash!(yaml_tree); end + end +end + +RuboCop::ConfigLoader::DEFAULT_FILE = T.let(T.unsafe(nil), String) + +RuboCop::ConfigLoader::DOTFILE = T.let(T.unsafe(nil), String) + +RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigLoaderResolver + # When one .rubocop.yml file inherits from another .rubocop.yml file, the Include paths in the + # base configuration are relative to the directory where the base configuration file is. For the + # derived configuration, we need to make those paths relative to where the derived configuration + # file is. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#64 + def fix_include_paths(base_config_path, hash, path, key, value); end + + # Return a recursive merge of two hashes. That is, a normal hash merge, + # with the addition that any value that is a hash, and occurs in both + # arguments, will also be merged. And so on. + # + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#118 + def merge(base_hash, derived_hash, **opts); end + + # Merges the given configuration with the default one. If + # AllCops:DisabledByDefault is true, it changes the Enabled params so that + # only cops from user configuration are enabled. If + # AllCops:EnabledByDefault is true, it changes the Enabled params so that + # only cops explicitly disabled in user configuration are disabled. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#94 + def merge_with_default(config, config_file, unset_nil:); end + + # An `Enabled: true` setting in user configuration for a cop overrides an + # `Enabled: false` setting for its department. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#138 + def override_department_setting_for_cops(base_hash, derived_hash); end + + # If a cop was previously explicitly enabled, but then superseded by the + # department being disabled, disable it. + # + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#155 + def override_enabled_for_disabled_departments(base_hash, derived_hash); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#38 + def resolve_inheritance(path, hash, file, debug); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#74 + def resolve_inheritance_from_gems(hash); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#11 + def resolve_plugins(rubocop_config, plugins); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#18 + def resolve_requires(path, hash); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#234 + def base_configs(path, inherit_from, file); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#202 + def determine_inherit_mode(hash, key); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#171 + def disabled?(hash, department); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#175 + def duplicate_setting?(base_hash, derived_hash, key, inherited_file); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#196 + def duplicate_setting_warning(opts, key); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#293 + def gem_config_path(gem_name, relative_config_path); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#271 + def handle_disabled_by_default(config, new_default_configuration); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#246 + def inherited_file(path, inherit_from, file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#230 + def merge_hashes?(base_hash, derived_hash, key); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#267 + def remote_config?(file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#222 + def should_merge?(mode, key); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#226 + def should_override?(mode, key); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#208 + def should_union?(derived_hash, base_hash, root_mode, key); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#289 + def transform(config, &block); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#184 + def warn_on_duplicate_setting(base_hash, derived_hash, key, **opts); end +end + +class RuboCop::ConfigNotFoundError < ::RuboCop::Error; end + +class RuboCop::ConfigObsoletion + # @api private + # @return [ConfigObsoletion] a new instance of ConfigObsoletion + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#66 + def initialize(config); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#84 + def deprecated_cop_name?(name); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#79 + def legacy_cop_names; end + + # @api private + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#72 + def reject_obsolete!; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#21 + def rules; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#21 + def warnings; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#151 + def cop_rules; end + + # Cop rules are keyed by the name of the original cop + # + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#112 + def load_cop_rules(rules); end + + # Parameter rules may apply to multiple cops and multiple parameters + # and are given as an array. Each combination is turned into a separate + # rule object. + # + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#125 + def load_parameter_rules(rules); end + + # Default rules for obsoletions are in config/obsoletion.yml + # Additional rules files can be added with `RuboCop::ConfigObsoletion.files << filename` + # + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#92 + def load_rules; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#138 + def obsoletions; end + + class << self + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#45 + def deprecated_cop_name?(name); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#49 + def deprecated_names_for(cop); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#24 + def files; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#24 + def files=(_arg0); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#26 + def global; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#40 + def legacy_cop_names; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#30 + def reset!; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion.rb#36 + def rules_cache_key; end + end +end + +RuboCop::ConfigObsoletion::COP_RULE_CLASSES = T.let(T.unsafe(nil), Hash) + +class RuboCop::ConfigObsoletion::ChangedEnforcedStyles < ::RuboCop::ConfigObsoletion::ParameterRule + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#14 + def message; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#10 + def violated?; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/changed_enforced_styles.rb#28 + def value; end +end + +RuboCop::ConfigObsoletion::ChangedEnforcedStyles::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigObsoletion::ChangedParameter < ::RuboCop::ConfigObsoletion::ParameterRule + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/changed_parameter.rb#10 + def message; end +end + +RuboCop::ConfigObsoletion::ChangedParameter::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigObsoletion::CopRule < ::RuboCop::ConfigObsoletion::Rule + # @api private + # @return [CopRule] a new instance of CopRule + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#10 + def initialize(config, old_name); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#15 + def cop_rule?; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#19 + def message; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#8 + def old_name; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#28 + def violated?; end + + # Cop rules currently can only be failures, not warnings + # + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/cop_rule.rb#24 + def warning?; end +end + +RuboCop::ConfigObsoletion::DEFAULT_RULES_FILE = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigObsoletion::ExtractedCop < ::RuboCop::ConfigObsoletion::CopRule + # @api private + # @return [ExtractedCop] a new instance of ExtractedCop + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#11 + def initialize(config, old_name, gem); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#9 + def department; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#9 + def gem; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#23 + def rule_message; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#17 + def violated?; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#32 + def affected_cops; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/extracted_cop.rb#41 + def plugin_loaded?; end +end + +RuboCop::ConfigObsoletion::LOAD_RULES_CACHE = T.let(T.unsafe(nil), Hash) + +RuboCop::ConfigObsoletion::PARAMETER_RULE_CLASSES = T.let(T.unsafe(nil), Hash) + +class RuboCop::ConfigObsoletion::ParameterRule < ::RuboCop::ConfigObsoletion::Rule + # @api private + # @return [ParameterRule] a new instance of ParameterRule + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#10 + def initialize(config, cop, parameter, metadata); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 + def cop; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 + def metadata; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#8 + def parameter; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#17 + def parameter_rule?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#21 + def violated?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#25 + def warning?; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#39 + def alternative; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#43 + def alternatives; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#31 + def applies_to_current_ruby_version?; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#47 + def reason; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/parameter_rule.rb#51 + def severity; end +end + +class RuboCop::ConfigObsoletion::RemovedCop < ::RuboCop::ConfigObsoletion::CopRule + # @api private + # @return [RemovedCop] a new instance of RemovedCop + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#13 + def initialize(config, old_name, metadata); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#9 + def metadata; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#9 + def old_name; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#18 + def rule_message; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#36 + def alternatives; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/removed_cop.rb#32 + def reason; end +end + +RuboCop::ConfigObsoletion::RemovedCop::BASE_MESSAGE = T.let(T.unsafe(nil), String) + +class RuboCop::ConfigObsoletion::RenamedCop < ::RuboCop::ConfigObsoletion::CopRule + # @api private + # @return [RenamedCop] a new instance of RenamedCop + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#11 + def initialize(config, old_name, name_or_hash); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#9 + def metadata; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#9 + def new_name; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#23 + def rule_message; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#27 + def warning?; end + + private + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#33 + def moved?; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#44 + def severity; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/renamed_cop.rb#40 + def verb; end +end + +class RuboCop::ConfigObsoletion::Rule + # @api private + # @return [Rule] a new instance of Rule + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#8 + def initialize(config); end + + # Does this rule relate to cops? + # + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#13 + def cop_rule?; end + + # Does this rule relate to parameters? + # + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#18 + def parameter_rule?; end + + # @api private + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#22 + def violated?; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#28 + def config; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#36 + def smart_loaded_path; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/rule.rb#30 + def to_sentence(collection, connector: T.unsafe(nil)); end +end + +class RuboCop::ConfigObsoletion::SplitCop < ::RuboCop::ConfigObsoletion::CopRule + # @api private + # @return [SplitCop] a new instance of SplitCop + # + # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#11 + def initialize(config, old_name, metadata); end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#9 + def metadata; end + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#16 + def rule_message; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_obsoletion/split_cop.rb#22 + def alternatives; end +end + +class RuboCop::ConfigRegeneration + # Get options from the comment in the TODO file, and parse them as options + # + # @api private + # + # source://rubocop//lib/rubocop/config_regeneration.rb#12 + def options; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/config_regeneration.rb#29 + def generation_command; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_regeneration.rb#25 + def todo_exists?; end +end + +RuboCop::ConfigRegeneration::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) + +RuboCop::ConfigRegeneration::COMMAND_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::ConfigRegeneration::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +class RuboCop::ConfigStore + # @return [ConfigStore] a new instance of ConfigStore + # + # source://rubocop//lib/rubocop/config_store.rb#10 + def initialize; end + + # If type (file/dir) is known beforehand, + # prefer using #for_file or #for_dir for improved performance + # + # source://rubocop//lib/rubocop/config_store.rb#52 + def for(file_or_dir); end + + # source://rubocop//lib/rubocop/config_store.rb#61 + def for_dir(dir); end + + # source://rubocop//lib/rubocop/config_store.rb#42 + def for_file(file); end + + # source://rubocop//lib/rubocop/config_store.rb#46 + def for_pwd; end + + # source://rubocop//lib/rubocop/config_store.rb#33 + def force_default_config!; end + + # source://rubocop//lib/rubocop/config_store.rb#28 + def options_config=(options_config); end + + # source://rubocop//lib/rubocop/config_store.rb#37 + def unvalidated; end + + # Returns the value of attribute validated. + # + # source://rubocop//lib/rubocop/config_store.rb#7 + def validated; end + + # Returns the value of attribute validated. + # + # source://rubocop//lib/rubocop/config_store.rb#8 + def validated?; end +end + +class RuboCop::ConfigValidator + extend ::RuboCop::SimpleForwardable + + # @return [ConfigValidator] a new instance of ConfigValidator + # + # source://rubocop//lib/rubocop/config_validator.rb#28 + def initialize(config); end + + # source://rubocop//lib/rubocop/config_validator.rb#26 + def for_all_cops(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config_validator.rb#26 + def smart_loaded_path(*_arg0, **_arg1, &_arg2); end + + # source://rubocop//lib/rubocop/config_validator.rb#65 + def target_ruby_version; end + + # source://rubocop//lib/rubocop/config_validator.rb#34 + def validate; end + + # Validations that should only be run after all config resolving has + # taken place: + # * The target ruby version is only checked once the entire inheritance + # chain has been loaded so that only the final value is validated, and + # any obsolete but overridden values are ignored. + # + # source://rubocop//lib/rubocop/config_validator.rb#61 + def validate_after_resolution; end + + private + + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_validator.rb#100 + def alert_about_unrecognized_cops(invalid_cop_names); end + + # source://rubocop//lib/rubocop/config_validator.rb#263 + def check_cop_config_value(hash, parent = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/config_validator.rb#73 + def check_obsoletions; end + + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_validator.rb#80 + def check_target_ruby; end + + # source://rubocop//lib/rubocop/config_validator.rb#205 + def each_invalid_parameter(cop_name); end + + # source://rubocop//lib/rubocop/config_validator.rb#116 + def list_unknown_cops(invalid_cop_names); end + + # FIXME: Handling colors in exception messages like this is ugly. + # + # source://rubocop//lib/rubocop/config_validator.rb#284 + def param_error_message(parent, key, value, supposed_values); end + + # source://rubocop//lib/rubocop/config_validator.rb#252 + def reject_conflicting_safe_settings; end + + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_validator.rb#243 + def reject_mutually_exclusive_defaults; end + + # source://rubocop//lib/rubocop/config_validator.rb#139 + def suggestion(name); end + + # Returns the value of attribute target_ruby. + # + # source://rubocop//lib/rubocop/config_validator.rb#71 + def target_ruby; end + + # source://rubocop//lib/rubocop/config_validator.rb#217 + def validate_enforced_styles(valid_cop_names); end + + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_validator.rb#166 + def validate_new_cops_parameter; end + + # source://rubocop//lib/rubocop/config_validator.rb#191 + def validate_parameter_names(valid_cop_names); end + + # source://rubocop//lib/rubocop/config_validator.rb#177 + def validate_parameter_shape(valid_cop_names); end + + # source://rubocop//lib/rubocop/config_validator.rb#237 + def validate_support_and_has_list(name, formats, valid); end + + # @raise [ValidationError] + # + # source://rubocop//lib/rubocop/config_validator.rb#155 + def validate_syntax_cop; end +end + +RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) + +RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = T.let(T.unsafe(nil), Array) + +RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array) + +RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) + +RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Alignment::SPACE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::AllowedIdentifiers::SIGILS = T.let(T.unsafe(nil), String) + +module RuboCop::Cop::AllowedMethods + private + + # @api public + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#13 + def allowed_method?(name); end + + # @api public + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#27 + def allowed_methods; end + + # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#35 + def cop_config_allowed_methods; end + + # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#39 + def cop_config_deprecated_values; end + + # @deprecated Use allowed_method? instead + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#18 + def ignored_method?; end +end + +module RuboCop::Cop::AllowedPattern + private + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#10 + def allowed_line?(line); end + + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#42 + def allowed_patterns; end + + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#58 + def cop_config_deprecated_methods_values; end + + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#52 + def cop_config_patterns_values; end + + # @deprecated Use allowed_line? instead + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#21 + def ignored_line?(line); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#29 + def matches_allowed_pattern?(line); end + + # @deprecated Use matches_allowed_pattern? instead + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/allowed_pattern.rb#34 + def matches_ignored_pattern?(line); end +end + +RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::AnnotationComment::KEYWORDS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) + +module RuboCop::Cop::AutoCorrector + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/auto_corrector.rb#7 + def support_autocorrect?; end +end + +module RuboCop::Cop::AutocorrectLogic + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#7 + def autocorrect?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#31 + def autocorrect_enabled?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#15 + def autocorrect_requested?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#11 + def autocorrect_with_disable_uncorrectable?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#19 + def correctable?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#23 + def disable_uncorrectable?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#27 + def safe_autocorrect?; end + + private + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#51 + def disable_offense(offense_range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#139 + def disable_offense_at_end_of_line(range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#147 + def disable_offense_before_and_after(range_by_lines); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#77 + def disable_offense_with_eol_or_surround_comment(range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#143 + def eol_comment; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#85 + def eol_comment_would_be_inside_literal?(offense_range, literal_range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#100 + def heredoc_range(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#92 + def line_with_eol_comment_too_long?(range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#135 + def max_line_length; end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63 + def multiline_ranges(offense_range); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#112 + def multiline_string?(node); end + + # Expand the given range to include all of any lines it covers. Does not + # include newline at end of the last line. + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#125 + def range_by_lines(range); end + + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#116 + def range_of_first_line(range); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#108 + def string_continuation?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#96 + def surrounding_heredoc?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#104 + def surrounding_percent_array?(node); end +end + +class RuboCop::Cop::Base + include ::RuboCop::AST::Sexp + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + include ::RuboCop::Cop::IgnoredNode + include ::RuboCop::Cop::AutocorrectLogic + extend ::RuboCop::AST::Sexp + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::ExcludeLimit + + # @return [Base] a new instance of Base + # + # source://rubocop//lib/rubocop/cop/base.rb#156 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#278 + def active_support_extensions_enabled?; end + + # Adds an offense that has no particular location. + # No correction can be applied to global offenses + # + # source://rubocop//lib/rubocop/cop/base.rb#189 + def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end + + # Adds an offense on the specified range (or node with an expression) + # Unless that offense is disabled for this range, a corrector will be yielded + # to provide the cop the opportunity to autocorrect the offense. + # If message is not specified, the method `message` will be called. + # + # source://rubocop//lib/rubocop/cop/base.rb#201 + def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#357 + def always_autocorrect?; end + + # Called before any investigation + # + # @api private + # + # source://rubocop//lib/rubocop/cop/base.rb#343 + def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end + + # @api private + # + # source://rubocop//lib/rubocop/cop/base.rb#324 + def callbacks_needed; end + + # Returns the value of attribute config. + # + # source://rubocop//lib/rubocop/cop/base.rb#43 + def config; end + + # source://rubocop//lib/rubocop/cop/base.rb#252 + def config_to_allow_offenses; end + + # source://rubocop//lib/rubocop/cop/base.rb#256 + def config_to_allow_offenses=(hash); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#363 + def contextual_autocorrect?; end + + # Configuration Helpers + # + # source://rubocop//lib/rubocop/cop/base.rb#246 + def cop_config; end + + # source://rubocop//lib/rubocop/cop/base.rb#238 + def cop_name; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#295 + def excluded_file?(file); end + + # This method should be overridden when a cop's behavior depends + # on state that lives outside of these locations: + # + # (1) the file under inspection + # (2) the cop's source code + # (3) the config (eg a .rubocop.yml file) + # + # For example, some cops may want to look at other parts of + # the codebase being inspected to find violations. A cop may + # use the presence or absence of file `foo.rb` to determine + # whether a certain violation exists in `bar.rb`. + # + # Overriding this method allows the cop to indicate to RuboCop's + # ResultCache system when those external dependencies change, + # ie when the ResultCache should be invalidated. + # + # source://rubocop//lib/rubocop/cop/base.rb#234 + def external_dependency_checksum; end + + # source://rubocop//lib/rubocop/cop/base.rb#367 + def inspect; end + + # Gets called if no message is specified when calling `add_offense` or + # `add_global_offense` + # Cops are discouraged to override this; instead pass your message directly + # + # source://rubocop//lib/rubocop/cop/base.rb#183 + def message(_range = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/base.rb#242 + def name; end + + # @deprecated Make potential errors with previous API more obvious + # + # source://rubocop//lib/rubocop/cop/base.rb#315 + def offenses; end + + # Called after all on_... have been called + # When refining this method, always call `super` + # + # source://rubocop//lib/rubocop/cop/base.rb#170 + def on_investigation_end; end + + # Called before all on_... have been called + # When refining this method, always call `super` + # + # source://rubocop//lib/rubocop/cop/base.rb#164 + def on_new_investigation; end + + # Called instead of all on_... callbacks for unrecognized files / syntax errors + # When refining this method, always call `super` + # + # source://rubocop//lib/rubocop/cop/base.rb#176 + def on_other_file; end + + # There should be very limited reasons for a Cop to do it's own parsing + # + # source://rubocop//lib/rubocop/cop/base.rb#300 + def parse(source, path = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/base.rb#270 + def parser_engine; end + + # Returns the value of attribute processed_source. + # + # source://rubocop//lib/rubocop/cop/base.rb#43 + def processed_source; end + + # Called between investigations + # + # @api private + # + # source://rubocop//lib/rubocop/cop/base.rb#306 + def ready; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#286 + def relevant_file?(file); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#282 + def string_literals_frozen_by_default?; end + + # Returns a gems locked versions (i.e. from Gemfile.lock or gems.locked) + # + # source://rubocop//lib/rubocop/cop/base.rb#266 + def target_gem_version(gem_name); end + + # source://rubocop//lib/rubocop/cop/base.rb#274 + def target_rails_version; end + + # source://rubocop//lib/rubocop/cop/base.rb#260 + def target_ruby_version; end + + private + + # source://rubocop//lib/rubocop/cop/base.rb#485 + def annotate(message); end + + # source://rubocop//lib/rubocop/cop/base.rb#379 + def apply_correction(corrector); end + + # @return [Symbol] offense status + # + # source://rubocop//lib/rubocop/cop/base.rb#449 + def attempt_correction(range, corrector); end + + # Reserved for Cop::Cop + # + # source://rubocop//lib/rubocop/cop/base.rb#375 + def callback_argument(range); end + + # Called to complete an investigation + # + # source://rubocop//lib/rubocop/cop/base.rb#408 + def complete_investigation; end + + # @return [Symbol, Corrector] offense status + # + # source://rubocop//lib/rubocop/cop/base.rb#423 + def correct(range); end + + # source://rubocop//lib/rubocop/cop/base.rb#393 + def current_corrector; end + + # Reserved for Commissioner: + # + # source://rubocop//lib/rubocop/cop/base.rb#385 + def current_offense_locations; end + + # source://rubocop//lib/rubocop/cop/base.rb#397 + def current_offenses; end + + # source://rubocop//lib/rubocop/cop/base.rb#389 + def currently_disabled_lines; end + + # source://rubocop//lib/rubocop/cop/base.rb#513 + def custom_severity; end + + # source://rubocop//lib/rubocop/cop/base.rb#509 + def default_severity; end + + # source://rubocop//lib/rubocop/cop/base.rb#463 + def disable_uncorrectable(range); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#499 + def enabled_line?(line_number); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#491 + def file_name_matches_any?(file, parameter, default_result); end + + # source://rubocop//lib/rubocop/cop/base.rb#481 + def find_message(range, message); end + + # source://rubocop//lib/rubocop/cop/base.rb#505 + def find_severity(_range, severity); end + + # source://rubocop//lib/rubocop/cop/base.rb#526 + def range_for_original(range); end + + # source://rubocop//lib/rubocop/cop/base.rb#470 + def range_from_node_or_range(node_or_range); end + + # Actually private methods + # + # source://rubocop//lib/rubocop/cop/base.rb#418 + def reset_investigation; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#534 + def target_satisfies_all_gem_version_requirements?; end + + # @return [Symbol] offense status + # + # source://rubocop//lib/rubocop/cop/base.rb#438 + def use_corrector(range, corrector); end + + class << self + # List of cops that should not try to autocorrect at the same + # time as this cop + # + # @api public + # @return [Array] + # + # source://rubocop//lib/rubocop/cop/base.rb#59 + def autocorrect_incompatible_with; end + + # Naming + # + # source://rubocop//lib/rubocop/cop/base.rb#93 + def badge; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/base.rb#329 + def callbacks_needed; end + + # source://rubocop//lib/rubocop/cop/base.rb#97 + def cop_name; end + + # source://rubocop//lib/rubocop/cop/base.rb#101 + def department; end + + # Returns a url to view this cops documentation online. + # Requires 'DocumentationBaseURL' to be set for your department. + # Will follow the convention of RuboCops own documentation structure, + # overwrite this method to accommodate your custom layout. + # + # @api public + # @return [String, nil] + # + # source://rubocop//lib/rubocop/cop/base.rb#70 + def documentation_url(config = T.unsafe(nil)); end + + # Call for abstract Cop classes + # + # source://rubocop//lib/rubocop/cop/base.rb#81 + def exclude_from_registry; end + + # Returns the value of attribute gem_requirements. + # + # source://rubocop//lib/rubocop/cop/base.rb#138 + def gem_requirements; end + + # @private + # + # source://rubocop//lib/rubocop/cop/base.rb#74 + def inherited(subclass); end + + # Override and return the Force class(es) you need to join + # + # source://rubocop//lib/rubocop/cop/base.rb#118 + def joining_forces; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#105 + def lint?; end + + # Returns true if the cop name or the cop namespace matches any of the + # given names. + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#111 + def match?(given_names); end + + # Register a version requirement for the given gem name. + # This cop will be skipped unless the target satisfies *all* requirements. + # + # @api public + # @param gem_name [String] + # @param version_requirements [Array] The version requirements, + # using the same syntax as a Gemfile, e.g. ">= 1.2.3" + # + # If omitted, any version of the gem will be accepted. + # + # https://guides.rubygems.org/patterns/#declaring-dependencies + # + # source://rubocop//lib/rubocop/cop/base.rb#151 + def requires_gem(gem_name, *version_requirements); end + + # Returns if class supports autocorrect. + # It is recommended to extend AutoCorrector instead of overriding + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#87 + def support_autocorrect?; end + + # Override if your cop should be called repeatedly for multiple investigations + # Between calls to `on_new_investigation` and `on_investigation_end`, + # the result of `processed_source` will remain constant. + # You should invalidate any caches that depend on the current `processed_source` + # in the `on_new_investigation` callback. + # If your cop does autocorrections, be aware that your instance may be called + # multiple times with the same `processed_source.path` but different content. + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#129 + def support_multiple_source?; end + + private + + # source://rubocop//lib/rubocop/cop/base.rb#401 + def restrict_on_send; end + end +end + +RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) + +class RuboCop::Cop::Base::InvestigationReport < ::Struct + # Returns the value of attribute cop + # + # @return [Object] the current value of cop + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def cop; end + + # Sets the attribute cop + # + # @param value [Object] the value to set the attribute cop to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def cop=(_); end + + # Returns the value of attribute corrector + # + # @return [Object] the current value of corrector + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def corrector; end + + # Sets the attribute corrector + # + # @param value [Object] the value to set the attribute corrector to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def corrector=(_); end + + # Returns the value of attribute offenses + # + # @return [Object] the current value of offenses + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def offenses; end + + # Sets the attribute offenses + # + # @param value [Object] the value to set the attribute offenses to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def offenses=(_); end + + # Returns the value of attribute processed_source + # + # @return [Object] the current value of processed_source + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def processed_source; end + + # Sets the attribute processed_source + # + # @param value [Object] the value to set the attribute processed_source to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/base.rb#48 + def processed_source=(_); end + + class << self + # source://rubocop//lib/rubocop/cop/base.rb#48 + def [](*_arg0); end + + # source://rubocop//lib/rubocop/cop/base.rb#48 + def inspect; end + + # source://rubocop//lib/rubocop/cop/base.rb#48 + def keyword_init?; end + + # source://rubocop//lib/rubocop/cop/base.rb#48 + def members; end + + # source://rubocop//lib/rubocop/cop/base.rb#48 + def new(*_arg0); end + end +end + +RuboCop::Cop::Base::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::DuplicatedGroup::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::DuplicatedGroup::SOURCE_BLOCK_NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::GemComment::CHECKED_OPTIONS_CONFIG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemFilename::GEMFILE_FILES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::GemFilename::GEMS_RB_FILES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_MISMATCHED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_REQUIRED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_MISMATCHED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_REQUIRED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::GemVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Bundler::InsecureProtocolSource::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::InsecureProtocolSource::MSG_HTTP_PROTOCOL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Bundler::InsecureProtocolSource::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Bundler::OrderedGems::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::CodeLength::MSG = T.let(T.unsafe(nil), String) + +module RuboCop::Cop::CommentsHelp + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#27 + def comments_contain_disables?(node, cop_name); end + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#18 + def comments_in_range(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#14 + def contains_comments?(node); end + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#7 + def source_range_with_comment(node); end + + private + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#46 + def begin_pos_with_comment(node); end + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#60 + def buffer; end + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#41 + def end_position_for(node); end + + # Returns the end line of a node, which might be a comment and not part of the AST + # End line is considered either the line at which another node starts, or + # the line at which the parent node ends. + # + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#68 + def find_end_line(node); end + + # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#56 + def start_line_position(node); end +end + +RuboCop::Cop::Commissioner::RESTRICTED_CALLBACKS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::ConfigurableEnforcedStyle::SYMBOL_TO_STRING_CACHE = T.let(T.unsafe(nil), Hash) + +module RuboCop::Cop::ConfigurableFormatting + include ::RuboCop::Cop::ConfigurableEnforcedStyle + + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#9 + def check_name(node, name, name_range); end + + # A class emitter method is a singleton method in a class/module, where + # the method has the same name as a class defined in the class/module. + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#30 + def class_emitter_method?(node, name); end + + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#17 + def report_opposing_styles(node, name); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#24 + def valid_name?(node, name, given_style = T.unsafe(nil)); end +end + +module RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::ConfigurableFormatting +end + +RuboCop::Cop::ConfigurableNaming::FORMATS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash) + +class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter + # corrector = Corrector.new(cop) + # + # @param source [Parser::Source::Buffer, or anything + # leading to one via `(processed_source.)buffer`] + # @return [Corrector] a new instance of Corrector + # + # source://rubocop//lib/rubocop/cop/corrector.rb#32 + def initialize(source); end + + # Removes `size` characters from the beginning of the given range. + # If `size` is greater than the size of `range`, the removed region can + # overrun the end of `range`. + # + # @param range [Parser::Source::Range, RuboCop::AST::Node] or node + # @param size [Integer] + # + # source://rubocop//lib/rubocop/cop/corrector.rb#63 + def remove_leading(node_or_range, size); end + + # Removes `size` characters prior to the source range. + # + # @param range [Parser::Source::Range, RuboCop::AST::Node] or node + # @param size [Integer] + # + # source://rubocop//lib/rubocop/cop/corrector.rb#51 + def remove_preceding(node_or_range, size); end + + # Removes `size` characters from the end of the given range. + # If `size` is greater than the size of `range`, the removed region can + # overrun the beginning of `range`. + # + # @param range [Parser::Source::Range, RuboCop::AST::Node] or node + # @param size [Integer] + # + # source://rubocop//lib/rubocop/cop/corrector.rb#75 + def remove_trailing(node_or_range, size); end + + # Legacy + # + # source://rubocop//lib/rubocop/cop/corrector.rb#45 + def rewrite; end + + # Swaps sources at the given ranges. + # + # @param node_or_range1 [Parser::Source::Range, RuboCop::AST::Node] + # @param node_or_range2 [Parser::Source::Range, RuboCop::AST::Node] + # + # source://rubocop//lib/rubocop/cop/corrector.rb#85 + def swap(node_or_range1, node_or_range2); end + + private + + # source://rubocop//lib/rubocop/cop/corrector.rb#119 + def check_range_validity(node_or_range); end + + # source://rubocop//lib/rubocop/cop/corrector.rb#104 + def to_range(node_or_range); end + + # source://rubocop//lib/rubocop/cop/corrector.rb#123 + def validate_buffer(buffer); end + + class << self + # Duck typing for get to a ::Parser::Source::Buffer + # + # source://rubocop//lib/rubocop/cop/corrector.rb#15 + def source_buffer(source); end + end +end + +RuboCop::Cop::Corrector::NOOP_CONSUMER = T.let(T.unsafe(nil), Proc) + +RuboCop::Cop::EachToForCorrector::CORRECTION_WITHOUT_ARGUMENTS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::EachToForCorrector::CORRECTION_WITH_ARGUMENTS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::ForbiddenIdentifiers::SIGILS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES_RUBY27 = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::AttributeAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::DependencyVersion::ADD_DEPENDENCY_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::DependencyVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::DependencyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::DependencyVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::DevelopmentDependencies::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::DevelopmentDependencies::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::DuplicatedAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::OrderedDependencies::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::RequireMFA::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::RequiredRubyVersion::MISSING_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::RequiredRubyVersion::NOT_EQUAL_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Generator::CONFIGURATION_ADDED_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Generator::ConfigurationInjector::TEMPLATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Generator::RequireFileInjector::REQUIRE_PATH = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Generator::SOURCE_TEMPLATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Generator::SPEC_TEMPLATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_EXPLICIT_VALUE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_MSG_PREFIX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_OMIT_VALUE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashShorthandSyntax::EXPLICIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashShorthandSyntax::OMIT_HASH_VALUE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashSubset::ACTIVE_SUPPORT_SUBSET_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::HashSubset::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::HashSubset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::HashSubset::SUBSET_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::HashTransformMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Heredoc::OPENING_DELIMITER = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::IfThenCorrector::DEFAULT_INDENTATION_WIDTH = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods + +module RuboCop::Cop::IgnoredNode + # source://rubocop//lib/rubocop/cop/ignored_node.rb#7 + def ignore_node(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/ignored_node.rb#24 + def ignored_node?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/ignored_node.rb#11 + def part_of_ignored_node?(node); end + + private + + # source://rubocop//lib/rubocop/cop/ignored_node.rb#31 + def ignored_nodes; end +end + +RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern + +RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::BlockEndNewline::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::CaseIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClassStructure::HUMANIZED_NODE_TYPE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Layout::ClassStructure::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::DefEndAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ElseAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::END_OF_HEREDOC_LINE = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLineAfterGuardClause::SIMPLE_DIRECTIVE_COMMENT_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::EmptyLineAfterMagicComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLineBetweenDefs::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLines::LINE_OFFSET = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Layout::EmptyLines::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_AND_AFTER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::EmptyLinesAroundArguments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundBeginBody::KIND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundBlockBody::KIND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_DEFERRED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_EXTRA = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_MISSING = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundClassBody::KIND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundMethodBody::KIND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EmptyLinesAroundModuleBody::KIND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EndOfLine::MSG_DETECTED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::EndOfLine::MSG_MISSING = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstHashElementIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::FirstParameterIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::HashAlignment::MESSAGES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Layout::HashAlignment::SEPARATOR_ALIGNMENT_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LEADING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_1_ENDING = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::LineContinuationLeadingSpace::LINE_2_BEGINNING = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::LineContinuationLeadingSpace::TRAILING_STYLE_OFFENSE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_INDENTED = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::LineLength::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineArrayBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineArrayBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineArrayLineBreaks::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineAssignmentLayout::NEW_LINE_OFFENSE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineAssignmentLayout::SAME_LINE_OFFENSE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineBlockLayout::ARG_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineBlockLayout::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineBlockLayout::PIPE_SIZE = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineHashBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineHashBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::MultilineMethodParameterLineBreaks::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ParameterAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::ParameterAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::RedundantLineBreak::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::RescueEnsureAlignment::ALTERNATIVE_ACCESS_MODIFIERS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::RescueEnsureAlignment::ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SingleLineBlockChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAfterColon::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAfterMethodName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAfterNot::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAfterNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_PAREN = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_SQUARE_BRACKET = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::DO = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_AFTER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_BEFORE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundKeyword::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceAroundKeyword::SAFE_NAVIGATION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::SPACES_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::SpaceAroundOperators::EXCESSIVE_SPACE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceAroundOperators::IRREGULAR_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceBeforeBlockBraces::DETECTED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceBeforeBlockBraces::MISSING_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceBeforeBrackets::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceBeforeBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceBeforeComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceBeforeFirstArg::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_NO_SPACE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_SPACE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MULTIPLE_SPACES_BETWEEN_ITEMS_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideParens::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideParens::MSG_SPACE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::BEGIN_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::END_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideRangeLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Layout::SpaceInsideStringInterpolation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Layout::TrailingWhitespace::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousAssignment::MISTAKES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::AmbiguousAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::PRECEDENCE = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ArrayLiteralInRegexp::LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_ALTERNATION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_CHARACTER_CLASS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ArrayLiteralInRegexp::MSG_UNKNOWN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AssignmentInCondition::ASGN_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITHOUT_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ConstantDefinitionInBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ConstantOverwrittenInRescue::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ConstantReassignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ConstantReassignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CopDirectiveSyntax::COMMON_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CopDirectiveSyntax::INVALID_MODE_NAME_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CopDirectiveSyntax::MALFORMED_COP_NAMES_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_COP_NAME_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::CopDirectiveSyntax::MISSING_MODE_NAME_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Debugger::BLOCK_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DeprecatedClassMethods::DIR_ENV_FILE_CONSTANTS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DeprecatedClassMethods::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::DeprecatedConstants::DO_NOT_USE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateMagicComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::MSG_REPEATED_ELEMENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::OCTAL_DIGITS_AFTER_ESCAPE = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Lint::DuplicateRequire::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyClass::CLASS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyClass::METACLASS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyExpression::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyFile::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyInPattern::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_EOUTVAR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_SAFE_LEVEL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_TRIM_MODE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FloatComparison::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::FloatComparison::FLOAT_INSTANCE_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::FloatComparison::MSG_CASE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FloatComparison::MSG_EQUALITY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FloatComparison::MSG_INEQUALITY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::HashCompareByIdentity::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::HashCompareByIdentity::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::HashNewWithKeywordArgumentsAsDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::HeredocMethodCallPosition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IdentityComparison::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::InheritException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::InheritException::PREFERRED_BASE_CLASS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::LiteralAsCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::LiteralAsCondition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::LiteralAssignmentInCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MissingCopEnableDirective::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MissingCopEnableDirective::MSG_BOUND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MissingSuper::CALLBACKS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::MissingSuper::CALLBACK_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MissingSuper::CLASS_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MissingSuper::CONSTRUCTOR_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MissingSuper::METHOD_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MissingSuper::STATELESS_CLASSES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MixedCaseRange::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MixedCaseRange::RANGES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MixedRegexpCaptureTypes::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MultipleComparison::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MultipleComparison::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::MultipleComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NestedPercentLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NestedPercentLiteral::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NoReturnInBeginEndBlocks::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_FORCE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonAtomicFileOperation::MAKE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_CHANGE_FORCE_METHOD = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NonAtomicFileOperation::MSG_REMOVE_FILE_EXIST_CHECK = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NonAtomicFileOperation::RECURSIVE_REMOVE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_FORCE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonAtomicFileOperation::REMOVE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonAtomicFileOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NonDeterministicRequireOrder::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NonLocalExitFromIterator::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHOD_CLASS_MAPPING = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::NumberConversion::METHODS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumberConversion::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumberedParameterAssignment::LVAR_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumberedParameterAssignment::NUMBERED_PARAMETER_RANGE = T.let(T.unsafe(nil), Range) + +RuboCop::Cop::Lint::NumberedParameterAssignment::NUM_PARAM_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumericOperationWithConstantResult::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::NumericOperationWithConstantResult::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::OrAssignmentToConstant::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::OrderedMagicComments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::OutOfRangeRegexpRef::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_ARGUMENT_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_CAPTURE_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_RECEIVER_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::OutOfRangeRegexpRef::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RaiseException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantCopDisableDirective::COP_NAME = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantCopDisableDirective::DEPARTMENT_MARKER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantDirGlobSort::GLOB_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantDirGlobSort::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantDirGlobSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantRegexpQuantifiers::MSG_REDUNDANT_QUANTIFIER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantRequireStatement::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantRequireStatement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantRequireStatement::RUBY_22_LOADED_FEATURES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantSafeNavigation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSafeNavigation::MSG_LITERAL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_SPECIFIC_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::RedundantSafeNavigation::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Lint::RedundantSplatExpansion::ARRAY_PARAM_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSplatExpansion::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantSplatExpansion::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_I = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_W = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_I = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantStringCoercion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RedundantTypeConversion::CONSTRUCTOR_MAPPING = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::RedundantTypeConversion::CONVERSION_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::RedundantTypeConversion::LITERAL_NODE_TYPES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::RedundantTypeConversion::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantTypeConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::RedundantTypeConversion::TYPED_METHODS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::RedundantWithIndex::MSG_EACH_WITH_INDEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantWithIndex::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantWithObject::MSG_EACH_WITH_OBJECT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RedundantWithObject::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RefinementImportMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RefinementImportMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RequireRangeParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RequireRelativeSelfPath::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RequireRelativeSelfPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::RescueType::INVALID_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ReturnInVoidContext::SCOPE_CHANGING_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SafeNavigationChain::PLUS_MINUS_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_DOT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_SAFE_NAVIGATION_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SafeNavigationWithEmpty::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ScriptPermission::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ScriptPermission::SHEBANG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SelfAssignment::ASSIGNMENT_TYPE_TO_RHS_TYPE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::SelfAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SendWithMixinArgument::MIXIN_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SendWithMixinArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SendWithMixinArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SendWithMixinArgument::SEND_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ShadowedArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SharedMutableDefault::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SharedMutableDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::StructNewOverride::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::StructNewOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::StructNewOverride::STRUCT_MEMBER_NAME_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::StructNewOverride::STRUCT_METHOD_NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::EXPECTED_EXCEPTION_CLASSES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::SuppressedExceptionInNumberConversion::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SymbolConversion::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SymbolConversion::MSG_CONSISTENCY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Syntax::LEVELS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ToEnumArguments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::ToEnumArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::ToJSON::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::TopLevelReturnWithArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::TripleQuotes::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnderscorePrefixedVariableName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnescapedBracketInRegexp::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnescapedBracketInRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UnexpectedBlockArity::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UnreachableLoop::CONTINUE_KEYWORDS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_ESCAPE = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_UNESCAPE = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UriEscapeUnescape::METHOD_NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessConstantScoping::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessDefaultValueArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessDefaultValueArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UselessDefined::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessDefined::TYPES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UselessOr::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessOr::TRUTHY_RETURN_VALUE_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Lint::UselessRescue::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessTimes::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::UselessTimes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::CONST_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::EXPRESSION_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::METHODS_REPLACEABLE_BY_EACH = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::NONMUTATING_METHODS_WITH_BANG_VERSION = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::NONMUTATING_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::OP_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::SELF_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String) + +module RuboCop::Cop::MethodPreference + private + + # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#25 + def default_cop_config; end + + # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#9 + def preferred_method(method); end + + # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#13 + def preferred_methods; end +end + +RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::CollectionLiteralLength::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::ParameterLists::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::ParameterLists::NAMED_KEYWORD_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::ParameterLists::OPTIONAL_PARAMETERS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::PerceivedComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::PerceivedComplexity::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::BRANCH_NODES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::CONDITION_NODES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::CLASSLIKE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::FOLDABLE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Metrics::Utils::IteratingBlock::KNOWN_ITERATING_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Metrics::Utils::RepeatedAttributeDiscount::VAR_SETTER_TO_GETTER = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Migration::DepartmentName::DISABLE_COMMENT_FORMAT = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Migration::DepartmentName::DISABLING_COPS_CONTENT_TOKEN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Migration::DepartmentName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::MultilineExpressionIndentation::ASSIGNMENT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::MultilineExpressionIndentation::DEFAULT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_MESSAGE_TAIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::MultilineExpressionIndentation::UNALIGNED_RHS_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Naming::AccessorMethodName::MSG_READER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::AccessorMethodName::MSG_WRITER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::AsciiIdentifiers::CONSTANT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::AsciiIdentifiers::IDENTIFIER_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::BinaryOperatorParameterName::EXCLUDED = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Naming::BinaryOperatorParameterName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::BinaryOperatorParameterName::OP_LIKE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Naming::BlockForwarding::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::ClassAndModuleCamelCase::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::ConstantName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::ConstantName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Naming::FileName::MSG_NO_DEFINITION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::FileName::MSG_REGEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::FileName::MSG_SNAKE_CASE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::FileName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Naming::HeredocDelimiterCase::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::HeredocDelimiterNaming::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::InclusiveLanguage::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Naming::InclusiveLanguage::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::InclusiveLanguage::MSG_FOR_FILE_PATH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::MemoizedInstanceVariableName::DYNAMIC_DEFINE_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Naming::MemoizedInstanceVariableName::INITIALIZE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Naming::MemoizedInstanceVariableName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::MemoizedInstanceVariableName::UNDERSCORE_REQUIRED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::MethodName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::MethodName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::PredicateMethod::MSG_NON_PREDICATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::PredicateMethod::MSG_PREDICATE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::VariableName::MSG_FORBIDDEN = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Naming::VariableNumber::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::NegativeConditional::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Offense + include ::Comparable + + # @api private + # @return [Offense] a new instance of Offense + # + # source://rubocop//lib/rubocop/cop/offense.rb#83 + def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end + + # Returns `-1`, `0`, or `+1` + # if this offense is less than, equal to, or greater than `other`. + # + # @api public + # @return [Integer] comparison result + # + # source://rubocop//lib/rubocop/cop/offense.rb#229 + def <=>(other); end + + # @api public + # @return [Boolean] returns `true` if two offenses contain same attributes + # + # source://rubocop//lib/rubocop/cop/offense.rb#210 + def ==(other); end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#159 + def column; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#169 + def column_length; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#193 + def column_range; end + + # @api public + # @example + # 'Layout/LineLength' + # @return [String] the cop name as a String for which this offense is for. + # + # source://rubocop//lib/rubocop/cop/offense.rb#50 + def cop_name; end + + # @api public + # @return [Boolean] whether this offense can be automatically corrected via autocorrect. + # This includes todo comments, for example when requested with `--disable-uncorrectable`. + # + # source://rubocop//lib/rubocop/cop/offense.rb#101 + def correctable?; end + + # @api public + # @return [Boolean] whether this offense is automatically corrected via + # autocorrect or a todo. + # + # source://rubocop//lib/rubocop/cop/offense.rb#112 + def corrected?; end + + # @api public + # @return [Boolean] whether this offense is automatically disabled via a todo. + # + # source://rubocop//lib/rubocop/cop/offense.rb#122 + def corrected_with_todo?; end + + # @api public + # @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available + # + # source://rubocop//lib/rubocop/cop/offense.rb#61 + def corrector; end + + # @api public + # @return [Boolean] whether this offense was locally disabled with a + # disable or todo where it occurred. + # + # source://rubocop//lib/rubocop/cop/offense.rb#133 + def disabled?; end + + # @api public + # @return [Boolean] returns `true` if two offenses contain same attributes + # + # source://rubocop//lib/rubocop/cop/offense.rb#216 + def eql?(other); end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#178 + def first_line; end + + # source://rubocop//lib/rubocop/cop/offense.rb#218 + def hash; end + + # @api public + # @return [Parser::Source::Range] the range of the code that is highlighted + # + # source://rubocop//lib/rubocop/cop/offense.rb#141 + def highlighted_area; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#188 + def last_column; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#183 + def last_line; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#154 + def line; end + + # @api public + # @return [Parser::Source::Range] the location where the violation is detected. + # @see https://www.rubydoc.info/gems/parser/Parser/Source/Range Parser::Source::Range + # + # source://rubocop//lib/rubocop/cop/offense.rb#28 + def location; end + + # @api public + # @example + # 'Line is too long. [90/80]' + # @return [String] human-readable message + # + # source://rubocop//lib/rubocop/cop/offense.rb#39 + def message; end + + # Internally we use column number that start at 0, but when + # outputting column numbers, we want them to start at 1. One + # reason is that editors, such as Emacs, expect this. + # + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#202 + def real_column; end + + # @api public + # @return [RuboCop::Cop::Severity] + # + # source://rubocop//lib/rubocop/cop/offense.rb#17 + def severity; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#164 + def source_line; end + + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#53 + def status; end + + # This is just for debugging purpose. + # + # @api private + # + # source://rubocop//lib/rubocop/cop/offense.rb#147 + def to_s; end +end + +RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) + +class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct + # Returns the value of attribute begin_pos + # + # @return [Object] the current value of begin_pos + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def begin_pos; end + + # Sets the attribute begin_pos + # + # @param value [Object] the value to set the attribute begin_pos to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def begin_pos=(_); end + + # Returns the value of attribute column + # + # @return [Object] the current value of column + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def column; end + + # Sets the attribute column + # + # @param value [Object] the value to set the attribute column to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def column=(_); end + + # source://rubocop//lib/rubocop/cop/offense.rb#69 + def column_range; end + + # Returns the value of attribute end_pos + # + # @return [Object] the current value of end_pos + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def end_pos; end + + # Sets the attribute end_pos + # + # @param value [Object] the value to set the attribute end_pos to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def end_pos=(_); end + + # Returns the value of attribute line + # + # @return [Object] the current value of line + # + # source://rubocop//lib/rubocop/cop/offense.rb#65 + def first_line; end + + # Returns the value of attribute column + # + # @return [Object] the current value of column + # + # source://rubocop//lib/rubocop/cop/offense.rb#67 + def last_column; end + + # Returns the value of attribute line + # + # @return [Object] the current value of line + # + # source://rubocop//lib/rubocop/cop/offense.rb#66 + def last_line; end + + # source://rubocop//lib/rubocop/cop/offense.rb#76 + def length; end + + # Returns the value of attribute line + # + # @return [Object] the current value of line + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def line; end + + # Sets the attribute line + # + # @param value [Object] the value to set the attribute line to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def line=(_); end + + # source://rubocop//lib/rubocop/cop/offense.rb#73 + def size; end + + # Returns the value of attribute source_line + # + # @return [Object] the current value of source_line + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def source_line; end + + # Sets the attribute source_line + # + # @param value [Object] the value to set the attribute source_line to. + # @return [Object] the newly set value + # + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def source_line=(_); end + + class << self + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def [](*_arg0); end + + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def inspect; end + + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def keyword_init?; end + + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def members; end + + # source://rubocop//lib/rubocop/cop/offense.rb#63 + def new(*_arg0); end + end +end + +RuboCop::Cop::PrecedingFollowingAlignment::ASSIGNMENT_OR_COMPARISON_TOKENS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::PreferredDelimiters::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +module RuboCop::Cop::RangeHelp + private + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#152 + def add_range(range1, range2); end + + # A range containing the first to the last argument + # of a method call or method definition. + # def foo(a, b:) + # ^^^^^ + # bar(1, 2, 3, &blk) + # ^^^^^^^^^^^^^ + # baz { |x, y:, z:| } + # ^^^^^^^^^ + # + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#45 + def arguments_range(node); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#93 + def column_offset_between(base_range, range); end + + # A range containing only the contents of a literal with delimiters (e.g. in + # `%i{1 2 3}` this will be the range covering `1 2 3` only). + # + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#33 + def contents_range(node); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#111 + def directions(side); end + + # Returns the column attribute of the range, except if the range is on + # the first line and there's a byte order mark at the beginning of that + # line, in which case 1 is subtracted from the column value. This gives + # the column as it appears when viewing the file in an editor. + # + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#103 + def effective_column(range); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#120 + def final_pos(src, pos, increment, continuations, newlines, whitespace); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#128 + def move_pos(src, pos, step, condition, regexp); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#134 + def move_pos_str(src, pos, step, condition, needle); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#49 + def range_between(start_pos, end_pos); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#84 + def range_by_whole_lines(range, include_final_newline: T.unsafe(nil), buffer: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#145 + def range_with_comments(node); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#141 + def range_with_comments_and_lines(node); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#53 + def range_with_surrounding_comma(range, side = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#67 + def range_with_surrounding_space(range_positional = T.unsafe(nil), range: T.unsafe(nil), side: T.unsafe(nil), newlines: T.unsafe(nil), whitespace: T.unsafe(nil), continuations: T.unsafe(nil), buffer: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#12 + def source_range(source_buffer, line_number, column, length = T.unsafe(nil)); end +end + +RuboCop::Cop::RangeHelp::BYTE_ORDER_MARK = T.let(T.unsafe(nil), Integer) + +module RuboCop::Cop::RangeHelp::NOT_GIVEN; end + +class RuboCop::Cop::Registry + include ::Enumerable + + # @return [Registry] a new instance of Registry + # + # source://rubocop//lib/rubocop/cop/registry.rb#51 + def initialize(cops = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/registry.rb#232 + def ==(other); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#97 + def contains_cop_matching?(names); end + + # source://rubocop//lib/rubocop/cop/registry.rb#179 + def cops; end + + # source://rubocop//lib/rubocop/cop/registry.rb#224 + def cops_for_department(department); end + + # @return [Boolean] Checks if given name is department + # + # source://rubocop//lib/rubocop/cop/registry.rb#93 + def department?(name); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#147 + def department_missing?(badge, name); end + + # @return [Array] list of departments for current cops. + # + # source://rubocop//lib/rubocop/cop/registry.rb#72 + def departments; end + + # source://rubocop//lib/rubocop/cop/registry.rb#193 + def disabled(config); end + + # source://rubocop//lib/rubocop/cop/registry.rb#67 + def dismiss(cop); end + + # source://rubocop//lib/rubocop/cop/registry.rb#247 + def each(&block); end + + # source://rubocop//lib/rubocop/cop/registry.rb#189 + def enabled(config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#197 + def enabled?(cop, config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#213 + def enabled_pending_cop?(cop_cfg, config); end + + # source://rubocop//lib/rubocop/cop/registry.rb#63 + def enlist(cop); end + + # @param cop_name [String] + # @return [Class, nil] + # + # source://rubocop//lib/rubocop/cop/registry.rb#253 + def find_by_cop_name(cop_name); end + + # When a cop name is given returns a single-element array with the cop class. + # When a department name is given returns an array with all the cop classes + # for that department. + # + # source://rubocop//lib/rubocop/cop/registry.rb#260 + def find_cops_by_directive(directive); end + + # source://rubocop//lib/rubocop/cop/registry.rb#265 + def freeze; end + + # source://rubocop//lib/rubocop/cop/registry.rb#184 + def length; end + + # source://rubocop//lib/rubocop/cop/registry.rb#220 + def names; end + + # source://rubocop//lib/rubocop/cop/registry.rb#228 + def names_for_department(department); end + + # Returns the value of attribute options. + # + # source://rubocop//lib/rubocop/cop/registry.rb#49 + def options; end + + # source://rubocop//lib/rubocop/cop/registry.rb#151 + def print_warning(name, path); end + + # Convert a user provided cop name into a properly namespaced name + # + # @example gives back a correctly qualified cop name + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('Layout/EndOfLine', '') # => 'Layout/EndOfLine' + # @example fixes incorrect namespaces + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('Lint/EndOfLine', '') # => 'Layout/EndOfLine' + # @example namespaces bare cop identifiers + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('EndOfLine', '') # => 'Layout/EndOfLine' + # @example passes back unrecognized cop names + # + # registry = RuboCop::Cop::Registry + # registry.qualified_cop_name('NotACop', '') # => 'NotACop' + # @note Emits a warning if the provided name has an incorrect namespace + # @param name [String] Cop name extracted from config + # @param path [String, nil] Path of file that `name` was extracted from + # @param warn [Boolean] Print a warning if no department given for `name` + # @raise [AmbiguousCopName] if a bare identifier with two possible namespaces is provided + # @return [String] Qualified cop name + # + # source://rubocop//lib/rubocop/cop/registry.rb#133 + def qualified_cop_name(name, path, warn: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/registry.rb#166 + def qualify_badge(badge); end + + # source://rubocop//lib/rubocop/cop/registry.rb#243 + def select(&block); end + + # source://rubocop//lib/rubocop/cop/registry.rb#236 + def sort!; end + + # @return [Hash{String => Array}] + # + # source://rubocop//lib/rubocop/cop/registry.rb#174 + def to_h; end + + # source://rubocop//lib/rubocop/cop/registry.rb#159 + def unqualified_cop_names; end + + # @return [Registry] Cops for that specific department. + # + # source://rubocop//lib/rubocop/cop/registry.rb#78 + def with_department(department); end + + # @return [Registry] Cops not for a specific department. + # + # source://rubocop//lib/rubocop/cop/registry.rb#84 + def without_department(department); end + + private + + # source://rubocop//lib/rubocop/cop/registry.rb#283 + def clear_enrollment_queue; end + + # source://rubocop//lib/rubocop/cop/registry.rb#279 + def initialize_copy(reg); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#312 + def registered?(badge); end + + # source://rubocop//lib/rubocop/cop/registry.rb#299 + def resolve_badge(given_badge, real_badge, source_path, warn: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/registry.rb#295 + def with(cops); end + + class << self + # source://rubocop//lib/rubocop/cop/registry.rb#22 + def all; end + + # Returns the value of attribute global. + # + # source://rubocop//lib/rubocop/cop/registry.rb#274 + def global; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/registry.rb#44 + def qualified_cop?(name); end + + # source://rubocop//lib/rubocop/cop/registry.rb#26 + def qualified_cop_name(name, origin, warn: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/registry.rb#40 + def reset!; end + + # Changes momentarily the global registry + # Intended for testing purposes + # + # source://rubocop//lib/rubocop/cop/registry.rb#32 + def with_temporary_global(temp_global = T.unsafe(nil)); end + end +end + +RuboCop::Cop::RequireLibrary::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::CompoundHash::COMBINATOR_IN_HASH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::CompoundHash::MONUPLE_HASH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::CompoundHash::REDUNDANT_HASH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::CompoundHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::Eval::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::Eval::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::IoMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::IoMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::JSONLoad::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::JSONLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::MarshalLoad::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::Open::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::Open::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Security::YAMLLoad::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Security::YAMLLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Severity::CODE_TABLE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Severity::NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::SpaceAfterPunctuation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::SpaceBeforePunctuation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Alias::MSG_ALIAS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Alias::MSG_ALIAS_METHOD = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArgumentsForwarding::ADDITIONAL_ARG_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayCoercion::CHECK_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayCoercion::SPLAT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayFirstLast::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayFirstLast::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArrayIntersect::ACTIVE_SUPPORT_PREDICATES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::ArrayIntersect::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayIntersect::NEGATED_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArrayIntersect::PREDICATES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::ArrayIntersect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArrayIntersect::STRAIGHT_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ArrayJoin::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ArrayJoin::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::AsciiComments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Attr::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Attr::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::AutoResourceCleanup::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::AutoResourceCleanup::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::BarePercentLiterals::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BeginBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BisectedAttrAccessor::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BitwisePredicate::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BitwisePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::BlockComments::BEGIN_LENGTH = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Style::BlockComments::END_LENGTH = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Style::BlockComments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BlockDelimiters::ALWAYS_BRACES_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::BlockDelimiters::BRACES_REQUIRED_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CaseEquality::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CaseEquality::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CaseLikeIf::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CharacterLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassAndModuleChildren::COMPACT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassAndModuleChildren::NESTED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassCheck::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ClassEqualityComparison::CLASS_NAME_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ClassEqualityComparison::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassEqualityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ClassMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassMethodsDefinitions::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassMethodsDefinitions::MSG_SCLASS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassVars::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CollectionCompact::FILTER_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CollectionCompact::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CollectionCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CollectionCompact::TO_ENUM_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CollectionQuerying::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CollectionQuerying::REPLACEMENTS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::CollectionQuerying::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ColonMethodCall::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CombinableDefined::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CombinableDefined::OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CombinableLoops::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommandLiteral::MSG_USE_BACKTICKS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommandLiteral::MSG_USE_PERCENT_X = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommentAnnotation::MISSING_NOTE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommentAnnotation::MSG_COLON_STYLE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommentAnnotation::MSG_SPACE_STYLE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENTS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENT_REGEXES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CommentedKeyword::KEYWORDS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CommentedKeyword::KEYWORD_REGEXES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::CommentedKeyword::METHOD_OR_END_DEFINITIONS = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::CommentedKeyword::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::CommentedKeyword::REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::CommentedKeyword::STEEP_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::CommentedKeyword::SUBCLASS_DEFINITION = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::ComparableBetween::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ComparableClamp::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ComparableClamp::MSG_MIN_MAX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ComparableClamp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ConcatArrayLiterals::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConcatArrayLiterals::MSG_FOR_PERCENT_LITERALS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConcatArrayLiterals::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ConditionalAssignment::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ConditionalAssignment::ASSIGN_TO_CONDITION_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::ENABLED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::LINE_LENGTH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::MAX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::SINGLE_LINE_CONDITIONS_ONLY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignment::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ConditionalAssignmentHelper::ALIGN_WITH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignmentHelper::END_ALIGNMENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignmentHelper::EQUAL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConditionalAssignmentHelper::KEYWORD = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ConstantVisibility::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Copyright::AUTOCORRECT_EMPTY_WARNING = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Copyright::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DataInheritance::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DateTime::CLASS_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DigChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DigChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Dir::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Dir::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::DirEmpty::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DirEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective::MSG_FOR_COPS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DocumentDynamicEvalDefinition::BLOCK_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::DocumentDynamicEvalDefinition::COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::DocumentDynamicEvalDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DocumentDynamicEvalDefinition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DocumentationMethod::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DoubleCopDisableDirective::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DoubleNegation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::DoubleNegation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EachForSimpleLoop::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EachWithObject::METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EachWithObject::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyBlockParameter::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyCaseCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyCaseCondition::NOT_SUPPORTED_PARENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EmptyElse::EMPTY_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyElse::NIL_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EmptyHeredoc::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyLiteral::ARR_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyLiteral::HASH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EmptyLiteral::STR_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyMethod::MSG_COMPACT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyMethod::MSG_EXPANDED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyStringInsideInterpolation::MSG_TERNARY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EmptyStringInsideInterpolation::MSG_TRAILING_CONDITIONAL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Encoding::ENCODING_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::Encoding::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Encoding::SHEBANG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EndlessMethod::MSG_REQUIRE_ALWAYS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EndlessMethod::MSG_REQUIRE_SINGLE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EnvHome::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EvalWithLocation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EvalWithLocation::MSG_EVAL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_FILE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_LINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EvalWithLocation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::EvenOdd::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::EvenOdd::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ExactRegexpMatch::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ExactRegexpMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ExpandPathArguments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_NEW_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ExpandPathArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ExplicitBlockArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::FetchEnvVar::MSG_WITHOUT_NIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FetchEnvVar::MSG_WITH_NIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FetchEnvVar::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FileEmpty::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FileNull::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FileNull::REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::FileRead::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FileRead::READ_FILE_START_TO_FINISH_MODES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FileTouch::APPEND_FILE_MODES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::FileTouch::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FileTouch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FileWrite::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FileWrite::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::FileWrite::TRUNCATING_WRITE_MODES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::FloatDivision::MESSAGES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::FloatDivision::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::For::EACH_LENGTH = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Style::For::PREFER_EACH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::For::PREFER_FOR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FormatString::AUTOCORRECTABLE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FormatString::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FormatString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_DISABLED = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING_TRUE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::FrozenStringLiteralComment::SHEBANG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::GlobalStdStream::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::GlobalStdStream::STD_STREAMS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::GlobalVars::BUILT_IN_VARS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::GlobalVars::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::GuardClause::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashConversion::MSG_LITERAL_HASH_ARG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashConversion::MSG_LITERAL_MULTI_ARG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashConversion::MSG_SPLAT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashConversion::MSG_TO_H = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::HashEachMethods::ARRAY_CONVERTER_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::HashEachMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashFetchChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashFetchChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashSyntax::MSG_19 = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::HashSyntax::NO_MIXED_KEYS_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::IdenticalConditionalBranches::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_MODIFIER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_NORMAL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG_FOR_ELSIF = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfWithSemicolon::MSG_IF_ELSE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfWithSemicolon::MSG_NEWLINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IfWithSemicolon::MSG_TERNARY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ImplicitRuntimeError::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ImplicitRuntimeError::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InPatternThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::InfiniteLoop::LEADING_SPACE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::InfiniteLoop::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::InlineComment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::InverseMethods::CAMEL_CASE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::InverseMethods::CLASS_COMPARISON_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InverseMethods::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InverseMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::InverseMethods::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InverseMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InverseMethods::SAFE_NAVIGATION_INCOMPATIBLE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::InvertibleUnlessCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ItAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_PARAMETER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ItBlockParameter::MSG_AVOID_IT_PARAMETER_MULTILINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ItBlockParameter::MSG_USE_IT_PARAMETER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::KeywordParametersOrder::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Lambda::LITERAL_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Lambda::METHOD_MESSAGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Lambda::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::LambdaCall::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::LambdaCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_BEGIN_TOKEN = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_END_TOKEN = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::Style::LineEndConcatenation::CONCAT_TOKEN_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::LineEndConcatenation::HIGH_PRECEDENCE_OP_TOKEN_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::LineEndConcatenation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::LineEndConcatenation::QUOTE_DELIMITERS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::LineEndConcatenation::SIMPLE_STRING_TOKEN_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::Style::MagicCommentFormat::CommentRange::DIRECTIVE_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::MagicCommentFormat::CommentRange::VALUE_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::MagicCommentFormat::KEBAB_SEPARATOR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MagicCommentFormat::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MagicCommentFormat::MSG_VALUE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MapCompactWithConditionalBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MapIntoArray::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MapToHash::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MapToHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MapToSet::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::OMIT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::TRAILING_WHITESPACE_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses::REQUIRE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MethodCallWithoutArgsParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MethodCalledOnDoEndBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MethodDefParentheses::MSG_MISSING = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MethodDefParentheses::MSG_PRESENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MinMax::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MinMaxComparison::COMPARISON_OPERATORS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::MinMaxComparison::GREATER_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MinMaxComparison::LESS_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MinMaxComparison::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MissingElse::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MissingElse::MSG_EMPTY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MissingElse::MSG_NIL = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MissingRespondToMissing::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MixinGrouping::MIXIN_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MixinGrouping::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MixinUsage::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MixinUsage::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ModuleFunction::EXTEND_SELF_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ModuleFunction::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ModuleFunction::MODULE_FUNCTION_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineBlockChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineIfModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineIfThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineIfThen::NON_MODIFIER_THEN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::MultilineInPatternThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineMemoization::BRACES_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineMemoization::KEYWORD_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineMethodSignature::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineTernaryOperator::MSG_IF = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineTernaryOperator::MSG_SINGLE_LINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultilineTernaryOperator::SINGLE_LINE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::MultilineWhenThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MultipleComparison::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::MutableConstant::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NegatedIfElseCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NegatedIfElseCondition::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::NestedFileDirname::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NestedFileDirname::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::NestedModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NestedParenthesizedCalls::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NestedTernaryOperator::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Next::EXIT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Next::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NilComparison::EXPLICIT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NilComparison::PREDICATE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NilComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::NilLambda::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NonNilCheck::MSG_FOR_REDUNDANCY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NonNilCheck::MSG_FOR_REPLACEMENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NonNilCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Not::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Not::OPPOSITE_METHODS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::Not::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::NumberedParameters::MSG_DISALLOW = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumberedParameters::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumberedParametersLimit::DEFAULT_MAX_VALUE = T.let(T.unsafe(nil), Integer) + +RuboCop::Cop::Style::NumberedParametersLimit::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumberedParametersLimit::NUMBERED_PARAMETER_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiteralPrefix::HEX_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericLiteralPrefix::HEX_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiterals::DELIMITER_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::NumericLiterals::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericPredicate::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::NumericPredicate::REPLACEMENTS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::NumericPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ObjectThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ObjectThen::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::OneLineConditional::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OpenStructUse::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OperatorMethodCall::INVALID_SYNTAX_ARG_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::OperatorMethodCall::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OperatorMethodCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::OptionHash::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OptionalArguments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OptionalBooleanParameter::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::OrAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ParallelAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::PercentQLiterals::LOWER_CASE_Q_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::PercentQLiterals::UPPER_CASE_Q_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::PerlBackrefs::MESSAGE_FORMAT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::PreferredHashMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::PreferredHashMethods::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::PreferredHashMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Proc::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::QuotedSymbols::MSG_DOUBLE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::QuotedSymbols::MSG_SINGLE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RaiseArgs::ACCEPTABLE_ARG_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RaiseArgs::COMPACT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RaiseArgs::EXPLODED_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RaiseArgs::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RandomWithOffset::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RandomWithOffset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantArgument::NO_RECEIVER_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantArrayConstructor::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantArrayConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantArrayFlatten::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantArrayFlatten::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantBegin::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantCondition::ARGUMENT_WITH_OPERATOR_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantCondition::REDUNDANT_CONDITION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantConditional::COMPARISON_OPERATOR_MATCHER = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantConditional::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantConstantBase::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::CURRENT_DIRECTORY_PREFIX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::REDUNDANT_CURRENT_DIRECTORY_PREFIX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantDoubleSplatHashBraces::MERGE_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantDoubleSplatHashBraces::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantEach::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantEach::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantEach::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantEach::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantException::MSG_1 = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantException::MSG_2 = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantFetchBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantFileExtensionInRequire::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantFileExtensionInRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantFilterChain::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantFilterChain::RAILS_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantFilterChain::REPLACEMENT_METHODS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::RedundantFilterChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantFormat::ACCEPTABLE_LITERAL_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantFormat::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantFormat::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::RedundantFreeze::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantFreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::STRING_INTERPOLATION_OR_ESCAPED_CHARACTER_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantInitialize::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantInitialize::MSG_EMPTY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantInterpolation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantInterpolationUnfreeze::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantInterpolationUnfreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantLineContinuation::ALLOWED_STRING_TOKENS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TAKING_FLOW_TOKEN_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantLineContinuation::ARITHMETIC_OPERATOR_TOKENS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantLineContinuation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantParentheses::ALLOWED_NODE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantPercentQ::DYNAMIC_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::EMPTY = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::ESCAPED_NON_BACKSLASH = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantPercentQ::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::PERCENT_CAPITAL_Q = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::PERCENT_Q = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::QUOTE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::SINGLE_QUOTE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantPercentQ::STRING_INTERPOLATION_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::RedundantRegexpArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpCharacterClass::MSG_REDUNDANT_CHARACTER_CLASS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantRegexpCharacterClass::REQUIRES_ESCAPE_OUTSIDE_CHAR_CLASS_CHARS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpConstructor::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantRegexpConstructor::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_ALWAYS_ESCAPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_OUTSIDE_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_WITHIN_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantRegexpEscape::MSG_REDUNDANT_ESCAPE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantReturn::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantReturn::MULTI_RETURN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantReturn::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantSelf::KERNEL_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantSelf::KEYWORDS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantSelf::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSelfAssignment::ASSIGNMENT_TYPE_TO_RECEIVER_TYPE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::RedundantSelfAssignment::METHODS_RETURNING_SELF = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::RedundantSelfAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSelfAssignmentBranch::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSort::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RedundantSortBy::MSG_BLOCK = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSortBy::MSG_ITBLOCK = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantSortBy::MSG_NUMBLOCK = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RedundantStringEscape::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RegexpLiteral::MSG_USE_PERCENT_R = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RegexpLiteral::MSG_USE_SLASHES = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RequireOrder::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RequireOrder::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::RescueModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RescueStandardError::MSG_EXPLICIT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::RescueStandardError::MSG_IMPLICIT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ReturnNil::RETURN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SafeNavigationChainLength::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Sample::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Sample::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SelectByRegexp::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SelectByRegexp::OPPOSITE_REPLACEMENTS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::SelectByRegexp::REGEXP_METHODS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::SelectByRegexp::REPLACEMENTS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::SelectByRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SelfAssignment::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SelfAssignment::OPS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::Semicolon::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Send::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SendWithLiteralMethodName::METHOD_NAME_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Style::SendWithLiteralMethodName::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SendWithLiteralMethodName::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SendWithLiteralMethodName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SendWithLiteralMethodName::STATIC_METHOD_NAME_NODE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SignalException::FAIL_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SignalException::RAISE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SignalException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SingleArgumentDig::IGNORED_ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SingleArgumentDig::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SingleArgumentDig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SingleLineBlockParams::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SingleLineDoEndBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SingleLineMethods::NOT_SUPPORTED_ENDLESS_METHOD_BODY_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SlicingWithRange::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SlicingWithRange::MSG_USELESS_RANGE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SlicingWithRange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SpecialGlobalVars::BUILTIN_VARS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::SpecialGlobalVars::LIBRARY_NAME = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::SpecialGlobalVars::STYLE_VARS_MAP = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_NO_REQUIRE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_REQUIRE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StaticClass::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StringChars::BAD_ARGUMENTS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StringChars::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StringConcatenation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StringConcatenation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StringHashKeys::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StringLiterals::MSG_INCONSISTENT = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StringMethods::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Strip::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::Strip::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SuperArguments::ASSIGN_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SuperArguments::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SuperArguments::MSG_INLINE_BLOCK = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SuperWithArgsParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SwapValues::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SwapValues::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::SymbolArray::ARRAY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SymbolArray::DELIMITERS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SymbolArray::PERCENT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SymbolArray::REDEFINABLE_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SymbolArray::SPECIAL_GVARS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SymbolProc::LAMBDA_OR_PROC = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::TernaryParentheses::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TernaryParentheses::MSG_COMPLEX = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TernaryParentheses::NON_COMPLEX_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::TernaryParentheses::VARIABLE_TYPES = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::TopLevelMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TopLevelMethodDefinition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::TrailingBodyOnClass::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingBodyOnMethodDefinition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingBodyOnModule::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingCommaInBlockArgs::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingMethodEndStatement::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingUnderscoreVariable::DISALLOW = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::TrailingUnderscoreVariable::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrailingUnderscoreVariable::UNDERSCORE = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::TrivialAccessors::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnlessElse::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_MIXED_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnpackFirst::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnpackFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::VariableInterpolation::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::WhileUntilModifier::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::WordArray::ARRAY_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::WordArray::PERCENT_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::YAMLFileRead::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::YAMLFileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::ENFORCE_YODA_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::EQUALITY_ONLY_STYLES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::EQUALITY_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::YodaCondition::NONCOMMUTATIVE_OPERATORS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::PROGRAM_NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::YodaCondition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + +RuboCop::Cop::Style::YodaCondition::REVERSE_COMPARISON = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Style::YodaExpression::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::YodaExpression::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ZeroLengthPredicate::NONZERO_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::ZeroLengthPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::ZeroLengthPredicate::ZERO_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::SurroundingSpace::NO_SPACE_COMMAND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::SurroundingSpace::SINGLE_SPACE_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::SurroundingSpace::SPACE_COMMAND = T.let(T.unsafe(nil), String) + +RuboCop::Cop::TrailingComma::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::UncommunicativeName::CASE_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::UncommunicativeName::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::UncommunicativeName::LENGTH_MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::UncommunicativeName::NUM_MSG = T.let(T.unsafe(nil), String) + +module RuboCop::Cop::Util + include ::RuboCop::PathUtil + + private + + # source://rubocop//lib/rubocop/cop/util.rb#39 + def add_parentheses(node, corrector); end + + # source://rubocop//lib/rubocop/cop/util.rb#60 + def any_descendant?(node, *types); end + + # source://rubocop//lib/rubocop/cop/util.rb#75 + def args_begin(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#87 + def args_end(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#108 + def begins_its_line?(range); end + + # This is a bad API + # + # source://rubocop//lib/rubocop/cop/util.rb#17 + def comment_line?(line_source); end + + # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar + # + # source://rubocop//lib/rubocop/cop/util.rb#22 + def comment_lines?(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#206 + def compatible_external_encoding_for?(src); end + + # If converting a string to Ruby string literal source code, must + # double quotes be used? + # + # source://rubocop//lib/rubocop/cop/util.rb#134 + def double_quotes_required?(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#148 + def escape_string(string); end + + # Returns, for example, a bare `if` node if the given node is an `if` + # with calls chained to the end of it. + # + # source://rubocop//lib/rubocop/cop/util.rb#118 + def first_part_of_call_chain(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#210 + def include_or_equal?(source, target); end + + # source://rubocop//lib/rubocop/cop/util.rb#185 + def indent(node, offset: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/util.rb#165 + def interpret_string_escapes(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#169 + def line(node_or_range); end + + # source://rubocop//lib/rubocop/cop/util.rb#30 + def line_range(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#144 + def needs_escaping?(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#91 + def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end + + # source://rubocop//lib/rubocop/cop/util.rb#34 + def parentheses?(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#196 + def parse_regexp(text); end + + # source://rubocop//lib/rubocop/cop/util.rb#177 + def same_line?(node1, node2); end + + # source://rubocop//lib/rubocop/cop/util.rb#152 + def to_string_literal(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#191 + def to_supported_styles(enforced_style); end + + # source://rubocop//lib/rubocop/cop/util.rb#161 + def trim_string_interpolation_escape_character(str); end + + class << self + # source://rubocop//lib/rubocop/cop/util.rb#39 + def add_parentheses(node, corrector); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#60 + def any_descendant?(node, *types); end + + # source://rubocop//lib/rubocop/cop/util.rb#75 + def args_begin(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#87 + def args_end(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#108 + def begins_its_line?(range); end + + # This is a bad API + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#17 + def comment_line?(line_source); end + + # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#22 + def comment_lines?(node); end + + # If converting a string to Ruby string literal source code, must + # double quotes be used? + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#134 + def double_quotes_required?(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#148 + def escape_string(string); end + + # Returns, for example, a bare `if` node if the given node is an `if` + # with calls chained to the end of it. + # + # source://rubocop//lib/rubocop/cop/util.rb#118 + def first_part_of_call_chain(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#185 + def indent(node, offset: T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/util.rb#165 + def interpret_string_escapes(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#169 + def line(node_or_range); end + + # source://rubocop//lib/rubocop/cop/util.rb#30 + def line_range(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#144 + def needs_escaping?(string); end + + # @yield [sexp] + # + # source://rubocop//lib/rubocop/cop/util.rb#91 + def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#34 + def parentheses?(node); end + + # source://rubocop//lib/rubocop/cop/util.rb#196 + def parse_regexp(text); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/util.rb#177 + def same_line?(node1, node2); end + + # source://rubocop//lib/rubocop/cop/util.rb#152 + def to_string_literal(string); end + + # source://rubocop//lib/rubocop/cop/util.rb#191 + def to_supported_styles(enforced_style); end + + # source://rubocop//lib/rubocop/cop/util.rb#161 + def trim_string_interpolation_escape_character(str); end + end +end + +RuboCop::Cop::Util::LINE_BEGINS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::Util::LITERAL_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Util::MAX_LINE_BEGINS_REGEX_INDEX = T.let(T.unsafe(nil), Integer) + +module RuboCop::Cop::Utils; end + +class RuboCop::Cop::Utils::FormatString + # @return [FormatString] a new instance of FormatString + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#94 + def initialize(string); end + + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#98 + def format_sequences; end + + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#110 + def max_digit_dollar_num; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#106 + def named_interpolation?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#102 + def valid?; end + + private + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#122 + def mixed_formats?; end + + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#116 + def parse; end +end + +RuboCop::Cop::Utils::FormatString::DIGIT_DOLLAR = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::FLAG = T.let(T.unsafe(nil), Regexp) + +class RuboCop::Cop::Utils::FormatString::FormatSequence + # @return [FormatSequence] a new instance of FormatSequence + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#50 + def initialize(match); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#66 + def annotated?; end + + # Returns the value of attribute arg_number. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def arg_number; end + + # Number of arguments required for the format sequence + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#75 + def arity; end + + # Returns the value of attribute begin_pos. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def begin_pos; end + + # Returns the value of attribute end_pos. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def end_pos; end + + # Returns the value of attribute flags. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def flags; end + + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#79 + def max_digit_dollar_num; end + + # Returns the value of attribute name. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def name; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#62 + def percent?; end + + # Returns the value of attribute precision. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def precision; end + + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#83 + def style; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#70 + def template?; end + + # Returns the value of attribute type. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def type; end + + # Returns the value of attribute width. + # + # source://rubocop//lib/rubocop/cop/utils/format_string.rb#48 + def width; end +end + +RuboCop::Cop::Utils::FormatString::INTERPOLATION = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::NAME = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::NUMBER = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::NUMBER_ARG = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::PRECISION = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::SEQUENCE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::TEMPLATE_NAME = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::TYPE = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Utils::FormatString::WIDTH = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::VariableForce::ARGUMENT_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::Assignment::MULTIPLE_LEFT_HAND_SIDE_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::Branch::CLASSES_BY_TYPE = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::VariableForce::LOGICAL_OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::LOOP_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::MULTIPLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::NODE_HANDLER_METHOD_NAMES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::VariableForce::OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::PATTERN_MATCH_VARIABLE_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::REGEXP_NAMED_CAPTURE_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::RESCUE_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::REST_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::Reference::VARIABLE_REFERENCE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::SCOPE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::SEND_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::Scope::OUTER_SCOPE_CHILD_INDICES = T.let(T.unsafe(nil), Hash) + +RuboCop::Cop::VariableForce::TWISTED_SCOPE_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::VARIABLE_REFERENCE_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VariableForce::Variable::VARIABLE_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::VariableForce::ZERO_ARITY_SUPER_TYPE = T.let(T.unsafe(nil), Symbol) + +RuboCop::Cop::VisibilityHelp::VISIBILITY_SCOPES = T.let(T.unsafe(nil), Set) + +class RuboCop::DirectiveComment + # @return [DirectiveComment] a new instance of DirectiveComment + # + # source://rubocop//lib/rubocop/directive_comment.rb#46 + def initialize(comment, cop_registry = T.unsafe(nil)); end + + # Checks if all cops specified in this directive + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#115 + def all_cops?; end + + # Returns the value of attribute comment. + # + # source://rubocop//lib/rubocop/directive_comment.rb#44 + def comment; end + + # Returns array of specified in this directive cop names + # + # source://rubocop//lib/rubocop/directive_comment.rb#120 + def cop_names; end + + # Returns the value of attribute cop_registry. + # + # source://rubocop//lib/rubocop/directive_comment.rb#44 + def cop_registry; end + + # Returns the value of attribute cops. + # + # source://rubocop//lib/rubocop/directive_comment.rb#44 + def cops; end + + # Returns array of specified in this directive department names + # when all department disabled + # + # source://rubocop//lib/rubocop/directive_comment.rb#131 + def department_names; end + + # source://rubocop//lib/rubocop/directive_comment.rb#145 + def directive_count; end + + # Checks if this directive disables cops + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#95 + def disabled?; end + + # Checks if this directive disables all cops + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#110 + def disabled_all?; end + + # Checks if this directive enables cops + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#100 + def enabled?; end + + # Checks if this directive enables all cops + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#105 + def enabled_all?; end + + # Checks if directive departments include cop + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#136 + def in_directive_department?(cop); end + + # Returns line number for directive + # + # source://rubocop//lib/rubocop/directive_comment.rb#150 + def line_number; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#59 + def malformed?; end + + # Checks if this directive contains all the given cop names + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#77 + def match?(cop_names); end + + # Returns match captures to directive comment pattern + # + # source://rubocop//lib/rubocop/directive_comment.rb#90 + def match_captures; end + + # Checks if the directive comment is missing a cop name + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#67 + def missing_cop_name?; end + + # Returns the value of attribute mode. + # + # source://rubocop//lib/rubocop/directive_comment.rb#44 + def mode; end + + # Checks if cop department has already used in directive comment + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#141 + def overridden_by_department?(cop); end + + # source://rubocop//lib/rubocop/directive_comment.rb#81 + def range; end + + # Returns an array of cops for this directive comment, without resolving departments + # + # source://rubocop//lib/rubocop/directive_comment.rb#125 + def raw_cop_names; end + + # Checks if this directive relates to single line + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#72 + def single_line?; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#54 + def start_with_marker?; end + + private + + # source://rubocop//lib/rubocop/directive_comment.rb#167 + def all_cop_names; end + + # source://rubocop//lib/rubocop/directive_comment.rb#171 + def cop_names_for_department(department); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/directive_comment.rb#163 + def department?(name); end + + # source://rubocop//lib/rubocop/directive_comment.rb#176 + def exclude_lint_department_cops(cops); end + + # source://rubocop//lib/rubocop/directive_comment.rb#156 + def parsed_cop_names; end + + class << self + # source://rubocop//lib/rubocop/directive_comment.rb#40 + def before_comment(line); end + end +end + +RuboCop::DirectiveComment::AVAILABLE_MODES = T.let(T.unsafe(nil), Array) + +RuboCop::DirectiveComment::COPS_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::COP_NAME_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::DIRECTIVE_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::DirectiveComment::DIRECTIVE_HEADER_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::DIRECTIVE_MARKER_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::DIRECTIVE_MARKER_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::DirectiveComment::LINT_DEPARTMENT = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::LINT_REDUNDANT_DIRECTIVE_COP = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::LINT_SYNTAX_COP = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::MALFORMED_DIRECTIVE_WITHOUT_COP_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::DirectiveComment::TRAILING_COMMENT_MARKER = T.let(T.unsafe(nil), String) + +class RuboCop::Error < ::StandardError; end + +class RuboCop::ErrorWithAnalyzedFileLocation < ::RuboCop::Error + # @return [ErrorWithAnalyzedFileLocation] a new instance of ErrorWithAnalyzedFileLocation + # + # source://rubocop//lib/rubocop/error.rb#14 + def initialize(cause:, node:, cop:); end + + # Returns the value of attribute cause. + # + # source://rubocop//lib/rubocop/error.rb#21 + def cause; end + + # source://rubocop//lib/rubocop/error.rb#27 + def column; end + + # Returns the value of attribute cop. + # + # source://rubocop//lib/rubocop/error.rb#21 + def cop; end + + # source://rubocop//lib/rubocop/error.rb#23 + def line; end + + # source://rubocop//lib/rubocop/error.rb#31 + def message; end +end + +module RuboCop::ExcludeLimit + # Sets up a configuration option to have an exclude limit tracked. + # The parameter name given is transformed into a method name (eg. `Max` + # becomes `self.max=` and `MinDigits` becomes `self.min_digits=`). + # + # source://rubocop//lib/rubocop/cop/exclude_limit.rb#10 + def exclude_limit(parameter_name, method_name: T.unsafe(nil)); end + + private + + # source://rubocop//lib/rubocop/cop/exclude_limit.rb#22 + def transform(parameter_name); end +end + +module RuboCop::Ext::Comment + # source://rubocop//lib/rubocop/ext/comment.rb#7 + def source; end + + # source://rubocop//lib/rubocop/ext/comment.rb#11 + def source_range; end +end + +module RuboCop::Ext::ProcessedSource + # source://rubocop//lib/rubocop/ext/processed_source.rb#9 + def comment_config; end + + # Returns the value of attribute config. + # + # source://rubocop//lib/rubocop/ext/processed_source.rb#7 + def config; end + + # Sets the attribute config + # + # @param value the value to set the attribute config to. + # + # source://rubocop//lib/rubocop/ext/processed_source.rb#7 + def config=(_arg0); end + + # source://rubocop//lib/rubocop/ext/processed_source.rb#13 + def disabled_line_ranges; end + + # Returns the value of attribute registry. + # + # source://rubocop//lib/rubocop/ext/processed_source.rb#7 + def registry; end + + # Sets the attribute registry + # + # @param value the value to set the attribute registry to. + # + # source://rubocop//lib/rubocop/ext/processed_source.rb#7 + def registry=(_arg0); end +end + +module RuboCop::Ext::Range + # Adds `Range#single_line?` to parallel `Node#single_line?` + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/ext/range.rb#8 + def single_line?; end +end + +RuboCop::Ext::RegexpNode::ANY = T.let(T.unsafe(nil), Object) + +module RuboCop::FileFinder + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#13 + def find_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end + + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#20 + def find_last_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end + + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#26 + def traverse_directories_upwards(start_dir, stop_dir = T.unsafe(nil)); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#36 + def traverse_files_upwards(filename, start_dir, stop_dir); end + + class << self + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#10 + def root_level; end + + # @api private + # + # source://rubocop//lib/rubocop/file_finder.rb#10 + def root_level=(_arg0); end + end +end + +RuboCop::Formatter::ClangStyleFormatter::ELLIPSES = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::DisabledConfigFormatter::HEADING = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS = T.let(T.unsafe(nil), Hash) + +RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTER_NAMES = T.let(T.unsafe(nil), Array) + +RuboCop::Formatter::FormatterSet::FORMATTER_APIS = T.let(T.unsafe(nil), Array) + +RuboCop::Formatter::FuubarStyleFormatter::RESET_SEQUENCE = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::GitHubActionsFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +RuboCop::Formatter::HTMLFormatter::CSSContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash) + +RuboCop::Formatter::HTMLFormatter::CSS_PATH = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::HTMLFormatter::ELLIPSES = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::HTMLFormatter::TEMPLATE_PATH = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::JUnitFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +RuboCop::Formatter::PacmanFormatter::FALLBACK_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) + +RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::NullPresenter) + +RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::NullPresenter) + +RuboCop::Formatter::ProgressFormatter::DOT = T.let(T.unsafe(nil), String) + +RuboCop::Formatter::SimpleTextFormatter::COLOR_FOR_SEVERITY = T.let(T.unsafe(nil), Hash) + +module RuboCop::Formatter::TextUtil + private + + # source://rubocop//lib/rubocop/formatter/text_util.rb#9 + def pluralize(number, thing, options = T.unsafe(nil)); end + + class << self + # source://rubocop//lib/rubocop/formatter/text_util.rb#9 + def pluralize(number, thing, options = T.unsafe(nil)); end + end +end + +RuboCop::MagicComment::EmacsComment::FORMAT = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::EmacsComment::OPERATOR = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::EmacsComment::REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::MagicComment::EmacsComment::SEPARATOR = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::KEYWORDS = T.let(T.unsafe(nil), Hash) + +RuboCop::MagicComment::SimpleComment::FSTRING_LITERAL_COMMENT = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::TOKEN = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::VimComment::FORMAT = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::VimComment::KEYWORDS = T.let(T.unsafe(nil), Hash) + +RuboCop::MagicComment::VimComment::OPERATOR = T.let(T.unsafe(nil), String) + +RuboCop::MagicComment::VimComment::REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::MagicComment::VimComment::SEPARATOR = T.let(T.unsafe(nil), String) + +RuboCop::NodePattern = RuboCop::AST::NodePattern + +class RuboCop::Options + # @api private + # @return [Options] a new instance of Options + # + # source://rubocop//lib/rubocop/options.rb#22 + def initialize; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#27 + def parse(command_line_args); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#229 + def add_additional_modes(opts); end + + # the autocorrect command-line arguments map to the autocorrect @options values like so: + # :fix_layout :autocorrect :safe_autocorrect :autocorrect_all + # -x, --fix-layout true true - - + # -a, --auto-correct - true true - + # --safe-auto-correct - true true - + # -A, --auto-correct-all - true - true + # + # @api private + # + # source://rubocop//lib/rubocop/options.rb#140 + def add_autocorrection_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#205 + def add_cache_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#73 + def add_check_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#163 + def add_config_generation_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#181 + def add_cop_selection_csv_option(option, opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#241 + def add_general_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#212 + def add_lsp_option(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#105 + def add_output_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#254 + def add_profile_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#218 + def add_server_options(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#196 + def add_severity_option(opts); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#53 + def define_options; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#264 + def handle_deprecated_option(old_option, new_option); end + + # Finds the option in `args` starting with -- and converts it to a symbol, + # e.g. [..., '--autocorrect', ...] to :autocorrect. + # + # @api private + # + # source://rubocop//lib/rubocop/options.rb#298 + def long_opt_symbol(args); end + + # Sets a value in the @options hash, based on the given long option and its + # value, in addition to calling the block if a block is given. + # + # @api private + # + # source://rubocop//lib/rubocop/options.rb#287 + def option(opts, *args); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#303 + def plugin_feature(file); end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#269 + def rainbow; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#309 + def require_feature(file); end + + # Creates a section of options in order to separate them visually when + # using `--help`. + # + # @api private + # + # source://rubocop//lib/rubocop/options.rb#279 + def section(opts, heading, &_block); end +end + +RuboCop::Options::DEFAULT_MAXIMUM_EXCLUSION_ITEMS = T.let(T.unsafe(nil), Integer) + +RuboCop::Options::EXITING_OPTIONS = T.let(T.unsafe(nil), Array) + +RuboCop::Options::E_STDIN_NO_PATH = T.let(T.unsafe(nil), String) + +module RuboCop::OptionsHelp; end + +RuboCop::OptionsHelp::FORMATTER_OPTION_LIST = T.let(T.unsafe(nil), Array) + +RuboCop::OptionsHelp::MAX_EXCL = T.let(T.unsafe(nil), String) + +RuboCop::OptionsHelp::TEXT = T.let(T.unsafe(nil), Hash) + +class RuboCop::OptionsValidator + # @api private + # @return [OptionsValidator] a new instance of OptionsValidator + # + # source://rubocop//lib/rubocop/options.rb#365 + def initialize(options); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/options.rb#486 + def boolean_or_empty_cache?; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#456 + def disable_parallel_when_invalid_option_combo; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/options.rb#482 + def except_syntax?; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#490 + def incompatible_options; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#469 + def invalid_arguments_for_parallel; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/options.rb#477 + def only_includes_redundant_disable?; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#397 + def validate_auto_gen_config; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#442 + def validate_autocorrect; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#502 + def validate_cache_enabled_for_cache_root; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#374 + def validate_compatibility; end + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#369 + def validate_cop_options; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#418 + def validate_display_only_correctable_and_autocorrect; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#410 + def validate_display_only_failed; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#427 + def validate_display_only_failed_and_display_only_correctable; end + + # @api private + # @raise [OptionParser::MissingArgument] + # + # source://rubocop//lib/rubocop/options.rb#494 + def validate_exclude_limit_option; end + + # @api private + # @raise [OptionArgumentError] + # + # source://rubocop//lib/rubocop/options.rb#436 + def validate_lsp_and_editor_mode; end + + class << self + # Cop name validation must be done later than option parsing, so it's not + # called from within Options. + # + # @api private + # + # source://rubocop//lib/rubocop/options.rb#334 + def validate_cop_list(names); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/options.rb#351 + def format_message_from(name, cop_names); end + end +end + +RuboCop::PathUtil::HIDDEN_FILE_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::PathUtil::SMART_PATH_CACHE = T.let(T.unsafe(nil), Hash) + +RuboCop::Plugin::BUILTIN_INTERNAL_PLUGINS = T.let(T.unsafe(nil), Hash) + +RuboCop::Plugin::INTERNAL_AFFAIRS_PLUGIN_NAME = T.let(T.unsafe(nil), String) + +RuboCop::Plugin::Loader::DEFAULT_PLUGIN_CONFIG = T.let(T.unsafe(nil), Hash) + +RuboCop::Plugin::OBSOLETE_INTERNAL_AFFAIRS_PLUGIN_NAME = T.let(T.unsafe(nil), String) + +RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource + +RuboCop::RSpec::ExpectOffense::AnnotatedSource::ABBREV = T.let(T.unsafe(nil), String) + +RuboCop::RSpec::ExpectOffense::AnnotatedSource::ANNOTATION_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::RemoteConfig::CACHE_LIFETIME = T.let(T.unsafe(nil), Integer) + +class RuboCop::ResultCache + # @api private + # @return [ResultCache] a new instance of ResultCache + # + # source://rubocop//lib/rubocop/result_cache.rb#87 + def initialize(file, team, options, config_store, cache_root_override = T.unsafe(nil)); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#100 + def debug?; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#108 + def load; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#85 + def path; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#113 + def save(offenses); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#104 + def valid?; end + + private + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#146 + def any_symlink?(path); end + + # We combine team and options into a single "context" checksum to avoid + # making file names that are too long for some filesystems to handle. + # This context is for anything that's not (1) the RuboCop executable + # checksum or (2) the inspected file checksum. + # + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#229 + def context_checksum(team, options); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#189 + def digest(path); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#157 + def file_checksum(file, config_store); end + + # Return a hash of the options given at invocation, minus the ones that have + # no effect on which offenses and disabled line ranges are found, and thus + # don't affect caching. + # + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#220 + def relevant_options_digest(options); end + + # The checksum of the RuboCop program running the inspection. + # + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#174 + def rubocop_checksum; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#200 + def rubocop_extra_features; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#142 + def symlink_protection_triggered?(path); end + + class << self + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#81 + def allow_symlinks_in_cache_location?(config_store); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#75 + def cache_root(config_store, cache_root_override = T.unsafe(nil)); end + + # Remove old files so that the cache doesn't grow too big. When the + # threshold MaxFilesInCache has been exceeded, the oldest 50% of all the + # files in the cache are removed. The reason for removing so much is that + # cleaning should be done relatively seldom, since there is a slight risk + # that some other RuboCop process was just about to read the file, when + # there's parallel execution and the cache is shared. + # + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#28 + def cleanup(config_store, verbose, cache_root_override = T.unsafe(nil)); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#170 + def inhibit_cleanup; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#170 + def inhibit_cleanup=(_arg0); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#42 + def rubocop_required_features; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#42 + def rubocop_required_features=(_arg0); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#170 + def source_checksum; end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#170 + def source_checksum=(_arg0); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#65 + def remove_files(files, dirs, remove_count); end + + # @api private + # + # source://rubocop//lib/rubocop/result_cache.rb#52 + def remove_oldest_files(files, dirs, rubocop_cache_dir, verbose); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/result_cache.rb#48 + def requires_file_removal?(file_count, config_store); end + end +end + +RuboCop::ResultCache::DL_EXTENSIONS = T.let(T.unsafe(nil), Array) + +RuboCop::ResultCache::NON_CHANGING = T.let(T.unsafe(nil), Array) + +class RuboCop::Runner + # @return [Runner] a new instance of Runner + # + # source://rubocop//lib/rubocop/runner.rb#59 + def initialize(options, config_store); end + + # Sets the attribute aborting + # + # @param value the value to set the attribute aborting to. + # + # source://rubocop//lib/rubocop/runner.rb#57 + def aborting=(_arg0); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#83 + def aborting?; end + + # Returns the value of attribute errors. + # + # source://rubocop//lib/rubocop/runner.rb#56 + def errors; end + + # source://rubocop//lib/rubocop/runner.rb#248 + def file_finished(file, offenses); end + + # source://rubocop//lib/rubocop/runner.rb#177 + def file_offense_cache(file); end + + # source://rubocop//lib/rubocop/runner.rb#485 + def get_processed_source(*args); end + + # source://rubocop//lib/rubocop/runner.rb#67 + def run(paths); end + + # Returns the value of attribute warnings. + # + # source://rubocop//lib/rubocop/runner.rb#56 + def warnings; end + + private + + # source://rubocop//lib/rubocop/runner.rb#199 + def add_redundant_disables(file, offenses, source); end + + # source://rubocop//lib/rubocop/runner.rb#173 + def cached_result(file, team); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#253 + def cached_run?; end + + # Check whether a run created source identical to a previous run, which + # means that we definitely have an infinite loop. + # + # source://rubocop//lib/rubocop/runner.rb#331 + def check_for_infinite_loop(processed_source, offenses_by_iteration); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#225 + def check_for_redundant_disables?(source); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#433 + def considered_failure?(offense); end + + # source://rubocop//lib/rubocop/runner.rb#470 + def default_config(cop_name); end + + # source://rubocop//lib/rubocop/runner.rb#275 + def do_inspection_loop(file); end + + # source://rubocop//lib/rubocop/runner.rb#133 + def each_inspected_file(files); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#239 + def except_redundant_cop_disable_directive?; end + + # source://rubocop//lib/rubocop/runner.rb#360 + def extract_ruby_sources(processed_source); end + + # source://rubocop//lib/rubocop/runner.rb#165 + def file_offenses(file); end + + # source://rubocop//lib/rubocop/runner.rb#243 + def file_started(file); end + + # source://rubocop//lib/rubocop/runner.rb#413 + def filter_cop_classes(cop_classes, config); end + + # source://rubocop//lib/rubocop/runner.rb#104 + def find_target_files(paths); end + + # source://rubocop//lib/rubocop/runner.rb#424 + def formatter_set; end + + # source://rubocop//lib/rubocop/runner.rb#345 + def inspect_file(processed_source, team = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/runner.rb#115 + def inspect_files(files); end + + # source://rubocop//lib/rubocop/runner.rb#306 + def iterate_until_no_changes(source, offenses_by_iteration); end + + # source://rubocop//lib/rubocop/runner.rb#148 + def list_files(paths); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#466 + def mark_as_safe_by_config?(config); end + + # source://rubocop//lib/rubocop/runner.rb#474 + def minimum_severity_to_fail; end + + # source://rubocop//lib/rubocop/runner.rb#374 + def mobilize_team(processed_source); end + + # source://rubocop//lib/rubocop/runner.rb#379 + def mobilized_cop_classes(config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#442 + def offense_displayed?(offense); end + + # source://rubocop//lib/rubocop/runner.rb#454 + def offenses_to_report(offenses); end + + # source://rubocop//lib/rubocop/runner.rb#152 + def process_file(file); end + + # source://rubocop//lib/rubocop/runner.rb#403 + def qualify_option_cop_names; end + + # @yield [cop] + # + # source://rubocop//lib/rubocop/runner.rb#231 + def redundant_cop_disable_directive(file); end + + # source://rubocop//lib/rubocop/runner.rb#265 + def save_in_cache(cache, offenses); end + + # A Cop::Team instance is stateful and may change when inspecting. + # The "standby" team for a given config is an initialized but + # otherwise dormant team that can be used for config- and option- + # level caching in ResultCache. + # + # source://rubocop//lib/rubocop/runner.rb#517 + def standby_team(config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#420 + def style_guide_cops_only?(config); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/runner.rb#458 + def supports_safe_autocorrect?(offense); end + + # @yield [team] + # + # source://rubocop//lib/rubocop/runner.rb#214 + def team_for_redundant_disables(file, offenses, source); end + + # Warms up the RuboCop cache by forking a suitable number of RuboCop + # instances that each inspects its allotted group of files. + # + # source://rubocop//lib/rubocop/runner.rb#91 + def warm_cache(target_files); end + + class << self + # @return [Array<#call>] + # + # source://rubocop//lib/rubocop/runner.rb#29 + def ruby_extractors; end + + private + + # @return [#call] + # + # source://rubocop//lib/rubocop/runner.rb#36 + def default_ruby_extractor; end + end +end + +class RuboCop::Runner::InfiniteCorrectionLoop < ::StandardError + # @return [InfiniteCorrectionLoop] a new instance of InfiniteCorrectionLoop + # + # source://rubocop//lib/rubocop/runner.rb#14 + def initialize(path, offenses_by_iteration, loop_start: T.unsafe(nil)); end + + # Returns the value of attribute offenses. + # + # source://rubocop//lib/rubocop/runner.rb#12 + def offenses; end +end + +RuboCop::Runner::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) + +RuboCop::Runner::REDUNDANT_COP_DISABLE_DIRECTIVE_RULES = T.let(T.unsafe(nil), Array) + +RuboCop::StringInterpreter::STRING_ESCAPES = T.let(T.unsafe(nil), Hash) + +RuboCop::StringInterpreter::STRING_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +class RuboCop::TargetFinder + # @api private + # @return [TargetFinder] a new instance of TargetFinder + # + # source://rubocop//lib/rubocop/target_finder.rb#9 + def initialize(config_store, options = T.unsafe(nil)); end + + # Generate a list of target files by expanding globbing patterns (if any). If args is empty, + # recursively find all Ruby source files under the current directory + # + # @api private + # @return [Array] array of file paths + # + # source://rubocop//lib/rubocop/target_finder.rb#17 + def find(args, mode); end + + # Search for files recursively starting at the given base directory using the given flags that + # determine how the match is made. Excluded files will be removed later by the caller, but as an + # optimization find_files removes the top level directories that are excluded in configuration + # in the normal way (dir/**/*). + # + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#62 + def find_files(base_dir, flags); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#154 + def ruby_file?(file); end + + # Finds all Ruby source files under the current or other supplied directory. A Ruby source file + # is defined as a file with the `.rb` extension or a file with no extension that has a ruby + # shebang line as its first line. + # It is possible to specify includes and excludes using the config file, so you can include + # other Ruby files like Rakefiles and gemspecs. + # + # @api private + # @param base_dir Root directory under which to search for + # ruby source files + # @return [Array] Array of filenames + # + # source://rubocop//lib/rubocop/target_finder.rb#41 + def target_files_in_dir(base_dir = T.unsafe(nil)); end + + private + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#124 + def all_cops_include; end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#110 + def combined_exclude_glob_patterns(base_dir); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#177 + def configured_include?(file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#213 + def debug?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#217 + def fail_fast?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#205 + def force_exclusion?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#209 + def ignore_parent_exclusion?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#150 + def included_file?(file); end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#196 + def order; end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#128 + def process_explicit_path(path, mode); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#181 + def ruby_executable?(file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#162 + def ruby_extension?(file); end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#166 + def ruby_extensions; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#173 + def ruby_filename?(file); end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#117 + def ruby_filenames; end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#192 + def ruby_interpreters(file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#158 + def stdin?; end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#102 + def symlink_excluded_or_infinite_loop?(base_dir, current_dir, exclude_pattern, flags); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/target_finder.rb#77 + def to_inspect?(file, hidden_files, base_dir_config); end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#86 + def wanted_dir_patterns(base_dir, exclude_pattern, flags); end + + # @api private + # + # source://rubocop//lib/rubocop/target_finder.rb#139 + def without_excluded(files); end +end + +RuboCop::TargetFinder::HIDDEN_PATH_SUBSTRING = T.let(T.unsafe(nil), String) + +RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float) + +RuboCop::TargetRuby::KNOWN_RUBIES = T.let(T.unsafe(nil), Array) + +RuboCop::TargetRuby::OBSOLETE_RUBIES = T.let(T.unsafe(nil), Hash) + +RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String) + +RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array) + +RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String) + +RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp) + +RuboCop::Token = RuboCop::AST::Token + +module RuboCop::Version + class << self + # @api private + # + # source://rubocop//lib/rubocop/version.rb#121 + def config_for_pwd(env); end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#151 + def document_version; end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#74 + def extension_versions(env); end + + # Returns feature version in one of two ways: + # + # * Find by RuboCop core version style (e.g. rubocop-performance, rubocop-rspec) + # * Find by `bundle gem` version style (e.g. rubocop-rake) + # + # @api private + # + # source://rubocop//lib/rubocop/version.rb#135 + def feature_version(feature); end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#57 + def parser_version(target_ruby_version); end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#156 + def server_mode; end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#112 + def target_ruby_version(env); end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#52 + def verbose(env: T.unsafe(nil)); end + + # NOTE: Marked as private but used by gems like standard. + # + # @api private + # + # source://rubocop//lib/rubocop/version.rb#26 + def version(debug: T.unsafe(nil), env: T.unsafe(nil)); end + end +end + +RuboCop::Version::CANONICAL_FEATURE_NAMES = T.let(T.unsafe(nil), Hash) + +RuboCop::Version::EXTENSION_PATH_NAMES = T.let(T.unsafe(nil), Hash) + +RuboCop::Version::MINIMUM_PARSABLE_PRISM_VERSION = T.let(T.unsafe(nil), Float) + +RuboCop::Version::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Version::STRING = T.let(T.unsafe(nil), String) + diff --git a/Library/Homebrew/sorbet/rbi/gems/ruby-lsp@0.23.21.rbi b/Library/Homebrew/sorbet/rbi/gems/ruby-lsp@0.24.2.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/ruby-lsp@0.23.21.rbi rename to Library/Homebrew/sorbet/rbi/gems/ruby-lsp@0.24.2.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/spoom@1.6.3.rbi b/Library/Homebrew/sorbet/rbi/gems/spoom@1.7.4.rbi similarity index 68% rename from Library/Homebrew/sorbet/rbi/gems/spoom@1.6.3.rbi rename to Library/Homebrew/sorbet/rbi/gems/spoom@1.7.4.rbi index 47d8116a53..9ee2633c3c 100644 --- a/Library/Homebrew/sorbet/rbi/gems/spoom@1.6.3.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/spoom@1.7.4.rbi @@ -14,17 +14,9 @@ # source://spoom//lib/spoom.rb#7 module Spoom class << self - # : (String ruby, file: String) -> Prism::Node - # # source://spoom//lib/spoom/parse.rb#11 - sig { params(ruby: ::String, file: ::String).returns(::Prism::Node) } - def parse_ruby(ruby, file:); end - - # : (String ruby, file: String) -> [Prism::Node, Array[Prism::Comment]] - # - # source://spoom//lib/spoom/parse.rb#27 - sig { params(ruby: ::String, file: ::String).returns([::Prism::Node, T::Array[::Prism::Comment]]) } - def parse_ruby_with_comments(ruby, file:); end + sig { params(ruby: ::String, file: ::String, comments: T::Boolean).returns(::Prism::Node) } + def parse_ruby(ruby, file:, comments: T.unsafe(nil)); end end end @@ -36,132 +28,108 @@ class Spoom::Cli::Deadcode < ::Thor include ::Spoom::Colorize include ::Spoom::Cli::Helper - # : (*String paths) -> void - # # source://spoom//lib/spoom/cli/deadcode.rb#51 sig { params(paths: ::String).void } def deadcode(*paths); end + # source://spoom//lib/spoom/cli.rb#71 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # source://spoom//lib/spoom/cli/deadcode.rb#153 def remove(location_string); end end -# source://spoom//lib/spoom/cli/helper.rb#10 +# source://spoom//lib/spoom/cli/helper.rb#11 module Spoom::Cli::Helper include ::Spoom::Colorize requires_ancestor { Thor } - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#149 + # source://spoom//lib/spoom/cli/helper.rb#146 sig { params(string: ::String).returns(::String) } def blue(string); end # Collect files from `paths`, defaulting to `exec_path` - # : (Array[String] paths, ?include_rbi_files: bool) -> Array[String] # - # source://spoom//lib/spoom/cli/helper.rb#85 + # source://spoom//lib/spoom/cli/helper.rb#82 sig { params(paths: T::Array[::String], include_rbi_files: T::Boolean).returns(T::Array[::String]) } def collect_files(paths, include_rbi_files: T.unsafe(nil)); end # Is the `--color` option true? - # : -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/cli/helper.rb#113 + # source://spoom//lib/spoom/cli/helper.rb#110 sig { returns(T::Boolean) } def color?; end # Colorize a string if `color?` - # : (String string, *Color color) -> String # - # source://spoom//lib/spoom/cli/helper.rb#142 + # source://spoom//lib/spoom/cli/helper.rb#139 sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } def colorize(string, *color); end # Returns the context at `--path` (by default the current working directory) - # : -> Context # - # source://spoom//lib/spoom/cli/helper.rb#58 + # source://spoom//lib/spoom/cli/helper.rb#55 sig { returns(::Spoom::Context) } def context; end # Raise if `spoom` is not ran inside a context with a `sorbet/config` file - # : -> Context # - # source://spoom//lib/spoom/cli/helper.rb#64 + # source://spoom//lib/spoom/cli/helper.rb#61 sig { returns(::Spoom::Context) } def context_requiring_sorbet!; end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#154 + # source://spoom//lib/spoom/cli/helper.rb#151 sig { params(string: ::String).returns(::String) } def cyan(string); end # Return the path specified through `--path` - # : -> String # - # source://spoom//lib/spoom/cli/helper.rb#79 + # source://spoom//lib/spoom/cli/helper.rb#76 sig { returns(::String) } def exec_path; end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#159 + # source://spoom//lib/spoom/cli/helper.rb#156 sig { params(string: ::String).returns(::String) } def gray(string); end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#164 + # source://spoom//lib/spoom/cli/helper.rb#161 sig { params(string: ::String).returns(::String) } def green(string); end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#118 + # source://spoom//lib/spoom/cli/helper.rb#115 sig { params(string: ::String).returns(::String) } def highlight(string); end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#169 + # source://spoom//lib/spoom/cli/helper.rb#166 sig { params(string: ::String).returns(::String) } def red(string); end # Print `message` on `$stdout` - # : (String message) -> void # - # source://spoom//lib/spoom/cli/helper.rb#19 + # source://spoom//lib/spoom/cli/helper.rb#16 sig { params(message: ::String).void } def say(message); end # Print `message` on `$stderr` # # The message is prefixed by a status (default: `Error`). - # : (String message, ?status: String?, ?nl: bool) -> void # - # source://spoom//lib/spoom/cli/helper.rb#32 + # source://spoom//lib/spoom/cli/helper.rb#29 sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } def say_error(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end # Print `message` on `$stderr` # # The message is prefixed by a status (default: `Warning`). - # : (String message, ?status: String?, ?nl: bool) -> void # - # source://spoom//lib/spoom/cli/helper.rb#46 + # source://spoom//lib/spoom/cli/helper.rb#43 sig { params(message: ::String, status: T.nilable(::String), nl: T::Boolean).void } def say_warning(message, status: T.unsafe(nil), nl: T.unsafe(nil)); end - # : (String string) -> String - # - # source://spoom//lib/spoom/cli/helper.rb#174 + # source://spoom//lib/spoom/cli/helper.rb#171 sig { params(string: ::String).returns(::String) } def yellow(string); end end @@ -174,8 +142,6 @@ class Spoom::Cli::Main < ::Thor # source://spoom//lib/spoom/cli.rb#100 def __print_version; end - # : (?String directory) -> void - # # source://spoom//lib/spoom/cli.rb#57 sig { params(directory: ::String).void } def bump(directory = T.unsafe(nil)); end @@ -183,13 +149,13 @@ class Spoom::Cli::Main < ::Thor # source://spoom//lib/spoom/cli.rb#64 def coverage(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli.rb#71 def deadcode(*args); end # source://spoom//lib/spoom/cli.rb#74 def lsp(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli.rb#21 def srb(*args); end # source://spoom//lib/spoom/cli.rb#93 @@ -220,6 +186,7 @@ class Spoom::Cli::Srb::Assertions < ::Thor include ::Spoom::Colorize include ::Spoom::Cli::Helper + # source://spoom//lib/spoom/cli/srb.rb#17 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # source://spoom//lib/spoom/cli/srb/assertions.rb#29 @@ -234,12 +201,11 @@ class Spoom::Cli::Srb::Bump < ::Thor include ::Spoom::Colorize include ::Spoom::Cli::Helper - # : (?String directory) -> void - # # source://spoom//lib/spoom/cli/srb/bump.rb#49 sig { params(directory: ::String).void } def bump(directory = T.unsafe(nil)); end + # source://spoom//lib/spoom/cli/srb.rb#20 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # source://spoom//lib/spoom/cli/srb/bump.rb#170 @@ -257,6 +223,7 @@ class Spoom::Cli::Srb::Coverage < ::Thor # source://spoom//lib/spoom/cli/srb/coverage.rb#199 def bundle_install(path, sha); end + # source://spoom//lib/spoom/cli/srb.rb#23 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # source://spoom//lib/spoom/cli/srb/coverage.rb#211 @@ -296,6 +263,7 @@ class Spoom::Cli::Srb::LSP < ::Thor # source://spoom//lib/spoom/cli/srb/lsp.rb#55 def find(query); end + # source://spoom//lib/spoom/cli/srb.rb#26 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # TODO: options, filter, limit, kind etc.. filter rbi @@ -341,49 +309,66 @@ class Spoom::Cli::Srb::LSP < ::Thor def types(file, line, col); end end -# source://spoom//lib/spoom/cli/srb.rb#14 +# source://spoom//lib/spoom/cli/srb.rb#15 class Spoom::Cli::Srb::Main < ::Thor - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#17 def assertions(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#20 def bump(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#23 def coverage(*args); end + # source://spoom//lib/spoom/cli.rb#21 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#26 def lsp(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#29 + def metrics(*args); end + + # source://spoom//lib/spoom/cli/srb.rb#32 def sigs(*args); end - # source://thor/1.3.2/lib/thor.rb#334 + # source://spoom//lib/spoom/cli/srb.rb#35 def tc(*args); end end -# source://spoom//lib/spoom/cli/srb/sigs.rb#9 +# source://spoom//lib/spoom/cli/srb/metrics.rb#7 +class Spoom::Cli::Srb::Metrics < ::Thor + include ::Spoom::Colorize + include ::Spoom::Cli::Helper + + # source://spoom//lib/spoom/cli/srb.rb#29 + def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end + + # source://spoom//lib/spoom/cli/srb/metrics.rb#14 + def show(*paths); end +end + +# source://spoom//lib/spoom/cli/srb/sigs.rb#7 class Spoom::Cli::Srb::Sigs < ::Thor include ::Spoom::Colorize include ::Spoom::Cli::Helper - # source://spoom//lib/spoom/cli/srb/sigs.rb#198 + # source://spoom//lib/spoom/cli/srb/sigs.rb#216 def exec(context, command); end - # source://spoom//lib/spoom/cli/srb/sigs.rb#69 + # source://spoom//lib/spoom/cli/srb/sigs.rb#87 def export(output_path = T.unsafe(nil)); end + # source://spoom//lib/spoom/cli/srb.rb#32 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # source://spoom//lib/spoom/cli/srb/sigs.rb#50 + # source://spoom//lib/spoom/cli/srb/sigs.rb#68 def strip(*paths); end - # source://spoom//lib/spoom/cli/srb/sigs.rb#175 + # source://spoom//lib/spoom/cli/srb/sigs.rb#193 def transform_files(files, &block); end - # source://spoom//lib/spoom/cli/srb/sigs.rb#21 + # source://spoom//lib/spoom/cli/srb/sigs.rb#20 def translate(*paths); end end @@ -398,6 +383,7 @@ class Spoom::Cli::Srb::Tc < ::Thor # source://spoom//lib/spoom/cli/srb/tc.rb#138 def format_error(error, format); end + # source://spoom//lib/spoom/cli/srb.rb#35 def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end # source://spoom//lib/spoom/cli/srb/tc.rb#28 @@ -439,8 +425,6 @@ class Spoom::Color < ::T::Enum YELLOW = new end - # : -> String - # # source://spoom//lib/spoom/colors.rb#30 sig { returns(::String) } def ansi_code; end @@ -448,8 +432,6 @@ end # source://spoom//lib/spoom/colors.rb#35 module Spoom::Colorize - # : (String string, *Color color) -> String - # # source://spoom//lib/spoom/colors.rb#37 sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } def set_color(string, *color); end @@ -472,7 +454,6 @@ class Spoom::Context # # The directory will not be created if it doesn't exist. # Call `#make!` to create it. - # : (String absolute_path) -> void # # @return [Context] a new instance of Context # @@ -481,7 +462,6 @@ class Spoom::Context def initialize(absolute_path); end # The absolute path to the directory this context is about - # : String # # source://spoom//lib/spoom/context.rb#40 sig { returns(::String) } @@ -492,7 +472,6 @@ class Spoom::Context # # `name` is used as prefix to the temporary directory name. # The directory will be created if it doesn't exist. - # : (?String? name) -> instance # # source://spoom//lib/spoom/context.rb#33 sig { params(name: T.nilable(::String)).returns(T.attached_class) } @@ -502,98 +481,85 @@ end # Bundle features for a context # -# source://spoom//lib/spoom/context/bundle.rb#7 +# source://spoom//lib/spoom/context/bundle.rb#8 module Spoom::Context::Bundle requires_ancestor { Spoom::Context } # Run a command with `bundle` in this context directory - # : (String command, ?version: String?, ?capture_err: bool) -> ExecResult # - # source://spoom//lib/spoom/context/bundle.rb#32 + # source://spoom//lib/spoom/context/bundle.rb#29 sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } def bundle(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end # Run a command `bundle exec` in this context directory - # : (String command, ?version: String?, ?capture_err: bool) -> ExecResult # - # source://spoom//lib/spoom/context/bundle.rb#45 + # source://spoom//lib/spoom/context/bundle.rb#42 sig { params(command: ::String, version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } def bundle_exec(command, version: T.unsafe(nil), capture_err: T.unsafe(nil)); end # Run `bundle install` in this context directory - # : (?version: String?, ?capture_err: bool) -> ExecResult # - # source://spoom//lib/spoom/context/bundle.rb#39 + # source://spoom//lib/spoom/context/bundle.rb#36 sig { params(version: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } def bundle_install!(version: T.unsafe(nil), capture_err: T.unsafe(nil)); end # Get `gem` version from the `Gemfile.lock` content # # Returns `nil` if `gem` cannot be found in the Gemfile. - # : (String gem) -> Gem::Version? # - # source://spoom//lib/spoom/context/bundle.rb#61 + # source://spoom//lib/spoom/context/bundle.rb#58 sig { params(gem: ::String).returns(T.nilable(::Gem::Version)) } def gem_version_from_gemfile_lock(gem); end - # : -> Hash[String, Bundler::LazySpecification] - # - # source://spoom//lib/spoom/context/bundle.rb#50 + # source://spoom//lib/spoom/context/bundle.rb#47 sig { returns(T::Hash[::String, ::Bundler::LazySpecification]) } def gemfile_lock_specs; end # Read the contents of the Gemfile in this context directory - # : -> String? # - # source://spoom//lib/spoom/context/bundle.rb#14 + # source://spoom//lib/spoom/context/bundle.rb#11 sig { returns(T.nilable(::String)) } def read_gemfile; end # Read the contents of the Gemfile.lock in this context directory - # : -> String? # - # source://spoom//lib/spoom/context/bundle.rb#20 + # source://spoom//lib/spoom/context/bundle.rb#17 sig { returns(T.nilable(::String)) } def read_gemfile_lock; end # Set the `contents` of the Gemfile in this context directory - # : (String contents, ?append: bool) -> void # - # source://spoom//lib/spoom/context/bundle.rb#26 + # source://spoom//lib/spoom/context/bundle.rb#23 sig { params(contents: ::String, append: T::Boolean).void } def write_gemfile!(contents, append: T.unsafe(nil)); end end # Execution features for a context # -# source://spoom//lib/spoom/context/exec.rb#25 +# source://spoom//lib/spoom/context/exec.rb#26 module Spoom::Context::Exec requires_ancestor { Spoom::Context } # Run a command in this context directory - # : (String command, ?capture_err: bool) -> ExecResult # - # source://spoom//lib/spoom/context/exec.rb#32 + # source://spoom//lib/spoom/context/exec.rb#29 sig { params(command: ::String, capture_err: T::Boolean).returns(::Spoom::ExecResult) } def exec(command, capture_err: T.unsafe(nil)); end end # File System features for a context # -# source://spoom//lib/spoom/context/file_system.rb#7 +# source://spoom//lib/spoom/context/file_system.rb#8 module Spoom::Context::FileSystem requires_ancestor { Spoom::Context } # Returns the absolute path to `relative_path` in the context's directory - # : (String relative_path) -> String # - # source://spoom//lib/spoom/context/file_system.rb#14 + # source://spoom//lib/spoom/context/file_system.rb#11 sig { params(relative_path: ::String).returns(::String) } def absolute_path_to(relative_path); end - # : (?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> Array[String] - # - # source://spoom//lib/spoom/context/file_system.rb#46 + # source://spoom//lib/spoom/context/file_system.rb#43 sig do params( allow_extensions: T::Array[::String], @@ -606,129 +572,113 @@ module Spoom::Context::FileSystem # Delete this context and its content # # Warning: it will `rm -rf` the context directory on the file system. - # : -> void # - # source://spoom//lib/spoom/context/file_system.rb#98 + # source://spoom//lib/spoom/context/file_system.rb#95 sig { void } def destroy!; end # Does the context directory at `absolute_path` exist and is a directory? - # : -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/context/file_system.rb#20 + # source://spoom//lib/spoom/context/file_system.rb#17 sig { returns(T::Boolean) } def exist?; end # Does `relative_path` point to an existing file in this context directory? - # : (String relative_path) -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/context/file_system.rb#58 + # source://spoom//lib/spoom/context/file_system.rb#55 sig { params(relative_path: ::String).returns(T::Boolean) } def file?(relative_path); end # List all files in this context matching `pattern` - # : (?String pattern) -> Array[String] # - # source://spoom//lib/spoom/context/file_system.rb#33 + # source://spoom//lib/spoom/context/file_system.rb#30 sig { params(pattern: ::String).returns(T::Array[::String]) } def glob(pattern = T.unsafe(nil)); end # List all files at the top level of this context directory - # : -> Array[String] # - # source://spoom//lib/spoom/context/file_system.rb#41 + # source://spoom//lib/spoom/context/file_system.rb#38 sig { returns(T::Array[::String]) } def list; end # Create the context directory at `absolute_path` - # : -> void # - # source://spoom//lib/spoom/context/file_system.rb#26 + # source://spoom//lib/spoom/context/file_system.rb#23 sig { void } def mkdir!; end # Move the file or directory from `from_relative_path` to `to_relative_path` - # : (String from_relative_path, String to_relative_path) -> void # - # source://spoom//lib/spoom/context/file_system.rb#88 + # source://spoom//lib/spoom/context/file_system.rb#85 sig { params(from_relative_path: ::String, to_relative_path: ::String).void } def move!(from_relative_path, to_relative_path); end # Return the contents of the file at `relative_path` in this context directory # # Will raise if the file doesn't exist. - # : (String relative_path) -> String # - # source://spoom//lib/spoom/context/file_system.rb#66 + # source://spoom//lib/spoom/context/file_system.rb#63 sig { params(relative_path: ::String).returns(::String) } def read(relative_path); end # Remove the path at `relative_path` (recursive + force) in this context directory - # : (String relative_path) -> void # - # source://spoom//lib/spoom/context/file_system.rb#82 + # source://spoom//lib/spoom/context/file_system.rb#79 sig { params(relative_path: ::String).void } def remove!(relative_path); end # Write `contents` in the file at `relative_path` in this context directory # # Append to the file if `append` is true. - # : (String relative_path, ?String contents, ?append: bool) -> void # - # source://spoom//lib/spoom/context/file_system.rb#74 + # source://spoom//lib/spoom/context/file_system.rb#71 sig { params(relative_path: ::String, contents: ::String, append: T::Boolean).void } def write!(relative_path, contents = T.unsafe(nil), append: T.unsafe(nil)); end end # Git features for a context # -# source://spoom//lib/spoom/context/git.rb#31 +# source://spoom//lib/spoom/context/git.rb#32 module Spoom::Context::Git requires_ancestor { Spoom::Context } # Run a command prefixed by `git` in this context directory - # : (String command) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#38 + # source://spoom//lib/spoom/context/git.rb#35 sig { params(command: ::String).returns(::Spoom::ExecResult) } def git(command); end # Run `git checkout` in this context directory - # : (?ref: String) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#57 + # source://spoom//lib/spoom/context/git.rb#54 sig { params(ref: ::String).returns(::Spoom::ExecResult) } def git_checkout!(ref: T.unsafe(nil)); end # Run `git checkout -b ` in this context directory - # : (String branch_name, ?ref: String?) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#63 + # source://spoom//lib/spoom/context/git.rb#60 sig { params(branch_name: ::String, ref: T.nilable(::String)).returns(::Spoom::ExecResult) } def git_checkout_new_branch!(branch_name, ref: T.unsafe(nil)); end # Run `git add . && git commit` in this context directory - # : (?message: String, ?time: Time, ?allow_empty: bool) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#73 + # source://spoom//lib/spoom/context/git.rb#70 sig { params(message: ::String, time: ::Time, allow_empty: T::Boolean).returns(::Spoom::ExecResult) } def git_commit!(message: T.unsafe(nil), time: T.unsafe(nil), allow_empty: T.unsafe(nil)); end # Get the current git branch in this context directory - # : -> String? # - # source://spoom//lib/spoom/context/git.rb#84 + # source://spoom//lib/spoom/context/git.rb#81 sig { returns(T.nilable(::String)) } def git_current_branch; end # Run `git diff` in this context directory - # : (*String arg) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#93 + # source://spoom//lib/spoom/context/git.rb#90 sig { params(arg: ::String).returns(::Spoom::ExecResult) } def git_diff(*arg); end @@ -736,115 +686,97 @@ module Spoom::Context::Git # # Warning: passing a branch will run `git init -b ` which is only available in git 2.28+. # In older versions, use `git_init!` followed by `git("checkout -b ")`. - # : (?branch: String?) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#47 + # source://spoom//lib/spoom/context/git.rb#44 sig { params(branch: T.nilable(::String)).returns(::Spoom::ExecResult) } def git_init!(branch: T.unsafe(nil)); end # Get the last commit in the currently checked out branch - # : (?short_sha: bool) -> Spoom::Git::Commit? # - # source://spoom//lib/spoom/context/git.rb#99 + # source://spoom//lib/spoom/context/git.rb#96 sig { params(short_sha: T::Boolean).returns(T.nilable(::Spoom::Git::Commit)) } def git_last_commit(short_sha: T.unsafe(nil)); end - # : (*String arg) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#110 + # source://spoom//lib/spoom/context/git.rb#107 sig { params(arg: ::String).returns(::Spoom::ExecResult) } def git_log(*arg); end # Run `git push ` in this context directory - # : (String remote, String ref, ?force: bool) -> ExecResult # - # source://spoom//lib/spoom/context/git.rb#116 + # source://spoom//lib/spoom/context/git.rb#113 sig { params(remote: ::String, ref: ::String, force: T::Boolean).returns(::Spoom::ExecResult) } def git_push!(remote, ref, force: T.unsafe(nil)); end - # : (*String arg) -> ExecResult - # - # source://spoom//lib/spoom/context/git.rb#121 + # source://spoom//lib/spoom/context/git.rb#118 sig { params(arg: ::String).returns(::Spoom::ExecResult) } def git_show(*arg); end # Is there uncommitted changes in this context directory? - # : (?path: String) -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/context/git.rb#127 + # source://spoom//lib/spoom/context/git.rb#124 sig { params(path: ::String).returns(T::Boolean) } def git_workdir_clean?(path: T.unsafe(nil)); end end # Sorbet features for a context # -# source://spoom//lib/spoom/context/sorbet.rb#7 +# source://spoom//lib/spoom/context/sorbet.rb#8 module Spoom::Context::Sorbet requires_ancestor { Spoom::Context } # Does this context has a `sorbet/config` file? - # : -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/context/sorbet.rb#106 + # source://spoom//lib/spoom/context/sorbet.rb#103 sig { returns(T::Boolean) } def has_sorbet_config?; end # Read the strictness sigil from the file at `relative_path` (returns `nil` if no sigil) - # : (String relative_path) -> String? # - # source://spoom//lib/spoom/context/sorbet.rb#129 + # source://spoom//lib/spoom/context/sorbet.rb#126 sig { params(relative_path: ::String).returns(T.nilable(::String)) } def read_file_strictness(relative_path); end # Read the contents of `sorbet/config` in this context directory - # : -> String # - # source://spoom//lib/spoom/context/sorbet.rb#117 + # source://spoom//lib/spoom/context/sorbet.rb#114 sig { returns(::String) } def read_sorbet_config; end - # : -> Spoom::Sorbet::Config - # - # source://spoom//lib/spoom/context/sorbet.rb#111 + # source://spoom//lib/spoom/context/sorbet.rb#108 sig { returns(::Spoom::Sorbet::Config) } def sorbet_config; end # Get the commit introducing the `sorbet/config` file - # : -> Spoom::Git::Commit? # - # source://spoom//lib/spoom/context/sorbet.rb#135 + # source://spoom//lib/spoom/context/sorbet.rb#132 sig { returns(T.nilable(::Spoom::Git::Commit)) } def sorbet_intro_commit; end # Get the commit removing the `sorbet/config` file - # : -> Spoom::Git::Commit? # - # source://spoom//lib/spoom/context/sorbet.rb#147 + # source://spoom//lib/spoom/context/sorbet.rb#144 sig { returns(T.nilable(::Spoom::Git::Commit)) } def sorbet_removal_commit; end # Run `bundle exec srb` in this context directory - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> ExecResult # - # source://spoom//lib/spoom/context/sorbet.rb#14 + # source://spoom//lib/spoom/context/sorbet.rb#11 sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } def srb(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end # List all files typechecked by Sorbet from its `config` - # : (?with_config: Spoom::Sorbet::Config?, ?include_rbis: bool) -> Array[String] # - # source://spoom//lib/spoom/context/sorbet.rb#58 + # source://spoom//lib/spoom/context/sorbet.rb#55 sig { params(with_config: T.nilable(::Spoom::Sorbet::Config), include_rbis: T::Boolean).returns(T::Array[::String]) } def srb_files(with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end # List all files typechecked by Sorbet from its `config` that matches `strictness` - # : (String strictness, ?with_config: Spoom::Sorbet::Config?, ?include_rbis: bool) -> Array[String] # - # source://spoom//lib/spoom/context/sorbet.rb#91 + # source://spoom//lib/spoom/context/sorbet.rb#88 sig do params( strictness: ::String, @@ -854,9 +786,7 @@ module Spoom::Context::Sorbet end def srb_files_with_strictness(strictness, with_config: T.unsafe(nil), include_rbis: T.unsafe(nil)); end - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> Hash[String, Integer]? - # - # source://spoom//lib/spoom/context/sorbet.rb#38 + # source://spoom//lib/spoom/context/sorbet.rb#35 sig do params( arg: ::String, @@ -866,37 +796,51 @@ module Spoom::Context::Sorbet end def srb_metrics(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> ExecResult - # - # source://spoom//lib/spoom/context/sorbet.rb#32 + # source://spoom//lib/spoom/context/sorbet.rb#29 sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(::Spoom::ExecResult) } def srb_tc(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end - # : (*String arg, ?sorbet_bin: String?, ?capture_err: bool) -> String? - # - # source://spoom//lib/spoom/context/sorbet.rb#97 + # source://spoom//lib/spoom/context/sorbet.rb#94 sig { params(arg: ::String, sorbet_bin: T.nilable(::String), capture_err: T::Boolean).returns(T.nilable(::String)) } def srb_version(*arg, sorbet_bin: T.unsafe(nil), capture_err: T.unsafe(nil)); end # Set the `contents` of `sorbet/config` in this context directory - # : (String contents, ?append: bool) -> void # - # source://spoom//lib/spoom/context/sorbet.rb#123 + # source://spoom//lib/spoom/context/sorbet.rb#120 sig { params(contents: ::String, append: T::Boolean).void } def write_sorbet_config!(contents, append: T.unsafe(nil)); end end +# source://spoom//lib/spoom/counters.rb#6 +class Spoom::Counters < ::Hash + extend T::Generic + + K = type_member { { fixed: String } } + V = type_member { { fixed: Integer } } + Elem = type_member { { fixed: [String, Integer] } } + + # @return [Counters] a new instance of Counters + # + # source://spoom//lib/spoom/counters.rb#8 + sig { void } + def initialize; end + + # source://spoom//lib/spoom/counters.rb#18 + sig { params(key: ::String).returns(::Integer) } + def [](key); end + + # source://spoom//lib/spoom/counters.rb#13 + sig { params(key: ::String).void } + def increment(key); end +end + # source://spoom//lib/spoom/coverage/snapshot.rb#5 module Spoom::Coverage class << self - # : (Context context) -> FileTree - # # source://spoom//lib/spoom/coverage.rb#101 sig { params(context: ::Spoom::Context).returns(::Spoom::FileTree) } def file_tree(context); end - # : (Context context, Array[Snapshot] snapshots, palette: D3::ColorPalette) -> Report - # # source://spoom//lib/spoom/coverage.rb#81 sig do params( @@ -907,8 +851,6 @@ module Spoom::Coverage end def report(context, snapshots, palette:); end - # : (Context context, ?rbi: bool, ?sorbet_bin: String?) -> Snapshot - # # source://spoom//lib/spoom/coverage.rb#14 sig do params( @@ -921,70 +863,56 @@ module Spoom::Coverage end end -# source://spoom//lib/spoom/coverage/report.rb#87 +# source://spoom//lib/spoom/coverage/report.rb#81 module Spoom::Coverage::Cards; end -# source://spoom//lib/spoom/coverage/report.rb#88 +# source://spoom//lib/spoom/coverage/report.rb#82 class Spoom::Coverage::Cards::Card < ::Spoom::Coverage::Template - # : (?template: String, ?title: String?, ?body: String?) -> void - # # @return [Card] a new instance of Card # - # source://spoom//lib/spoom/coverage/report.rb#97 + # source://spoom//lib/spoom/coverage/report.rb#89 sig { params(template: ::String, title: T.nilable(::String), body: T.nilable(::String)).void } def initialize(template: T.unsafe(nil), title: T.unsafe(nil), body: T.unsafe(nil)); end - # : String? - # - # source://spoom//lib/spoom/coverage/report.rb#94 + # source://spoom//lib/spoom/coverage/report.rb#86 def body; end - # : String? - # - # source://spoom//lib/spoom/coverage/report.rb#94 + # source://spoom//lib/spoom/coverage/report.rb#86 sig { returns(T.nilable(::String)) } def title; end end -# : String -# -# source://spoom//lib/spoom/coverage/report.rb#91 +# source://spoom//lib/spoom/coverage/report.rb#83 Spoom::Coverage::Cards::Card::TEMPLATE = T.let(T.unsafe(nil), String) -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/report.rb#104 +# source://spoom//lib/spoom/coverage/report.rb#97 class Spoom::Coverage::Cards::Erb < ::Spoom::Coverage::Cards::Card abstract! - # : -> void - # # @return [Erb] a new instance of Erb # - # source://spoom//lib/spoom/coverage/report.rb#110 + # source://spoom//lib/spoom/coverage/report.rb#99 sig { void } def initialize; end # @abstract # - # source://spoom//lib/spoom/coverage/report.rb#119 + # source://spoom//lib/spoom/coverage/report.rb#109 sig { abstract.returns(::String) } def erb; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#114 + # source://spoom//lib/spoom/coverage/report.rb#103 sig { override.returns(::String) } def html; end end -# source://spoom//lib/spoom/coverage/report.rb#150 +# source://spoom//lib/spoom/coverage/report.rb#140 class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card - # : (file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?title: String) -> void - # # @return [Map] a new instance of Map # - # source://spoom//lib/spoom/coverage/report.rb#152 + # source://spoom//lib/spoom/coverage/report.rb#142 sig do params( file_tree: ::Spoom::FileTree, @@ -996,136 +924,106 @@ class Spoom::Coverage::Cards::Map < ::Spoom::Coverage::Cards::Card def initialize(file_tree:, nodes_strictnesses:, nodes_strictness_scores:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#122 +# source://spoom//lib/spoom/coverage/report.rb#112 class Spoom::Coverage::Cards::Snapshot < ::Spoom::Coverage::Cards::Card - # : (snapshot: Coverage::Snapshot, ?title: String) -> void - # # @return [Snapshot] a new instance of Snapshot # - # source://spoom//lib/spoom/coverage/report.rb#129 + # source://spoom//lib/spoom/coverage/report.rb#119 sig { params(snapshot: ::Spoom::Coverage::Snapshot, title: ::String).void } def initialize(snapshot:, title: T.unsafe(nil)); end - # : -> D3::Pie::Calls - # - # source://spoom//lib/spoom/coverage/report.rb#140 + # source://spoom//lib/spoom/coverage/report.rb#130 sig { returns(::Spoom::Coverage::D3::Pie::Calls) } def pie_calls; end - # : -> D3::Pie::Sigils - # - # source://spoom//lib/spoom/coverage/report.rb#135 + # source://spoom//lib/spoom/coverage/report.rb#125 sig { returns(::Spoom::Coverage::D3::Pie::Sigils) } def pie_sigils; end - # : -> D3::Pie::Sigs - # - # source://spoom//lib/spoom/coverage/report.rb#145 + # source://spoom//lib/spoom/coverage/report.rb#135 sig { returns(::Spoom::Coverage::D3::Pie::Sigs) } def pie_sigs; end - # : Coverage::Snapshot - # - # source://spoom//lib/spoom/coverage/report.rb#126 + # source://spoom//lib/spoom/coverage/report.rb#116 sig { returns(::Spoom::Coverage::Snapshot) } def snapshot; end end -# : String -# -# source://spoom//lib/spoom/coverage/report.rb#123 +# source://spoom//lib/spoom/coverage/report.rb#113 Spoom::Coverage::Cards::Snapshot::TEMPLATE = T.let(T.unsafe(nil), String) -# source://spoom//lib/spoom/coverage/report.rb#214 +# source://spoom//lib/spoom/coverage/report.rb#204 class Spoom::Coverage::Cards::SorbetIntro < ::Spoom::Coverage::Cards::Erb - # : (?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void - # # @return [SorbetIntro] a new instance of SorbetIntro # - # source://spoom//lib/spoom/coverage/report.rb#216 + # source://spoom//lib/spoom/coverage/report.rb#206 sig { params(sorbet_intro_commit: T.nilable(::String), sorbet_intro_date: T.nilable(::Time)).void } def initialize(sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#223 + # source://spoom//lib/spoom/coverage/report.rb#213 sig { override.returns(::String) } def erb; end end -# source://spoom//lib/spoom/coverage/report.rb#165 +# source://spoom//lib/spoom/coverage/report.rb#155 class Spoom::Coverage::Cards::Timeline < ::Spoom::Coverage::Cards::Card - # : (title: String, timeline: D3::Timeline) -> void - # # @return [Timeline] a new instance of Timeline # - # source://spoom//lib/spoom/coverage/report.rb#167 + # source://spoom//lib/spoom/coverage/report.rb#157 sig { params(title: ::String, timeline: ::Spoom::Coverage::D3::Timeline).void } def initialize(title:, timeline:); end end -# source://spoom//lib/spoom/coverage/report.rb#178 +# source://spoom//lib/spoom/coverage/report.rb#168 class Spoom::Coverage::Cards::Timeline::Calls < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [Calls] a new instance of Calls # - # source://spoom//lib/spoom/coverage/report.rb#180 + # source://spoom//lib/spoom/coverage/report.rb#170 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#192 +# source://spoom//lib/spoom/coverage/report.rb#182 class Spoom::Coverage::Cards::Timeline::RBIs < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [RBIs] a new instance of RBIs # - # source://spoom//lib/spoom/coverage/report.rb#194 + # source://spoom//lib/spoom/coverage/report.rb#184 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#206 +# source://spoom//lib/spoom/coverage/report.rb#196 class Spoom::Coverage::Cards::Timeline::Runtimes < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [Runtimes] a new instance of Runtimes # - # source://spoom//lib/spoom/coverage/report.rb#208 + # source://spoom//lib/spoom/coverage/report.rb#198 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#171 +# source://spoom//lib/spoom/coverage/report.rb#161 class Spoom::Coverage::Cards::Timeline::Sigils < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [Sigils] a new instance of Sigils # - # source://spoom//lib/spoom/coverage/report.rb#173 + # source://spoom//lib/spoom/coverage/report.rb#163 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#185 +# source://spoom//lib/spoom/coverage/report.rb#175 class Spoom::Coverage::Cards::Timeline::Sigs < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [Sigs] a new instance of Sigs # - # source://spoom//lib/spoom/coverage/report.rb#187 + # source://spoom//lib/spoom/coverage/report.rb#177 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end -# source://spoom//lib/spoom/coverage/report.rb#199 +# source://spoom//lib/spoom/coverage/report.rb#189 class Spoom::Coverage::Cards::Timeline::Versions < ::Spoom::Coverage::Cards::Timeline - # : (snapshots: Array[Coverage::Snapshot], ?title: String) -> void - # # @return [Versions] a new instance of Versions # - # source://spoom//lib/spoom/coverage/report.rb#201 + # source://spoom//lib/spoom/coverage/report.rb#191 sig { params(snapshots: T::Array[::Spoom::Coverage::Snapshot], title: ::String).void } def initialize(snapshots:, title: T.unsafe(nil)); end end @@ -1133,68 +1031,52 @@ end # source://spoom//lib/spoom/coverage/d3/base.rb#6 module Spoom::Coverage::D3 class << self - # : (ColorPalette palette) -> String - # # source://spoom//lib/spoom/coverage/d3.rb#59 sig { params(palette: ::Spoom::Coverage::D3::ColorPalette).returns(::String) } def header_script(palette); end - # : -> String - # # source://spoom//lib/spoom/coverage/d3.rb#19 sig { returns(::String) } def header_style; end end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/d3/base.rb#7 +# source://spoom//lib/spoom/coverage/d3/base.rb#8 class Spoom::Coverage::D3::Base abstract! - # : (String id, untyped data) -> void - # # @return [Base] a new instance of Base # - # source://spoom//lib/spoom/coverage/d3/base.rb#17 + # source://spoom//lib/spoom/coverage/d3/base.rb#13 sig { params(id: ::String, data: T.untyped).void } def initialize(id, data); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#35 + # source://spoom//lib/spoom/coverage/d3/base.rb#31 sig { returns(::String) } def html; end - # : String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#14 + # source://spoom//lib/spoom/coverage/d3/base.rb#10 sig { returns(::String) } def id; end # @abstract # - # source://spoom//lib/spoom/coverage/d3/base.rb#48 + # source://spoom//lib/spoom/coverage/d3/base.rb#45 sig { abstract.returns(::String) } def script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#43 + # source://spoom//lib/spoom/coverage/d3/base.rb#39 sig { returns(::String) } def tooltip; end class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#29 + # source://spoom//lib/spoom/coverage/d3/base.rb#25 sig { returns(::String) } def header_script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/base.rb#24 + # source://spoom//lib/spoom/coverage/d3/base.rb#20 sig { returns(::String) } def header_style; end end @@ -1217,21 +1099,15 @@ Spoom::Coverage::D3::COLOR_TRUE = T.let(T.unsafe(nil), String) # source://spoom//lib/spoom/coverage/d3/circle_map.rb#9 class Spoom::Coverage::D3::CircleMap < ::Spoom::Coverage::D3::Base - # : -> String - # # source://spoom//lib/spoom/coverage/d3/circle_map.rb#58 sig { override.returns(::String) } def script; end class << self - # : -> String - # # source://spoom//lib/spoom/coverage/d3/circle_map.rb#38 sig { returns(::String) } def header_script; end - # : -> String - # # source://spoom//lib/spoom/coverage/d3/circle_map.rb#12 sig { returns(::String) } def header_style; end @@ -1240,8 +1116,6 @@ end # source://spoom//lib/spoom/coverage/d3/circle_map.rb#147 class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap - # : (String id, FileTree file_tree, Hash[FileTree::Node, String?] nodes_strictnesses, Hash[FileTree::Node, Float] nodes_scores) -> void - # # @return [Sigils] a new instance of Sigils # # source://spoom//lib/spoom/coverage/d3/circle_map.rb#149 @@ -1255,8 +1129,6 @@ class Spoom::Coverage::D3::CircleMap::Sigils < ::Spoom::Coverage::D3::CircleMap end def initialize(id, file_tree, nodes_strictnesses, nodes_scores); end - # : (FileTree::Node node) -> Hash[Symbol, untyped] - # # source://spoom//lib/spoom/coverage/d3/circle_map.rb#156 sig { params(node: ::Spoom::FileTree::Node).returns(T::Hash[::Symbol, T.untyped]) } def tree_node_to_json(node); end @@ -1269,414 +1141,307 @@ class Spoom::Coverage::D3::ColorPalette < ::T::Struct prop :true, ::String prop :strict, ::String prop :strong, ::String - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/d3/pie.rb#9 +# source://spoom//lib/spoom/coverage/d3/pie.rb#10 class Spoom::Coverage::D3::Pie < ::Spoom::Coverage::D3::Base abstract! - # : (String id, String title, untyped data) -> void - # # @return [Pie] a new instance of Pie # - # source://spoom//lib/spoom/coverage/d3/pie.rb#15 + # source://spoom//lib/spoom/coverage/d3/pie.rb#12 sig { params(id: ::String, title: ::String, data: T.untyped).void } def initialize(id, title, data); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#54 + # source://spoom//lib/spoom/coverage/d3/pie.rb#51 sig { override.returns(::String) } def script; end class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#40 + # source://spoom//lib/spoom/coverage/d3/pie.rb#37 sig { returns(::String) } def header_script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#22 + # source://spoom//lib/spoom/coverage/d3/pie.rb#19 sig { returns(::String) } def header_style; end end end -# source://spoom//lib/spoom/coverage/d3/pie.rb#138 +# source://spoom//lib/spoom/coverage/d3/pie.rb#135 class Spoom::Coverage::D3::Pie::Calls < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # # @return [Calls] a new instance of Calls # - # source://spoom//lib/spoom/coverage/d3/pie.rb#140 + # source://spoom//lib/spoom/coverage/d3/pie.rb#137 sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } def initialize(id, title, snapshot); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#146 + # source://spoom//lib/spoom/coverage/d3/pie.rb#143 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/pie.rb#121 +# source://spoom//lib/spoom/coverage/d3/pie.rb#118 class Spoom::Coverage::D3::Pie::Sigils < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # # @return [Sigils] a new instance of Sigils # - # source://spoom//lib/spoom/coverage/d3/pie.rb#123 + # source://spoom//lib/spoom/coverage/d3/pie.rb#120 sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } def initialize(id, title, snapshot); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#129 + # source://spoom//lib/spoom/coverage/d3/pie.rb#126 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/pie.rb#155 +# source://spoom//lib/spoom/coverage/d3/pie.rb#152 class Spoom::Coverage::D3::Pie::Sigs < ::Spoom::Coverage::D3::Pie - # : (String id, String title, Snapshot snapshot) -> void - # # @return [Sigs] a new instance of Sigs # - # source://spoom//lib/spoom/coverage/d3/pie.rb#157 + # source://spoom//lib/spoom/coverage/d3/pie.rb#154 sig { params(id: ::String, title: ::String, snapshot: ::Spoom::Coverage::Snapshot).void } def initialize(id, title, snapshot); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/pie.rb#167 + # source://spoom//lib/spoom/coverage/d3/pie.rb#164 sig { override.returns(::String) } def tooltip; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/d3/timeline.rb#9 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#10 class Spoom::Coverage::D3::Timeline < ::Spoom::Coverage::D3::Base abstract! - # : (String id, untyped data, Array[String] keys) -> void - # # @return [Timeline] a new instance of Timeline # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#15 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#12 sig { params(id: ::String, data: T.untyped, keys: T::Array[::String]).void } def initialize(id, data, keys); end - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#185 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#183 sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } def area(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#201 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#199 sig { params(y: ::String, color: ::String, curve: ::String).returns(::String) } def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end # @abstract # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#124 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#122 sig { abstract.returns(::String) } def plot; end - # : (y: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#215 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#213 sig { params(y: ::String).returns(::String) } def points(y:); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#99 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#96 sig { override.returns(::String) } def script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#127 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#125 sig { returns(::String) } def x_scale; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#143 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#141 sig { returns(::String) } def x_ticks; end - # : (min: String, max: String, ticks: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#156 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#154 sig { params(min: ::String, max: ::String, ticks: ::String).returns(::String) } def y_scale(min:, max:, ticks:); end - # : (ticks: String, format: String, padding: Integer) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#172 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#170 sig { params(ticks: ::String, format: ::String, padding: ::Integer).returns(::String) } def y_ticks(ticks:, format:, padding:); end class << self - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#76 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#73 sig { returns(::String) } def header_script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#22 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#19 sig { returns(::String) } def header_style; end end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#447 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#442 class Spoom::Coverage::D3::Timeline::Calls < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [Calls] a new instance of Calls # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#449 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#444 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#464 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#459 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#502 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#497 class Spoom::Coverage::D3::Timeline::RBIs < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [RBIs] a new instance of RBIs # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#504 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#499 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#575 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#570 sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#616 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#611 sig { override.returns(::String) } def plot; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#534 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#529 sig { override.returns(::String) } def script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#519 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#514 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#280 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#278 class Spoom::Coverage::D3::Timeline::Runtimes < ::Spoom::Coverage::D3::Timeline - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [Runtimes] a new instance of Runtimes # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#282 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#280 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#309 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#307 sig { override.returns(::String) } def plot; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#295 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#293 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#421 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#416 class Spoom::Coverage::D3::Timeline::Sigils < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [Sigils] a new instance of Sigils # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#423 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#418 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#438 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#433 sig { override.returns(::String) } def tooltip; end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#473 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#468 class Spoom::Coverage::D3::Timeline::Sigs < ::Spoom::Coverage::D3::Timeline::Stacked - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [Sigs] a new instance of Sigs # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#475 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#470 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#493 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#488 sig { override.returns(::String) } def tooltip; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/d3/timeline.rb#327 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#326 class Spoom::Coverage::D3::Timeline::Stacked < ::Spoom::Coverage::D3::Timeline abstract! - # : (y: String, ?color: String, ?curve: String) -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#388 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#383 sig { override.params(y: ::String, color: ::String, curve: ::String).returns(::String) } def line(y:, color: T.unsafe(nil), curve: T.unsafe(nil)); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#376 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#371 sig { override.returns(::String) } def plot; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#334 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#329 sig { override.returns(::String) } def script; end end -# source://spoom//lib/spoom/coverage/d3/timeline.rb#230 +# source://spoom//lib/spoom/coverage/d3/timeline.rb#228 class Spoom::Coverage::D3::Timeline::Versions < ::Spoom::Coverage::D3::Timeline - # : (String id, Array[Snapshot] snapshots) -> void - # # @return [Versions] a new instance of Versions # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#232 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#230 sig { params(id: ::String, snapshots: T::Array[::Spoom::Coverage::Snapshot]).void } def initialize(id, snapshots); end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#261 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#259 sig { override.returns(::String) } def plot; end - # : -> String - # - # source://spoom//lib/spoom/coverage/d3/timeline.rb#246 + # source://spoom//lib/spoom/coverage/d3/timeline.rb#244 sig { override.returns(::String) } def tooltip; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/report.rb#37 +# source://spoom//lib/spoom/coverage/report.rb#35 class Spoom::Coverage::Page < ::Spoom::Coverage::Template abstract! - # : (title: String, palette: D3::ColorPalette, ?template: String) -> void - # # @return [Page] a new instance of Page # - # source://spoom//lib/spoom/coverage/report.rb#52 + # source://spoom//lib/spoom/coverage/report.rb#45 sig { params(title: ::String, palette: ::Spoom::Coverage::D3::ColorPalette, template: ::String).void } def initialize(title:, palette:, template: T.unsafe(nil)); end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#74 + # source://spoom//lib/spoom/coverage/report.rb#67 sig { returns(::String) } def body_html; end # @abstract # - # source://spoom//lib/spoom/coverage/report.rb#79 + # source://spoom//lib/spoom/coverage/report.rb#73 sig { abstract.returns(T::Array[::Spoom::Coverage::Cards::Card]) } def cards; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#82 + # source://spoom//lib/spoom/coverage/report.rb#76 sig { returns(::String) } def footer_html; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#69 + # source://spoom//lib/spoom/coverage/report.rb#62 sig { returns(::String) } def header_html; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#64 + # source://spoom//lib/spoom/coverage/report.rb#57 sig { returns(::String) } def header_script; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#59 + # source://spoom//lib/spoom/coverage/report.rb#52 sig { returns(::String) } def header_style; end - # : D3::ColorPalette - # - # source://spoom//lib/spoom/coverage/report.rb#49 + # source://spoom//lib/spoom/coverage/report.rb#42 sig { returns(::Spoom::Coverage::D3::ColorPalette) } def palette; end - # : String - # - # source://spoom//lib/spoom/coverage/report.rb#46 + # source://spoom//lib/spoom/coverage/report.rb#39 sig { returns(::String) } def title; end end -# : String -# -# source://spoom//lib/spoom/coverage/report.rb#43 +# source://spoom//lib/spoom/coverage/report.rb#36 Spoom::Coverage::Page::TEMPLATE = T.let(T.unsafe(nil), String) -# source://spoom//lib/spoom/coverage/report.rb#234 +# source://spoom//lib/spoom/coverage/report.rb#224 class Spoom::Coverage::Report < ::Spoom::Coverage::Page - # : (project_name: String, palette: D3::ColorPalette, snapshots: Array[Snapshot], file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void - # # @return [Report] a new instance of Report # - # source://spoom//lib/spoom/coverage/report.rb#236 + # source://spoom//lib/spoom/coverage/report.rb#226 sig do params( project_name: ::String, @@ -1691,15 +1456,11 @@ class Spoom::Coverage::Report < ::Spoom::Coverage::Page end def initialize(project_name:, palette:, snapshots:, file_tree:, nodes_strictnesses:, nodes_strictness_scores:, sorbet_intro_commit: T.unsafe(nil), sorbet_intro_date: T.unsafe(nil)); end - # : -> Array[Cards::Card] - # - # source://spoom//lib/spoom/coverage/report.rb#270 + # source://spoom//lib/spoom/coverage/report.rb#260 sig { override.returns(T::Array[::Spoom::Coverage::Cards::Card]) } def cards; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#258 + # source://spoom//lib/spoom/coverage/report.rb#248 sig { override.returns(::String) } def header_html; end end @@ -1726,33 +1487,22 @@ class Spoom::Coverage::Snapshot < ::T::Struct prop :methods_without_sig_excluding_rbis, ::Integer, default: T.unsafe(nil) prop :sigils_excluding_rbis, T::Hash[::String, ::Integer], default: T.unsafe(nil) - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer) -> void - # # source://spoom//lib/spoom/coverage/snapshot.rb#31 sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } def print(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end - # : (*untyped arg) -> String - # # source://spoom//lib/spoom/coverage/snapshot.rb#37 sig { params(arg: T.untyped).returns(::String) } def to_json(*arg); end class << self - # : (String json) -> Snapshot - # # source://spoom//lib/spoom/coverage/snapshot.rb#43 sig { params(json: ::String).returns(::Spoom::Coverage::Snapshot) } def from_json(json); end - # : (Hash[String, untyped] obj) -> Snapshot - # # source://spoom//lib/spoom/coverage/snapshot.rb#48 sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } def from_obj(obj); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end @@ -1763,57 +1513,44 @@ Spoom::Coverage::Snapshot::STRICTNESSES = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/coverage/snapshot.rb#91 class Spoom::Coverage::SnapshotPrinter < ::Spoom::Printer - # : (Snapshot snapshot) -> void - # # source://spoom//lib/spoom/coverage/snapshot.rb#93 sig { params(snapshot: ::Spoom::Coverage::Snapshot).void } def print_snapshot(snapshot); end private - # : (Integer? value, Integer? total) -> String - # # source://spoom//lib/spoom/coverage/snapshot.rb#152 sig { params(value: T.nilable(::Integer), total: T.nilable(::Integer)).returns(::String) } def percent(value, total); end - # : (Hash[String, Integer] hash, Integer total) -> void - # # source://spoom//lib/spoom/coverage/snapshot.rb#141 sig { params(hash: T::Hash[::String, ::Integer], total: ::Integer).void } def print_map(hash, total); end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/coverage/report.rb#10 +# source://spoom//lib/spoom/coverage/report.rb#11 class Spoom::Coverage::Template abstract! # Create a new template from an Erb file path - # : (template: String) -> void # # @return [Template] a new instance of Template # - # source://spoom//lib/spoom/coverage/report.rb#17 + # source://spoom//lib/spoom/coverage/report.rb#14 sig { params(template: ::String).void } def initialize(template:); end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#22 + # source://spoom//lib/spoom/coverage/report.rb#19 sig { returns(::String) } def erb; end - # : -> Binding - # - # source://spoom//lib/spoom/coverage/report.rb#32 + # source://spoom//lib/spoom/coverage/report.rb#29 sig { returns(::Binding) } def get_binding; end - # : -> String - # - # source://spoom//lib/spoom/coverage/report.rb#27 + # source://spoom//lib/spoom/coverage/report.rb#24 sig { returns(::String) } def html; end end @@ -1821,14 +1558,10 @@ end # source://spoom//lib/spoom/deadcode/erb.rb#27 module Spoom::Deadcode class << self - # : (Context context) -> Array[singleton(Plugins::Base)] - # # source://spoom//lib/spoom/deadcode/plugins.rb#67 sig { params(context: ::Spoom::Context).returns(T::Array[T.class_of(Spoom::Deadcode::Plugins::Base)]) } def load_custom_plugins(context); end - # : (Context context) -> Set[singleton(Plugins::Base)] - # # source://spoom//lib/spoom/deadcode/plugins.rb#53 sig { params(context: ::Spoom::Context).returns(T::Set[T.class_of(Spoom::Deadcode::Plugins::Base)]) } def plugins_from_gemfile_lock(context); end @@ -1851,100 +1584,71 @@ class Spoom::Deadcode::Definition < ::T::Struct const :location, ::Spoom::Location const :status, ::Spoom::Deadcode::Definition::Status, default: T.unsafe(nil) - # : -> void - # # source://spoom//lib/spoom/deadcode/definition.rb#76 sig { void } def alive!; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#71 sig { returns(T::Boolean) } def alive?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#39 sig { returns(T::Boolean) } def attr_reader?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#44 sig { returns(T::Boolean) } def attr_writer?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#49 sig { returns(T::Boolean) } def class?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#54 sig { returns(T::Boolean) } def constant?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#81 sig { returns(T::Boolean) } def dead?; end - # : -> void - # # source://spoom//lib/spoom/deadcode/definition.rb#91 sig { void } def ignored!; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#86 sig { returns(T::Boolean) } def ignored?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#59 sig { returns(T::Boolean) } def method?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/definition.rb#64 sig { returns(T::Boolean) } def module?; end - # : (*untyped args) -> String - # # source://spoom//lib/spoom/deadcode/definition.rb#98 sig { params(args: T.untyped).returns(::String) } def to_json(*args); end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # source://spoom//lib/spoom/deadcode/definition.rb#8 @@ -1972,8 +1676,6 @@ end # # source://spoom//lib/spoom/deadcode/erb.rb#29 class Spoom::Deadcode::ERB < ::Erubi::Engine - # : (untyped input, ?untyped properties) -> void - # # @return [ERB] a new instance of ERB # # source://spoom//lib/spoom/deadcode/erb.rb#31 @@ -1982,32 +1684,22 @@ class Spoom::Deadcode::ERB < ::Erubi::Engine private - # : (untyped code) -> void - # # source://spoom//lib/spoom/deadcode/erb.rb#84 sig { override.params(code: T.untyped).void } def add_code(code); end - # : (untyped indicator, untyped code) -> void - # # source://spoom//lib/spoom/deadcode/erb.rb#66 sig { override.params(indicator: T.untyped, code: T.untyped).void } def add_expression(indicator, code); end - # : (untyped _) -> void - # # source://spoom//lib/spoom/deadcode/erb.rb#91 sig { override.params(_: T.untyped).void } def add_postamble(_); end - # : (untyped text) -> void - # # source://spoom//lib/spoom/deadcode/erb.rb#47 sig { override.params(text: T.untyped).void } def add_text(text); end - # : (untyped src) -> void - # # source://spoom//lib/spoom/deadcode/erb.rb#97 sig { params(src: T.untyped).void } def flush_newline_if_pending(src); end @@ -2018,46 +1710,32 @@ Spoom::Deadcode::ERB::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) # source://spoom//lib/spoom/deadcode/index.rb#6 class Spoom::Deadcode::Index - # : (Model model) -> void - # # @return [Index] a new instance of Index # # source://spoom//lib/spoom/deadcode/index.rb#25 sig { params(model: ::Spoom::Model).void } def initialize(model); end - # : -> Array[Definition] - # # source://spoom//lib/spoom/deadcode/index.rb#215 sig { returns(T::Array[::Spoom::Deadcode::Definition]) } def all_definitions; end - # : -> Array[Model::Reference] - # # source://spoom//lib/spoom/deadcode/index.rb#220 sig { returns(T::Array[::Spoom::Model::Reference]) } def all_references; end - # : (Array[Plugins::Base] plugins) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#95 sig { params(plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } def apply_plugins!(plugins); end - # : (Definition definition) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#75 sig { params(definition: ::Spoom::Deadcode::Definition).void } def define(definition); end - # : Hash[String, Array[Definition]] - # # source://spoom//lib/spoom/deadcode/index.rb#19 sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Definition]]) } def definitions; end - # : (String name) -> Array[Definition] - # # source://spoom//lib/spoom/deadcode/index.rb#210 sig { params(name: ::String).returns(T::Array[::Spoom::Deadcode::Definition]) } def definitions_for_name(name); end @@ -2065,56 +1743,39 @@ class Spoom::Deadcode::Index # Mark all definitions having a reference of the same name as `alive` # # To be called once all the files have been indexed and all the definitions and references discovered. - # : -> void # # source://spoom//lib/spoom/deadcode/index.rb#118 sig { void } def finalize!; end - # : (Model::SymbolDef symbol_def) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#90 sig { params(symbol_def: ::Spoom::Model::SymbolDef).void } def ignore(symbol_def); end - # : (String erb, file: String, ?plugins: Array[Plugins::Base]) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#46 sig { params(erb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } def index_erb(erb, file:, plugins: T.unsafe(nil)); end - # : (String file, ?plugins: Array[Plugins::Base]) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#35 sig { params(file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } def index_file(file, plugins: T.unsafe(nil)); end - # : (String rb, file: String, ?plugins: Array[Plugins::Base]) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#51 sig { params(rb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } def index_ruby(rb, file:, plugins: T.unsafe(nil)); end - # : Model - # # source://spoom//lib/spoom/deadcode/index.rb#16 sig { returns(::Spoom::Model) } def model; end - # : (String name, Location location) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#80 sig { params(name: ::String, location: ::Spoom::Location).void } def reference_constant(name, location); end - # : (String name, Location location) -> void - # # source://spoom//lib/spoom/deadcode/index.rb#85 sig { params(name: ::String, location: ::Spoom::Location).void } def reference_method(name, location); end - # : Hash[String, Array[Model::Reference]] - # # source://spoom//lib/spoom/deadcode/index.rb#22 sig { returns(T::Hash[::String, T::Array[::Spoom::Model::Reference]]) } def references; end @@ -2122,8 +1783,6 @@ end # source://spoom//lib/spoom/deadcode/index.rb#7 class Spoom::Deadcode::Index::Error < ::Spoom::Error - # : (String message, parent: Exception) -> void - # # @return [Error] a new instance of Error # # source://spoom//lib/spoom/deadcode/index.rb#9 @@ -2133,8 +1792,6 @@ end # source://spoom//lib/spoom/deadcode/indexer.rb#6 class Spoom::Deadcode::Indexer < ::Spoom::Visitor - # : (String path, Index index, ?plugins: Array[Plugins::Base]) -> void - # # @return [Indexer] a new instance of Indexer # # source://spoom//lib/spoom/deadcode/indexer.rb#14 @@ -2147,27 +1804,19 @@ class Spoom::Deadcode::Indexer < ::Spoom::Visitor end def initialize(path, index, plugins: T.unsafe(nil)); end - # : Index - # # source://spoom//lib/spoom/deadcode/indexer.rb#11 sig { returns(::Spoom::Deadcode::Index) } def index; end - # : String - # # source://spoom//lib/spoom/deadcode/indexer.rb#8 sig { returns(::String) } def path; end - # : (Prism::CallNode node) -> void - # # source://spoom//lib/spoom/deadcode/indexer.rb#26 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end end -# : Set[singleton(Plugins::Base)] -# # source://spoom//lib/spoom/deadcode/plugins.rb#33 Spoom::Deadcode::PLUGINS_FOR_GEM = T.let(T.unsafe(nil), Hash) @@ -2176,8 +1825,6 @@ module Spoom::Deadcode::Plugins; end # source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#7 class Spoom::Deadcode::Plugins::ActionMailer < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/action_mailer.rb#10 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end @@ -2185,8 +1832,6 @@ end # source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#7 class Spoom::Deadcode::Plugins::ActionMailerPreview < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/action_mailer_preview.rb#12 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end @@ -2194,14 +1839,10 @@ end # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#7 class Spoom::Deadcode::Plugins::ActionPack < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#27 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/actionpack.rb#36 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end @@ -2211,12 +1852,17 @@ end Spoom::Deadcode::Plugins::ActionPack::CALLBACKS = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/deadcode/plugins/active_job.rb#7 -class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base; end +class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base + # source://spoom//lib/spoom/deadcode/plugins/active_job.rb#22 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end +end + +# source://spoom//lib/spoom/deadcode/plugins/active_job.rb#11 +Spoom::Deadcode::Plugins::ActiveJob::CALLBACKS = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/deadcode/plugins/active_model.rb#7 class Spoom::Deadcode::Plugins::ActiveModel < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/active_model.rb#13 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end @@ -2224,92 +1870,76 @@ end # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#7 class Spoom::Deadcode::Plugins::ActiveRecord < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#64 + # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#69 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end end -# : Array[String] -# -# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#56 +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#61 Spoom::Deadcode::Plugins::ActiveRecord::ARRAY_METHODS = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#18 Spoom::Deadcode::Plugins::ActiveRecord::CALLBACKS = T.let(T.unsafe(nil), Array) -# : Array[String] -# # source://spoom//lib/spoom/deadcode/plugins/active_record.rb#44 +Spoom::Deadcode::Plugins::ActiveRecord::CALLBACK_CONDITIONS = T.let(T.unsafe(nil), Array) + +# source://spoom//lib/spoom/deadcode/plugins/active_record.rb#49 Spoom::Deadcode::Plugins::ActiveRecord::CRUD_METHODS = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/deadcode/plugins/active_support.rb#7 class Spoom::Deadcode::Plugins::ActiveSupport < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/active_support.rb#23 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end end -# : Array[String] -# # source://spoom//lib/spoom/deadcode/plugins/active_support.rb#19 Spoom::Deadcode::Plugins::ActiveSupport::SETUP_AND_TEARDOWN_METHODS = T.let(T.unsafe(nil), Array) -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/deadcode/plugins/base.rb#9 +# source://spoom//lib/spoom/deadcode/plugins/base.rb#10 class Spoom::Deadcode::Plugins::Base abstract! - # : (Index index) -> void - # # @return [Base] a new instance of Base # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#129 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#126 sig { params(index: ::Spoom::Deadcode::Index).void } def initialize(index); end - # : Index - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#126 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#123 sig { returns(::Spoom::Deadcode::Index) } def index; end # Do not override this method, use `on_define_accessor` instead. - # : (Model::Attr definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#155 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#152 sig { params(definition: ::Spoom::Model::Attr).void } def internal_on_define_accessor(definition); end # Do not override this method, use `on_define_class` instead. - # : (Model::Class definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#179 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#176 sig { params(definition: ::Spoom::Model::Class).void } def internal_on_define_class(definition); end # Do not override this method, use `on_define_constant` instead. - # : (Model::Constant definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#209 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#206 sig { params(definition: ::Spoom::Model::Constant).void } def internal_on_define_constant(definition); end # Do not override this method, use `on_define_method` instead. - # : (Model::Method definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#235 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#232 sig { params(definition: ::Spoom::Model::Method).void } def internal_on_define_method(definition); end # Do not override this method, use `on_define_module` instead. - # : (Model::Module definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#261 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#258 sig { params(definition: ::Spoom::Model::Module).void } def internal_on_define_module(definition); end @@ -2326,9 +1956,8 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Model::Attr definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#149 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#146 sig { params(definition: ::Spoom::Model::Attr).void } def on_define_accessor(definition); end @@ -2345,9 +1974,8 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Model::Class definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#173 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#170 sig { params(definition: ::Spoom::Model::Class).void } def on_define_class(definition); end @@ -2364,9 +1992,8 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Model::Constant definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#203 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#200 sig { params(definition: ::Spoom::Model::Constant).void } def on_define_constant(definition); end @@ -2383,9 +2010,8 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Model::Method definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#229 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#226 sig { params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end @@ -2402,9 +2028,8 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Model::Module definition) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#255 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#252 sig { params(definition: ::Spoom::Model::Module).void } def on_define_module(definition); end @@ -2421,85 +2046,64 @@ class Spoom::Deadcode::Plugins::Base # end # end # ~~~ - # : (Send send) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#281 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#278 sig { params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end private - # : (String name) -> String - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#349 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#346 sig { params(name: ::String).returns(::String) } def camelize(name); end - # : (String? name) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#298 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#295 sig { params(name: T.nilable(::String)).returns(T::Boolean) } def ignored_class_name?(name); end - # : (String name) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#317 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#314 sig { params(name: ::String).returns(T::Boolean) } def ignored_constant_name?(name); end - # : (String name) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#322 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#319 sig { params(name: ::String).returns(T::Boolean) } def ignored_method_name?(name); end - # : (String name) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#327 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#324 sig { params(name: ::String).returns(T::Boolean) } def ignored_module_name?(name); end - # : (String name, Symbol names_variable, Symbol patterns_variable) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#332 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#329 sig { params(name: ::String, names_variable: ::Symbol, patterns_variable: ::Symbol).returns(T::Boolean) } def ignored_name?(name, names_variable, patterns_variable); end - # : (Model::Class definition) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#305 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#302 sig { params(definition: ::Spoom::Model::Class).returns(T::Boolean) } def ignored_subclass?(definition); end - # : (Symbol const) -> Set[String] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#337 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#334 sig { params(const: ::Symbol).returns(T::Set[::String]) } def names(const); end - # : (Symbol const) -> Array[Regexp] - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#342 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#339 sig { params(const: ::Symbol).returns(T::Array[::Regexp]) } def patterns(const); end - # : (Model::Namespace definition, String superclass_name) -> bool - # # @return [Boolean] # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#290 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#287 sig { params(definition: ::Spoom::Model::Namespace, superclass_name: ::String).returns(T::Boolean) } def subclass_of?(definition, superclass_name); end @@ -2517,9 +2121,8 @@ class Spoom::Deadcode::Plugins::Base # ) # end # ~~~ - # : (*(String | Regexp) names) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#49 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#46 sig { params(names: T.any(::Regexp, ::String)).void } def ignore_classes_inheriting_from(*names); end @@ -2536,9 +2139,8 @@ class Spoom::Deadcode::Plugins::Base # ) # end # ~~~ - # : (*(String | Regexp) names) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#31 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#28 sig { params(names: T.any(::Regexp, ::String)).void } def ignore_classes_named(*names); end @@ -2555,9 +2157,8 @@ class Spoom::Deadcode::Plugins::Base # ) # end # ~~~ - # : (*(String | Regexp) names) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#67 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#64 sig { params(names: T.any(::Regexp, ::String)).void } def ignore_constants_named(*names); end @@ -2574,9 +2175,8 @@ class Spoom::Deadcode::Plugins::Base # ) # end # ~~~ - # : (*(String | Regexp) names) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#85 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#82 sig { params(names: T.any(::Regexp, ::String)).void } def ignore_methods_named(*names); end @@ -2593,17 +2193,14 @@ class Spoom::Deadcode::Plugins::Base # ) # end # ~~~ - # : (*(String | Regexp) names) -> void # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#103 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#100 sig { params(names: T.any(::Regexp, ::String)).void } def ignore_modules_named(*names); end private - # : (Array[(String | Regexp)] names, Symbol names_variable, Symbol patterns_variable) -> void - # - # source://spoom//lib/spoom/deadcode/plugins/base.rb#110 + # source://spoom//lib/spoom/deadcode/plugins/base.rb#107 sig do params( names: T::Array[T.any(::Regexp, ::String)], @@ -2617,8 +2214,6 @@ end # source://spoom//lib/spoom/deadcode/plugins/graphql.rb#7 class Spoom::Deadcode::Plugins::GraphQL < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/graphql.rb#27 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end @@ -2626,14 +2221,10 @@ end # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#7 class Spoom::Deadcode::Plugins::Minitest < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#21 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/minitest.rb#28 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end @@ -2641,22 +2232,16 @@ end # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#7 class Spoom::Deadcode::Plugins::Namespaces < ::Spoom::Deadcode::Plugins::Base - # : (Model::Class definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#10 sig { override.params(definition: ::Spoom::Model::Class).void } def on_define_class(definition); end - # : (Model::Module definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#16 sig { override.params(definition: ::Spoom::Model::Module).void } def on_define_module(definition); end private - # : (Model::Namespace symbol_def) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/plugins/namespaces.rb#23 @@ -2669,22 +2254,16 @@ class Spoom::Deadcode::Plugins::RSpec < ::Spoom::Deadcode::Plugins::Base; end # source://spoom//lib/spoom/deadcode/plugins/rails.rb#7 class Spoom::Deadcode::Plugins::Rails < ::Spoom::Deadcode::Plugins::Base - # : (Model::Class definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/rails.rb#12 sig { override.params(definition: ::Spoom::Model::Class).void } def on_define_class(definition); end - # : (Model::Module definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/rails.rb#18 sig { override.params(definition: ::Spoom::Model::Module).void } def on_define_module(definition); end private - # : (Model::Namespace symbol_def) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/plugins/rails.rb#25 @@ -2697,36 +2276,26 @@ class Spoom::Deadcode::Plugins::Rake < ::Spoom::Deadcode::Plugins::Base; end # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#7 class Spoom::Deadcode::Plugins::Rubocop < ::Spoom::Deadcode::Plugins::Base - # : (Model::Constant definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#17 sig { override.params(definition: ::Spoom::Model::Constant).void } def on_define_constant(definition); end - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#26 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end end -# : Set[String] -# # source://spoom//lib/spoom/deadcode/plugins/rubocop.rb#8 Spoom::Deadcode::Plugins::Rubocop::RUBOCOP_CONSTANTS = T.let(T.unsafe(nil), Set) # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#7 class Spoom::Deadcode::Plugins::Ruby < ::Spoom::Deadcode::Plugins::Base - # : (Send send) -> void - # # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#23 sig { override.params(send: ::Spoom::Deadcode::Send).void } def on_send(send); end private - # : (Send send, Prism::Node node) -> void - # # source://spoom//lib/spoom/deadcode/plugins/ruby.rb#45 sig { params(send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } def reference_symbol_as_constant(send, node); end @@ -2734,30 +2303,22 @@ end # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#7 class Spoom::Deadcode::Plugins::Sorbet < ::Spoom::Deadcode::Plugins::Base - # : (Model::Constant definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#10 sig { override.params(definition: ::Spoom::Model::Constant).void } def on_define_constant(definition); end - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#16 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end private - # : (Model::Constant definition) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#34 sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } def sorbet_enum_constant?(definition); end - # : (Model::Constant definition) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/plugins/sorbet.rb#29 @@ -2767,8 +2328,6 @@ end # source://spoom//lib/spoom/deadcode/plugins/thor.rb#7 class Spoom::Deadcode::Plugins::Thor < ::Spoom::Deadcode::Plugins::Base - # : (Model::Method definition) -> void - # # source://spoom//lib/spoom/deadcode/plugins/thor.rb#12 sig { override.params(definition: ::Spoom::Model::Method).void } def on_define_method(definition); end @@ -2776,16 +2335,12 @@ end # source://spoom//lib/spoom/deadcode/remover.rb#6 class Spoom::Deadcode::Remover - # : (Context context) -> void - # # @return [Remover] a new instance of Remover # # source://spoom//lib/spoom/deadcode/remover.rb#10 sig { params(context: ::Spoom::Context).void } def initialize(context); end - # : (Definition::Kind? kind, Location location) -> String - # # source://spoom//lib/spoom/deadcode/remover.rb#15 sig { params(kind: T.nilable(::Spoom::Deadcode::Definition::Kind), location: ::Spoom::Location).returns(::String) } def remove_location(kind, location); end @@ -2796,8 +2351,6 @@ class Spoom::Deadcode::Remover::Error < ::Spoom::Error; end # source://spoom//lib/spoom/deadcode/remover.rb#366 class Spoom::Deadcode::Remover::NodeContext - # : (String source, Hash[Integer, Prism::Comment] comments, Prism::Node node, Array[Prism::Node] nesting) -> void - # # @return [NodeContext] a new instance of NodeContext # # source://spoom//lib/spoom/deadcode/remover.rb#377 @@ -2811,113 +2364,79 @@ class Spoom::Deadcode::Remover::NodeContext end def initialize(source, comments, node, nesting); end - # : (Prism::Node node) -> Array[Prism::Comment] - # # source://spoom//lib/spoom/deadcode/remover.rb#491 sig { params(node: ::Prism::Node).returns(T::Array[::Prism::Comment]) } def attached_comments(node); end - # : -> Prism::CallNode? - # # source://spoom//lib/spoom/deadcode/remover.rb#519 sig { returns(T.nilable(::Prism::CallNode)) } def attached_sig; end - # : -> Array[Prism::Node] - # # source://spoom//lib/spoom/deadcode/remover.rb#506 sig { returns(T::Array[::Prism::Node]) } def attached_sigs; end - # : Hash[Integer, Prism::Comment] - # # source://spoom//lib/spoom/deadcode/remover.rb#368 sig { returns(T::Hash[::Integer, ::Prism::Comment]) } def comments; end - # : (Integer start_line, Integer end_line) -> Array[Prism::Comment] - # # source://spoom//lib/spoom/deadcode/remover.rb#479 sig { params(start_line: ::Integer, end_line: ::Integer).returns(T::Array[::Prism::Comment]) } def comments_between_lines(start_line, end_line); end - # : Array[Prism::Node] - # # source://spoom//lib/spoom/deadcode/remover.rb#374 sig { returns(T::Array[::Prism::Node]) } def nesting; end - # : Array[Prism::Node] - # # source://spoom//lib/spoom/deadcode/remover.rb#374 def nesting=(_arg0); end - # : -> Prism::Node? - # # source://spoom//lib/spoom/deadcode/remover.rb#429 sig { returns(T.nilable(::Prism::Node)) } def next_node; end - # : -> Array[Prism::Node] - # # @raise [Error] # # source://spoom//lib/spoom/deadcode/remover.rb#418 sig { returns(T::Array[::Prism::Node]) } def next_nodes; end - # : Prism::Node - # # source://spoom//lib/spoom/deadcode/remover.rb#371 sig { returns(::Prism::Node) } def node; end - # : -> NodeContext - # # @raise [Error] # # source://spoom//lib/spoom/deadcode/remover.rb#393 sig { returns(::Spoom::Deadcode::Remover::NodeContext) } def parent_context; end - # : -> Prism::Node - # # @raise [Error] # # source://spoom//lib/spoom/deadcode/remover.rb#385 sig { returns(::Prism::Node) } def parent_node; end - # : -> Prism::Node? - # # source://spoom//lib/spoom/deadcode/remover.rb#413 sig { returns(T.nilable(::Prism::Node)) } def previous_node; end - # : -> Array[Prism::Node] - # # @raise [Error] # # source://spoom//lib/spoom/deadcode/remover.rb#402 sig { returns(T::Array[::Prism::Node]) } def previous_nodes; end - # : -> NodeContext? - # # source://spoom//lib/spoom/deadcode/remover.rb#434 sig { returns(T.nilable(::Spoom::Deadcode::Remover::NodeContext)) } def sclass_context; end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/remover.rb#467 sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } def sorbet_extend_sig?(node); end - # : (Prism::Node? node) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/remover.rb#462 @@ -2927,35 +2446,25 @@ end # source://spoom//lib/spoom/deadcode/remover.rb#534 class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor - # : (Location location, Definition::Kind? kind) -> void - # # @return [NodeFinder] a new instance of NodeFinder # # source://spoom//lib/spoom/deadcode/remover.rb#599 sig { params(location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind)).void } def initialize(location, kind); end - # : Prism::Node? - # # source://spoom//lib/spoom/deadcode/remover.rb#593 sig { returns(T.nilable(::Prism::Node)) } def node; end - # : Array[Prism::Node] - # # source://spoom//lib/spoom/deadcode/remover.rb#596 sig { returns(T::Array[::Prism::Node]) } def nodes_nesting; end - # : (Prism::Node? node) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#609 sig { override.params(node: T.nilable(::Prism::Node)).void } def visit(node); end class << self - # : (String source, Location location, Definition::Kind? kind) -> NodeContext - # # source://spoom//lib/spoom/deadcode/remover.rb#537 sig do params( @@ -2966,8 +2475,6 @@ class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor end def find(source, location, kind); end - # : (Prism::Node node, Definition::Kind kind) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/deadcode/remover.rb#568 @@ -2978,8 +2485,6 @@ end # source://spoom//lib/spoom/deadcode/remover.rb#27 class Spoom::Deadcode::Remover::NodeRemover - # : (String source, Definition::Kind? kind, Location location) -> void - # # @return [NodeRemover] a new instance of NodeRemover # # source://spoom//lib/spoom/deadcode/remover.rb#32 @@ -2992,52 +2497,36 @@ class Spoom::Deadcode::Remover::NodeRemover end def initialize(source, kind, location); end - # : -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#42 sig { void } def apply_edit; end - # : String - # # source://spoom//lib/spoom/deadcode/remover.rb#29 sig { returns(::String) } def new_source; end private - # : (NodeContext context) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#151 sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } def delete_attr_accessor(context); end - # : (Integer start_char, Integer end_char) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#325 sig { params(start_char: ::Integer, end_char: ::Integer).void } def delete_chars(start_char, end_char); end - # : (NodeContext context) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#69 sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } def delete_constant_assignment(context); end - # : (Integer start_line, Integer end_line) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#318 sig { params(start_line: ::Integer, end_line: ::Integer).void } def delete_lines(start_line, end_line); end - # : (NodeContext context) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#255 sig { params(context: ::Spoom::Deadcode::Remover::NodeContext).void } def delete_node_and_comments_and_sigs(context); end - # : (Prism::Node node, NodeContext send_context, was_removed: bool) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#212 sig do params( @@ -3048,14 +2537,10 @@ class Spoom::Deadcode::Remover::NodeRemover end def insert_accessor(node, send_context, was_removed:); end - # : (Integer start_char, Integer end_char, String replacement) -> void - # # source://spoom//lib/spoom/deadcode/remover.rb#330 sig { params(start_char: ::Integer, end_char: ::Integer, replacement: ::String).void } def replace_chars(start_char, end_char, replacement); end - # : (Prism::CallNode node, name: String, kind: Definition::Kind?) -> String - # # source://spoom//lib/spoom/deadcode/remover.rb#335 sig do params( @@ -3078,8 +2563,6 @@ class Spoom::Deadcode::Send < ::T::Struct const :block, T.nilable(::Prism::Node), default: T.unsafe(nil) const :location, ::Spoom::Location - # : [T] (Class[T] arg_type) { (T arg) -> void } -> void - # # source://spoom//lib/spoom/deadcode/send.rb#16 sig do type_parameters(:T) @@ -3090,16 +2573,9 @@ class Spoom::Deadcode::Send < ::T::Struct end def each_arg(arg_type, &block); end - # : { (Prism::Node key, Prism::Node? value) -> void } -> void - # # source://spoom//lib/spoom/deadcode/send.rb#23 sig { params(block: T.proc.params(key: ::Prism::Node, value: T.nilable(::Prism::Node)).void).void } def each_arg_assoc(&block); end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # source://spoom//lib/spoom.rb#10 @@ -3112,16 +2588,9 @@ class Spoom::ExecResult < ::T::Struct const :status, T::Boolean const :exit_code, ::Integer - # : -> String - # # source://spoom//lib/spoom/context/exec.rb#12 sig { returns(::String) } def to_s; end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # source://spoom//lib/spoom/file_collector.rb#5 @@ -3134,7 +2603,6 @@ class Spoom::FileCollector # If `allow_mime_types` is empty, all files are collected. # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in # the list. - # : (?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> void # # @return [FileCollector] a new instance of FileCollector # @@ -3148,62 +2616,44 @@ class Spoom::FileCollector end def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end - # : Array[String] - # # source://spoom//lib/spoom/file_collector.rb#7 sig { returns(T::Array[::String]) } def files; end - # : (String path) -> void - # # source://spoom//lib/spoom/file_collector.rb#31 sig { params(path: ::String).void } def visit_path(path); end - # : (Array[String] paths) -> void - # # source://spoom//lib/spoom/file_collector.rb#26 sig { params(paths: T::Array[::String]).void } def visit_paths(paths); end private - # : (String path) -> String - # # source://spoom//lib/spoom/file_collector.rb#48 sig { params(path: ::String).returns(::String) } def clean_path(path); end - # : (String path) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/file_collector.rb#65 sig { params(path: ::String).returns(T::Boolean) } def excluded_file?(path); end - # : (String path) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/file_collector.rb#80 sig { params(path: ::String).returns(T::Boolean) } def excluded_path?(path); end - # : (String path) -> String? - # # source://spoom//lib/spoom/file_collector.rb#89 sig { params(path: ::String).returns(T.nilable(::String)) } def mime_type_for(path); end - # : (String path) -> void - # # source://spoom//lib/spoom/file_collector.rb#60 sig { params(path: ::String).void } def visit_directory(path); end - # : (String path) -> void - # # source://spoom//lib/spoom/file_collector.rb#53 sig { params(path: ::String).void } def visit_file(path); end @@ -3213,8 +2663,6 @@ end # # source://spoom//lib/spoom/file_tree.rb#6 class Spoom::FileTree - # : (?T::Enumerable[String] paths) -> void - # # @return [FileTree] a new instance of FileTree # # source://spoom//lib/spoom/file_tree.rb#8 @@ -3224,55 +2672,46 @@ class Spoom::FileTree # Add a `path` to the tree # # This will create all nodes until the root of `path`. - # : (String path) -> Node # # source://spoom//lib/spoom/file_tree.rb#23 sig { params(path: ::String).returns(::Spoom::FileTree::Node) } def add_path(path); end # Add all `paths` to the tree - # : (T::Enumerable[String] paths) -> void # # source://spoom//lib/spoom/file_tree.rb#15 sig { params(paths: T::Enumerable[::String]).void } def add_paths(paths); end # All the nodes in this tree - # : -> Array[Node] # # source://spoom//lib/spoom/file_tree.rb#43 sig { returns(T::Array[::Spoom::FileTree::Node]) } def nodes; end # Return a map of typing scores for each node in the tree - # : (Context context) -> Hash[Node, Float] # # source://spoom//lib/spoom/file_tree.rb#57 sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } def nodes_strictness_scores(context); end # All the paths in this tree - # : -> Array[String] # # source://spoom//lib/spoom/file_tree.rb#51 sig { returns(T::Array[::String]) } def paths; end # Return a map of typing scores for each path in the tree - # : (Context context) -> Hash[String, Float] # # source://spoom//lib/spoom/file_tree.rb#65 sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } def paths_strictness_scores(context); end - # : (?out: (IO | StringIO), ?colors: bool) -> void - # # source://spoom//lib/spoom/file_tree.rb#70 sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end # All root nodes - # : -> Array[Node] # # source://spoom//lib/spoom/file_tree.rb#37 sig { returns(T::Array[::Spoom::FileTree::Node]) } @@ -3281,89 +2720,67 @@ end # A visitor that collects all the nodes in a tree # -# source://spoom//lib/spoom/file_tree.rb#119 +# source://spoom//lib/spoom/file_tree.rb#116 class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor - # : -> void - # # @return [CollectNodes] a new instance of CollectNodes # - # source://spoom//lib/spoom/file_tree.rb#124 + # source://spoom//lib/spoom/file_tree.rb#121 sig { void } def initialize; end - # : Array[FileTree::Node] - # - # source://spoom//lib/spoom/file_tree.rb#121 + # source://spoom//lib/spoom/file_tree.rb#118 sig { returns(T::Array[::Spoom::FileTree::Node]) } def nodes; end - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#131 + # source://spoom//lib/spoom/file_tree.rb#128 sig { override.params(node: ::Spoom::FileTree::Node).void } def visit_node(node); end end # A visitor that collects the typing score of each node in a tree # -# source://spoom//lib/spoom/file_tree.rb#160 +# source://spoom//lib/spoom/file_tree.rb#157 class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses - # : (Context context) -> void - # # @return [CollectScores] a new instance of CollectScores # - # source://spoom//lib/spoom/file_tree.rb#165 + # source://spoom//lib/spoom/file_tree.rb#162 sig { params(context: ::Spoom::Context).void } def initialize(context); end - # : Hash[Node, Float] - # - # source://spoom//lib/spoom/file_tree.rb#162 + # source://spoom//lib/spoom/file_tree.rb#159 sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } def scores; end - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#173 + # source://spoom//lib/spoom/file_tree.rb#170 sig { override.params(node: ::Spoom::FileTree::Node).void } def visit_node(node); end private - # : (Node node) -> Float - # - # source://spoom//lib/spoom/file_tree.rb#182 + # source://spoom//lib/spoom/file_tree.rb#179 sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } def node_score(node); end - # : (String? strictness) -> Float - # - # source://spoom//lib/spoom/file_tree.rb#191 + # source://spoom//lib/spoom/file_tree.rb#188 sig { params(strictness: T.nilable(::String)).returns(::Float) } def strictness_score(strictness); end end # A visitor that collects the strictness of each node in a tree # -# source://spoom//lib/spoom/file_tree.rb#138 +# source://spoom//lib/spoom/file_tree.rb#135 class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor - # : (Context context) -> void - # # @return [CollectStrictnesses] a new instance of CollectStrictnesses # - # source://spoom//lib/spoom/file_tree.rb#143 + # source://spoom//lib/spoom/file_tree.rb#140 sig { params(context: ::Spoom::Context).void } def initialize(context); end - # : Hash[Node, String?] - # - # source://spoom//lib/spoom/file_tree.rb#140 + # source://spoom//lib/spoom/file_tree.rb#137 sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } def strictnesses; end - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#151 + # source://spoom//lib/spoom/file_tree.rb#148 sig { override.params(node: ::Spoom::FileTree::Node).void } def visit_node(node); end end @@ -3377,29 +2794,21 @@ class Spoom::FileTree::Node < ::T::Struct const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) # Full path to this node from root - # : -> String # # source://spoom//lib/spoom/file_tree.rb#88 sig { returns(::String) } def path; end - - class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - end end # An internal class used to print a FileTree # # See `FileTree#print` # -# source://spoom//lib/spoom/file_tree.rb#204 +# source://spoom//lib/spoom/file_tree.rb#201 class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor - # : (Hash[FileTree::Node, String?] strictnesses, ?out: (IO | StringIO), ?colors: bool) -> void - # # @return [Printer] a new instance of Printer # - # source://spoom//lib/spoom/file_tree.rb#206 + # source://spoom//lib/spoom/file_tree.rb#203 sig do params( strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], @@ -3409,44 +2818,34 @@ class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor end def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#215 + # source://spoom//lib/spoom/file_tree.rb#212 sig { override.params(node: ::Spoom::FileTree::Node).void } def visit_node(node); end private - # : (String? strictness) -> Color - # - # source://spoom//lib/spoom/file_tree.rb#240 + # source://spoom//lib/spoom/file_tree.rb#237 sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } def strictness_color(strictness); end end # An abstract visitor for FileTree # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/file_tree.rb#97 +# source://spoom//lib/spoom/file_tree.rb#98 class Spoom::FileTree::Visitor abstract! - # : (FileTree::Node node) -> void - # - # source://spoom//lib/spoom/file_tree.rb#108 + # source://spoom//lib/spoom/file_tree.rb#105 sig { params(node: ::Spoom::FileTree::Node).void } def visit_node(node); end - # : (Array[FileTree::Node] nodes) -> void - # - # source://spoom//lib/spoom/file_tree.rb#113 + # source://spoom//lib/spoom/file_tree.rb#110 sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } def visit_nodes(nodes); end - # : (FileTree tree) -> void - # - # source://spoom//lib/spoom/file_tree.rb#103 + # source://spoom//lib/spoom/file_tree.rb#100 sig { params(tree: ::Spoom::FileTree).void } def visit_tree(tree); end end @@ -3459,18 +2858,12 @@ class Spoom::Git::Commit < ::T::Struct const :sha, ::String const :time, ::Time - # : -> Integer - # # source://spoom//lib/spoom/context/git.rb#23 sig { returns(::Integer) } def timestamp; end class << self - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - # Parse a line formatted as `%h %at` into a `Commit` - # : (String string) -> Commit? # # source://spoom//lib/spoom/context/git.rb#10 sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } @@ -3483,68 +2876,48 @@ module Spoom::LSP; end # source://spoom//lib/spoom/sorbet/lsp.rb#13 class Spoom::LSP::Client - # : (String sorbet_bin, *String sorbet_args, ?path: String) -> void - # # @return [Client] a new instance of Client # # source://spoom//lib/spoom/sorbet/lsp.rb#15 sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end - # : -> void - # # source://spoom//lib/spoom/sorbet/lsp.rb#227 sig { void } def close; end - # : (String uri, Integer line, Integer column) -> Array[Location] - # # source://spoom//lib/spoom/sorbet/lsp.rb#129 sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } def definitions(uri, line, column); end - # : (String uri) -> Array[DocumentSymbol] - # # source://spoom//lib/spoom/sorbet/lsp.rb#210 sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } def document_symbols(uri); end - # : (String uri, Integer line, Integer column) -> Hover? - # # source://spoom//lib/spoom/sorbet/lsp.rb#87 sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } def hover(uri, line, column); end - # : -> Integer - # # source://spoom//lib/spoom/sorbet/lsp.rb#25 sig { returns(::Integer) } def next_id; end - # : (String workspace_path) -> void - # # @raise [Error::AlreadyOpen] # # source://spoom//lib/spoom/sorbet/lsp.rb#70 sig { params(workspace_path: ::String).void } def open(workspace_path); end - # : -> Hash[untyped, untyped]? - # # source://spoom//lib/spoom/sorbet/lsp.rb#52 sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } def read; end - # : -> String? - # # @raise [Error::BadHeaders] # # source://spoom//lib/spoom/sorbet/lsp.rb#41 sig { returns(T.nilable(::String)) } def read_raw; end - # : (String uri, Integer line, Integer column, ?bool include_decl) -> Array[Location] - # # source://spoom//lib/spoom/sorbet/lsp.rb#171 sig do params( @@ -3556,38 +2929,28 @@ class Spoom::LSP::Client end def references(uri, line, column, include_decl = T.unsafe(nil)); end - # : (Message message) -> Hash[untyped, untyped]? - # # source://spoom//lib/spoom/sorbet/lsp.rb#35 sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } def send(message); end - # : (String json_string) -> void - # # source://spoom//lib/spoom/sorbet/lsp.rb#30 sig { params(json_string: ::String).void } def send_raw(json_string); end - # : (String uri, Integer line, Integer column) -> Array[SignatureHelp] - # # source://spoom//lib/spoom/sorbet/lsp.rb#108 sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } def signatures(uri, line, column); end - # : (String query) -> Array[DocumentSymbol] - # # source://spoom//lib/spoom/sorbet/lsp.rb#195 sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } def symbols(query); end - # : (String uri, Integer line, Integer column) -> Array[Location] - # # source://spoom//lib/spoom/sorbet/lsp.rb#150 sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } def type_definitions(uri, line, column); end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#168 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#165 class Spoom::LSP::Diagnostic < ::T::Struct include ::Spoom::LSP::PrintableSymbol @@ -3596,31 +2959,22 @@ class Spoom::LSP::Diagnostic < ::T::Struct const :message, ::String const :information, ::Object - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#190 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#187 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#195 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#192 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> Diagnostic - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#178 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#175 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#200 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#197 class Spoom::LSP::DocumentSymbol < ::T::Struct include ::Spoom::LSP::PrintableSymbol @@ -3631,37 +2985,26 @@ class Spoom::LSP::DocumentSymbol < ::T::Struct const :range, T.nilable(::Spoom::LSP::Range) const :children, T::Array[::Spoom::LSP::DocumentSymbol] - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#226 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#223 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#258 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#255 sig { returns(::String) } def kind_string; end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#253 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#250 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> DocumentSymbol - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#212 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#209 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#262 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#259 Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) # source://spoom//lib/spoom/sorbet/lsp/errors.rb#6 @@ -3675,94 +3018,68 @@ class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end # source://spoom//lib/spoom/sorbet/lsp/errors.rb#10 class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error - # : (String uri, Array[Diagnostic] diagnostics) -> void - # # @return [Diagnostics] a new instance of Diagnostics # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#28 sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } def initialize(uri, diagnostics); end - # : Array[Diagnostic] - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#15 sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } def diagnostics; end - # : String - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#12 sig { returns(::String) } def uri; end class << self - # : (Hash[untyped, untyped] json) -> Diagnostics - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#19 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } def from_json(json); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#19 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#16 class Spoom::LSP::Hover < ::T::Struct include ::Spoom::LSP::PrintableSymbol const :contents, ::String const :range, T.nilable(T::Range[T.untyped]) - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#37 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#34 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#43 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#40 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> Hover - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#27 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#24 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#106 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#103 class Spoom::LSP::Location < ::T::Struct include ::Spoom::LSP::PrintableSymbol const :uri, ::String const :range, ::Spoom::LSP::Range - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#124 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#121 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#130 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#127 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> Location - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#114 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#111 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end @@ -3772,22 +3089,16 @@ end # # source://spoom//lib/spoom/sorbet/lsp/base.rb#12 class Spoom::LSP::Message - # : -> void - # # @return [Message] a new instance of Message # # source://spoom//lib/spoom/sorbet/lsp/base.rb#14 sig { void } def initialize; end - # : -> Hash[untyped, untyped] - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#19 sig { returns(T::Hash[T.untyped, T.untyped]) } def as_json; end - # : (*untyped args) -> String - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#27 sig { params(args: T.untyped).returns(::String) } def to_json(*args); end @@ -3799,99 +3110,73 @@ end # # source://spoom//lib/spoom/sorbet/lsp/base.rb#54 class Spoom::LSP::Notification < ::Spoom::LSP::Message - # : (String method, Hash[untyped, untyped] params) -> void - # # @return [Notification] a new instance of Notification # # source://spoom//lib/spoom/sorbet/lsp/base.rb#62 sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } def initialize(method, params); end - # : String - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#56 sig { returns(::String) } def method; end - # : Hash[untyped, untyped] - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#59 sig { returns(T::Hash[T.untyped, T.untyped]) } def params; end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#48 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#45 class Spoom::LSP::Position < ::T::Struct include ::Spoom::LSP::PrintableSymbol const :line, ::Integer const :char, ::Integer - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#66 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#63 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#71 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#68 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> Position - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#56 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#53 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#9 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#10 module Spoom::LSP::PrintableSymbol interface! # @abstract # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#16 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#13 sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#76 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#73 class Spoom::LSP::Range < ::T::Struct include ::Spoom::LSP::PrintableSymbol const :start, ::Spoom::LSP::Position const :end, ::Spoom::LSP::Position - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#94 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#91 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#101 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#98 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> Range - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#84 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#81 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end @@ -3901,22 +3186,16 @@ end # # source://spoom//lib/spoom/sorbet/lsp/base.rb#35 class Spoom::LSP::Request < ::Spoom::LSP::Message - # : (Integer id, String method, Hash[untyped, untyped] params) -> void - # # @return [Request] a new instance of Request # # source://spoom//lib/spoom/sorbet/lsp/base.rb#43 sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } def initialize(id, method, params); end - # : Integer - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#37 sig { returns(::Integer) } def id; end - # : Hash[untyped, untyped] - # # source://spoom//lib/spoom/sorbet/lsp/base.rb#40 sig { returns(T::Hash[T.untyped, T.untyped]) } def params; end @@ -3924,36 +3203,28 @@ end # source://spoom//lib/spoom/sorbet/lsp/errors.rb#36 class Spoom::LSP::ResponseError < ::Spoom::LSP::Error - # : (Integer code, String message, Hash[untyped, untyped] data) -> void - # # @return [ResponseError] a new instance of ResponseError # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#55 sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } def initialize(code, message, data); end - # : Integer - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#38 sig { returns(::Integer) } def code; end - # : Hash[untyped, untyped] - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#41 sig { returns(T::Hash[T.untyped, T.untyped]) } def data; end class << self - # : (Hash[untyped, untyped] json) -> ResponseError - # # source://spoom//lib/spoom/sorbet/lsp/errors.rb#45 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } def from_json(json); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#135 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#132 class Spoom::LSP::SignatureHelp < ::T::Struct include ::Spoom::LSP::PrintableSymbol @@ -3961,37 +3232,26 @@ class Spoom::LSP::SignatureHelp < ::T::Struct const :doc, ::Object const :params, T::Array[T.untyped] - # : (SymbolPrinter printer) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#155 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#152 sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } def accept_printer(printer); end - # : -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#163 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#160 sig { returns(::String) } def to_s; end class << self - # : (Hash[untyped, untyped] json) -> SignatureHelp - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#144 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#141 sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } def from_json(json); end - - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end end end -# source://spoom//lib/spoom/sorbet/lsp/structures.rb#292 +# source://spoom//lib/spoom/sorbet/lsp/structures.rb#289 class Spoom::LSP::SymbolPrinter < ::Spoom::Printer - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer, ?prefix: String?) -> void - # # @return [SymbolPrinter] a new instance of SymbolPrinter # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#300 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#297 sig do params( out: T.any(::IO, ::StringIO), @@ -4002,44 +3262,30 @@ class Spoom::LSP::SymbolPrinter < ::Spoom::Printer end def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end - # : (String uri) -> String - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#322 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#319 sig { params(uri: ::String).returns(::String) } def clean_uri(uri); end - # : String? - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#297 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#294 sig { returns(T.nilable(::String)) } def prefix; end - # : String? - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#297 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#294 def prefix=(_arg0); end - # : (Array[PrintableSymbol] objects) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#330 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#327 sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } def print_list(objects); end - # : (PrintableSymbol? object) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#310 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#307 sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } def print_object(object); end - # : (Array[PrintableSymbol] objects) -> void - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#317 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#314 sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } def print_objects(objects); end - # : Set[Integer] - # - # source://spoom//lib/spoom/sorbet/lsp/structures.rb#294 + # source://spoom//lib/spoom/sorbet/lsp/structures.rb#291 sig { returns(T::Set[::Integer]) } def seen; end end @@ -4048,8 +3294,6 @@ end class Spoom::Location include ::Comparable - # : (String file, ?start_line: Integer?, ?start_column: Integer?, ?end_line: Integer?, ?end_column: Integer?) -> void - # # @raise [LocationError] # @return [Location] a new instance of Location # @@ -4065,62 +3309,42 @@ class Spoom::Location end def initialize(file, start_line: T.unsafe(nil), start_column: T.unsafe(nil), end_line: T.unsafe(nil), end_column: T.unsafe(nil)); end - # : (BasicObject other) -> Integer? - # # source://spoom//lib/spoom/location.rb#95 sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } def <=>(other); end - # : Integer? - # # source://spoom//lib/spoom/location.rb#58 def end_column; end - # : Integer? - # # source://spoom//lib/spoom/location.rb#58 def end_line; end - # : String - # # source://spoom//lib/spoom/location.rb#55 sig { returns(::String) } def file; end - # : (Location other) -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/location.rb#81 sig { params(other: ::Spoom::Location).returns(T::Boolean) } def include?(other); end - # : Integer? - # # source://spoom//lib/spoom/location.rb#58 def start_column; end - # : Integer? - # # source://spoom//lib/spoom/location.rb#58 sig { returns(T.nilable(::Integer)) } def start_line; end - # : -> String - # # source://spoom//lib/spoom/location.rb#118 sig { returns(::String) } def to_s; end class << self - # : (String file, Prism::Location location) -> Location - # # source://spoom//lib/spoom/location.rb#43 sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Location) } def from_prism(file, location); end - # : (String location_string) -> Location - # # @raise [LocationError] # # source://spoom//lib/spoom/location.rb#12 @@ -4134,190 +3358,145 @@ class Spoom::Location::LocationError < ::Spoom::Error; end # source://spoom//lib/spoom/model/model.rb#5 class Spoom::Model - # : -> void - # # @return [Model] a new instance of Model # - # source://spoom//lib/spoom/model/model.rb#235 + # source://spoom//lib/spoom/model/model.rb#227 sig { void } def initialize; end # Get a symbol by it's full name # # Raises an error if the symbol is not found - # : (String full_name) -> Symbol # # @raise [Error] # - # source://spoom//lib/spoom/model/model.rb#244 + # source://spoom//lib/spoom/model/model.rb#236 sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } def [](full_name); end - # : -> void - # - # source://spoom//lib/spoom/model/model.rb#293 + # source://spoom//lib/spoom/model/model.rb#285 sig { void } def finalize!; end # Register a new symbol by it's full name # # If the symbol already exists, it will be returned. - # : (String full_name) -> Symbol # - # source://spoom//lib/spoom/model/model.rb#255 + # source://spoom//lib/spoom/model/model.rb#247 sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } def register_symbol(full_name); end - # : (String full_name, context: Symbol) -> Symbol - # - # source://spoom//lib/spoom/model/model.rb#260 + # source://spoom//lib/spoom/model/model.rb#252 sig { params(full_name: ::String, context: ::Spoom::Model::Symbol).returns(::Spoom::Model::Symbol) } def resolve_symbol(full_name, context:); end - # : (Symbol symbol) -> Array[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#287 + # source://spoom//lib/spoom/model/model.rb#279 sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } def subtypes(symbol); end - # : (Symbol symbol) -> Array[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#281 + # source://spoom//lib/spoom/model/model.rb#273 sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } def supertypes(symbol); end # All the symbols registered in this model - # : Hash[String, Symbol] # - # source://spoom//lib/spoom/model/model.rb#229 + # source://spoom//lib/spoom/model/model.rb#221 sig { returns(T::Hash[::String, ::Spoom::Model::Symbol]) } def symbols; end - # : Poset[Symbol] - # - # source://spoom//lib/spoom/model/model.rb#232 + # source://spoom//lib/spoom/model/model.rb#224 sig { returns(Spoom::Poset[::Spoom::Model::Symbol]) } def symbols_hierarchy; end private - # : -> void - # - # source://spoom//lib/spoom/model/model.rb#300 + # source://spoom//lib/spoom/model/model.rb#292 sig { void } def compute_symbols_hierarchy!; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/model.rb#179 +# source://spoom//lib/spoom/model/model.rb#175 class Spoom::Model::Attr < ::Spoom::Model::Property abstract! end -# source://spoom//lib/spoom/model/model.rb#185 +# source://spoom//lib/spoom/model/model.rb#180 class Spoom::Model::AttrAccessor < ::Spoom::Model::Attr; end -# source://spoom//lib/spoom/model/model.rb#183 +# source://spoom//lib/spoom/model/model.rb#178 class Spoom::Model::AttrReader < ::Spoom::Model::Attr; end -# source://spoom//lib/spoom/model/model.rb#184 +# source://spoom//lib/spoom/model/model.rb#179 class Spoom::Model::AttrWriter < ::Spoom::Model::Attr; end # Populate a Model by visiting the nodes from a Ruby file # # source://spoom//lib/spoom/model/builder.rb#7 class Spoom::Model::Builder < ::Spoom::Model::NamespaceVisitor - # : (Model model, String file, ?comments: Array[Prism::Comment]) -> void - # # @return [Builder] a new instance of Builder # # source://spoom//lib/spoom/model/builder.rb#9 - sig { params(model: ::Spoom::Model, file: ::String, comments: T::Array[::Prism::Comment]).void } - def initialize(model, file, comments:); end + sig { params(model: ::Spoom::Model, file: ::String).void } + def initialize(model, file); end - # : (Prism::CallNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#162 + # source://spoom//lib/spoom/model/builder.rb#159 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # : (Prism::ClassNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#26 + # source://spoom//lib/spoom/model/builder.rb#23 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # : (Prism::ConstantPathWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#79 + # source://spoom//lib/spoom/model/builder.rb#76 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # : (Prism::ConstantWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#102 + # source://spoom//lib/spoom/model/builder.rb#99 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # : (Prism::DefNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#141 + # source://spoom//lib/spoom/model/builder.rb#138 sig { override.params(node: ::Prism::DefNode).void } def visit_def_node(node); end - # : (Prism::ModuleNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#61 + # source://spoom//lib/spoom/model/builder.rb#58 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # : (Prism::MultiWriteNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#118 + # source://spoom//lib/spoom/model/builder.rb#115 sig { override.params(node: ::Prism::MultiWriteNode).void } def visit_multi_write_node(node); end - # : (Prism::SingletonClassNode node) -> void - # - # source://spoom//lib/spoom/model/builder.rb#43 + # source://spoom//lib/spoom/model/builder.rb#40 sig { override.params(node: ::Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end private - # : -> Array[Sig] - # - # source://spoom//lib/spoom/model/builder.rb#253 + # source://spoom//lib/spoom/model/builder.rb#250 sig { returns(T::Array[::Spoom::Model::Sig]) } def collect_sigs; end - # : -> Visibility - # - # source://spoom//lib/spoom/model/builder.rb#248 + # source://spoom//lib/spoom/model/builder.rb#245 sig { returns(::Spoom::Model::Visibility) } def current_visibility; end - # : (Prism::Node node) -> Array[Comment] - # - # source://spoom//lib/spoom/model/builder.rb#265 + # source://spoom//lib/spoom/model/builder.rb#262 sig { params(node: ::Prism::Node).returns(T::Array[::Spoom::Model::Comment]) } def node_comments(node); end - # : (Prism::Node node) -> Location - # - # source://spoom//lib/spoom/model/builder.rb#260 + # source://spoom//lib/spoom/model/builder.rb#257 sig { params(node: ::Prism::Node).returns(::Spoom::Location) } def node_location(node); end end -# source://spoom//lib/spoom/model/model.rb#132 +# source://spoom//lib/spoom/model/model.rb#128 class Spoom::Model::Class < ::Spoom::Model::Namespace - # : (Symbol symbol, owner: Namespace?, location: Location, ?superclass_name: String?, ?comments: Array[Comment]) -> void - # # @return [Class] a new instance of Class # - # source://spoom//lib/spoom/model/model.rb#137 + # source://spoom//lib/spoom/model/model.rb#133 sig do params( symbol: ::Spoom::Model::Symbol, @@ -4329,48 +3508,36 @@ class Spoom::Model::Class < ::Spoom::Model::Namespace end def initialize(symbol, owner:, location:, superclass_name: T.unsafe(nil), comments: T.unsafe(nil)); end - # : String? - # - # source://spoom//lib/spoom/model/model.rb#134 + # source://spoom//lib/spoom/model/model.rb#130 sig { returns(T.nilable(::String)) } def superclass_name; end - # : String? - # - # source://spoom//lib/spoom/model/model.rb#134 + # source://spoom//lib/spoom/model/model.rb#130 def superclass_name=(_arg0); end end # source://spoom//lib/spoom/model/model.rb#8 class Spoom::Model::Comment - # : (String string, Location location) -> void - # # @return [Comment] a new instance of Comment # # source://spoom//lib/spoom/model/model.rb#16 sig { params(string: ::String, location: ::Spoom::Location).void } def initialize(string, location); end - # : Location - # # source://spoom//lib/spoom/model/model.rb#13 sig { returns(::Spoom::Location) } def location; end - # : String - # # source://spoom//lib/spoom/model/model.rb#10 sig { returns(::String) } def string; end end -# source://spoom//lib/spoom/model/model.rb#146 +# source://spoom//lib/spoom/model/model.rb#142 class Spoom::Model::Constant < ::Spoom::Model::SymbolDef - # : (Symbol symbol, owner: Namespace?, location: Location, value: String, ?comments: Array[Comment]) -> void - # # @return [Constant] a new instance of Constant # - # source://spoom//lib/spoom/model/model.rb#151 + # source://spoom//lib/spoom/model/model.rb#147 sig do params( symbol: ::Spoom::Model::Symbol, @@ -4382,9 +3549,7 @@ class Spoom::Model::Constant < ::Spoom::Model::SymbolDef end def initialize(symbol, owner:, location:, value:, comments: T.unsafe(nil)); end - # : String - # - # source://spoom//lib/spoom/model/model.rb#148 + # source://spoom//lib/spoom/model/model.rb#144 sig { returns(::String) } def value; end end @@ -4392,54 +3557,48 @@ end # source://spoom//lib/spoom/model/model.rb#6 class Spoom::Model::Error < ::Spoom::Error; end -# source://spoom//lib/spoom/model/model.rb#212 +# source://spoom//lib/spoom/model/model.rb#204 class Spoom::Model::Extend < ::Spoom::Model::Mixin; end -# source://spoom//lib/spoom/model/model.rb#210 +# source://spoom//lib/spoom/model/model.rb#202 class Spoom::Model::Include < ::Spoom::Model::Mixin; end -# source://spoom//lib/spoom/model/model.rb#177 +# source://spoom//lib/spoom/model/model.rb#172 class Spoom::Model::Method < ::Spoom::Model::Property; end # A mixin (include, prepend, extend) to a namespace # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/model.rb#196 +# source://spoom//lib/spoom/model/model.rb#192 class Spoom::Model::Mixin abstract! - # : (String name) -> void - # # @return [Mixin] a new instance of Mixin # - # source://spoom//lib/spoom/model/model.rb#205 + # source://spoom//lib/spoom/model/model.rb#197 sig { params(name: ::String).void } def initialize(name); end - # : String - # - # source://spoom//lib/spoom/model/model.rb#202 + # source://spoom//lib/spoom/model/model.rb#194 sig { returns(::String) } def name; end end -# source://spoom//lib/spoom/model/model.rb#144 +# source://spoom//lib/spoom/model/model.rb#140 class Spoom::Model::Module < ::Spoom::Model::Namespace; end # A class or module # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/model.rb#112 +# source://spoom//lib/spoom/model/model.rb#110 class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef abstract! - # : (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array[Comment]) -> void - # # @return [Namespace] a new instance of Namespace # - # source://spoom//lib/spoom/model/model.rb#122 + # source://spoom//lib/spoom/model/model.rb#118 sig do params( symbol: ::Spoom::Model::Symbol, @@ -4450,56 +3609,46 @@ class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef end def initialize(symbol, owner:, location:, comments: T.unsafe(nil)); end - # : Array[SymbolDef] - # - # source://spoom//lib/spoom/model/model.rb#116 + # source://spoom//lib/spoom/model/model.rb#112 sig { returns(T::Array[::Spoom::Model::SymbolDef]) } def children; end - # : Array[Mixin] - # - # source://spoom//lib/spoom/model/model.rb#119 + # source://spoom//lib/spoom/model/model.rb#115 sig { returns(T::Array[::Spoom::Model::Mixin]) } def mixins; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/namespace_visitor.rb#6 +# source://spoom//lib/spoom/model/namespace_visitor.rb#7 class Spoom::Model::NamespaceVisitor < ::Spoom::Visitor abstract! - # : -> void - # # @return [NamespaceVisitor] a new instance of NamespaceVisitor # - # source://spoom//lib/spoom/model/namespace_visitor.rb#12 + # source://spoom//lib/spoom/model/namespace_visitor.rb#9 sig { void } def initialize; end - # : (Prism::Node? node) -> void - # - # source://spoom//lib/spoom/model/namespace_visitor.rb#20 + # source://spoom//lib/spoom/model/namespace_visitor.rb#17 sig { override.params(node: T.nilable(::Prism::Node)).void } def visit(node); end end -# source://spoom//lib/spoom/model/model.rb#211 +# source://spoom//lib/spoom/model/model.rb#203 class Spoom::Model::Prepend < ::Spoom::Model::Mixin; end # A method or an attribute accessor # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/model.rb#159 +# source://spoom//lib/spoom/model/model.rb#156 class Spoom::Model::Property < ::Spoom::Model::SymbolDef abstract! - # : (Symbol symbol, owner: Namespace?, location: Location, visibility: Visibility, ?sigs: Array[Sig], ?comments: Array[Comment]) -> void - # # @return [Property] a new instance of Property # - # source://spoom//lib/spoom/model/model.rb#169 + # source://spoom//lib/spoom/model/model.rb#164 sig do params( symbol: ::Spoom::Model::Symbol, @@ -4512,15 +3661,11 @@ class Spoom::Model::Property < ::Spoom::Model::SymbolDef end def initialize(symbol, owner:, location:, visibility:, sigs: T.unsafe(nil), comments: T.unsafe(nil)); end - # : Array[Sig] - # - # source://spoom//lib/spoom/model/model.rb#166 + # source://spoom//lib/spoom/model/model.rb#161 sig { returns(T::Array[::Spoom::Model::Sig]) } def sigs; end - # : Visibility - # - # source://spoom//lib/spoom/model/model.rb#163 + # source://spoom//lib/spoom/model/model.rb#158 sig { returns(::Spoom::Model::Visibility) } def visibility; end end @@ -4536,16 +3681,12 @@ class Spoom::Model::Reference < ::T::Struct const :name, ::String const :location, ::Spoom::Location - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/model/reference.rb#35 sig { returns(T::Boolean) } def constant?; end - # : -> bool - # # @return [Boolean] # # source://spoom//lib/spoom/model/reference.rb#40 @@ -4553,17 +3694,10 @@ class Spoom::Model::Reference < ::T::Struct def method?; end class << self - # : (String name, Spoom::Location location) -> Reference - # # source://spoom//lib/spoom/model/reference.rb#20 sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } def constant(name, location); end - # source://sorbet-runtime/0.5.12079/lib/types/struct.rb#13 - def inherited(s); end - - # : (String name, Spoom::Location location) -> Reference - # # source://spoom//lib/spoom/model/reference.rb#25 sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } def method(name, location); end @@ -4582,168 +3716,114 @@ end # # source://spoom//lib/spoom/model/references_visitor.rb#7 class Spoom::Model::ReferencesVisitor < ::Spoom::Visitor - # : (String file) -> void - # # @return [ReferencesVisitor] a new instance of ReferencesVisitor # # source://spoom//lib/spoom/model/references_visitor.rb#12 sig { params(file: ::String).void } def initialize(file); end - # : Array[Reference] - # # source://spoom//lib/spoom/model/references_visitor.rb#9 sig { returns(T::Array[::Spoom::Model::Reference]) } def references; end - # : (Prism::AliasMethodNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#21 sig { override.params(node: ::Prism::AliasMethodNode).void } def visit_alias_method_node(node); end - # : (Prism::AndNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#27 sig { override.params(node: ::Prism::AndNode).void } def visit_and_node(node); end - # : (Prism::BlockArgumentNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#34 sig { override.params(node: ::Prism::BlockArgumentNode).void } def visit_block_argument_node(node); end - # : (Prism::CallAndWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#46 sig { override.params(node: ::Prism::CallAndWriteNode).void } def visit_call_and_write_node(node); end - # : (Prism::CallNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#73 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # : (Prism::CallOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#55 sig { override.params(node: ::Prism::CallOperatorWriteNode).void } def visit_call_operator_write_node(node); end - # : (Prism::CallOrWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#64 sig { override.params(node: ::Prism::CallOrWriteNode).void } def visit_call_or_write_node(node); end - # : (Prism::ClassNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#91 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # : (Prism::ConstantAndWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#98 sig { override.params(node: ::Prism::ConstantAndWriteNode).void } def visit_constant_and_write_node(node); end - # : (Prism::ConstantOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#105 sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } def visit_constant_operator_write_node(node); end - # : (Prism::ConstantOrWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#112 sig { override.params(node: ::Prism::ConstantOrWriteNode).void } def visit_constant_or_write_node(node); end - # : (Prism::ConstantPathNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#119 sig { override.params(node: ::Prism::ConstantPathNode).void } def visit_constant_path_node(node); end - # : (Prism::ConstantPathWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#126 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # : (Prism::ConstantReadNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#133 sig { override.params(node: ::Prism::ConstantReadNode).void } def visit_constant_read_node(node); end - # : (Prism::ConstantWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#139 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # : (Prism::LocalVariableAndWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#145 sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end - # : (Prism::LocalVariableOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#154 sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end - # : (Prism::LocalVariableOrWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#163 sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end - # : (Prism::LocalVariableWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#172 sig { override.params(node: ::Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end - # : (Prism::ModuleNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#179 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # : (Prism::MultiWriteNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#185 sig { override.params(node: ::Prism::MultiWriteNode).void } def visit_multi_write_node(node); end - # : (Prism::OrNode node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#197 sig { override.params(node: ::Prism::OrNode).void } def visit_or_node(node); end private - # : (Prism::Node node) -> Location - # # source://spoom//lib/spoom/model/references_visitor.rb#215 sig { params(node: ::Prism::Node).returns(::Spoom::Location) } def node_location(node); end - # : (String name, Prism::Node node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#205 sig { params(name: ::String, node: ::Prism::Node).void } def reference_constant(name, node); end - # : (String name, Prism::Node node) -> void - # # source://spoom//lib/spoom/model/references_visitor.rb#210 sig { params(name: ::String, node: ::Prism::Node).void } def reference_method(name, node); end @@ -4751,24 +3831,20 @@ end # A Sorbet signature (sig block) # -# source://spoom//lib/spoom/model/model.rb#215 +# source://spoom//lib/spoom/model/model.rb#207 class Spoom::Model::Sig - # : (String string) -> void - # # @return [Sig] a new instance of Sig # - # source://spoom//lib/spoom/model/model.rb#220 + # source://spoom//lib/spoom/model/model.rb#212 sig { params(string: ::String).void } def initialize(string); end - # : String - # - # source://spoom//lib/spoom/model/model.rb#217 + # source://spoom//lib/spoom/model/model.rb#209 sig { returns(::String) } def string; end end -# source://spoom//lib/spoom/model/model.rb#130 +# source://spoom//lib/spoom/model/model.rb#126 class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end # A Symbol is a uniquely named entity in the Ruby codebase @@ -4779,8 +3855,6 @@ class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end # # source://spoom//lib/spoom/model/model.rb#27 class Spoom::Model::Symbol - # : (String full_name) -> void - # # @return [Symbol] a new instance of Symbol # # source://spoom//lib/spoom/model/model.rb#37 @@ -4788,28 +3862,23 @@ class Spoom::Model::Symbol def initialize(full_name); end # The definitions of this symbol (where it exists in the code) - # : Array[SymbolDef] # # source://spoom//lib/spoom/model/model.rb#34 sig { returns(T::Array[::Spoom::Model::SymbolDef]) } def definitions; end # The full, unique name of this symbol - # : String # # source://spoom//lib/spoom/model/model.rb#30 sig { returns(::String) } def full_name; end # The short name of this symbol - # : -> String # # source://spoom//lib/spoom/model/model.rb#44 sig { returns(::String) } def name; end - # : -> String - # # source://spoom//lib/spoom/model/model.rb#49 sig { returns(::String) } def to_s; end @@ -4820,17 +3889,15 @@ end # It can be a class, module, constant, method, etc. # A SymbolDef has a location pointing to the actual code that defines the symbol. # -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://spoom//lib/spoom/model/model.rb#66 +# source://spoom//lib/spoom/model/model.rb#67 class Spoom::Model::SymbolDef abstract! - # : (Symbol symbol, owner: Namespace?, location: Location, ?comments: Array[Comment]) -> void - # # @return [SymbolDef] a new instance of SymbolDef # - # source://spoom//lib/spoom/model/model.rb#88 + # source://spoom//lib/spoom/model/model.rb#85 sig do params( symbol: ::Spoom::Model::Symbol, @@ -4842,58 +3909,50 @@ class Spoom::Model::SymbolDef def initialize(symbol, owner:, location:, comments:); end # The comments associated with this definition - # : Array[Comment] # - # source://spoom//lib/spoom/model/model.rb#85 + # source://spoom//lib/spoom/model/model.rb#82 sig { returns(T::Array[::Spoom::Model::Comment]) } def comments; end # The full name of the symbol this definition belongs to - # : -> String # - # source://spoom//lib/spoom/model/model.rb#100 + # source://spoom//lib/spoom/model/model.rb#97 sig { returns(::String) } def full_name; end # The actual code location of this definition - # : Location # - # source://spoom//lib/spoom/model/model.rb#81 + # source://spoom//lib/spoom/model/model.rb#78 sig { returns(::Spoom::Location) } def location; end # The short name of the symbol this definition belongs to - # : -> String # - # source://spoom//lib/spoom/model/model.rb#106 + # source://spoom//lib/spoom/model/model.rb#103 sig { returns(::String) } def name; end # The enclosing namespace this definition belongs to - # : Namespace? # - # source://spoom//lib/spoom/model/model.rb#77 + # source://spoom//lib/spoom/model/model.rb#74 sig { returns(T.nilable(::Spoom::Model::Namespace)) } def owner; end # The symbol this definition belongs to - # : Symbol # - # source://spoom//lib/spoom/model/model.rb#73 + # source://spoom//lib/spoom/model/model.rb#70 sig { returns(::Spoom::Model::Symbol) } def symbol; end end # source://spoom//lib/spoom/model/model.rb#54 class Spoom::Model::UnresolvedSymbol < ::Spoom::Model::Symbol - # : -> String - # # source://spoom//lib/spoom/model/model.rb#57 sig { override.returns(::String) } def to_s; end end -# source://spoom//lib/spoom/model/model.rb#187 +# source://spoom//lib/spoom/model/model.rb#182 class Spoom::Model::Visibility < ::T::Enum enums do Private = new @@ -4910,28 +3969,25 @@ class Spoom::ParseError < ::Spoom::Error; end # The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. # It can be used to represent a hierarchy of classes or modules, the dependencies between gems, etc. # -# source://spoom//lib/spoom/poset.rb#9 +# source://spoom//lib/spoom/poset.rb#10 class Spoom::Poset extend T::Generic E = type_member { { upper: Object } } - # : -> void - # # @return [Poset] a new instance of Poset # - # source://spoom//lib/spoom/poset.rb#17 + # source://spoom//lib/spoom/poset.rb#14 sig { void } def initialize; end # Get the POSet element for a given value # # Raises if the element is not found - # : (E value) -> Element[E] # # @raise [Error] # - # source://spoom//lib/spoom/poset.rb#25 + # source://spoom//lib/spoom/poset.rb#22 sig { params(value: E).returns(Spoom::Poset::Element[E]) } def [](value); end @@ -4940,154 +3996,132 @@ class Spoom::Poset # Transitive edges (transitive closure) are automatically computed. # Adds the elements if they don't exist. # If the direct edge already exists, nothing is done. - # : (E from, E to) -> void # - # source://spoom//lib/spoom/poset.rb#53 + # source://spoom//lib/spoom/poset.rb#50 sig { params(from: E, to: E).void } def add_direct_edge(from, to); end # Add an element to the POSet - # : (E value) -> Element[E] # - # source://spoom//lib/spoom/poset.rb#34 + # source://spoom//lib/spoom/poset.rb#31 sig { params(value: E).returns(Spoom::Poset::Element[E]) } def add_element(value); end # Is there a direct edge from `from` to `to`? - # : (E from, E to) -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/poset.rb#100 + # source://spoom//lib/spoom/poset.rb#97 sig { params(from: E, to: E).returns(T::Boolean) } def direct_edge?(from, to); end # Is there an edge (direct or indirect) from `from` to `to`? - # : (E from, E to) -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/poset.rb#91 + # source://spoom//lib/spoom/poset.rb#88 sig { params(from: E, to: E).returns(T::Boolean) } def edge?(from, to); end # Is the given value a element in the POSet? - # : (E value) -> bool # # @return [Boolean] # - # source://spoom//lib/spoom/poset.rb#43 + # source://spoom//lib/spoom/poset.rb#40 sig { params(value: E).returns(T::Boolean) } def element?(value); end # Show the POSet as a DOT graph using xdot (used for debugging) - # : (?direct: bool, ?transitive: bool) -> void # - # source://spoom//lib/spoom/poset.rb#106 + # source://spoom//lib/spoom/poset.rb#103 sig { params(direct: T::Boolean, transitive: T::Boolean).void } def show_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end # Return the POSet as a DOT graph - # : (?direct: bool, ?transitive: bool) -> String # - # source://spoom//lib/spoom/poset.rb#115 + # source://spoom//lib/spoom/poset.rb#112 sig { params(direct: T::Boolean, transitive: T::Boolean).returns(::String) } def to_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end end # An element in a POSet # -# source://spoom//lib/spoom/poset.rb#135 +# source://spoom//lib/spoom/poset.rb#133 class Spoom::Poset::Element - extend T::Generic include ::Comparable + extend T::Generic E = type_member { { upper: Object } } - # : (E value) -> void - # # @return [Element] a new instance of Element # - # source://spoom//lib/spoom/poset.rb#150 + # source://spoom//lib/spoom/poset.rb#145 sig { params(value: E).void } def initialize(value); end - # : (untyped other) -> Integer? - # - # source://spoom//lib/spoom/poset.rb#159 + # source://spoom//lib/spoom/poset.rb#154 sig { params(other: T.untyped).returns(T.nilable(::Integer)) } def <=>(other); end # Direct and indirect ancestors of this element - # : -> Array[E] # - # source://spoom//lib/spoom/poset.rb#178 + # source://spoom//lib/spoom/poset.rb#173 sig { returns(T::Array[E]) } def ancestors; end # Direct children of this element - # : -> Array[E] # - # source://spoom//lib/spoom/poset.rb#184 + # source://spoom//lib/spoom/poset.rb#179 sig { returns(T::Array[E]) } def children; end # Direct and indirect descendants of this element - # : -> Array[E] # - # source://spoom//lib/spoom/poset.rb#190 + # source://spoom//lib/spoom/poset.rb#185 sig { returns(T::Array[E]) } def descendants; end # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] # - # source://spoom//lib/spoom/poset.rb#147 + # source://spoom//lib/spoom/poset.rb#142 def dfroms; end # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] # - # source://spoom//lib/spoom/poset.rb#147 + # source://spoom//lib/spoom/poset.rb#142 sig { returns(T::Set[Spoom::Poset::Element[E]]) } def dtos; end # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] # - # source://spoom//lib/spoom/poset.rb#147 + # source://spoom//lib/spoom/poset.rb#142 def froms; end # Direct parents of this element - # : -> Array[E] # - # source://spoom//lib/spoom/poset.rb#172 + # source://spoom//lib/spoom/poset.rb#167 sig { returns(T::Array[E]) } def parents; end # Edges (direct and indirect) from this element to other elements in the same POSet - # : Set[Element[E]] # - # source://spoom//lib/spoom/poset.rb#147 + # source://spoom//lib/spoom/poset.rb#142 def tos; end # The value held by this element - # : E # - # source://spoom//lib/spoom/poset.rb#143 + # source://spoom//lib/spoom/poset.rb#138 sig { returns(E) } def value; end end -# source://spoom//lib/spoom/poset.rb#12 +# source://spoom//lib/spoom/poset.rb#11 class Spoom::Poset::Error < ::Spoom::Error; end # source://spoom//lib/spoom/printer.rb#7 class Spoom::Printer include ::Spoom::Colorize - # : (?out: (IO | StringIO), ?colors: bool, ?indent_level: Integer) -> void - # # @return [Printer] a new instance of Printer # # source://spoom//lib/spoom/printer.rb#14 @@ -5095,39 +4129,31 @@ class Spoom::Printer def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end # Colorize `string` with color if `@colors` - # : (String string, *Spoom::Color color) -> String # # source://spoom//lib/spoom/printer.rb#75 sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } def colorize(string, *color); end # Decrease indent level - # : -> void # # source://spoom//lib/spoom/printer.rb#28 sig { void } def dedent; end # Increase indent level - # : -> void # # source://spoom//lib/spoom/printer.rb#22 sig { void } def indent; end - # : (IO | StringIO) - # # source://spoom//lib/spoom/printer.rb#11 sig { returns(T.any(::IO, ::StringIO)) } def out; end - # : (IO | StringIO) - # # source://spoom//lib/spoom/printer.rb#11 def out=(_arg0); end # Print `string` into `out` - # : (String? string) -> void # # source://spoom//lib/spoom/printer.rb#34 sig { params(string: T.nilable(::String)).void } @@ -5136,327 +4162,100 @@ class Spoom::Printer # Print `string` colored with `color` into `out` # # Does not use colors unless `@colors`. - # : (String? string, *Color color) -> void # # source://spoom//lib/spoom/printer.rb#44 sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } def print_colored(string, *color); end # Print `string` with indent and newline - # : (String? string) -> void # # source://spoom//lib/spoom/printer.rb#59 sig { params(string: T.nilable(::String)).void } def printl(string); end # Print a new line into `out` - # : -> void # # source://spoom//lib/spoom/printer.rb#53 sig { void } def printn; end # Print an indent space into `out` - # : -> void # # source://spoom//lib/spoom/printer.rb#69 sig { void } def printt; end end -# : String -# +# source://spoom//lib/spoom/rbs.rb#5 +module Spoom::RBS; end + +# source://spoom//lib/spoom/rbs.rb#65 +class Spoom::RBS::Annotation < ::Spoom::RBS::Comment; end + +# source://spoom//lib/spoom/rbs.rb#51 +class Spoom::RBS::Comment + # @return [Comment] a new instance of Comment + # + # source://spoom//lib/spoom/rbs.rb#59 + sig { params(string: ::String, location: ::Prism::Location).void } + def initialize(string, location); end + + # source://spoom//lib/spoom/rbs.rb#56 + sig { returns(::Prism::Location) } + def location; end + + # source://spoom//lib/spoom/rbs.rb#53 + sig { returns(::String) } + def string; end +end + +# source://spoom//lib/spoom/rbs.rb#6 +class Spoom::RBS::Comments + # @return [Comments] a new instance of Comments + # + # source://spoom//lib/spoom/rbs.rb#14 + sig { void } + def initialize; end + + # source://spoom//lib/spoom/rbs.rb#8 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def annotations; end + + # source://spoom//lib/spoom/rbs.rb#25 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def class_annotations; end + + # @return [Boolean] + # + # source://spoom//lib/spoom/rbs.rb#20 + sig { returns(T::Boolean) } + def empty?; end + + # source://spoom//lib/spoom/rbs.rb#39 + sig { returns(T::Array[::Spoom::RBS::Annotation]) } + def method_annotations; end + + # source://spoom//lib/spoom/rbs.rb#11 + sig { returns(T::Array[::Spoom::RBS::Signature]) } + def signatures; end +end + +# source://spoom//lib/spoom/rbs.rb#68 +module Spoom::RBS::ExtractRBSComments + # source://spoom//lib/spoom/rbs.rb#70 + sig { params(node: ::Prism::Node).returns(::Spoom::RBS::Comments) } + def node_rbs_comments(node); end +end + +# source://spoom//lib/spoom/rbs.rb#66 +class Spoom::RBS::Signature < ::Spoom::RBS::Comment; end + # source://spoom//lib/spoom.rb#8 Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) -# source://spoom//lib/spoom/sorbet/assertions.rb#7 +# source://spoom//lib/spoom/sorbet/config.rb#5 module Spoom::Sorbet; end -# source://spoom//lib/spoom/sorbet/assertions.rb#8 -class Spoom::Sorbet::Assertions - class << self - # : (String, file: String) -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#11 - sig { params(ruby_contents: ::String, file: ::String).returns(::String) } - def rbi_to_rbs(ruby_contents, file:); end - - private - - # : (String, file: String) -> Array[AssignNode] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#46 - sig { params(ruby_contents: ::String, file: ::String).returns(T::Array[::Spoom::Sorbet::Assertions::AssignNode]) } - def collect_assigns(ruby_contents, file:); end - - # : (AssignNode) -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#54 - sig { params(assign: ::Spoom::Sorbet::Assertions::AssignNode).returns(::String) } - def dedent_value(assign); end - end -end - -# source://spoom//lib/spoom/sorbet/assertions.rb#122 -class Spoom::Sorbet::Assertions::AssignNode - # : (AssignType, Prism::Location, Prism::Node, Prism::Node) -> void - # - # @return [AssignNode] a new instance of AssignNode - # - # source://spoom//lib/spoom/sorbet/assertions.rb#133 - sig do - params( - node: T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode), - operator_loc: ::Prism::Location, - value: ::Prism::Node, - type: ::Prism::Node - ).void - end - def initialize(node, operator_loc, value, type); end - - # : AssignType - # - # source://spoom//lib/spoom/sorbet/assertions.rb#124 - sig do - returns(T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode)) - end - def node; end - - # : Prism::Location - # - # source://spoom//lib/spoom/sorbet/assertions.rb#127 - sig { returns(::Prism::Location) } - def operator_loc; end - - # : -> String - # - # source://spoom//lib/spoom/sorbet/assertions.rb#141 - sig { returns(::String) } - def rbs_type; end - - # : Prism::Node - # - # source://spoom//lib/spoom/sorbet/assertions.rb#130 - def type; end - - # : Prism::Node - # - # source://spoom//lib/spoom/sorbet/assertions.rb#130 - sig { returns(::Prism::Node) } - def value; end -end - -# source://spoom//lib/spoom/sorbet/assertions.rb#93 -Spoom::Sorbet::Assertions::AssignType = T.type_alias { T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode) } - -# source://spoom//lib/spoom/sorbet/assertions.rb#146 -class Spoom::Sorbet::Assertions::Locator < ::Spoom::Visitor - # : -> void - # - # @return [Locator] a new instance of Locator - # - # source://spoom//lib/spoom/sorbet/assertions.rb#153 - sig { void } - def initialize; end - - # : Array[AssignNode] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#150 - sig { returns(T::Array[::Spoom::Sorbet::Assertions::AssignNode]) } - def assigns; end - - # : (Prism::Node) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#245 - sig { params(node: ::Prism::Node).returns(T::Boolean) } - def contains_heredoc?(node); end - - # Is this node a `T` or `::T` constant? - # : (Prism::Node?) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#223 - sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } - def t?(node); end - - # Is this node a `T.let` or `T.cast`? - # : (Prism::CallNode) -> bool - # - # @return [Boolean] - # - # source://spoom//lib/spoom/sorbet/assertions.rb#236 - sig { params(node: ::Prism::CallNode).returns(T::Boolean) } - def t_annotation?(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - sig do - params( - node: T.any(::Prism::ClassVariableAndWriteNode, ::Prism::ClassVariableOperatorWriteNode, ::Prism::ClassVariableOrWriteNode, ::Prism::ClassVariableWriteNode, ::Prism::ConstantAndWriteNode, ::Prism::ConstantOperatorWriteNode, ::Prism::ConstantOrWriteNode, ::Prism::ConstantPathAndWriteNode, ::Prism::ConstantPathOperatorWriteNode, ::Prism::ConstantPathOrWriteNode, ::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode, ::Prism::GlobalVariableAndWriteNode, ::Prism::GlobalVariableOperatorWriteNode, ::Prism::GlobalVariableOrWriteNode, ::Prism::GlobalVariableWriteNode, ::Prism::InstanceVariableAndWriteNode, ::Prism::InstanceVariableOperatorWriteNode, ::Prism::InstanceVariableOrWriteNode, ::Prism::InstanceVariableWriteNode, ::Prism::LocalVariableAndWriteNode, ::Prism::LocalVariableOperatorWriteNode, ::Prism::LocalVariableOrWriteNode, ::Prism::LocalVariableWriteNode) - ).void - end - def visit_assign(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_class_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_path_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_constant_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_global_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_instance_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_and_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_operator_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_or_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_local_variable_write_node(node); end - - # : (AssignType) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#159 - def visit_multi_write_node(node); end -end - -# : Array[Symbol] -# -# source://spoom//lib/spoom/sorbet/assertions.rb#147 -Spoom::Sorbet::Assertions::Locator::ANNOTATION_METHODS = T.let(T.unsafe(nil), Array) - -# source://spoom//lib/spoom/sorbet/assertions.rb#251 -class Spoom::Sorbet::Assertions::Locator::HeredocVisitor < ::Spoom::Visitor - # : -> void - # - # @return [HeredocVisitor] a new instance of HeredocVisitor - # - # source://spoom//lib/spoom/sorbet/assertions.rb#256 - sig { void } - def initialize; end - - # : bool - # - # source://spoom//lib/spoom/sorbet/assertions.rb#253 - sig { returns(T::Boolean) } - def contains_heredoc; end - - # : (Prism::Node?) -> void - # - # source://spoom//lib/spoom/sorbet/assertions.rb#264 - sig { override.params(node: T.nilable(::Prism::Node)).void } - def visit(node); end -end - -# : String -# # source://spoom//lib/spoom/sorbet.rb#33 Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) @@ -5486,48 +4285,32 @@ Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) # # source://spoom//lib/spoom/sorbet/config.rb#26 class Spoom::Sorbet::Config - # : -> void - # # @return [Config] a new instance of Config # # source://spoom//lib/spoom/sorbet/config.rb#36 sig { void } def initialize; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 def allowed_extensions; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 def allowed_extensions=(_arg0); end - # : -> Config - # # source://spoom//lib/spoom/sorbet/config.rb#44 sig { returns(::Spoom::Sorbet::Config) } def copy; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 def ignore; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 def ignore=(_arg0); end - # : bool - # # source://spoom//lib/spoom/sorbet/config.rb#33 sig { returns(T::Boolean) } def no_stdlib; end - # : bool - # # source://spoom//lib/spoom/sorbet/config.rb#33 def no_stdlib=(_arg0); end @@ -5543,63 +4326,46 @@ class Spoom::Sorbet::Config # # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" # ~~~ - # : -> String # # source://spoom//lib/spoom/sorbet/config.rb#66 sig { returns(::String) } def options_string; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 sig { returns(T::Array[::String]) } def paths; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/config.rb#30 def paths=(_arg0); end class << self - # : (String sorbet_config_path) -> Spoom::Sorbet::Config - # # source://spoom//lib/spoom/sorbet/config.rb#77 sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } def parse_file(sorbet_config_path); end - # : (String sorbet_config) -> Spoom::Sorbet::Config - # # source://spoom//lib/spoom/sorbet/config.rb#82 sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } def parse_string(sorbet_config); end private - # : (String line) -> String - # # source://spoom//lib/spoom/sorbet/config.rb#143 sig { params(line: ::String).returns(::String) } def parse_option(line); end end end -# : Array[String] -# # source://spoom//lib/spoom/sorbet/config.rb#27 Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/sorbet.rb#15 class Spoom::Sorbet::Error < ::Spoom::Error - # : (String message, ExecResult result) -> void - # # @return [Error] a new instance of Error # # source://spoom//lib/spoom/sorbet.rb#23 sig { params(message: ::String, result: ::Spoom::ExecResult).void } def initialize(message, result); end - # : ExecResult - # # source://spoom//lib/spoom/sorbet.rb#20 sig { returns(::Spoom::ExecResult) } def result; end @@ -5614,14 +4380,10 @@ class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end # source://spoom//lib/spoom/sorbet/errors.rb#8 module Spoom::Sorbet::Errors class << self - # : (Array[Error] errors) -> Array[Error] - # # source://spoom//lib/spoom/sorbet/errors.rb#13 sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } def sort_errors_by_code(errors); end - # : (Array[Error]) -> REXML::Document - # # source://spoom//lib/spoom/sorbet/errors.rb#18 sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(::REXML::Document) } def to_junit_xml(errors); end @@ -5635,8 +4397,6 @@ Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) class Spoom::Sorbet::Errors::Error include ::Comparable - # : (String? file, Integer? line, String? message, Integer? code, ?Array[String] more) -> void - # # @return [Error] a new instance of Error # # source://spoom//lib/spoom/sorbet/errors.rb#166 @@ -5652,55 +4412,39 @@ class Spoom::Sorbet::Errors::Error def initialize(file, line, message, code, more = T.unsafe(nil)); end # By default errors are sorted by location - # : (untyped other) -> Integer # # source://spoom//lib/spoom/sorbet/errors.rb#177 sig { params(other: T.untyped).returns(::Integer) } def <=>(other); end - # : Integer? - # # source://spoom//lib/spoom/sorbet/errors.rb#156 def code; end - # : String? - # # source://spoom//lib/spoom/sorbet/errors.rb#153 sig { returns(T.nilable(::String)) } def file; end # Other files associated with the error - # : Set[String] # # source://spoom//lib/spoom/sorbet/errors.rb#163 sig { returns(T::Set[::String]) } def files_from_error_sections; end - # : Integer? - # # source://spoom//lib/spoom/sorbet/errors.rb#156 sig { returns(T.nilable(::Integer)) } def line; end - # : String? - # # source://spoom//lib/spoom/sorbet/errors.rb#153 def message; end - # : Array[String] - # # source://spoom//lib/spoom/sorbet/errors.rb#159 sig { returns(T::Array[::String]) } def more; end - # : -> REXML::Element - # # source://spoom//lib/spoom/sorbet/errors.rb#189 sig { returns(::REXML::Element) } def to_junit_xml_element; end - # : -> String - # # source://spoom//lib/spoom/sorbet/errors.rb#184 sig { returns(::String) } def to_s; end @@ -5710,52 +4454,38 @@ end # # source://spoom//lib/spoom/sorbet/errors.rb#47 class Spoom::Sorbet::Errors::Parser - # : (?error_url_base: String) -> void - # # @return [Parser] a new instance of Parser # # source://spoom//lib/spoom/sorbet/errors.rb#67 sig { params(error_url_base: ::String).void } def initialize(error_url_base: T.unsafe(nil)); end - # : (String output) -> Array[Error] - # # source://spoom//lib/spoom/sorbet/errors.rb#74 sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } def parse(output); end private - # : (String line) -> void - # # @raise [ParseError] # # source://spoom//lib/spoom/sorbet/errors.rb#138 sig { params(line: ::String).void } def append_error(line); end - # : -> void - # # @raise [ParseError] # # source://spoom//lib/spoom/sorbet/errors.rb#130 sig { void } def close_error; end - # : (String error_url_base) -> Regexp - # # source://spoom//lib/spoom/sorbet/errors.rb#97 sig { params(error_url_base: ::String).returns(::Regexp) } def error_line_match_regexp(error_url_base); end - # : (String line) -> Error? - # # source://spoom//lib/spoom/sorbet/errors.rb#114 sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } def match_error_line(line); end - # : (Error error) -> void - # # @raise [ParseError] # # source://spoom//lib/spoom/sorbet/errors.rb#123 @@ -5763,8 +4493,6 @@ class Spoom::Sorbet::Errors::Parser def open_error(error); end class << self - # : (String output, ?error_url_base: String) -> Array[Error] - # # source://spoom//lib/spoom/sorbet/errors.rb#60 sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } def parse_string(output, error_url_base: T.unsafe(nil)); end @@ -5777,44 +4505,119 @@ Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) # source://spoom//lib/spoom/sorbet/errors.rb#48 class Spoom::Sorbet::Errors::Parser::ParseError < ::Spoom::Error; end -# : String -# # source://spoom//lib/spoom/sorbet.rb#31 Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) -# : String -# # source://spoom//lib/spoom/sorbet.rb#32 Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) # source://spoom//lib/spoom/sorbet.rb#35 Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) -# source://spoom//lib/spoom/sorbet/metrics.rb#8 -module Spoom::Sorbet::MetricsParser +# source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#6 +module Spoom::Sorbet::Metrics class << self - # : (String path, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#13 + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#9 + sig { params(files: T::Array[::String]).returns(Spoom::Counters) } + def collect_code_metrics(files); end + end +end + +# Collects metrics about how Sorbet is used in the codebase. +# +# This approach is different from the metrics file we get directly from Sorbet. +# +# This visitor actually visits the codebase and collects metrics about the amount of signatures, `T.` calls, +# and other metrics. It also knows about RBS comments. +# +# On the other hand, the metrics file is a snapshot of the metrics at type checking time and knows about +# is calls are typed, how many assertions are done, etc. +# +# source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#34 +class Spoom::Sorbet::Metrics::CodeMetricsVisitor < ::Spoom::Visitor + include ::Spoom::RBS::ExtractRBSComments + + # @return [CodeMetricsVisitor] a new instance of CodeMetricsVisitor + # + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#38 + sig { params(counters: Spoom::Counters).void } + def initialize(counters); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#49 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#124 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#75 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#99 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#83 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#91 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#213 + sig { returns(T::Array[::Prism::CallNode]) } + def collect_last_srb_sigs; end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#220 + sig { params(node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode)).returns(::String) } + def node_key(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#167 + sig { params(node: ::Prism::CallNode).void } + def visit_attr_accessor(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#151 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + block: T.proc.void + ).void + end + def visit_scope(node, &block); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#187 + sig { params(node: ::Prism::CallNode).void } + def visit_sig(node); end + + # source://spoom//lib/spoom/sorbet/metrics/code_metrics_visitor.rb#197 + sig { params(node: ::Prism::CallNode).void } + def visit_type_member(node); end +end + +# source://spoom//lib/spoom/sorbet/metrics/metrics_file_parser.rb#9 +module Spoom::Sorbet::Metrics::MetricsFileParser + class << self + # source://spoom//lib/spoom/sorbet/metrics/metrics_file_parser.rb#14 sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } def parse_file(path, prefix = T.unsafe(nil)); end - # : (Hash[String, untyped] obj, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#23 - sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) } + # source://spoom//lib/spoom/sorbet/metrics/metrics_file_parser.rb#24 + sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(Spoom::Counters) } def parse_hash(obj, prefix = T.unsafe(nil)); end - # : (String string, ?String prefix) -> Hash[String, Integer] - # - # source://spoom//lib/spoom/sorbet/metrics.rb#18 + # source://spoom//lib/spoom/sorbet/metrics/metrics_file_parser.rb#19 sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } def parse_string(string, prefix = T.unsafe(nil)); end end end -# source://spoom//lib/spoom/sorbet/metrics.rb#9 -Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) +# source://spoom//lib/spoom/sorbet/metrics/metrics_file_parser.rb#10 +Spoom::Sorbet::Metrics::MetricsFileParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) # source://spoom//lib/spoom/sorbet.rb#36 Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) @@ -5823,14 +4626,12 @@ Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) module Spoom::Sorbet::Sigils class << self # changes the sigil in the file at the passed path to the specified new strictness - # : ((String | Pathname) path, String new_strictness) -> bool # # source://spoom//lib/spoom/sorbet/sigils.rb#65 sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } def change_sigil_in_file(path, new_strictness); end # changes the sigil to have a new strictness in a list of files - # : (Array[String] path_list, String new_strictness) -> Array[String] # # source://spoom//lib/spoom/sorbet/sigils.rb#76 sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } @@ -5838,35 +4639,30 @@ module Spoom::Sorbet::Sigils # returns a string containing the strictness of a sigil in a file at the passed path # * returns nil if no sigil - # : ((String | Pathname) path) -> String? # # source://spoom//lib/spoom/sorbet/sigils.rb#56 sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } def file_strictness(path); end # returns the full sigil comment string for the passed strictness - # : (String strictness) -> String # # source://spoom//lib/spoom/sorbet/sigils.rb#31 sig { params(strictness: ::String).returns(::String) } def sigil_string(strictness); end # returns the strictness of a sigil in the passed file content string (nil if no sigil) - # : (String content) -> String? # # source://spoom//lib/spoom/sorbet/sigils.rb#43 sig { params(content: ::String).returns(T.nilable(::String)) } def strictness_in_content(content); end # returns a string which is the passed content but with the sigil updated to a new strictness - # : (String content, String new_strictness) -> String # # source://spoom//lib/spoom/sorbet/sigils.rb#49 sig { params(content: ::String, new_strictness: ::String).returns(::String) } def update_sigil(content, new_strictness); end # returns true if the passed string is a valid strictness (else false) - # : (String strictness) -> bool # # @return [Boolean] # @@ -5876,8 +4672,6 @@ module Spoom::Sorbet::Sigils end end -# : Array[String] -# # source://spoom//lib/spoom/sorbet/sigils.rb#26 Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) @@ -5902,160 +4696,471 @@ Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) # source://spoom//lib/spoom/sorbet/sigils.rb#17 Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) -# source://spoom//lib/spoom/sorbet/sigs.rb#8 -class Spoom::Sorbet::Sigs +# source://spoom//lib/spoom/sorbet/translate/translator.rb#6 +module Spoom::Sorbet::Translate class << self - # : (String ruby_contents, positional_names: bool) -> String + # Converts all the RBS comments in the given Ruby code to `sig` nodes. + # It also handles type members and class annotations. # - # source://spoom//lib/spoom/sorbet/sigs.rb#24 - sig { params(ruby_contents: ::String, positional_names: T::Boolean).returns(::String) } - def rbi_to_rbs(ruby_contents, positional_names: T.unsafe(nil)); end + # source://spoom//lib/spoom/sorbet/translate.rb#36 + sig { params(ruby_contents: ::String, file: ::String, max_line_length: T.nilable(::Integer)).returns(::String) } + def rbs_comments_to_sorbet_sigs(ruby_contents, file:, max_line_length: T.unsafe(nil)); end - # : (String ruby_contents) -> String + # Converts all `T.let` and `T.cast` nodes to RBS comments in the given Ruby code. + # It also handles type members and class annotations. # - # source://spoom//lib/spoom/sorbet/sigs.rb#46 - sig { params(ruby_contents: ::String).returns(::String) } - def rbs_to_rbi(ruby_contents); end + # source://spoom//lib/spoom/sorbet/translate.rb#43 + sig { params(ruby_contents: ::String, file: ::String).returns(::String) } + def sorbet_assertions_to_rbs_comments(ruby_contents, file:); end - # : (String ruby_contents) -> String + # Converts all `sig` nodes to RBS comments in the given Ruby code. + # It also handles type members and class annotations. # - # source://spoom//lib/spoom/sorbet/sigs.rb#12 - sig { params(ruby_contents: ::String).returns(::String) } - def strip(ruby_contents); end - - private - - # : (String ruby_contents) -> Array[[RBI::RBSComment, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#80 - sig { params(ruby_contents: ::String).returns(T::Array[[::RBI::RBSComment, T.any(::RBI::Attr, ::RBI::Method)]]) } - def collect_rbs_comments(ruby_contents); end - - # : (String ruby_contents) -> Array[[RBI::Sig, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#72 - sig { params(ruby_contents: ::String).returns(T::Array[[::RBI::Sig, T.any(::RBI::Attr, ::RBI::Method)]]) } - def collect_sorbet_sigs(ruby_contents); end - end -end - -# source://spoom//lib/spoom/sorbet/sigs.rb#9 -class Spoom::Sorbet::Sigs::Error < ::Spoom::Error; end - -# source://spoom//lib/spoom/sorbet/sigs.rb#123 -class Spoom::Sorbet::Sigs::RBIToRBSTranslator - class << self - # : (RBI::Sig sig, (RBI::Method | RBI::Attr) node, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#126 + # source://spoom//lib/spoom/sorbet/translate.rb#29 sig do params( - sig: ::RBI::Sig, - node: T.any(::RBI::Attr, ::RBI::Method), - positional_names: T::Boolean + ruby_contents: ::String, + file: ::String, + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer) ).returns(::String) end - def translate(sig, node, positional_names: T.unsafe(nil)); end + def sorbet_sigs_to_rbs_comments(ruby_contents, file:, positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil)); end - private - - # : (RBI::Sig sig, RBI::Attr node, positional_names: bool) -> String + # Deletes all `sig` nodes from the given Ruby code. + # It doesn't handle type members and class annotations. # - # source://spoom//lib/spoom/sorbet/sigs.rb#178 - sig { params(sig: ::RBI::Sig, node: ::RBI::Attr, positional_names: T::Boolean).returns(::String) } - def translate_attr_sig(sig, node, positional_names: T.unsafe(nil)); end - - # : (RBI::Sig sig, RBI::Method node, positional_names: bool) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#138 - sig { params(sig: ::RBI::Sig, node: ::RBI::Method, positional_names: T::Boolean).returns(::String) } - def translate_method_sig(sig, node, positional_names: T.unsafe(nil)); end + # source://spoom//lib/spoom/sorbet/translate.rb#22 + sig { params(ruby_contents: ::String, file: ::String).returns(::String) } + def strip_sorbet_sigs(ruby_contents, file:); end end end -# source://spoom//lib/spoom/sorbet/sigs.rb#187 -class Spoom::Sorbet::Sigs::RBSToRBITranslator - class << self - # : (RBI::RBSComment comment, (RBI::Method | RBI::Attr) node) -> String? - # - # source://spoom//lib/spoom/sorbet/sigs.rb#192 - sig { params(comment: ::RBI::RBSComment, node: T.any(::RBI::Attr, ::RBI::Method)).returns(T.nilable(::String)) } - def translate(comment, node); end +# source://spoom//lib/spoom/sorbet/translate.rb#16 +class Spoom::Sorbet::Translate::Error < ::Spoom::Error; end - private +# source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#7 +class Spoom::Sorbet::Translate::RBSCommentsToSorbetSigs < ::Spoom::Sorbet::Translate::Translator + include ::Spoom::RBS::ExtractRBSComments - # : (RBI::RBSComment comment, RBI::Attr node) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#235 - sig { params(comment: ::RBI::RBSComment, node: ::RBI::Attr).returns(::String) } - def translate_attr_sig(comment, node); end + # @return [RBSCommentsToSorbetSigs] a new instance of RBSCommentsToSorbetSigs + # + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#11 + sig { params(ruby_contents: ::String, file: ::String, max_line_length: T.nilable(::Integer)).void } + def initialize(ruby_contents, file:, max_line_length: T.unsafe(nil)); end - # : (RBI::RBSComment rbs_comment, RBI::Method node) -> String - # - # source://spoom//lib/spoom/sorbet/sigs.rb#206 - sig { params(rbs_comment: ::RBI::RBSComment, node: ::RBI::Method).returns(::String) } - def translate_method_sig(rbs_comment, node); end + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#73 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#19 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#43 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#27 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#35 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # @return [Boolean] + # + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#242 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + constant_regex: ::Regexp + ).returns(T::Boolean) end + def already_extends?(node, constant_regex); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#123 + sig { params(node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode)).void } + def apply_class_annotations(node); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#221 + sig { params(annotations: T::Array[::Spoom::RBS::Annotation], sig: ::RBI::Sig).void } + def apply_member_annotations(annotations, sig); end + + # source://spoom//lib/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs.rb#85 + sig { params(node: ::Prism::CallNode).void } + def visit_attr(node); end end -# From https://github.com/Shopify/ruby-lsp/blob/9154bfc6ef/lib/ruby_lsp/document.rb#L127 +# Translates Sorbet assertions to RBS comments. # -# source://spoom//lib/spoom/sorbet/sigs.rb#255 -class Spoom::Sorbet::Sigs::Scanner - # : (String source) -> void - # - # @return [Scanner] a new instance of Scanner - # - # source://spoom//lib/spoom/sorbet/sigs.rb#259 - sig { params(source: ::String).void } - def initialize(source); end +# source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#8 +class Spoom::Sorbet::Translate::SorbetAssertionsToRBSComments < ::Spoom::Sorbet::Translate::Translator + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#22 + sig { override.params(node: ::Prism::IfNode).void } + def visit_if_node(node); end - # Finds the character index inside the source string for a given line and column - # : (Integer line, Integer character) -> Integer + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#13 + sig { override.params(node: ::Prism::StatementsNode).void } + def visit_statements_node(node); end + + private + + # @return [Boolean] # - # source://spoom//lib/spoom/sorbet/sigs.rb#267 - sig { params(line: ::Integer, character: ::Integer).returns(::Integer) } - def find_char_position(line, character); end + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#135 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def at_end_of_line?(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#81 + sig { params(call: ::Prism::CallNode).returns(::String) } + def build_rbs_annotation(call); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#142 + sig { params(assign: ::Prism::Node, value: ::Prism::Node).returns(::String) } + def dedent_value(assign, value); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#44 + sig { params(node: ::Prism::Node).returns(T::Boolean) } + def maybe_translate_assertion(node); end + + # Is this node a `T` or `::T` constant? + # + # @return [Boolean] + # + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#106 + sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) } + def t?(node); end + + # Is this node a `T.let` or `T.cast`? + # + # @return [Boolean] + # + # source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#119 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def t_annotation?(node); end end -# : Integer -# -# source://spoom//lib/spoom/sorbet/sigs.rb#256 -Spoom::Sorbet::Sigs::Scanner::LINE_BREAK = T.let(T.unsafe(nil), Integer) +# source://spoom//lib/spoom/sorbet/translate/sorbet_assertions_to_rbs_comments.rb#9 +Spoom::Sorbet::Translate::SorbetAssertionsToRBSComments::LINE_BREAK = T.let(T.unsafe(nil), Integer) -# source://spoom//lib/spoom/sorbet/sigs.rb#88 -class Spoom::Sorbet::Sigs::SigsLocator < ::RBI::Visitor - # : -> void +# Converts all `sig` nodes to RBS comments in the given Ruby code. +# It also handles type members and class annotations. +# +# source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#9 +class Spoom::Sorbet::Translate::SorbetSigsToRBSComments < ::Spoom::Sorbet::Translate::Translator + # @return [SorbetSigsToRBSComments] a new instance of SorbetSigsToRBSComments # - # @return [SigsLocator] a new instance of SigsLocator + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#11 + sig do + params( + ruby_contents: ::String, + file: ::String, + positional_names: T::Boolean, + max_line_length: T.nilable(::Integer) + ).void + end + def initialize(ruby_contents, file:, positional_names:, max_line_length: T.unsafe(nil)); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#66 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#26 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#85 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#44 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#32 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#38 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end + + private + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#193 + sig do + params( + parent: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + node: ::Prism::CallNode + ).void + end + def apply_class_annotation(parent, node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#234 + sig { params(sigs: T::Array[[::Prism::CallNode, ::RBI::Sig]]).void } + def apply_member_annotations(sigs); end + + # @raise [Error] # - # source://spoom//lib/spoom/sorbet/sigs.rb#96 + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#266 + sig { params(node: ::Prism::ConstantWriteNode).returns(::String) } + def build_type_member_string(node); end + + # Collects the last signatures visited and clears the current list + # + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#337 + sig { returns(T::Array[[::Prism::CallNode, ::RBI::Sig]]) } + def collect_last_sigs; end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#324 + sig { void } + def delete_extend_t_generics; end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#312 + sig { void } + def delete_extend_t_helpers; end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#344 + sig { params(indent: ::Integer, block: T.proc.params(arg0: ::RBI::RBSPrinter).void).returns(::String) } + def rbs_print(indent, &block); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#151 + sig { params(node: ::Prism::CallNode).void } + def visit_attr(node); end + + # @raise [Error] + # + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#175 + sig { params(node: ::Prism::CallNode).void } + def visit_extend(node); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#102 + sig do + params( + node: T.any(::Prism::ClassNode, ::Prism::ModuleNode, ::Prism::SingletonClassNode), + block: T.proc.void + ).void + end + def visit_scope(node, &block); end + + # source://spoom//lib/spoom/sorbet/translate/sorbet_sigs_to_rbs_comments.rb#139 + sig { params(node: ::Prism::CallNode).void } + def visit_sig(node); end +end + +# Deletes all `sig` nodes from the given Ruby code. +# It doesn't handle type members and class annotations. +# +# source://spoom//lib/spoom/sorbet/translate/strip_sorbet_sigs.rb#9 +class Spoom::Sorbet::Translate::StripSorbetSigs < ::Spoom::Sorbet::Translate::Translator + # source://spoom//lib/spoom/sorbet/translate/strip_sorbet_sigs.rb#12 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end +end + +# @abstract +# +# source://spoom//lib/spoom/sorbet/translate/translator.rb#8 +class Spoom::Sorbet::Translate::Translator < ::Spoom::Visitor + abstract! + + # @return [Translator] a new instance of Translator + # + # source://spoom//lib/spoom/sorbet/translate/translator.rb#10 + sig { params(ruby_contents: ::String, file: ::String).void } + def initialize(ruby_contents, file:); end + + # source://spoom//lib/spoom/sorbet/translate/translator.rb#29 + sig { returns(::String) } + def rewrite; end + + private + + # source://spoom//lib/spoom/sorbet/translate/translator.rb#54 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_line_end(offset); end + + # source://spoom//lib/spoom/sorbet/translate/translator.rb#48 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_line_start(offset); end + + # Consume the next blank line if any + # + # source://spoom//lib/spoom/sorbet/translate/translator.rb#61 + sig { params(offset: ::Integer).returns(::Integer) } + def adjust_to_new_line(offset); end + + # @return [Boolean] + # + # source://spoom//lib/spoom/sorbet/translate/translator.rb#38 + sig { params(node: ::Prism::CallNode).returns(T::Boolean) } + def sorbet_sig?(node); end +end + +# This module provides a simple API to rewrite source code. +# +# Using a `Rewriter`, you can build a list of changes to apply to a source file +# and apply them all at once. Edits are applied from bottom to top, so that the +# line numbers are not remapped after each edit. +# +# The source code is represented as an array of bytes, so that it can be +# manipulated in place. The client is responsible for `string <-> bytes` +# conversions and encoding handling. +# +# ```ruby +# bytes = "def foo; end".bytes +# +# rewriter = Spoom::Source::Rewriter.new +# rewriter << Spoom::Source::Replace.new(4, 6, "baz") +# rewriter << Spoom::Source::Insert.new(0, "def bar; end\n") +# rewriter.rewrite!(bytes) +# +# puts bytes.pack("C*") # => "def bar; end\ndef baz; end" +# ``` +# +# source://spoom//lib/spoom/source/rewriter.rb#25 +module Spoom::Source; end + +# source://spoom//lib/spoom/source/rewriter.rb#113 +class Spoom::Source::Delete < ::Spoom::Source::Edit + # @return [Delete] a new instance of Delete + # + # source://spoom//lib/spoom/source/rewriter.rb#118 + sig { params(from: ::Integer, to: ::Integer).void } + def initialize(from, to); end + + # @raise [PositionError] + # + # source://spoom//lib/spoom/source/rewriter.rb#127 + sig { override.params(bytes: T::Array[T.untyped]).void } + def apply(bytes); end + + # source://spoom//lib/spoom/source/rewriter.rb#115 + sig { returns(::Integer) } + def from; end + + # source://spoom//lib/spoom/source/rewriter.rb#135 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # source://spoom//lib/spoom/source/rewriter.rb#115 + def to; end + + # source://spoom//lib/spoom/source/rewriter.rb#141 + sig { override.returns(::String) } + def to_s; end +end + +# @abstract +# +# source://spoom//lib/spoom/source/rewriter.rb#29 +class Spoom::Source::Edit + abstract! + + # @abstract + # + # source://spoom//lib/spoom/source/rewriter.rb#32 + sig { abstract.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # @abstract + # + # source://spoom//lib/spoom/source/rewriter.rb#36 + sig { abstract.returns([::Integer, ::Integer]) } + def range; end +end + +# source://spoom//lib/spoom/source/rewriter.rb#39 +class Spoom::Source::Insert < ::Spoom::Source::Edit + # @return [Insert] a new instance of Insert + # + # source://spoom//lib/spoom/source/rewriter.rb#47 + sig { params(position: ::Integer, text: ::String).void } + def initialize(position, text); end + + # @raise [PositionError] + # + # source://spoom//lib/spoom/source/rewriter.rb#56 + sig { override.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # source://spoom//lib/spoom/source/rewriter.rb#41 + sig { returns(::Integer) } + def position; end + + # source://spoom//lib/spoom/source/rewriter.rb#65 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # source://spoom//lib/spoom/source/rewriter.rb#44 + sig { returns(::String) } + def text; end + + # source://spoom//lib/spoom/source/rewriter.rb#71 + sig { override.returns(::String) } + def to_s; end +end + +# source://spoom//lib/spoom/source/rewriter.rb#26 +class Spoom::Source::PositionError < ::Spoom::Error; end + +# source://spoom//lib/spoom/source/rewriter.rb#76 +class Spoom::Source::Replace < ::Spoom::Source::Edit + # @return [Replace] a new instance of Replace + # + # source://spoom//lib/spoom/source/rewriter.rb#84 + sig { params(from: ::Integer, to: ::Integer, text: ::String).void } + def initialize(from, to, text); end + + # @raise [PositionError] + # + # source://spoom//lib/spoom/source/rewriter.rb#94 + sig { override.params(bytes: T::Array[::Integer]).void } + def apply(bytes); end + + # source://spoom//lib/spoom/source/rewriter.rb#78 + sig { returns(::Integer) } + def from; end + + # source://spoom//lib/spoom/source/rewriter.rb#102 + sig { override.returns([::Integer, ::Integer]) } + def range; end + + # source://spoom//lib/spoom/source/rewriter.rb#81 + sig { returns(::String) } + def text; end + + # source://spoom//lib/spoom/source/rewriter.rb#78 + def to; end + + # source://spoom//lib/spoom/source/rewriter.rb#108 + sig { override.returns(::String) } + def to_s; end +end + +# source://spoom//lib/spoom/source/rewriter.rb#146 +class Spoom::Source::Rewriter + # @return [Rewriter] a new instance of Rewriter + # + # source://spoom//lib/spoom/source/rewriter.rb#148 sig { void } def initialize; end - # : Array[[RBI::RBSComment, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#93 - sig { returns(T::Array[[::RBI::RBSComment, T.any(::RBI::Attr, ::RBI::Method)]]) } - def rbs_comments; end + # source://spoom//lib/spoom/source/rewriter.rb#153 + sig { params(other: ::Spoom::Source::Edit).void } + def <<(other); end - # : Array[[RBI::Sig, (RBI::Method | RBI::Attr)]] - # - # source://spoom//lib/spoom/sorbet/sigs.rb#90 - sig { returns(T::Array[[::RBI::Sig, T.any(::RBI::Attr, ::RBI::Method)]]) } - def sigs; end - - # : (RBI::Node? node) -> void - # - # source://spoom//lib/spoom/sorbet/sigs.rb#104 - sig { override.params(node: T.nilable(::RBI::Node)).void } - def visit(node); end + # source://spoom//lib/spoom/source/rewriter.rb#158 + sig { params(bytes: T::Array[::Integer]).void } + def rewrite!(bytes); end end # source://spoom//lib/spoom/timeline.rb#5 class Spoom::Timeline - # : (Context context, Time from, Time to) -> void - # # @return [Timeline] a new instance of Timeline # # source://spoom//lib/spoom/timeline.rb#7 @@ -6063,21 +5168,18 @@ class Spoom::Timeline def initialize(context, from, to); end # Return one commit for each date in `dates` - # : (Array[Time] dates) -> Array[Git::Commit] # # source://spoom//lib/spoom/timeline.rb#34 sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } def commits_for_dates(dates); end # Return all months between `from` and `to` - # : -> Array[Time] # # source://spoom//lib/spoom/timeline.rb#21 sig { returns(T::Array[::Time]) } def months; end # Return one commit for each month between `from` and `to` - # : -> Array[Git::Commit] # # source://spoom//lib/spoom/timeline.rb#15 sig { returns(T::Array[::Spoom::Git::Commit]) } @@ -6089,896 +5191,598 @@ Spoom::VERSION = T.let(T.unsafe(nil), String) # source://spoom//lib/spoom/visitor.rb#7 class Spoom::Visitor < ::Prism::Visitor - # : (Prism::AliasGlobalVariableNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#16 sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } def visit_alias_global_variable_node(node); end - # : (Prism::AliasMethodNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#22 sig { override.params(node: ::Prism::AliasMethodNode).void } def visit_alias_method_node(node); end - # : (Prism::AlternationPatternNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#28 sig { override.params(node: ::Prism::AlternationPatternNode).void } def visit_alternation_pattern_node(node); end - # : (Prism::AndNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#34 sig { override.params(node: ::Prism::AndNode).void } def visit_and_node(node); end - # : (Prism::ArgumentsNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#40 sig { override.params(node: ::Prism::ArgumentsNode).void } def visit_arguments_node(node); end - # : (Prism::ArrayNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#46 sig { override.params(node: ::Prism::ArrayNode).void } def visit_array_node(node); end - # : (Prism::ArrayPatternNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#52 sig { override.params(node: ::Prism::ArrayPatternNode).void } def visit_array_pattern_node(node); end - # : (Prism::AssocNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#58 sig { override.params(node: ::Prism::AssocNode).void } def visit_assoc_node(node); end - # : (Prism::AssocSplatNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#64 sig { override.params(node: ::Prism::AssocSplatNode).void } def visit_assoc_splat_node(node); end - # : (Prism::BackReferenceReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#70 sig { override.params(node: ::Prism::BackReferenceReadNode).void } def visit_back_reference_read_node(node); end - # : (Prism::BeginNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#76 sig { override.params(node: ::Prism::BeginNode).void } def visit_begin_node(node); end - # : (Prism::BlockArgumentNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#82 sig { override.params(node: ::Prism::BlockArgumentNode).void } def visit_block_argument_node(node); end - # : (Prism::BlockLocalVariableNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#88 sig { override.params(node: ::Prism::BlockLocalVariableNode).void } def visit_block_local_variable_node(node); end - # : (Prism::BlockNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#94 sig { override.params(node: ::Prism::BlockNode).void } def visit_block_node(node); end - # : (Prism::BlockParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#100 sig { override.params(node: ::Prism::BlockParameterNode).void } def visit_block_parameter_node(node); end - # : (Prism::BlockParametersNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#106 sig { override.params(node: ::Prism::BlockParametersNode).void } def visit_block_parameters_node(node); end - # : (Prism::BreakNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#112 sig { override.params(node: ::Prism::BreakNode).void } def visit_break_node(node); end - # : (Prism::CallAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#118 sig { override.params(node: ::Prism::CallAndWriteNode).void } def visit_call_and_write_node(node); end - # : (Prism::CallNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#124 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end - # : (Prism::CallOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#130 sig { override.params(node: ::Prism::CallOperatorWriteNode).void } def visit_call_operator_write_node(node); end - # : (Prism::CallOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#136 sig { override.params(node: ::Prism::CallOrWriteNode).void } def visit_call_or_write_node(node); end - # : (Prism::CallTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#142 sig { override.params(node: ::Prism::CallTargetNode).void } def visit_call_target_node(node); end - # : (Prism::CapturePatternNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#148 sig { override.params(node: ::Prism::CapturePatternNode).void } def visit_capture_pattern_node(node); end - # : (Prism::CaseMatchNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#154 sig { override.params(node: ::Prism::CaseMatchNode).void } def visit_case_match_node(node); end - # : (Prism::CaseNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#160 sig { override.params(node: ::Prism::CaseNode).void } def visit_case_node(node); end - # : (Prism::Node node) -> void - # # source://spoom//lib/spoom/visitor.rb#10 sig { override.params(node: ::Prism::Node).void } def visit_child_nodes(node); end - # : (Prism::ClassNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#166 sig { override.params(node: ::Prism::ClassNode).void } def visit_class_node(node); end - # : (Prism::ClassVariableAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#172 sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } def visit_class_variable_and_write_node(node); end - # : (Prism::ClassVariableOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#178 sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } def visit_class_variable_operator_write_node(node); end - # : (Prism::ClassVariableOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#184 sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } def visit_class_variable_or_write_node(node); end - # : (Prism::ClassVariableReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#190 sig { override.params(node: ::Prism::ClassVariableReadNode).void } def visit_class_variable_read_node(node); end - # : (Prism::ClassVariableTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#196 sig { override.params(node: ::Prism::ClassVariableTargetNode).void } def visit_class_variable_target_node(node); end - # : (Prism::ClassVariableWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#202 sig { override.params(node: ::Prism::ClassVariableWriteNode).void } def visit_class_variable_write_node(node); end - # : (Prism::ConstantAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#208 sig { override.params(node: ::Prism::ConstantAndWriteNode).void } def visit_constant_and_write_node(node); end - # : (Prism::ConstantOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#214 sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } def visit_constant_operator_write_node(node); end - # : (Prism::ConstantOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#220 sig { override.params(node: ::Prism::ConstantOrWriteNode).void } def visit_constant_or_write_node(node); end - # : (Prism::ConstantPathAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#226 sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } def visit_constant_path_and_write_node(node); end - # : (Prism::ConstantPathNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#232 sig { override.params(node: ::Prism::ConstantPathNode).void } def visit_constant_path_node(node); end - # : (Prism::ConstantPathOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#238 sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } def visit_constant_path_operator_write_node(node); end - # : (Prism::ConstantPathOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#244 sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } def visit_constant_path_or_write_node(node); end - # : (Prism::ConstantPathTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#250 sig { override.params(node: ::Prism::ConstantPathTargetNode).void } def visit_constant_path_target_node(node); end - # : (Prism::ConstantPathWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#256 sig { override.params(node: ::Prism::ConstantPathWriteNode).void } def visit_constant_path_write_node(node); end - # : (Prism::ConstantReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#262 sig { override.params(node: ::Prism::ConstantReadNode).void } def visit_constant_read_node(node); end - # : (Prism::ConstantTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#268 sig { override.params(node: ::Prism::ConstantTargetNode).void } def visit_constant_target_node(node); end - # : (Prism::ConstantWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#274 sig { override.params(node: ::Prism::ConstantWriteNode).void } def visit_constant_write_node(node); end - # : (Prism::DefNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#280 sig { override.params(node: ::Prism::DefNode).void } def visit_def_node(node); end - # : (Prism::DefinedNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#286 sig { override.params(node: ::Prism::DefinedNode).void } def visit_defined_node(node); end - # : (Prism::ElseNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#292 sig { override.params(node: ::Prism::ElseNode).void } def visit_else_node(node); end - # : (Prism::EmbeddedStatementsNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#298 sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } def visit_embedded_statements_node(node); end - # : (Prism::EmbeddedVariableNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#304 sig { override.params(node: ::Prism::EmbeddedVariableNode).void } def visit_embedded_variable_node(node); end - # : (Prism::EnsureNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#310 sig { override.params(node: ::Prism::EnsureNode).void } def visit_ensure_node(node); end - # : (Prism::FalseNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#316 sig { override.params(node: ::Prism::FalseNode).void } def visit_false_node(node); end - # : (Prism::FindPatternNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#322 sig { override.params(node: ::Prism::FindPatternNode).void } def visit_find_pattern_node(node); end - # : (Prism::FlipFlopNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#328 sig { override.params(node: ::Prism::FlipFlopNode).void } def visit_flip_flop_node(node); end - # : (Prism::FloatNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#334 sig { override.params(node: ::Prism::FloatNode).void } def visit_float_node(node); end - # : (Prism::ForNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#340 sig { override.params(node: ::Prism::ForNode).void } def visit_for_node(node); end - # : (Prism::ForwardingArgumentsNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#346 sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } def visit_forwarding_arguments_node(node); end - # : (Prism::ForwardingParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#352 sig { override.params(node: ::Prism::ForwardingParameterNode).void } def visit_forwarding_parameter_node(node); end - # : (Prism::ForwardingSuperNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#358 sig { override.params(node: ::Prism::ForwardingSuperNode).void } def visit_forwarding_super_node(node); end - # : (Prism::GlobalVariableAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#364 sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } def visit_global_variable_and_write_node(node); end - # : (Prism::GlobalVariableOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#370 sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } def visit_global_variable_operator_write_node(node); end - # : (Prism::GlobalVariableOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#376 sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } def visit_global_variable_or_write_node(node); end - # : (Prism::GlobalVariableReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#382 sig { override.params(node: ::Prism::GlobalVariableReadNode).void } def visit_global_variable_read_node(node); end - # : (Prism::GlobalVariableTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#388 sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } def visit_global_variable_target_node(node); end - # : (Prism::GlobalVariableWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#394 sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } def visit_global_variable_write_node(node); end - # : (Prism::HashNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#400 sig { override.params(node: ::Prism::HashNode).void } def visit_hash_node(node); end - # : (Prism::HashPatternNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#406 sig { override.params(node: ::Prism::HashPatternNode).void } def visit_hash_pattern_node(node); end - # : (Prism::IfNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#412 sig { override.params(node: ::Prism::IfNode).void } def visit_if_node(node); end - # : (Prism::ImaginaryNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#418 sig { override.params(node: ::Prism::ImaginaryNode).void } def visit_imaginary_node(node); end - # : (Prism::ImplicitNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#424 sig { override.params(node: ::Prism::ImplicitNode).void } def visit_implicit_node(node); end - # : (Prism::ImplicitRestNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#430 sig { override.params(node: ::Prism::ImplicitRestNode).void } def visit_implicit_rest_node(node); end - # : (Prism::InNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#436 sig { override.params(node: ::Prism::InNode).void } def visit_in_node(node); end - # : (Prism::IndexAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#442 sig { override.params(node: ::Prism::IndexAndWriteNode).void } def visit_index_and_write_node(node); end - # : (Prism::IndexOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#448 sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } def visit_index_operator_write_node(node); end - # : (Prism::IndexOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#454 sig { override.params(node: ::Prism::IndexOrWriteNode).void } def visit_index_or_write_node(node); end - # : (Prism::IndexTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#460 sig { override.params(node: ::Prism::IndexTargetNode).void } def visit_index_target_node(node); end - # : (Prism::InstanceVariableAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#466 sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } def visit_instance_variable_and_write_node(node); end - # : (Prism::InstanceVariableOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#472 sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } def visit_instance_variable_operator_write_node(node); end - # : (Prism::InstanceVariableOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#478 sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } def visit_instance_variable_or_write_node(node); end - # : (Prism::InstanceVariableReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#484 sig { override.params(node: ::Prism::InstanceVariableReadNode).void } def visit_instance_variable_read_node(node); end - # : (Prism::InstanceVariableTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#490 sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } def visit_instance_variable_target_node(node); end - # : (Prism::InstanceVariableWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#496 sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } def visit_instance_variable_write_node(node); end - # : (Prism::IntegerNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#502 sig { override.params(node: ::Prism::IntegerNode).void } def visit_integer_node(node); end - # : (Prism::InterpolatedMatchLastLineNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#508 sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } def visit_interpolated_match_last_line_node(node); end - # : (Prism::InterpolatedRegularExpressionNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#514 sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } def visit_interpolated_regular_expression_node(node); end - # : (Prism::InterpolatedStringNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#520 sig { override.params(node: ::Prism::InterpolatedStringNode).void } def visit_interpolated_string_node(node); end - # : (Prism::InterpolatedSymbolNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#526 sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } def visit_interpolated_symbol_node(node); end - # : (Prism::InterpolatedXStringNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#532 sig { override.params(node: ::Prism::InterpolatedXStringNode).void } def visit_interpolated_x_string_node(node); end - # : (Prism::KeywordHashNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#538 sig { override.params(node: ::Prism::KeywordHashNode).void } def visit_keyword_hash_node(node); end - # : (Prism::KeywordRestParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#544 sig { override.params(node: ::Prism::KeywordRestParameterNode).void } def visit_keyword_rest_parameter_node(node); end - # : (Prism::LambdaNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#550 sig { override.params(node: ::Prism::LambdaNode).void } def visit_lambda_node(node); end - # : (Prism::LocalVariableAndWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#556 sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end - # : (Prism::LocalVariableOperatorWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#562 sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end - # : (Prism::LocalVariableOrWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#568 sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end - # : (Prism::LocalVariableReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#574 sig { override.params(node: ::Prism::LocalVariableReadNode).void } def visit_local_variable_read_node(node); end - # : (Prism::LocalVariableTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#580 sig { override.params(node: ::Prism::LocalVariableTargetNode).void } def visit_local_variable_target_node(node); end - # : (Prism::LocalVariableWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#586 sig { override.params(node: ::Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end - # : (Prism::MatchLastLineNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#592 sig { override.params(node: ::Prism::MatchLastLineNode).void } def visit_match_last_line_node(node); end - # : (Prism::MatchPredicateNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#598 sig { override.params(node: ::Prism::MatchPredicateNode).void } def visit_match_predicate_node(node); end - # : (Prism::MatchRequiredNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#604 sig { override.params(node: ::Prism::MatchRequiredNode).void } def visit_match_required_node(node); end - # : (Prism::MatchWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#610 sig { override.params(node: ::Prism::MatchWriteNode).void } def visit_match_write_node(node); end - # : (Prism::MissingNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#616 sig { override.params(node: ::Prism::MissingNode).void } def visit_missing_node(node); end - # : (Prism::ModuleNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#622 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # : (Prism::MultiTargetNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#628 sig { override.params(node: ::Prism::MultiTargetNode).void } def visit_multi_target_node(node); end - # : (Prism::MultiWriteNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#634 sig { override.params(node: ::Prism::MultiWriteNode).void } def visit_multi_write_node(node); end - # : (Prism::NextNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#640 sig { override.params(node: ::Prism::NextNode).void } def visit_next_node(node); end - # : (Prism::NilNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#646 sig { override.params(node: ::Prism::NilNode).void } def visit_nil_node(node); end - # : (Prism::NoKeywordsParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#652 sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } def visit_no_keywords_parameter_node(node); end - # : (Prism::NumberedParametersNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#658 sig { override.params(node: ::Prism::NumberedParametersNode).void } def visit_numbered_parameters_node(node); end - # : (Prism::NumberedReferenceReadNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#664 sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } def visit_numbered_reference_read_node(node); end - # : (Prism::OptionalKeywordParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#670 sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } def visit_optional_keyword_parameter_node(node); end - # : (Prism::OptionalParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#676 sig { override.params(node: ::Prism::OptionalParameterNode).void } def visit_optional_parameter_node(node); end - # : (Prism::OrNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#682 sig { override.params(node: ::Prism::OrNode).void } def visit_or_node(node); end - # : (Prism::ParametersNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#688 sig { override.params(node: ::Prism::ParametersNode).void } def visit_parameters_node(node); end - # : (Prism::ParenthesesNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#694 sig { override.params(node: ::Prism::ParenthesesNode).void } def visit_parentheses_node(node); end - # : (Prism::PinnedExpressionNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#700 sig { override.params(node: ::Prism::PinnedExpressionNode).void } def visit_pinned_expression_node(node); end - # : (Prism::PinnedVariableNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#706 sig { override.params(node: ::Prism::PinnedVariableNode).void } def visit_pinned_variable_node(node); end - # : (Prism::PostExecutionNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#712 sig { override.params(node: ::Prism::PostExecutionNode).void } def visit_post_execution_node(node); end - # : (Prism::PreExecutionNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#718 sig { override.params(node: ::Prism::PreExecutionNode).void } def visit_pre_execution_node(node); end - # : (Prism::ProgramNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#724 sig { override.params(node: ::Prism::ProgramNode).void } def visit_program_node(node); end - # : (Prism::RangeNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#730 sig { override.params(node: ::Prism::RangeNode).void } def visit_range_node(node); end - # : (Prism::RationalNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#736 sig { override.params(node: ::Prism::RationalNode).void } def visit_rational_node(node); end - # : (Prism::RedoNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#742 sig { override.params(node: ::Prism::RedoNode).void } def visit_redo_node(node); end - # : (Prism::RegularExpressionNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#748 sig { override.params(node: ::Prism::RegularExpressionNode).void } def visit_regular_expression_node(node); end - # : (Prism::RequiredKeywordParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#754 sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } def visit_required_keyword_parameter_node(node); end - # : (Prism::RequiredParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#760 sig { override.params(node: ::Prism::RequiredParameterNode).void } def visit_required_parameter_node(node); end - # : (Prism::RescueModifierNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#766 sig { override.params(node: ::Prism::RescueModifierNode).void } def visit_rescue_modifier_node(node); end - # : (Prism::RescueNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#772 sig { override.params(node: ::Prism::RescueNode).void } def visit_rescue_node(node); end - # : (Prism::RestParameterNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#778 sig { override.params(node: ::Prism::RestParameterNode).void } def visit_rest_parameter_node(node); end - # : (Prism::RetryNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#784 sig { override.params(node: ::Prism::RetryNode).void } def visit_retry_node(node); end - # : (Prism::ReturnNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#790 sig { override.params(node: ::Prism::ReturnNode).void } def visit_return_node(node); end - # : (Prism::SelfNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#796 sig { override.params(node: ::Prism::SelfNode).void } def visit_self_node(node); end - # : (Prism::SingletonClassNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#802 sig { override.params(node: ::Prism::SingletonClassNode).void } def visit_singleton_class_node(node); end - # : (Prism::SourceEncodingNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#808 sig { override.params(node: ::Prism::SourceEncodingNode).void } def visit_source_encoding_node(node); end - # : (Prism::SourceFileNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#814 sig { override.params(node: ::Prism::SourceFileNode).void } def visit_source_file_node(node); end - # : (Prism::SourceLineNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#820 sig { override.params(node: ::Prism::SourceLineNode).void } def visit_source_line_node(node); end - # : (Prism::SplatNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#826 sig { override.params(node: ::Prism::SplatNode).void } def visit_splat_node(node); end - # : (Prism::StatementsNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#832 sig { override.params(node: ::Prism::StatementsNode).void } def visit_statements_node(node); end - # : (Prism::StringNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#838 sig { override.params(node: ::Prism::StringNode).void } def visit_string_node(node); end - # : (Prism::SuperNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#844 sig { override.params(node: ::Prism::SuperNode).void } def visit_super_node(node); end - # : (Prism::SymbolNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#850 sig { override.params(node: ::Prism::SymbolNode).void } def visit_symbol_node(node); end - # : (Prism::TrueNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#856 sig { override.params(node: ::Prism::TrueNode).void } def visit_true_node(node); end - # : (Prism::UndefNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#862 sig { override.params(node: ::Prism::UndefNode).void } def visit_undef_node(node); end - # : (Prism::UnlessNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#868 sig { override.params(node: ::Prism::UnlessNode).void } def visit_unless_node(node); end - # : (Prism::UntilNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#874 sig { override.params(node: ::Prism::UntilNode).void } def visit_until_node(node); end - # : (Prism::WhenNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#880 sig { override.params(node: ::Prism::WhenNode).void } def visit_when_node(node); end - # : (Prism::WhileNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#886 sig { override.params(node: ::Prism::WhileNode).void } def visit_while_node(node); end - # : (Prism::XStringNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#892 sig { override.params(node: ::Prism::XStringNode).void } def visit_x_string_node(node); end - # : (Prism::YieldNode node) -> void - # # source://spoom//lib/spoom/visitor.rb#898 sig { override.params(node: ::Prism::YieldNode).void } def visit_yield_node(node); end diff --git a/Library/Homebrew/sorbet/rbi/gems/tapioca@0.16.11.rbi b/Library/Homebrew/sorbet/rbi/gems/tapioca@0.17.6.rbi similarity index 75% rename from Library/Homebrew/sorbet/rbi/gems/tapioca@0.16.11.rbi rename to Library/Homebrew/sorbet/rbi/gems/tapioca@0.17.6.rbi index 8c91462e79..4207d248fa 100644 --- a/Library/Homebrew/sorbet/rbi/gems/tapioca@0.16.11.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/tapioca@0.17.6.rbi @@ -35,18 +35,21 @@ end # That's because RubyGems does alias-method-chain for Kernel#require and such, # so, if Bootsnap were to do prepend, it might end up breaking RubyGems. # -# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#68 +# source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#66 class Module - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#101 + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#98 def append_features(constant); end - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#71 + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#69 def autoload(const_name, path); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#111 + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#108 def extend_object(obj); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#91 + # source://tapioca//lib/tapioca/runtime/trackers/method_definition.rb#60 + def method_added(method_name); end + + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#88 def prepend_features(constant); end end @@ -55,19 +58,7 @@ module RBI; end # source://tapioca//lib/tapioca/rbi_ext/model.rb#5 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi/0.3.2/lib/rbi/model.rb#119 - def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - - # source://rbi/0.3.2/lib/rbi/model.rb#126 - def <<(node); end - - # source://rbi/0.3.2/lib/rbi/rewriters/add_sig_templates.rb#63 - def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - - # source://rbi/0.3.2/lib/rbi/rewriters/annotate.rb#46 - def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - - # source://tapioca//lib/tapioca/rbi_ext/model.rb#38 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#32 sig do params( name: ::String, @@ -77,19 +68,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#45 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#39 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#55 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#49 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#50 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#44 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#90 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#65 sig do params( name: ::String, @@ -103,7 +94,7 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#60 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#54 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end @@ -115,7 +106,7 @@ class RBI::Tree < ::RBI::NodeWithComments sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_path(constant, &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#74 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#59 sig do params( name: ::String, @@ -128,71 +119,21 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end - # source://rbi/0.3.2/lib/rbi/rewriters/deannotate.rb#38 - def deannotate!(annotation); end - - # source://rbi/0.3.2/lib/rbi/model.rb#132 - def empty?; end - - # source://rbi/0.3.2/lib/rbi/rewriters/filter_versions.rb#113 - def filter_versions!(version); end - - # source://rbi/0.3.2/lib/rbi/rewriters/flatten_singleton_methods.rb#58 - def flatten_singleton_methods!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/flatten_visibilities.rb#57 - def flatten_visibilities!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/group_nodes.rb#78 - def group_nodes!; end - - # source://rbi/0.3.2/lib/rbi/index.rb#64 - def index; end - - # source://rbi/0.3.2/lib/rbi/rewriters/merge_trees.rb#314 - def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - - # source://rbi/0.3.2/lib/rbi/rewriters/nest_non_public_members.rb#43 - def nest_non_public_members!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/nest_singleton_methods.rb#33 - def nest_singleton_methods!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/nest_top_level_members.rb#60 - def nest_top_level_members!; end - - # source://rbi/0.3.2/lib/rbi/model.rb#116 - def nodes; end - - # source://rbi/0.3.2/lib/rbi/rewriters/attr_to_methods.rb#50 - def replace_attributes_with_methods!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/sort_nodes.rb#118 - def sort_nodes!; end - - # source://rbi/0.3.2/lib/rbi/rewriters/translate_rbs_sigs.rb#82 - def translate_rbs_sigs!; end - private - # source://tapioca//lib/tapioca/rbi_ext/model.rb#123 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#98 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#118 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#93 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end -# source://tapioca//lib/tapioca/rbi_ext/model.rb#133 +# source://tapioca//lib/tapioca/rbi_ext/model.rb#108 class RBI::TypedParam < ::T::Struct const :param, ::RBI::Param const :type, ::String - - class << self - # source://sorbet-runtime/0.5.12026/lib/types/struct.rb#13 - def inherited(s); end - end end # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#5 @@ -387,18 +328,12 @@ end # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#4 module Tapioca class << self - # source://tapioca//lib/tapioca.rb#20 - sig do - type_parameters(:Result) - .params( - blk: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end + # source://tapioca//lib/tapioca.rb#16 def silence_warnings(&blk); end end end -# source://tapioca//lib/tapioca.rb#39 +# source://tapioca//lib/tapioca.rb#35 Tapioca::BINARY_FILE = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#5 @@ -412,7 +347,7 @@ module Tapioca::BundlerExt; end module Tapioca::BundlerExt::AutoRequireHook requires_ancestor { Bundler::Dependency } - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#46 + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#41 sig { returns(T.untyped) } def autorequire; end @@ -426,7 +361,7 @@ module Tapioca::BundlerExt::AutoRequireHook sig { params(name: T.untyped).returns(T::Boolean) } def excluded?(name); end - # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#36 + # source://tapioca//lib/tapioca/bundler_ext/auto_require_hook.rb#31 sig do type_parameters(:Result) .params( @@ -438,13 +373,13 @@ module Tapioca::BundlerExt::AutoRequireHook end end -# source://tapioca//lib/tapioca.rb#62 +# source://tapioca//lib/tapioca.rb#55 Tapioca::CENTRAL_REPO_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#61 +# source://tapioca//lib/tapioca.rb#54 Tapioca::CENTRAL_REPO_INDEX_PATH = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#60 +# source://tapioca//lib/tapioca.rb#53 Tapioca::CENTRAL_REPO_ROOT_URI = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/cli.rb#5 @@ -524,7 +459,7 @@ end # source://tapioca//lib/tapioca/commands.rb#5 module Tapioca::Commands; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#6 class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracker @@ -533,7 +468,7 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke abstract! - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#34 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#15 sig do params( requested_constants: T::Array[::String], @@ -560,15 +495,15 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke private - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#107 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#88 sig { returns(T::Array[::String]) } def all_requested_constants; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#313 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#284 sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } def build_error_for_files(cause, files); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#237 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#208 sig do params( constant_name: ::String, @@ -579,80 +514,80 @@ class Tapioca::Commands::AbstractDsl < ::Tapioca::Commands::CommandWithoutTracke end def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#172 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#150 sig { params(constant_names: T::Array[::String], ignore_missing: T::Boolean).returns(T::Array[::Module]) } def constantize(constant_names, ignore_missing: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#197 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#175 sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } def constantize_compilers(compiler_names); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#373 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#344 sig { returns(T::Array[::String]) } def constants_from_requested_paths; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#133 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#111 sig { returns(::Tapioca::Dsl::Pipeline) } def create_pipeline; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#276 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#247 sig { params(constant_name: ::String).returns(::Pathname) } def dsl_rbi_filename(constant_name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#158 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#136 sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) } def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#368 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#339 sig { params(constant: ::String).returns(::String) } def generate_command_for(constant); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#79 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#60 sig { params(outpath: ::Pathname, quiet: T::Boolean).returns(T::Set[::Pathname]) } def generate_dsl_rbi_files(outpath, quiet:); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#120 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#98 sig { void } def load_application; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#255 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#226 sig { params(dir: ::Pathname).void } def perform_dsl_verification(dir); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#115 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#93 sig { returns(::Tapioca::Dsl::Pipeline) } def pipeline; end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#264 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#235 sig { params(files: T::Set[::Pathname]).void } def purge_stale_dsl_rbi_files(files); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#363 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#334 sig { params(constant: ::String).returns(::String) } def rbi_filename_for(constant); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#344 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#315 sig { params(path: ::Pathname).returns(T::Array[::Pathname]) } def rbi_files_in(path); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#322 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#293 sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } def report_diff_and_exit_if_out_of_date(diff, command); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#217 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#195 sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) } def resolve(name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#351 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#322 sig { params(class_name: ::String).returns(::String) } def underscore(class_name); end - # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#281 + # source://tapioca//lib/tapioca/commands/abstract_dsl.rb#252 sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) } def verify_dsl_rbi(tmp_dir:); end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/commands/abstract_gem.rb#6 class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command @@ -661,7 +596,7 @@ class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command abstract! - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#33 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#15 sig do params( gem_names: T::Array[::String], @@ -687,70 +622,70 @@ class Tapioca::Commands::AbstractGem < ::Tapioca::Commands::Command private - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#200 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#182 sig { returns(T::Array[::String]) } def added_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#261 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#243 sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) } def build_error_for_files(cause, files); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#80 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#62 sig { params(gem: ::Tapioca::Gemfile::GemSpec).void } def compile_gem_rbi(gem); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#195 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#177 sig { params(gem_name: ::String).returns(::Pathname) } def existing_rbi(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#243 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#225 sig { returns(T::Hash[::String, ::String]) } def existing_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#207 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#189 sig { params(gem_name: ::String).returns(::Pathname) } def expected_rbi(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#249 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#231 sig { returns(T::Hash[::String, ::String]) } def expected_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#212 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#194 sig { params(gem_name: ::String).returns(T::Boolean) } def gem_rbi_exists?(gem_name); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#256 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#238 sig { params(gem_name: ::String, version: ::String).returns(::Pathname) } def gem_rbi_filename(gem_name, version); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#266 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#248 sig { params(gem: ::Tapioca::Gemfile::GemSpec, file: ::RBI::File).void } def merge_with_exported_rbi(gem, file); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#237 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#219 sig { params(old_filename: ::Pathname, new_filename: ::Pathname).void } def move(old_filename, new_filename); end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#147 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#129 sig { void } def perform_additions; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#120 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#102 sig { void } def perform_removals; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#190 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#172 sig { returns(T::Array[::String]) } def removed_rbis; end - # source://tapioca//lib/tapioca/commands/abstract_gem.rb#217 + # source://tapioca//lib/tapioca/commands/abstract_gem.rb#199 sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void } def report_diff_and_exit_if_out_of_date(diff, command); end end # source://tapioca//lib/tapioca/commands/annotations.rb#6 class Tapioca::Commands::Annotations < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/annotations.rb#18 + # source://tapioca//lib/tapioca/commands/annotations.rb#10 sig do params( central_repo_root_uris: T::Array[::String], @@ -764,71 +699,71 @@ class Tapioca::Commands::Annotations < ::Tapioca::Commands::CommandWithoutTracke private - # source://tapioca//lib/tapioca/commands/annotations.rb#197 + # source://tapioca//lib/tapioca/commands/annotations.rb#191 sig { params(name: ::String, content: ::String).returns(::String) } def add_header(name, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#217 + # source://tapioca//lib/tapioca/commands/annotations.rb#211 sig { params(name: ::String, content: ::String).returns(::String) } def apply_typed_override(name, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#39 + # source://tapioca//lib/tapioca/commands/annotations.rb#32 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/annotations.rb#136 - sig { params(repo_uris: T::Array[::String], gem_info: ::Tapioca::GemInfo).void } + # source://tapioca//lib/tapioca/commands/annotations.rb#129 + sig { params(repo_uris: T::Array[::String], gem_info: ::Tapioca::GemInfo).returns(T::Boolean) } def fetch_annotation(repo_uris, gem_info); end - # source://tapioca//lib/tapioca/commands/annotations.rb#113 + # source://tapioca//lib/tapioca/commands/annotations.rb#106 sig { params(project_gems: T::Array[::Tapioca::GemInfo]).returns(T::Array[::String]) } def fetch_annotations(project_gems); end - # source://tapioca//lib/tapioca/commands/annotations.rb#156 + # source://tapioca//lib/tapioca/commands/annotations.rb#150 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#173 + # source://tapioca//lib/tapioca/commands/annotations.rb#167 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_http_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#102 - sig { params(repo_uri: ::String, repo_number: T.nilable(::Integer)).returns(T.nilable(Tapioca::RepoIndex)) } + # source://tapioca//lib/tapioca/commands/annotations.rb#95 + sig { params(repo_uri: ::String, repo_number: T.nilable(::Integer)).returns(T.nilable(::Tapioca::RepoIndex)) } def fetch_index(repo_uri, repo_number:); end - # source://tapioca//lib/tapioca/commands/annotations.rb#81 - sig { returns(T::Hash[::String, Tapioca::RepoIndex]) } + # source://tapioca//lib/tapioca/commands/annotations.rb#74 + sig { returns(T::Hash[::String, ::Tapioca::RepoIndex]) } def fetch_indexes; end - # source://tapioca//lib/tapioca/commands/annotations.rb#165 + # source://tapioca//lib/tapioca/commands/annotations.rb#159 sig { params(repo_uri: ::String, path: ::String).returns(T.nilable(::String)) } def fetch_local_file(repo_uri, path); end - # source://tapioca//lib/tapioca/commands/annotations.rb#229 + # source://tapioca//lib/tapioca/commands/annotations.rb#223 sig { params(gem_version: ::Gem::Version, content: ::String).returns(::String) } def filter_versions(gem_version, content); end - # source://tapioca//lib/tapioca/commands/annotations.rb#50 + # source://tapioca//lib/tapioca/commands/annotations.rb#43 sig { returns(T::Array[::Tapioca::GemInfo]) } def list_gemfile_gems; end - # source://tapioca//lib/tapioca/commands/annotations.rb#237 + # source://tapioca//lib/tapioca/commands/annotations.rb#231 sig { params(gem_name: ::String, contents: T::Array[::String]).returns(T.nilable(::String)) } def merge_files(gem_name, contents); end - # source://tapioca//lib/tapioca/commands/annotations.rb#60 + # source://tapioca//lib/tapioca/commands/annotations.rb#53 sig { params(project_gems: T::Array[::Tapioca::GemInfo]).void } def remove_expired_annotations(project_gems); end - # source://tapioca//lib/tapioca/commands/annotations.rb#264 + # source://tapioca//lib/tapioca/commands/annotations.rb#258 sig { returns(T::Hash[::String, T.nilable(::String)]) } def repo_tokens; end - # source://tapioca//lib/tapioca/commands/annotations.rb#292 + # source://tapioca//lib/tapioca/commands/annotations.rb#286 sig { params(path: ::String, repo_uri: ::String, message: ::String).void } def say_http_error(path, repo_uri, message:); end - # source://tapioca//lib/tapioca/commands/annotations.rb#276 + # source://tapioca//lib/tapioca/commands/annotations.rb#270 sig { params(repo_uri: ::String).returns(T.nilable(::String)) } def token_for(repo_uri); end end @@ -838,7 +773,7 @@ class Tapioca::Commands::CheckShims < ::Tapioca::Commands::CommandWithoutTracker include ::Tapioca::SorbetHelper include ::Tapioca::RBIFilesHelper - # source://tapioca//lib/tapioca/commands/check_shims.rb#22 + # source://tapioca//lib/tapioca/commands/check_shims.rb#12 sig do params( gem_rbi_dir: ::String, @@ -854,12 +789,12 @@ class Tapioca::Commands::CheckShims < ::Tapioca::Commands::CommandWithoutTracker private - # source://tapioca//lib/tapioca/commands/check_shims.rb#44 + # source://tapioca//lib/tapioca/commands/check_shims.rb#35 sig { override.void } def execute; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/commands/command.rb#6 class Tapioca::Commands::Command @@ -876,17 +811,17 @@ class Tapioca::Commands::Command sig { void } def initialize; end - # source://thor/1.3.2/lib/thor/base.rb#155 + # source://tapioca//lib/tapioca/commands/command.rb#44 sig { returns(::Thor::Actions) } def file_writer; end - # source://tapioca//lib/tapioca/commands/command.rb#25 + # source://tapioca//lib/tapioca/commands/command.rb#26 sig(:final) { void } def run; end private - # source://tapioca//lib/tapioca/commands/command.rb#53 + # source://tapioca//lib/tapioca/commands/command.rb#47 sig do params( path: T.any(::Pathname, ::String), @@ -898,28 +833,29 @@ class Tapioca::Commands::Command end def create_file(path, content, force: T.unsafe(nil), skip: T.unsafe(nil), verbose: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/command.rb#37 + # source://tapioca//lib/tapioca/commands/command.rb#39 sig { params(command: ::Symbol, args: ::String).returns(::String) } def default_command(command, *args); end # @abstract + # @raise [NotImplementedError] # - # source://tapioca//lib/tapioca/commands/command.rb#34 + # source://tapioca//lib/tapioca/commands/command.rb#36 sig { abstract.void } def execute; end - # source://tapioca//lib/tapioca/commands/command.rb#63 + # source://tapioca//lib/tapioca/commands/command.rb#52 sig { params(path: T.any(::Pathname, ::String), verbose: T::Boolean).void } def remove_file(path, verbose: T.unsafe(nil)); end end -# source://tapioca//lib/tapioca/commands/command.rb#10 +# source://tapioca//lib/tapioca/commands/command.rb#12 class Tapioca::Commands::Command::FileWriter < ::Thor include ::Thor::Actions extend ::Thor::Actions::ClassMethods end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/commands/command_without_tracker.rb#6 class Tapioca::Commands::CommandWithoutTracker < ::Tapioca::Commands::Command @@ -932,37 +868,37 @@ end # source://tapioca//lib/tapioca/commands/configure.rb#6 class Tapioca::Commands::Configure < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/configure.rb#14 + # source://tapioca//lib/tapioca/commands/configure.rb#8 sig { params(sorbet_config: ::String, tapioca_config: ::String, default_postrequire: ::String).void } def initialize(sorbet_config:, tapioca_config:, default_postrequire:); end private - # source://tapioca//lib/tapioca/commands/configure.rb#79 + # source://tapioca//lib/tapioca/commands/configure.rb#74 sig { void } def create_binstub; end - # source://tapioca//lib/tapioca/commands/configure.rb#69 + # source://tapioca//lib/tapioca/commands/configure.rb#64 sig { void } def create_post_require; end - # source://tapioca//lib/tapioca/commands/configure.rb#40 + # source://tapioca//lib/tapioca/commands/configure.rb#35 sig { void } def create_sorbet_config; end - # source://tapioca//lib/tapioca/commands/configure.rb#50 + # source://tapioca//lib/tapioca/commands/configure.rb#45 sig { void } def create_tapioca_config; end - # source://tapioca//lib/tapioca/commands/configure.rb#32 + # source://tapioca//lib/tapioca/commands/configure.rb#27 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/configure.rb#92 + # source://tapioca//lib/tapioca/commands/configure.rb#87 sig { returns(::Bundler::Installer) } def installer; end - # source://tapioca//lib/tapioca/commands/configure.rb#97 + # source://tapioca//lib/tapioca/commands/configure.rb#92 sig { returns(T.any(::Bundler::StubSpecification, ::Gem::Specification)) } def spec; end end @@ -971,7 +907,7 @@ end class Tapioca::Commands::DslCompilerList < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#10 + # source://tapioca//lib/tapioca/commands/dsl_compiler_list.rb#11 sig { override.void } def execute; end end @@ -980,7 +916,7 @@ end class Tapioca::Commands::DslGenerate < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_generate.rb#10 + # source://tapioca//lib/tapioca/commands/dsl_generate.rb#11 sig { override.void } def execute; end end @@ -989,7 +925,7 @@ end class Tapioca::Commands::DslVerify < ::Tapioca::Commands::AbstractDsl private - # source://tapioca//lib/tapioca/commands/dsl_verify.rb#10 + # source://tapioca//lib/tapioca/commands/dsl_verify.rb#11 sig { override.void } def execute; end end @@ -998,11 +934,11 @@ end class Tapioca::Commands::GemGenerate < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_generate.rb#10 + # source://tapioca//lib/tapioca/commands/gem_generate.rb#11 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/gem_generate.rb#74 + # source://tapioca//lib/tapioca/commands/gem_generate.rb#70 sig do params( gem: ::Tapioca::Gemfile::GemSpec, @@ -1011,7 +947,7 @@ class Tapioca::Commands::GemGenerate < ::Tapioca::Commands::AbstractGem end def gem_dependencies(gem, dependencies = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/commands/gem_generate.rb#51 + # source://tapioca//lib/tapioca/commands/gem_generate.rb#52 sig { params(gem_names: T::Array[::String]).returns(T::Array[::Tapioca::Gemfile::GemSpec]) } def gems_to_generate(gem_names); end end @@ -1020,7 +956,7 @@ end class Tapioca::Commands::GemSync < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_sync.rb#10 + # source://tapioca//lib/tapioca/commands/gem_sync.rb#11 sig { override.void } def execute; end end @@ -1029,24 +965,24 @@ end class Tapioca::Commands::GemVerify < ::Tapioca::Commands::AbstractGem private - # source://tapioca//lib/tapioca/commands/gem_verify.rb#10 + # source://tapioca//lib/tapioca/commands/gem_verify.rb#11 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/gem_verify.rb#17 + # source://tapioca//lib/tapioca/commands/gem_verify.rb#18 sig { void } def perform_sync_verification; end end # source://tapioca//lib/tapioca/commands/require.rb#6 class Tapioca::Commands::Require < ::Tapioca::Commands::CommandWithoutTracker - # source://tapioca//lib/tapioca/commands/require.rb#13 + # source://tapioca//lib/tapioca/commands/require.rb#8 sig { params(requires_path: ::String, sorbet_config_path: ::String).void } def initialize(requires_path:, sorbet_config_path:); end private - # source://tapioca//lib/tapioca/commands/require.rb#23 + # source://tapioca//lib/tapioca/commands/require.rb#19 sig { override.void } def execute; end end @@ -1055,25 +991,25 @@ end class Tapioca::Commands::Todo < ::Tapioca::Commands::CommandWithoutTracker include ::Tapioca::SorbetHelper - # source://tapioca//lib/tapioca/commands/todo.rb#26 + # source://tapioca//lib/tapioca/commands/todo.rb#21 sig { params(todo_file: ::String, file_header: T::Boolean).void } def initialize(todo_file:, file_header:); end - # source://tapioca//lib/tapioca/commands/todo.rb#34 + # source://tapioca//lib/tapioca/commands/todo.rb#29 sig { void } def run_with_deprecation; end private - # source://tapioca//lib/tapioca/commands/todo.rb#44 + # source://tapioca//lib/tapioca/commands/todo.rb#40 sig { override.void } def execute; end - # source://tapioca//lib/tapioca/commands/todo.rb#68 + # source://tapioca//lib/tapioca/commands/todo.rb#64 sig { params(constants: T::Array[::String], command: ::String).returns(::RBI::File) } def rbi(constants, command:); end - # source://tapioca//lib/tapioca/commands/todo.rb#88 + # source://tapioca//lib/tapioca/commands/todo.rb#84 sig { returns(T::Array[::String]) } def unresolved_constants; end end @@ -1103,11 +1039,11 @@ module Tapioca::ConfigHelper private - # source://tapioca//lib/tapioca/helpers/config_helper.rb#153 + # source://tapioca//lib/tapioca/helpers/config_helper.rb#147 sig { params(msg: ::String).returns(::Tapioca::ConfigHelper::ConfigError) } def build_error(msg); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#178 + # source://tapioca//lib/tapioca/helpers/config_helper.rb#172 sig { params(config_file: ::String, errors: T::Array[::Tapioca::ConfigHelper::ConfigError]).returns(::String) } def build_error_message(config_file, errors); end @@ -1123,7 +1059,7 @@ module Tapioca::ConfigHelper sig { params(options: T::Hash[::Symbol, ::Thor::Option]).void } def filter_defaults(options); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#196 + # source://tapioca//lib/tapioca/helpers/config_helper.rb#187 sig do params( options: T.nilable(::Thor::CoreExt::HashWithIndifferentAccess) @@ -1135,7 +1071,7 @@ module Tapioca::ConfigHelper sig { params(config_file: ::String, config: T::Hash[T.untyped, T.untyped]).void } def validate_config!(config_file, config); end - # source://tapioca//lib/tapioca/helpers/config_helper.rb#102 + # source://tapioca//lib/tapioca/helpers/config_helper.rb#96 sig do params( command_options: T::Hash[::Symbol, ::Thor::Option], @@ -1146,64 +1082,54 @@ module Tapioca::ConfigHelper def validate_config_options(command_options, config_key, config_options); end end -# source://tapioca//lib/tapioca/helpers/config_helper.rb#148 +# source://tapioca//lib/tapioca/helpers/config_helper.rb#142 class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] - - class << self - # source://sorbet-runtime/0.5.12026/lib/types/struct.rb#13 - def inherited(s); end - end end -# source://tapioca//lib/tapioca/helpers/config_helper.rb#143 +# source://tapioca//lib/tapioca/helpers/config_helper.rb#137 class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :message, ::String const :colors, T::Array[::Symbol] - - class << self - # source://sorbet-runtime/0.5.12026/lib/types/struct.rb#13 - def inherited(s); end - end end -# source://tapioca//lib/tapioca.rb#46 +# source://tapioca//lib/tapioca.rb#42 Tapioca::DEFAULT_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#42 +# source://tapioca//lib/tapioca.rb#38 Tapioca::DEFAULT_DSL_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#58 +# source://tapioca//lib/tapioca.rb#51 Tapioca::DEFAULT_ENVIRONMENT = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#43 +# source://tapioca//lib/tapioca.rb#39 Tapioca::DEFAULT_GEM_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#48 +# source://tapioca//lib/tapioca.rb#44 Tapioca::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash) -# source://tapioca//lib/tapioca.rb#40 +# source://tapioca//lib/tapioca.rb#36 Tapioca::DEFAULT_POSTREQUIRE_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#41 +# source://tapioca//lib/tapioca.rb#37 Tapioca::DEFAULT_RBI_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/rbi_formatter.rb#31 +# source://tapioca//lib/tapioca/rbi_formatter.rb#25 Tapioca::DEFAULT_RBI_FORMATTER = T.let(T.unsafe(nil), Tapioca::RBIFormatter) -# source://tapioca//lib/tapioca.rb#57 +# source://tapioca//lib/tapioca.rb#50 Tapioca::DEFAULT_RBI_MAX_LINE_LENGTH = T.let(T.unsafe(nil), Integer) -# source://tapioca//lib/tapioca.rb#44 +# source://tapioca//lib/tapioca.rb#40 Tapioca::DEFAULT_SHIM_DIR = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#45 +# source://tapioca//lib/tapioca.rb#41 Tapioca::DEFAULT_TODO_FILE = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/dsl/compilers.rb#5 module Tapioca::Dsl; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/dsl/compiler.rb#6 class Tapioca::Dsl::Compiler @@ -1219,7 +1145,7 @@ class Tapioca::Dsl::Compiler ConstantType = type_member { { upper: Module } } - # source://tapioca//lib/tapioca/dsl/compiler.rb#110 + # source://tapioca//lib/tapioca/dsl/compiler.rb#93 sig do params( pipeline: ::Tapioca::Dsl::Pipeline, @@ -1232,64 +1158,66 @@ class Tapioca::Dsl::Compiler # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`. # - # source://tapioca//lib/tapioca/dsl/compiler.rb#128 + # source://tapioca//lib/tapioca/dsl/compiler.rb#112 sig { params(error: ::String).void } def add_error(error); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#119 + # source://tapioca//lib/tapioca/dsl/compiler.rb#102 sig { params(compiler_name: ::String).returns(T::Boolean) } def compiler_enabled?(compiler_name); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#20 + # source://tapioca//lib/tapioca/dsl/compiler.rb#22 sig { returns(ConstantType) } def constant; end # @abstract + # @raise [NotImplementedError] # - # source://tapioca//lib/tapioca/dsl/compiler.rb#124 + # source://tapioca//lib/tapioca/dsl/compiler.rb#108 sig { abstract.void } def decorate; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#26 + # source://tapioca//lib/tapioca/dsl/compiler.rb#28 sig { returns(T::Hash[::String, T.untyped]) } def options; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#23 + # source://tapioca//lib/tapioca/dsl/compiler.rb#25 sig { returns(::RBI::Tree) } def root; end private - # source://tapioca//lib/tapioca/dsl/compiler.rb#177 + # source://tapioca//lib/tapioca/dsl/compiler.rb#156 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) } def compile_method_parameters_to_rbi(method_def); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#213 + # source://tapioca//lib/tapioca/dsl/compiler.rb#192 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) } def compile_method_return_type_to_rbi(method_def); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#167 + # source://tapioca//lib/tapioca/dsl/compiler.rb#146 sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void } def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end # Get the types of each parameter from a method signature # - # source://tapioca//lib/tapioca/dsl/compiler.rb#141 + # source://tapioca//lib/tapioca/dsl/compiler.rb#120 sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) } def parameters_types_from_signature(method_def, signature); end class << self # @abstract + # @raise [NotImplementedError] # - # source://tapioca//lib/tapioca/dsl/compiler.rb#39 + # source://tapioca//lib/tapioca/dsl/compiler.rb#42 sig { abstract.returns(T::Enumerable[::Module]) } def gather_constants; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#34 + # source://tapioca//lib/tapioca/dsl/compiler.rb#36 sig { params(constant: ::Module).returns(T::Boolean) } def handles?(constant); end - # source://tapioca//lib/tapioca/dsl/compiler.rb#42 + # source://tapioca//lib/tapioca/dsl/compiler.rb#45 sig { returns(T::Set[::Module]) } def processable_constants; end @@ -1303,15 +1231,15 @@ class Tapioca::Dsl::Compiler private - # source://tapioca//lib/tapioca/dsl/compiler.rb#82 + # source://tapioca//lib/tapioca/dsl/compiler.rb#78 sig { returns(T::Enumerable[T::Class[T.anything]]) } def all_classes; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#90 + # source://tapioca//lib/tapioca/dsl/compiler.rb#83 sig { returns(T::Enumerable[::Module]) } def all_modules; end - # source://tapioca//lib/tapioca/dsl/compiler.rb#68 + # source://tapioca//lib/tapioca/dsl/compiler.rb#64 sig do type_parameters(:U) .params( @@ -1337,7 +1265,7 @@ Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array) # source://tapioca//lib/tapioca/dsl/pipeline.rb#6 class Tapioca::Dsl::Pipeline - # source://tapioca//lib/tapioca/dsl/pipeline.rb#40 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#28 sig do params( requested_constants: T::Array[::Module], @@ -1357,15 +1285,15 @@ class Tapioca::Dsl::Pipeline sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) } def active_compilers; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#110 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#92 sig { params(error: ::String).void } def add_error(error); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#115 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#97 sig { params(compiler_name: ::String).returns(T::Boolean) } def compiler_enabled?(compiler_name); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#124 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#106 sig { returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) } def compilers; end @@ -1385,7 +1313,7 @@ class Tapioca::Dsl::Pipeline sig { returns(T::Array[::Pathname]) } def requested_paths; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#70 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#52 sig do type_parameters(:T) .params( @@ -1400,15 +1328,15 @@ class Tapioca::Dsl::Pipeline private - # source://tapioca//lib/tapioca/dsl/pipeline.rb#231 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#199 sig { void } def abort_if_pending_migrations!; end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#177 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#145 sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) } def filter_anonymous_and_reloaded_constants(constants); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#141 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#115 sig do params( requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)], @@ -1417,7 +1345,7 @@ class Tapioca::Dsl::Pipeline end def gather_active_compilers(requested_compilers, excluded_compilers); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#155 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#123 sig do params( requested_constants: T::Array[::Module], @@ -1427,11 +1355,11 @@ class Tapioca::Dsl::Pipeline end def gather_constants(requested_constants, requested_paths, skipped_constants); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#206 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#174 sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) } def rbi_for_constant(constant); end - # source://tapioca//lib/tapioca/dsl/pipeline.rb#225 + # source://tapioca//lib/tapioca/dsl/pipeline.rb#193 sig { params(error: ::String).void } def report_error(error); end end @@ -1453,7 +1381,7 @@ class Tapioca::Executor sig { params(queue: T::Array[T.untyped], number_of_workers: T.nilable(::Integer)).void } def initialize(queue, number_of_workers: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/executor.rb#28 + # source://tapioca//lib/tapioca/executor.rb#22 sig do type_parameters(:T) .params( @@ -1464,7 +1392,7 @@ class Tapioca::Executor private - # source://tapioca//lib/tapioca/executor.rb#37 + # source://tapioca//lib/tapioca/executor.rb#31 sig { returns(::Integer) } def max_processors; end end @@ -1475,57 +1403,57 @@ Tapioca::Executor::MINIMUM_ITEMS_PER_WORKER = T.let(T.unsafe(nil), Integer) # source://tapioca//lib/tapioca/gem/events.rb#5 module Tapioca::Gem; end -# source://tapioca//lib/tapioca/gem/events.rb#77 +# source://tapioca//lib/tapioca/gem/events.rb#82 class Tapioca::Gem::ConstNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#84 + # source://tapioca//lib/tapioca/gem/events.rb#89 sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } def initialize(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/events.rb#81 + # source://tapioca//lib/tapioca/gem/events.rb#86 sig { returns(::RBI::Const) } def node; end end -# source://tapioca//lib/tapioca/gem/events.rb#26 +# source://tapioca//lib/tapioca/gem/events.rb#27 class Tapioca::Gem::ConstantFound < ::Tapioca::Gem::Event - # source://tapioca//lib/tapioca/gem/events.rb#36 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # @return [ConstantFound] a new instance of ConstantFound + # + # source://tapioca//lib/tapioca/gem/events.rb#39 def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#33 - sig { returns(::BasicObject) } + # source://tapioca//lib/tapioca/gem/events.rb#35 def constant; end - # source://tapioca//lib/tapioca/gem/events.rb#30 + # source://tapioca//lib/tapioca/gem/events.rb#31 sig { returns(::String) } def symbol; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/gem/events.rb#6 class Tapioca::Gem::Event abstract! end -# source://tapioca//lib/tapioca/gem/events.rb#43 +# source://tapioca//lib/tapioca/gem/events.rb#46 class Tapioca::Gem::ForeignConstantFound < ::Tapioca::Gem::ConstantFound - # source://tapioca//lib/tapioca/gem/events.rb#52 + # source://tapioca//lib/tapioca/gem/events.rb#56 sig { params(symbol: ::String, constant: ::Module).void } def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#47 + # source://tapioca//lib/tapioca/gem/events.rb#51 sig { override.returns(::Module) } def constant; end end -# source://tapioca//lib/tapioca/gem/events.rb#103 +# source://tapioca//lib/tapioca/gem/events.rb#108 class Tapioca::Gem::ForeignScopeNodeAdded < ::Tapioca::Gem::ScopeNodeAdded; end # source://tapioca//lib/tapioca/gem/listeners/base.rb#6 module Tapioca::Gem::Listeners; end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/gem/listeners/base.rb#7 class Tapioca::Gem::Listeners::Base @@ -1565,11 +1493,11 @@ class Tapioca::Gem::Listeners::DynamicMixins < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#31 + # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#33 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/dynamic_mixins.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1581,15 +1509,15 @@ class Tapioca::Gem::Listeners::ForeignConstants < ::Tapioca::Gem::Listeners::Bas private - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#60 + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#58 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#55 + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#52 sig { params(location: ::String).returns(T::Boolean) } def mixed_in_by_gem?(location); end - # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/foreign_constants.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1603,7 +1531,7 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#35 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#28 sig do params( tree: ::RBI::Tree, @@ -1615,7 +1543,7 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base end def compile_directly_owned_methods(tree, module_name, mod, for_visibility = T.unsafe(nil), attached_class: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#71 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#56 sig do params( tree: ::RBI::Tree, @@ -1627,7 +1555,7 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base end def compile_method(tree, symbol_name, constant, method, visibility = T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#211 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#212 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end @@ -1635,11 +1563,7 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base sig { params(constant: ::Module).returns(T.nilable(::UnboundMethod)) } def initialize_method_for(constant); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#216 - sig { params(method: ::UnboundMethod).returns(T.untyped) } - def lookup_signature_of(method); end - - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#172 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#177 sig { params(mod: ::Module).returns(T::Hash[::Symbol, T::Array[::Symbol]]) } def method_names_by_visibility(mod); end @@ -1657,15 +1581,15 @@ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base # It walks up the ancestor tree via the `super_method` method; if any of the super # methods are owned by the constant, it means that the constant declares the method. # - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#158 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#163 sig { params(method: ::UnboundMethod, constant: ::Module).returns(T::Boolean) } def method_owned_by_constant?(method, constant); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#16 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#17 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end - # source://tapioca//lib/tapioca/gem/listeners/methods.rb#181 + # source://tapioca//lib/tapioca/gem/listeners/methods.rb#186 sig { params(constant: ::Module, method_name: ::String).returns(T::Boolean) } def struct_method?(constant, method_name); end end @@ -1677,7 +1601,7 @@ class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#42 + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#36 sig do params( tree: ::RBI::Tree, @@ -1688,15 +1612,15 @@ class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base end def add_mixins(tree, constant, mods, mixin_type); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#84 + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#72 sig { params(mixin_name: ::String).returns(T::Boolean) } def filtered_mixin?(mixin_name); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#91 + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#79 sig { params(constant: ::Module).returns(T::Array[::Module]) } def interesting_ancestors_of(constant); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#75 + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#63 sig do params( constant: ::Module, @@ -1706,7 +1630,7 @@ class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base end def mixed_in_by_gem?(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/mixins.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1718,11 +1642,11 @@ class Tapioca::Gem::Listeners::RemoveEmptyPayloadScopes < ::Tapioca::Gem::Listen private - # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#20 + # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#22 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/remove_empty_payload_scopes.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1731,11 +1655,11 @@ end class Tapioca::Gem::Listeners::SorbetEnums < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#28 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#30 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#13 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_enums.rb#14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1747,11 +1671,11 @@ class Tapioca::Gem::Listeners::SorbetHelpers < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#27 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#29 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_helpers.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1763,11 +1687,11 @@ class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#33 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#35 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#14 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_props.rb#15 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1776,11 +1700,11 @@ end class Tapioca::Gem::Listeners::SorbetRequiredAncestors < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#23 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#25 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#13 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_required_ancestors.rb#14 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1794,19 +1718,19 @@ class Tapioca::Gem::Listeners::SorbetSignatures < ::Tapioca::Gem::Listeners::Bas private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#26 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#27 sig { params(signature: T.untyped, parameters: T::Array[[::Symbol, ::String]]).returns(::RBI::Sig) } def compile_signature(signature, parameters); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#79 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#81 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#18 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#19 sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#68 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_signatures.rb#69 sig { params(signature: T.untyped).returns(T::Boolean) } def signature_final?(signature); end end @@ -1821,19 +1745,19 @@ class Tapioca::Gem::Listeners::SorbetTypeVariables < ::Tapioca::Gem::Listeners:: private - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#27 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#28 sig { params(tree: ::RBI::Tree, constant: ::Module).void } def compile_type_variable_declarations(tree, constant); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#63 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#65 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#50 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#51 sig { params(type_variable: ::Tapioca::TypeVariableModule).returns(T.nilable(::RBI::Node)) } def node_from_type_variable(type_variable); end - # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/sorbet_type_variables.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1842,19 +1766,19 @@ end class Tapioca::Gem::Listeners::SourceLocation < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#41 + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#48 sig { params(node: ::RBI::NodeWithComments, file: T.nilable(::String), line: T.nilable(::Integer)).void } def add_source_location_comment(node, file, line); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#13 + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#14 sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } def on_const(event); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#35 + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#38 sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#19 + # source://tapioca//lib/tapioca/gem/listeners/source_location.rb#21 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end @@ -1866,53 +1790,57 @@ class Tapioca::Gem::Listeners::Subconstants < ::Tapioca::Gem::Listeners::Base private - # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#35 + # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#37 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#15 + # source://tapioca//lib/tapioca/gem/listeners/subconstants.rb#16 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end end # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#7 class Tapioca::Gem::Listeners::YardDoc < ::Tapioca::Gem::Listeners::Base - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#27 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#25 sig { params(pipeline: ::Tapioca::Gem::Pipeline).void } def initialize(pipeline); end private - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#55 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#61 sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) } def documentation_comments(name, sigs: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#99 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#106 sig { override.params(event: ::Tapioca::Gem::NodeAdded).returns(T::Boolean) } def ignore?(event); end - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#36 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#40 sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void } def on_const(event); end - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#46 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#52 sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void } def on_method(event); end - # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#41 + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#46 sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void } def on_scope(event); end + + # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#34 + sig { params(line: ::String).returns(T::Boolean) } + def rbs_comment?(line); end end # source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#10 Tapioca::Gem::Listeners::YardDoc::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#24 +# source://tapioca//lib/tapioca/gem/listeners/yard_doc.rb#22 Tapioca::Gem::Listeners::YardDoc::IGNORED_SIG_TAGS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/gem/events.rb#105 +# source://tapioca//lib/tapioca/gem/events.rb#110 class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#130 + # source://tapioca//lib/tapioca/gem/events.rb#126 sig do params( symbol: ::String, @@ -1925,38 +1853,38 @@ class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded end def initialize(symbol, constant, method, node, signature, parameters); end - # source://tapioca//lib/tapioca/gem/events.rb#109 + # source://tapioca//lib/tapioca/gem/events.rb#114 sig { returns(::UnboundMethod) } def method; end - # source://tapioca//lib/tapioca/gem/events.rb#112 + # source://tapioca//lib/tapioca/gem/events.rb#117 sig { returns(::RBI::Method) } def node; end - # source://tapioca//lib/tapioca/gem/events.rb#118 + # source://tapioca//lib/tapioca/gem/events.rb#123 sig { returns(T::Array[[::Symbol, ::String]]) } def parameters; end - # source://tapioca//lib/tapioca/gem/events.rb#115 + # source://tapioca//lib/tapioca/gem/events.rb#120 sig { returns(T.untyped) } def signature; end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # -# source://tapioca//lib/tapioca/gem/events.rb#57 +# source://tapioca//lib/tapioca/gem/events.rb#61 class Tapioca::Gem::NodeAdded < ::Tapioca::Gem::Event abstract! - # source://tapioca//lib/tapioca/gem/events.rb#70 + # source://tapioca//lib/tapioca/gem/events.rb#75 sig { params(symbol: ::String, constant: ::Module).void } def initialize(symbol, constant); end - # source://tapioca//lib/tapioca/gem/events.rb#67 + # source://tapioca//lib/tapioca/gem/events.rb#72 sig { returns(::Module) } def constant; end - # source://tapioca//lib/tapioca/gem/events.rb#64 + # source://tapioca//lib/tapioca/gem/events.rb#69 sig { returns(::String) } def symbol; end end @@ -1968,7 +1896,7 @@ class Tapioca::Gem::Pipeline include ::Tapioca::SorbetHelper include ::Tapioca::RBIHelper - # source://tapioca//lib/tapioca/gem/pipeline.rb#27 + # source://tapioca//lib/tapioca/gem/pipeline.rb#20 sig do params( gem: ::Tapioca::Gemfile::GemSpec, @@ -1979,11 +1907,11 @@ class Tapioca::Gem::Pipeline end def initialize(gem, error_handler:, include_doc: T.unsafe(nil), include_loc: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#64 + # source://tapioca//lib/tapioca/gem/pipeline.rb#57 sig { returns(::RBI::Tree) } def compile; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#135 + # source://tapioca//lib/tapioca/gem/pipeline.rb#111 sig { params(name: T.any(::String, ::Symbol)).returns(T::Boolean) } def constant_in_gem?(name); end @@ -1995,33 +1923,35 @@ class Tapioca::Gem::Pipeline sig { returns(::Tapioca::Gemfile::GemSpec) } def gem; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#153 - sig { params(method: ::UnboundMethod).returns(T::Boolean) } - def method_in_gem?(method); end + # source://tapioca//lib/tapioca/gem/pipeline.rb#149 + sig do + params( + method_name: ::Symbol, + owner: ::Module + ).returns(::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult) + end + def method_definition_in_gem(method_name, owner); end - # Helpers - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#163 + # source://tapioca//lib/tapioca/gem/pipeline.rb#175 sig { params(constant: ::Module).returns(T.nilable(::String)) } def name_of(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#87 + # source://tapioca//lib/tapioca/gem/pipeline.rb#81 sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void } def push_const(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#77 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # source://tapioca//lib/tapioca/gem/pipeline.rb#71 def push_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#82 + # source://tapioca//lib/tapioca/gem/pipeline.rb#76 sig { params(symbol: ::String, constant: ::Module).void } def push_foreign_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#101 + # source://tapioca//lib/tapioca/gem/pipeline.rb#91 sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } def push_foreign_scope(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#115 + # source://tapioca//lib/tapioca/gem/pipeline.rb#96 sig do params( symbol: ::String, @@ -2034,169 +1964,185 @@ class Tapioca::Gem::Pipeline end def push_method(symbol, constant, method, node, signature, parameters); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#94 + # source://tapioca//lib/tapioca/gem/pipeline.rb#86 sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } def push_scope(symbol, constant, node); end - # Events handling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#72 + # source://tapioca//lib/tapioca/gem/pipeline.rb#65 sig { params(symbol: ::String).void } def push_symbol(symbol); end - # Constants and properties filtering - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#122 + # source://tapioca//lib/tapioca/gem/pipeline.rb#103 sig { params(symbol_name: ::String).returns(T::Boolean) } def symbol_in_payload?(symbol_name); end private - # source://tapioca//lib/tapioca/gem/pipeline.rb#456 + # source://tapioca//lib/tapioca/gem/pipeline.rb#472 sig { params(name: ::String).void } def add_to_alias_namespace(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#461 + # source://tapioca//lib/tapioca/gem/pipeline.rb#477 sig { params(name: ::String).returns(T::Boolean) } def alias_namespaced?(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#260 + # source://tapioca//lib/tapioca/gem/pipeline.rb#273 sig { params(name: ::String, constant: ::Module).void } def compile_alias(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#246 - sig { params(symbol: ::String, constant: ::BasicObject).void } + # source://tapioca//lib/tapioca/gem/pipeline.rb#259 def compile_constant(symbol, constant); end - # Compiling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#235 + # source://tapioca//lib/tapioca/gem/pipeline.rb#247 sig { params(symbol: ::String, constant: ::Module).void } def compile_foreign_constant(symbol, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#314 + # source://tapioca//lib/tapioca/gem/pipeline.rb#328 sig { params(name: ::String, constant: ::Module).void } def compile_module(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#281 - sig { params(name: ::String, value: ::BasicObject).void } + # source://tapioca//lib/tapioca/gem/pipeline.rb#295 def compile_object(name, value); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#325 + # source://tapioca//lib/tapioca/gem/pipeline.rb#339 sig { params(name: ::String, constant: ::Module).returns(::RBI::Scope) } def compile_scope(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#339 + # source://tapioca//lib/tapioca/gem/pipeline.rb#353 sig { params(constant: T::Class[T.anything]).returns(T.nilable(::String)) } def compile_superclass(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#437 + # source://tapioca//lib/tapioca/gem/pipeline.rb#453 sig { params(constant: ::Module, strict: T::Boolean).returns(T::Boolean) } def defined_in_gem?(constant, strict: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#193 + # source://tapioca//lib/tapioca/gem/pipeline.rb#205 sig { params(event: ::Tapioca::Gem::Event).void } def dispatch(event); end - # Helpers - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#480 + # source://tapioca//lib/tapioca/gem/pipeline.rb#496 sig { params(constant: T.all(::Module, ::T::Generic)).returns(::String) } def generic_name_of(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#449 + # source://tapioca//lib/tapioca/gem/pipeline.rb#465 sig { params(constant: ::Module).returns(T::Set[::String]) } def get_file_candidates(constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#178 + # source://tapioca//lib/tapioca/gem/pipeline.rb#190 sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) } def load_bootstrap_symbols(gem); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#496 + # source://tapioca//lib/tapioca/gem/pipeline.rb#512 sig { params(constant: ::Module, class_name: T.nilable(::String)).returns(T.nilable(::String)) } def name_of_proxy_target(constant, class_name); end - # Events handling - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#188 + # source://tapioca//lib/tapioca/gem/pipeline.rb#200 sig { returns(::Tapioca::Gem::Event) } def next_event; end - # source://tapioca//lib/tapioca/gem/pipeline.rb#216 + # source://tapioca//lib/tapioca/gem/pipeline.rb#228 sig { params(event: ::Tapioca::Gem::ConstantFound).void } def on_constant(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#228 + # source://tapioca//lib/tapioca/gem/pipeline.rb#240 sig { params(event: ::Tapioca::Gem::NodeAdded).void } def on_node(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#207 + # source://tapioca//lib/tapioca/gem/pipeline.rb#219 sig { params(event: ::Tapioca::Gem::SymbolFound).void } def on_symbol(event); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#468 + # source://tapioca//lib/tapioca/gem/pipeline.rb#484 sig { params(name: ::String).void } def seen!(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#473 + # source://tapioca//lib/tapioca/gem/pipeline.rb#489 sig { params(name: ::String).returns(T::Boolean) } def seen?(name); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#407 + # source://tapioca//lib/tapioca/gem/pipeline.rb#422 sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } def skip_alias?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#395 - sig { params(name: ::String, constant: T.anything).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#410 def skip_constant?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#424 + # source://tapioca//lib/tapioca/gem/pipeline.rb#440 sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } def skip_foreign_constant?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#429 + # source://tapioca//lib/tapioca/gem/pipeline.rb#445 sig { params(name: ::String, constant: ::Module).returns(T::Boolean) } def skip_module?(name, constant); end - # source://tapioca//lib/tapioca/gem/pipeline.rb#416 - sig { params(name: ::String, constant: ::BasicObject).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/gem/pipeline.rb#432 def skip_object?(name, constant); end - # Constants and properties filtering - # - # source://tapioca//lib/tapioca/gem/pipeline.rb#390 + # source://tapioca//lib/tapioca/gem/pipeline.rb#404 sig { params(name: ::String).returns(T::Boolean) } def skip_symbol?(name); end end -# this looks something like: -# "(eval at /path/to/file.rb:123)" -# and we are just interested in the "/path/to/file.rb" part -# -# source://tapioca//lib/tapioca/gem/pipeline.rb#132 -Tapioca::Gem::Pipeline::EVAL_SOURCE_FILE_PATTERN = T.let(T.unsafe(nil), Regexp) - # source://tapioca//lib/tapioca/gem/pipeline.rb#11 Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/gem/events.rb#90 +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#120 +class Tapioca::Gem::Pipeline::MethodDefinitionLookupResult + abstract! +end + +# The method defined in gem and has a source location +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#135 +class Tapioca::Gem::Pipeline::MethodInGemWithLocation < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult + # source://tapioca//lib/tapioca/gem/pipeline.rb#142 + sig { params(location: ::Tapioca::Runtime::SourceLocation).void } + def initialize(location); end + + # source://tapioca//lib/tapioca/gem/pipeline.rb#139 + sig { returns(::Tapioca::Runtime::SourceLocation) } + def location; end +end + +# The method probably defined in the gem but doesn't have a source location +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#132 +class Tapioca::Gem::Pipeline::MethodInGemWithoutLocation < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end + +# The method is not defined in the gem +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#129 +class Tapioca::Gem::Pipeline::MethodNotInGem < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end + +# The method doesn't seem to exist +# +# source://tapioca//lib/tapioca/gem/pipeline.rb#126 +class Tapioca::Gem::Pipeline::MethodUnknown < ::Tapioca::Gem::Pipeline::MethodDefinitionLookupResult; end + +# source://tapioca//lib/tapioca/gem/events.rb#95 class Tapioca::Gem::ScopeNodeAdded < ::Tapioca::Gem::NodeAdded - # source://tapioca//lib/tapioca/gem/events.rb#97 + # source://tapioca//lib/tapioca/gem/events.rb#102 sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void } def initialize(symbol, constant, node); end - # source://tapioca//lib/tapioca/gem/events.rb#94 + # source://tapioca//lib/tapioca/gem/events.rb#99 sig { returns(::RBI::Scope) } def node; end end -# source://tapioca//lib/tapioca/gem/events.rb#13 +# source://tapioca//lib/tapioca/gem/events.rb#14 class Tapioca::Gem::SymbolFound < ::Tapioca::Gem::Event - # source://tapioca//lib/tapioca/gem/events.rb#20 + # source://tapioca//lib/tapioca/gem/events.rb#21 sig { params(symbol: ::String).void } def initialize(symbol); end - # source://tapioca//lib/tapioca/gem/events.rb#17 + # source://tapioca//lib/tapioca/gem/events.rb#18 sig { returns(::String) } def symbol; end end @@ -2235,9 +2181,6 @@ class Tapioca::GemInfo < ::T::Struct # source://tapioca//lib/tapioca/gem_info.rb#13 sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } def from_spec(spec); end - - # source://sorbet-runtime/0.5.12026/lib/types/struct.rb#13 - def inherited(s); end end end @@ -2285,8 +2228,6 @@ class Tapioca::Gemfile sig { returns([T::Array[::Tapioca::Gemfile::GemSpec], T::Array[::String]]) } def load_dependencies; end - # @return [File] - # # source://tapioca//lib/tapioca/gemfile.rb#54 def lockfile; end @@ -2303,94 +2244,92 @@ end class Tapioca::Gemfile::GemSpec include ::Tapioca::GemHelper - # source://tapioca//lib/tapioca/gemfile.rb#145 + # source://tapioca//lib/tapioca/gemfile.rb#139 sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).void } def initialize(spec); end - # source://tapioca//lib/tapioca/gemfile.rb#155 + # source://tapioca//lib/tapioca/gemfile.rb#149 sig { params(other: ::BasicObject).returns(T::Boolean) } def ==(other); end - # source://tapioca//lib/tapioca/gemfile.rb#180 + # source://tapioca//lib/tapioca/gemfile.rb#174 sig { params(path: ::String).returns(T::Boolean) } def contains_path?(path); end - # source://tapioca//lib/tapioca/gemfile.rb#170 + # source://tapioca//lib/tapioca/gemfile.rb#164 sig { returns(T::Array[::Gem::Dependency]) } def dependencies; end - # source://tapioca//lib/tapioca/gemfile.rb#210 + # source://tapioca//lib/tapioca/gemfile.rb#204 sig { returns(T::Boolean) } def export_rbi_files?; end - # source://tapioca//lib/tapioca/gemfile.rb#205 + # source://tapioca//lib/tapioca/gemfile.rb#199 sig { returns(T::Array[::String]) } def exported_rbi_files; end - # source://tapioca//lib/tapioca/gemfile.rb#215 + # source://tapioca//lib/tapioca/gemfile.rb#209 sig { returns(::RBI::MergeTree) } def exported_rbi_tree; end - # source://tapioca//lib/tapioca/gemfile.rb#142 + # source://tapioca//lib/tapioca/gemfile.rb#136 sig { returns(T::Array[::Pathname]) } def files; end - # source://tapioca//lib/tapioca/gemfile.rb#139 + # source://tapioca//lib/tapioca/gemfile.rb#133 sig { returns(::String) } def full_gem_path; end - # source://tapioca//lib/tapioca/gemfile.rb#160 + # source://tapioca//lib/tapioca/gemfile.rb#154 sig { params(gemfile_dir: ::String).returns(T::Boolean) } def ignore?(gemfile_dir); end - # source://tapioca//lib/tapioca/gemfile.rb#165 + # source://tapioca//lib/tapioca/gemfile.rb#159 sig { returns(::String) } def name; end - # source://tapioca//lib/tapioca/gemfile.rb#189 + # source://tapioca//lib/tapioca/gemfile.rb#183 sig { void } def parse_yard_docs; end - # source://tapioca//lib/tapioca/gemfile.rb#175 + # source://tapioca//lib/tapioca/gemfile.rb#169 sig { returns(::String) } def rbi_file_name; end - # source://tapioca//lib/tapioca/gemfile.rb#227 + # source://tapioca//lib/tapioca/gemfile.rb#221 sig { params(file: ::Pathname).returns(::Pathname) } def relative_path_for(file); end - # @return [String] - # - # source://tapioca//lib/tapioca/gemfile.rb#139 + # source://tapioca//lib/tapioca/gemfile.rb#133 def version; end private - # source://tapioca//lib/tapioca/gemfile.rb#238 + # source://tapioca//lib/tapioca/gemfile.rb#232 sig { returns(T::Array[::Pathname]) } def collect_files; end - # source://tapioca//lib/tapioca/gemfile.rb#253 + # source://tapioca//lib/tapioca/gemfile.rb#247 sig { returns(T.nilable(T::Boolean)) } def default_gem?; end - # source://tapioca//lib/tapioca/gemfile.rb#312 + # source://tapioca//lib/tapioca/gemfile.rb#303 sig { returns(T::Boolean) } def gem_ignored?; end - # source://tapioca//lib/tapioca/gemfile.rb#291 + # source://tapioca//lib/tapioca/gemfile.rb#282 sig { params(path: ::String).returns(T::Boolean) } def has_parent_gemspec?(path); end - # source://tapioca//lib/tapioca/gemfile.rb#258 + # source://tapioca//lib/tapioca/gemfile.rb#252 sig { returns(::Regexp) } def require_paths_prefix_matcher; end - # source://tapioca//lib/tapioca/gemfile.rb#270 + # source://tapioca//lib/tapioca/gemfile.rb#261 sig { params(file: ::String).returns(::Pathname) } def resolve_to_ruby_lib_dir(file); end - # source://tapioca//lib/tapioca/gemfile.rb#284 + # source://tapioca//lib/tapioca/gemfile.rb#275 sig { returns(::String) } def version_string; end @@ -2401,13 +2340,13 @@ class Tapioca::Gemfile::GemSpec end end -# source://tapioca//lib/tapioca/gemfile.rb#125 +# source://tapioca//lib/tapioca/gemfile.rb#122 Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array) # source://tapioca//lib/tapioca/gemfile.rb#10 Tapioca::Gemfile::Spec = T.type_alias { T.any(::Bundler::StubSpecification, ::Gem::Specification) } -# source://tapioca//lib/tapioca.rb#33 +# source://tapioca//lib/tapioca.rb#29 Tapioca::LIB_ROOT_DIR = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/loaders/loader.rb#5 @@ -2415,7 +2354,7 @@ module Tapioca::Loaders; end # source://tapioca//lib/tapioca/loaders/dsl.rb#6 class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader - # source://tapioca//lib/tapioca/loaders/dsl.rb#74 + # source://tapioca//lib/tapioca/loaders/dsl.rb#66 sig do params( tapioca_path: ::String, @@ -2426,40 +2365,40 @@ class Tapioca::Loaders::Dsl < ::Tapioca::Loaders::Loader end def initialize(tapioca_path:, eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/loaders/dsl.rb#36 + # source://tapioca//lib/tapioca/loaders/dsl.rb#30 sig { override.void } def load; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#43 + # source://tapioca//lib/tapioca/loaders/dsl.rb#37 sig { void } def load_dsl_extensions_and_compilers; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#49 + # source://tapioca//lib/tapioca/loaders/dsl.rb#43 sig { void } def reload_custom_compilers; end protected - # source://tapioca//lib/tapioca/loaders/dsl.rb#120 + # source://tapioca//lib/tapioca/loaders/dsl.rb#112 sig { void } def load_application; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#100 + # source://tapioca//lib/tapioca/loaders/dsl.rb#92 sig { void } def load_dsl_compilers; end - # source://tapioca//lib/tapioca/loaders/dsl.rb#85 + # source://tapioca//lib/tapioca/loaders/dsl.rb#77 sig { void } def load_dsl_extensions; end private - # source://tapioca//lib/tapioca/loaders/dsl.rb#136 + # source://tapioca//lib/tapioca/loaders/dsl.rb#128 sig { void } def load_custom_dsl_compilers; end class << self - # source://tapioca//lib/tapioca/loaders/dsl.rb#20 + # source://tapioca//lib/tapioca/loaders/dsl.rb#13 sig do params( tapioca_path: ::String, @@ -2474,7 +2413,7 @@ end # source://tapioca//lib/tapioca/loaders/gem.rb#6 class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader - # source://tapioca//lib/tapioca/loaders/gem.rb#49 + # source://tapioca//lib/tapioca/loaders/gem.rb#34 sig do params( bundle: ::Tapioca::Gemfile, @@ -2486,22 +2425,22 @@ class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader end def initialize(bundle:, prerequire:, postrequire:, default_command:, halt_upon_load_error:); end - # source://tapioca//lib/tapioca/loaders/gem.rb#34 + # source://tapioca//lib/tapioca/loaders/gem.rb#27 sig { override.void } def load; end protected - # source://tapioca//lib/tapioca/loaders/gem.rb#80 + # source://tapioca//lib/tapioca/loaders/gem.rb#65 sig { params(file: ::String, error: ::LoadError).void } def explain_failed_require(file, error); end - # source://tapioca//lib/tapioca/loaders/gem.rb#60 + # source://tapioca//lib/tapioca/loaders/gem.rb#45 sig { void } def require_gem_file; end class << self - # source://tapioca//lib/tapioca/loaders/gem.rb#21 + # source://tapioca//lib/tapioca/loaders/gem.rb#13 sig do params( bundle: ::Tapioca::Gemfile, @@ -2515,7 +2454,7 @@ class Tapioca::Loaders::Gem < ::Tapioca::Loaders::Loader end end -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# @abstract # # source://tapioca//lib/tapioca/loaders/loader.rb#6 class Tapioca::Loaders::Loader @@ -2530,8 +2469,9 @@ class Tapioca::Loaders::Loader abstract! # @abstract + # @raise [NotImplementedError] # - # source://tapioca//lib/tapioca/loaders/loader.rb#17 + # source://tapioca//lib/tapioca/loaders/loader.rb#18 sig { abstract.void } def load; end @@ -2542,22 +2482,17 @@ class Tapioca::Loaders::Loader # engine paths. The following commit is the change: # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664 # - # @param engine [T.class_of(Rails::Engine)] - # @return [Array] - # - # source://tapioca//lib/tapioca/loaders/loader.rb#234 + # source://tapioca//lib/tapioca/loaders/loader.rb#219 def eager_load_paths(engine); end - # source://tapioca//lib/tapioca/loaders/loader.rb#199 + # source://tapioca//lib/tapioca/loaders/loader.rb#183 sig { void } def eager_load_rails_app; end - # @return [Array] - # - # source://tapioca//lib/tapioca/loaders/loader.rb#178 + # source://tapioca//lib/tapioca/loaders/loader.rb#162 def engines; end - # source://tapioca//lib/tapioca/loaders/loader.rb#29 + # source://tapioca//lib/tapioca/loaders/loader.rb#23 sig do params( gemfile: ::Tapioca::Gemfile, @@ -2568,15 +2503,15 @@ class Tapioca::Loaders::Loader end def load_bundle(gemfile, initialize_file, require_file, halt_upon_load_error); end - # source://tapioca//lib/tapioca/loaders/loader.rb#136 + # source://tapioca//lib/tapioca/loaders/loader.rb#119 sig { void } def load_engines_in_classic_mode; end - # source://tapioca//lib/tapioca/loaders/loader.rb#114 + # source://tapioca//lib/tapioca/loaders/loader.rb#101 sig { void } def load_engines_in_zeitwerk_mode; end - # source://tapioca//lib/tapioca/loaders/loader.rb#49 + # source://tapioca//lib/tapioca/loaders/loader.rb#36 sig do params( environment_load: T::Boolean, @@ -2587,26 +2522,26 @@ class Tapioca::Loaders::Loader end def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil), app_root: T.unsafe(nil), halt_upon_load_error: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/loaders/loader.rb#89 + # source://tapioca//lib/tapioca/loaders/loader.rb#76 sig { void } def load_rails_engines; end - # source://tapioca//lib/tapioca/loaders/loader.rb#220 + # source://tapioca//lib/tapioca/loaders/loader.rb#204 sig { params(file: T.nilable(::String)).void } def require_helper(file); end - # source://tapioca//lib/tapioca/loaders/loader.rb#103 + # source://tapioca//lib/tapioca/loaders/loader.rb#90 def run_initializers; end - # source://tapioca//lib/tapioca/loaders/loader.rb#192 + # source://tapioca//lib/tapioca/loaders/loader.rb#176 sig { params(path: ::String).void } def safe_require(path); end - # source://tapioca//lib/tapioca/loaders/loader.rb#161 + # source://tapioca//lib/tapioca/loaders/loader.rb#144 sig { params(blk: T.proc.void).void } def with_rails_application(&blk); end - # source://tapioca//lib/tapioca/loaders/loader.rb#154 + # source://tapioca//lib/tapioca/loaders/loader.rb#137 sig { returns(T::Boolean) } def zeitwerk_mode?; end end @@ -2616,7 +2551,7 @@ module Tapioca::RBIFilesHelper requires_ancestor { Tapioca::SorbetHelper } requires_ancestor { Thor::Shell } - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#48 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#43 sig do params( index: ::RBI::Index, @@ -2626,19 +2561,19 @@ module Tapioca::RBIFilesHelper end def duplicated_nodes_from_index(index, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#13 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#14 sig { params(index: ::RBI::Index, kind: ::String, file: ::String).void } def index_rbi(index, kind, file); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#25 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#26 sig { params(index: ::RBI::Index, kind: ::String, dir: ::String, number_of_workers: T.nilable(::Integer)).void } def index_rbis(index, kind, dir, number_of_workers:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#65 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#60 sig { params(loc: ::RBI::Loc, path_prefix: T.nilable(::String)).returns(::String) } def location_to_payload_url(loc, path_prefix:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#86 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#72 sig do params( command: ::String, @@ -2653,27 +2588,11 @@ module Tapioca::RBIFilesHelper private - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#223 - sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[::RBI::Scope]) } - def extract_empty_scopes(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#228 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#250 sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) } def extract_methods_and_attrs(nodes); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#238 - sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Mixin, ::RBI::RequiresAncestor)]) } - def extract_mixins(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#248 - sig do - params( - nodes: T::Array[T.any(::RBI::Attr, ::RBI::Method)] - ).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) - end - def extract_nodes_with_sigs(nodes); end - - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#216 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#243 sig do params( nodes: T::Array[::RBI::Node], @@ -2683,30 +2602,44 @@ module Tapioca::RBIFilesHelper end def extract_shims_and_todos(nodes, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#280 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#287 sig { params(path: ::String).returns(::String) } def gem_name_from_rbi_path(path); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#155 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#211 + sig { params(nodes: T::Array[::RBI::Node], shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_methods_and_attrs?(nodes, shims_or_todos); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#203 + sig { params(shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_mixins?(shims_or_todos); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#175 + sig { params(all_nodes: T::Array[::RBI::Node], shims_or_todos: T::Array[::RBI::Node]).returns(T::Boolean) } + def has_duplicated_scopes?(all_nodes, shims_or_todos); end + + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#141 sig { params(index: ::RBI::Index, files: T::Array[::String], number_of_workers: T.nilable(::Integer)).void } def parse_and_index_files(index, files, number_of_workers:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#171 + # Do the list of `nodes` sharing the same name have duplicates? + # + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#158 sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String, todo_rbi_file: ::String).returns(T::Boolean) } def shims_or_todos_have_duplicates?(nodes, shim_rbi_dir:, todo_rbi_file:); end - # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#253 + # source://tapioca//lib/tapioca/helpers/rbi_files_helper.rb#260 sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error], gem_dir: ::String).void } def update_gem_rbis_strictnesses(errors, gem_dir); end end # source://tapioca//lib/tapioca/rbi_formatter.rb#5 class Tapioca::RBIFormatter < ::RBI::Formatter - # source://tapioca//lib/tapioca/rbi_formatter.rb#24 + # source://tapioca//lib/tapioca/rbi_formatter.rb#18 sig { params(file: ::RBI::File).void } def write_empty_body_comment!(file); end - # source://tapioca//lib/tapioca/rbi_formatter.rb#15 + # source://tapioca//lib/tapioca/rbi_formatter.rb#9 sig { params(file: ::RBI::File, command: ::String, reason: T.nilable(::String)).void } def write_header!(file, command, reason: T.unsafe(nil)); end end @@ -2717,60 +2650,60 @@ module Tapioca::RBIHelper extend ::Tapioca::SorbetHelper extend ::Tapioca::RBIHelper - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#91 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#83 sig { params(type: ::String).returns(::String) } def as_nilable_type(type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#100 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#92 sig { params(type: ::String).returns(::String) } def as_non_nilable_type(type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#72 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#64 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_block_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#62 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#54 sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } def create_kw_opt_param(name, type:, default:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#57 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#49 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_kw_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#67 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#59 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_kw_rest_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#47 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#39 sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) } def create_opt_param(name, type:, default:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#42 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#34 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#52 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#44 sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) } def create_rest_param(name, type:); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#77 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#69 sig { params(param: ::RBI::Param, type: ::String).returns(::RBI::TypedParam) } def create_typed_param(param, type); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#82 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#74 sig { params(sig_string: ::String).returns(::String) } def sanitize_signature_types(sig_string); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#109 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#101 sig { params(name: ::String).returns(T::Boolean) } def valid_method_name?(name); end - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#114 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#106 sig { params(name: ::String).returns(T::Boolean) } def valid_parameter_name?(name); end class << self - # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#23 + # source://tapioca//lib/tapioca/helpers/rbi_helper.rb#15 sig do params( type: ::String, @@ -2786,29 +2719,29 @@ end # source://tapioca//lib/tapioca/repo_index.rb#5 class Tapioca::RepoIndex - # source://tapioca//lib/tapioca/repo_index.rb#26 + # source://tapioca//lib/tapioca/repo_index.rb#24 sig { void } def initialize; end - # source://tapioca//lib/tapioca/repo_index.rb#31 + # source://tapioca//lib/tapioca/repo_index.rb#29 sig { params(gem_name: ::String).void } def <<(gem_name); end - # source://tapioca//lib/tapioca/repo_index.rb#36 + # source://tapioca//lib/tapioca/repo_index.rb#34 sig { returns(T::Enumerable[::String]) } def gems; end - # source://tapioca//lib/tapioca/repo_index.rb#41 + # source://tapioca//lib/tapioca/repo_index.rb#39 sig { params(gem_name: ::String).returns(T::Boolean) } def has_gem?(gem_name); end class << self - # source://tapioca//lib/tapioca/repo_index.rb#18 - sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(Tapioca::RepoIndex) } + # source://tapioca//lib/tapioca/repo_index.rb#16 + sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(::Tapioca::RepoIndex) } def from_hash(hash); end - # source://tapioca//lib/tapioca/repo_index.rb#13 - sig { params(json: ::String).returns(Tapioca::RepoIndex) } + # source://tapioca//lib/tapioca/repo_index.rb#11 + sig { params(json: ::String).returns(::Tapioca::RepoIndex) } def from_json(json); end end end @@ -2822,7 +2755,6 @@ module Tapioca::Runtime; end # class by iterating through ObjectSpace. module Tapioca::Runtime::AttachedClassOf # source://tapioca//lib/tapioca/runtime/attached_class_of_32.rb#14 - sig { params(singleton_class: ::Class).returns(T.nilable(::Module)) } def attached_class_of(singleton_class); end end @@ -2831,65 +2763,54 @@ class Tapioca::Runtime::DynamicMixinCompiler include ::Tapioca::Runtime::AttachedClassOf include ::Tapioca::Runtime::Reflection + # @return [DynamicMixinCompiler] a new instance of DynamicMixinCompiler + # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#20 - sig { params(constant: ::Module).void } def initialize(constant); end - # @return [Array] - # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 def class_attribute_predicates; end # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 - sig { returns(T::Array[::Symbol]) } def class_attribute_readers; end - # @return [Array] - # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#14 def class_attribute_writers; end # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#137 - sig { params(tree: ::RBI::Tree).void } def compile_class_attributes(tree); end # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#180 - sig { params(tree: ::RBI::Tree).returns([T::Array[::Module], T::Array[::Module]]) } def compile_mixes_in_class_methods(tree); end # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 - sig { returns(T::Array[::Module]) } def dynamic_extends; end - # @return [Array] - # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#11 def dynamic_includes; end + # @return [Boolean] + # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#132 - sig { returns(T::Boolean) } def empty_attributes?; end + # @return [Boolean] + # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#222 - sig { params(qualified_mixin_name: ::String).returns(T::Boolean) } def filtered_mixin?(qualified_mixin_name); end - # @return [Array] - # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 def instance_attribute_predicates; end # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 - sig { returns(T::Array[::Symbol]) } def instance_attribute_readers; end - # @return [Array] - # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#17 def instance_attribute_writers; end + # @return [Boolean] + # # source://tapioca//lib/tapioca/runtime/dynamic_mixin_compiler.rb#215 - sig { params(mod: ::Module, dynamic_extends: T::Array[::Module]).returns(T::Boolean) } def module_included_by_another_dynamic_extend?(mod, dynamic_extends); end end @@ -2914,12 +2835,12 @@ end # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#23 module Tapioca::Runtime::GenericTypeRegistry class << self - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#80 - sig { params(instance: ::Object).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#75 def generic_type_instance?(instance); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#85 - sig { params(constant: ::Module).returns(T.nilable(T::Array[::Tapioca::TypeVariableModule])) } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#80 def lookup_type_variables(constant); end # This method is responsible for building the name of the instantiated concrete type @@ -2934,8 +2855,7 @@ module Tapioca::Runtime::GenericTypeRegistry # # This method returns the created or cached clone of the constant. # - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#65 - sig { params(constant: T.untyped, types: T.untyped).returns(::Module) } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#60 def register_type(constant, types); end # This method is called from intercepted calls to `type_member` and `type_template`. @@ -2948,34 +2868,32 @@ module Tapioca::Runtime::GenericTypeRegistry # Finally, the original `type_variable` is returned from this method, so that the caller # can return it from the original methods as well. # - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#104 - sig { params(constant: T.untyped, type_variable: ::Tapioca::TypeVariableModule).void } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#94 def register_type_variable(constant, type_variable); end private - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#113 - sig { params(constant: ::Module, name: ::String).returns(::Module) } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#103 def create_generic_type(constant, name); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#155 - sig { params(constant: T::Class[T.anything]).returns(T::Class[T.anything]) } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#145 def create_safe_subclass(constant); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#182 - sig { params(constant: ::Module).returns(T::Array[::Tapioca::TypeVariableModule]) } + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#172 def lookup_or_initialize_type_variables(constant); end end end -# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#34 +# source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#28 class Tapioca::Runtime::GenericTypeRegistry::GenericType < ::T::Types::Simple - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#38 - sig { params(raw_type: ::Module, underlying_type: ::Module).void } + # @return [GenericType] a new instance of GenericType + # + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#32 def initialize(raw_type, underlying_type); end - # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#45 - sig { override.params(obj: T.untyped).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/generic_type_registry.rb#40 def valid?(obj); end end @@ -2984,34 +2902,32 @@ module Tapioca::Runtime::Reflection extend ::Tapioca::Runtime::AttachedClassOf extend ::Tapioca::Runtime::Reflection - # source://tapioca//lib/tapioca/runtime/reflection.rb#207 - sig { params(constant: ::Module).returns(T.untyped) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#228 def abstract_type_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#77 - sig { params(constant: ::Module).returns(T::Array[::Module]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#75 def ancestors_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#92 - sig { params(object: ::BasicObject, other: ::BasicObject).returns(T::Boolean) } - def are_equal?(object, other); end - - # source://tapioca//lib/tapioca/runtime/reflection.rb#56 - sig { params(object: ::BasicObject).returns(T::Class[T.anything]) } - def class_of(object); end - - # @param constant [BasicObject] # @return [Boolean] # - # source://tapioca//lib/tapioca/runtime/reflection.rb#38 + # source://tapioca//lib/tapioca/runtime/reflection.rb#90 + def are_equal?(object, other); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#54 + def class_of(object); end + + # source://tapioca//lib/tapioca/runtime/reflection.rb#179 + def const_source_location(constant_name); end + + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#41 def constant_defined?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#49 - sig { params(symbol: ::String, inherit: T::Boolean, namespace: ::Module).returns(::BasicObject) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#47 def constantize(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#61 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#59 def constants_of(constant); end # Returns an array with all classes that are < than the supplied class. @@ -3028,57 +2944,42 @@ module Tapioca::Runtime::Reflection # class D < C; end # descendants_of(C) # => [B, A, D] # - # source://tapioca//lib/tapioca/runtime/reflection.rb#172 - sig do - type_parameters(:U) - .params( - klass: T.all(T.type_parameter(:U), T::Class[T.anything]) - ).returns(T::Array[T.type_parameter(:U)]) - end + # source://tapioca//lib/tapioca/runtime/reflection.rb#170 def descendants_of(klass); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#200 - sig { params(constant: ::Module).returns(T::Set[::String]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#221 def file_candidates_for(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#213 - sig { params(constant: ::Module).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#234 def final_module?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#112 - sig { params(constant: ::Module).returns(T::Array[::Module]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#110 def inherited_ancestors_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#150 - sig { params(constant: ::Module, method: ::Symbol).returns(::Method) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#152 def method_of(constant, method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#66 - sig { params(constant: ::Module).returns(T.nilable(::String)) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#64 def name_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#145 - sig { params(type: ::T::Types::Base).returns(::String) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#147 def name_of_type(type); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#87 - sig { params(object: ::BasicObject).returns(::Integer) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#85 def object_id_of(object); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#107 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#105 def private_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#102 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#100 def protected_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#97 - sig { params(constant: ::Module).returns(T::Array[::Symbol]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#95 def public_instance_methods_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#121 - sig { params(constant: ::Module).returns(T.nilable(::String)) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#119 def qualified_name_of(constant); end # Examines the call stack to identify the closest location where a "require" is performed @@ -3086,110 +2987,128 @@ module Tapioca::Runtime::Reflection # case of an ActiveSupport.on_load hook. If none is found, it returns the location # labeled "
", which is the original call site. # - # source://tapioca//lib/tapioca/runtime/reflection.rb#185 - sig { params(locations: T.nilable(T::Array[::Thread::Backtrace::Location])).returns(::String) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#192 def resolve_loc(locations); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#218 - sig { params(constant: ::Module).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#239 def sealed_module?(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#138 - sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#140 def signature_of(method); end # source://tapioca//lib/tapioca/runtime/reflection.rb#133 - sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) } def signature_of!(method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#72 - sig { params(constant: ::Module).returns(T::Class[T.anything]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#70 def singleton_class_of(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#82 - sig { params(constant: T::Class[T.anything]).returns(T.nilable(T::Class[T.anything])) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#80 def superclass_of(constant); end private - # source://tapioca//lib/tapioca/runtime/reflection.rb#255 - sig { params(parent: ::Module, name: ::String).returns(T.nilable(::Module)) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#276 def child_module_for_parent_with_name(parent, name); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#271 - sig { params(name: ::String).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#292 def has_aliased_namespace?(name); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#266 - sig { params(method: ::UnboundMethod).returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/runtime/reflection.rb#287 def method_defined_by_forwardable_module?(method); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#241 - sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#262 def methods_for(constant); end - # source://tapioca//lib/tapioca/runtime/reflection.rb#225 - sig { params(constant: ::Module).returns(T::Array[::UnboundMethod]) } + # source://tapioca//lib/tapioca/runtime/reflection.rb#246 def relevant_methods_for(constant); end end -# source://tapioca//lib/tapioca/runtime/reflection.rb#25 +# source://tapioca//lib/tapioca/runtime/reflection.rb#27 Tapioca::Runtime::Reflection::ANCESTORS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#21 +# source://tapioca//lib/tapioca/runtime/reflection.rb#23 Tapioca::Runtime::Reflection::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#22 +# source://tapioca//lib/tapioca/runtime/reflection.rb#24 Tapioca::Runtime::Reflection::CONSTANTS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#28 +# source://tapioca//lib/tapioca/runtime/reflection.rb#30 Tapioca::Runtime::Reflection::EQUAL_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#32 +# source://tapioca//lib/tapioca/runtime/reflection.rb#34 Tapioca::Runtime::Reflection::METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#23 +# source://tapioca//lib/tapioca/runtime/reflection.rb#25 Tapioca::Runtime::Reflection::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#27 +# source://tapioca//lib/tapioca/runtime/reflection.rb#29 Tapioca::Runtime::Reflection::OBJECT_ID_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#31 +# source://tapioca//lib/tapioca/runtime/reflection.rb#33 Tapioca::Runtime::Reflection::PRIVATE_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#30 +# source://tapioca//lib/tapioca/runtime/reflection.rb#32 Tapioca::Runtime::Reflection::PROTECTED_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#29 +# source://tapioca//lib/tapioca/runtime/reflection.rb#31 Tapioca::Runtime::Reflection::PUBLIC_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#35 +# source://tapioca//lib/tapioca/runtime/reflection.rb#37 Tapioca::Runtime::Reflection::REQUIRED_FROM_LABELS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca/runtime/reflection.rb#24 +# source://tapioca//lib/tapioca/runtime/reflection.rb#26 Tapioca::Runtime::Reflection::SINGLETON_CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) -# source://tapioca//lib/tapioca/runtime/reflection.rb#26 +# source://tapioca//lib/tapioca/runtime/reflection.rb#28 Tapioca::Runtime::Reflection::SUPERCLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod) +class Tapioca::Runtime::Reflection::SignatureBlockError < ::Tapioca::Error; end + +class Tapioca::Runtime::SourceLocation + # @return [SourceLocation] a new instance of SourceLocation + # + # source://tapioca//lib/tapioca/runtime/source_location.rb#18 + def initialize(file:, line:); end + + # source://tapioca//lib/tapioca/runtime/source_location.rb#13 + def file; end + + # source://tapioca//lib/tapioca/runtime/source_location.rb#16 + def line; end + + class << self + # source://tapioca//lib/tapioca/runtime/source_location.rb#38 + def from_loc(loc); end + + private + + def new(*_arg0); end + end +end + +# this looks something like: +# "(eval at /path/to/file.rb:123)" +# and we are interested in the "/path/to/file.rb" and "123" parts +# +# source://tapioca//lib/tapioca/runtime/source_location.rb#10 +Tapioca::Runtime::SourceLocation::EVAL_SOURCE_FILE_PATTERN = T.let(T.unsafe(nil), Regexp) + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#6 module Tapioca::Runtime::Trackers class << self - # source://tapioca//lib/tapioca/runtime/trackers.rb#34 - sig { void } + # source://tapioca//lib/tapioca/runtime/trackers.rb#30 def disable_all!; end - # source://tapioca//lib/tapioca/runtime/trackers.rb#39 - sig { params(tracker: ::Tapioca::Runtime::Trackers::Tracker).void } + # source://tapioca//lib/tapioca/runtime/trackers.rb#35 def register_tracker(tracker); end - # source://tapioca//lib/tapioca/runtime/trackers.rb#21 - sig do - type_parameters(:Return) - .params( - blk: T.proc.returns(T.type_parameter(:Return)) - ).returns(T.type_parameter(:Return)) - end + # source://tapioca//lib/tapioca/runtime/trackers.rb#17 def with_trackers_enabled(&blk); end end end @@ -3200,20 +3119,12 @@ module Tapioca::Runtime::Trackers::Autoload class << self # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#19 - sig { void } def eager_load_all!; end # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#31 - sig { params(constant_name: ::String).void } def register(constant_name); end - # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#42 - sig do - type_parameters(:Result) - .params( - block: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end + # source://tapioca//lib/tapioca/runtime/trackers/autoload.rb#38 def with_disabled_exits(&block); end end end @@ -3232,7 +3143,7 @@ module Tapioca::Runtime::Trackers::ConstantDefinition class << self # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#61 - def build_constant_location(tp, locations); end + def build_source_location(tp, locations); end # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#55 def disable!; end @@ -3241,71 +3152,57 @@ module Tapioca::Runtime::Trackers::ConstantDefinition # about situations where the class was opened prior to +require+ing, # or where metaprogramming was used via +eval+, etc. # - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#71 + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#74 def files_for(klass); end - # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#75 + # source://tapioca//lib/tapioca/runtime/trackers/constant_definition.rb#79 def locations_for(klass); end end end +# source://tapioca//lib/tapioca/runtime/trackers/method_definition.rb#7 +module Tapioca::Runtime::Trackers::MethodDefinition + extend ::Tapioca::Runtime::Trackers::Tracker + + class << self + # source://tapioca//lib/tapioca/runtime/trackers/method_definition.rb#29 + def method_definitions_for(method_name, owner); end + + # source://tapioca//lib/tapioca/runtime/trackers/method_definition.rb#15 + def register(method_name, owner, locations); end + + private + + # source://tapioca//lib/tapioca/runtime/trackers/method_definition.rb#43 + def registrations_for(method_name, owner); end + end +end + module Tapioca::Runtime::Trackers::Mixin extend ::Tapioca::Runtime::Trackers::Tracker class << self - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#56 - sig do - params( - mixin: ::Module - ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) - end + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#53 def constants_with_mixin(mixin); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#61 - sig do - params( - mixin: ::Module, - mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, - constant: ::Module - ).returns(T.nilable(::String)) - end + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#58 def mixin_location(mixin, mixin_type, constant); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#35 - sig { params(constant: ::Module, mixin: ::Module, mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type).void } + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#31 def register(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#43 + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#40 def resolve_to_attached_class(constant, mixin, mixin_type); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#30 - sig do - type_parameters(:Result) - .params( - block: T.proc.returns(T.type_parameter(:Result)) - ).returns(T.type_parameter(:Result)) - end + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#26 def with_disabled_registration(&block); end private - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#76 - sig do - params( - mixin: ::Module - ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, ::String]]) - end + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#73 def find_or_initialize_mixin_lookup(mixin); end - # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#68 - sig do - params( - constant: ::Module, - mixin: ::Module, - mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type, - location: ::String - ).void - end + # source://tapioca//lib/tapioca/runtime/trackers/mixin.rb#65 def register_with_location(constant, mixin, mixin_type, location); end end end @@ -3324,109 +3221,102 @@ module Tapioca::Runtime::Trackers::RequiredAncestor class << self # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#15 - sig { params(requiring: ::T::Helpers, block: T.proc.void).void } def register(requiring, block); end # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#23 - sig { params(mod: ::Module).returns(T::Array[T.proc.void]) } def required_ancestors_blocks_by(mod); end # source://tapioca//lib/tapioca/runtime/trackers/required_ancestor.rb#28 - sig { params(mod: ::Module).returns(T::Array[T.untyped]) } def required_ancestors_by(mod); end end end -# @abstract Subclasses must implement the `abstract` methods below. +# @abstract module Tapioca::Runtime::Trackers::Tracker - abstract! - - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#26 - sig { void } + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#23 def disable!; end # @return [Boolean] # - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#30 + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#27 def enabled?; end - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#34 + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#31 def with_disabled_tracker(&block); end class << self - # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#17 - sig { params(base: T.all(::Module, ::Tapioca::Runtime::Trackers::Tracker)).void } + # source://tapioca//lib/tapioca/runtime/trackers/tracker.rb#14 def extended(base); end end end -# source://tapioca//lib/tapioca.rb#35 +# source://tapioca//lib/tapioca.rb#31 Tapioca::SORBET_CONFIG_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#34 +# source://tapioca//lib/tapioca.rb#30 Tapioca::SORBET_DIR = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#5 module Tapioca::SorbetHelper - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#32 + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#23 sig { params(sorbet_args: ::String).returns(::Spoom::ExecResult) } def sorbet(*sorbet_args); end - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#37 + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#28 sig { returns(::String) } def sorbet_path; end - # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#44 + # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#35 sig { params(feature: ::Symbol, version: T.nilable(::Gem::Version)).returns(T::Boolean) } def sorbet_supports?(feature, version: T.unsafe(nil)); end end -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#24 +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#18 Tapioca::SorbetHelper::FEATURE_REQUIREMENTS = T.let(T.unsafe(nil), Hash) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#13 +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#10 Tapioca::SorbetHelper::SORBET_BIN = T.let(T.unsafe(nil), Pathname) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#18 +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#12 Tapioca::SorbetHelper::SORBET_EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#8 Tapioca::SorbetHelper::SORBET_GEM_SPEC = T.let(T.unsafe(nil), Gem::Specification) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#20 +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#14 Tapioca::SorbetHelper::SORBET_PAYLOAD_URL = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#22 +# source://tapioca//lib/tapioca/helpers/sorbet_helper.rb#16 Tapioca::SorbetHelper::SPOOM_CONTEXT = T.let(T.unsafe(nil), Spoom::Context) # source://tapioca//lib/tapioca/helpers/source_uri.rb#7 class Tapioca::SourceURI < ::URI::File - # source://tapioca//lib/tapioca/helpers/source_uri.rb#72 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#62 sig { params(v: T.nilable(::String)).returns(T::Boolean) } def check_host(v); end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#55 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#45 sig { returns(T.nilable(::String)) } def gem_name; end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#29 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#26 sig { returns(T.nilable(::String)) } def gem_version; end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#60 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#50 sig { returns(T.nilable(::String)) } def line_number; end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#65 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#55 sig { params(v: T.nilable(::String)).void } def set_path(v); end - # source://tapioca//lib/tapioca/helpers/source_uri.rb#84 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#74 sig { returns(::String) } def to_s; end class << self - # source://tapioca//lib/tapioca/helpers/source_uri.rb#42 + # source://tapioca//lib/tapioca/helpers/source_uri.rb#32 sig do params( gem_name: ::String, @@ -3448,7 +3338,7 @@ Tapioca::SourceURI::COMPONENT = T.let(T.unsafe(nil), Array) # handling to select a parser that doesn't emit deprecations. While it was backported to Ruby 3.1, users may # have the uri gem in their own bundle and thus not use a compatible version. # -# source://tapioca//lib/tapioca/helpers/source_uri.rb#26 +# source://tapioca//lib/tapioca/helpers/source_uri.rb#23 Tapioca::SourceURI::PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser) # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#5 @@ -3508,12 +3398,10 @@ module Tapioca::Static::SymbolLoader private - # @return [Array] - # - # source://tapioca//lib/tapioca/static/symbol_loader.rb#71 + # source://tapioca//lib/tapioca/static/symbol_loader.rb#72 def engines; end - # source://tapioca//lib/tapioca/static/symbol_loader.rb#84 + # source://tapioca//lib/tapioca/static/symbol_loader.rb#82 sig { params(input: ::String, table_type: ::String).returns(::String) } def symbol_table_json_from(input, table_type: T.unsafe(nil)); end end @@ -3547,10 +3435,10 @@ end # source://tapioca//lib/tapioca/static/symbol_table_parser.rb#9 Tapioca::Static::SymbolTableParser::SKIP_PARSE_KINDS = T.let(T.unsafe(nil), Array) -# source://tapioca//lib/tapioca.rb#37 +# source://tapioca//lib/tapioca.rb#33 Tapioca::TAPIOCA_CONFIG_FILE = T.let(T.unsafe(nil), String) -# source://tapioca//lib/tapioca.rb#36 +# source://tapioca//lib/tapioca.rb#32 Tapioca::TAPIOCA_DIR = T.let(T.unsafe(nil), String) # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#108 @@ -3574,41 +3462,31 @@ end # # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#122 class Tapioca::TypeVariableModule < ::Module - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#146 - sig do - params( - context: ::Module, - type: ::Tapioca::TypeVariableModule::Type, - variance: ::Symbol, - bounds_proc: T.nilable(T.proc.returns(T::Hash[::Symbol, T.untyped])) - ).void - end + # @return [TypeVariableModule] a new instance of TypeVariableModule + # + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#139 def initialize(context, type, variance, bounds_proc); end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#181 - sig { returns(::Tapioca::TypeVariable) } + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#175 def coerce_to_type_variable; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#161 - sig { returns(T::Boolean) } + # @return [Boolean] + # + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#155 def fixed?; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#155 - sig { returns(T.nilable(::String)) } + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#149 def name; end - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#166 - sig { returns(::String) } + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#160 def serialize; end # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#136 - sig { returns(::Tapioca::TypeVariableModule::Type) } def type; end private - # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#188 - sig { returns(T::Hash[::Symbol, T.untyped]) } + # source://tapioca//lib/tapioca/sorbet_ext/generic_name_patch.rb#182 def bounds; end end diff --git a/Library/Homebrew/sorbet/rbi/gems/vernier@1.7.1.rbi b/Library/Homebrew/sorbet/rbi/gems/vernier@1.8.0.rbi similarity index 86% rename from Library/Homebrew/sorbet/rbi/gems/vernier@1.7.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/vernier@1.8.0.rbi index a8517adef3..8680e5fbbd 100644 --- a/Library/Homebrew/sorbet/rbi/gems/vernier@1.7.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/vernier@1.8.0.rbi @@ -8,24 +8,25 @@ # source://vernier//lib/vernier/version.rb#3 module Vernier class << self + # source://vernier//lib/vernier/marker.rb#3 def memory_rss; end - # source://vernier//lib/vernier.rb#20 + # source://vernier//lib/vernier.rb#21 def profile(mode: T.unsafe(nil), **collector_options); end - # source://vernier//lib/vernier.rb#20 + # source://vernier//lib/vernier.rb#37 def run(mode: T.unsafe(nil), **collector_options); end - # source://vernier//lib/vernier.rb#41 + # source://vernier//lib/vernier.rb#42 def start_profile(mode: T.unsafe(nil), **collector_options); end - # source://vernier//lib/vernier.rb#53 + # source://vernier//lib/vernier.rb#54 def stop_profile; end - # source://vernier//lib/vernier.rb#20 + # source://vernier//lib/vernier.rb#36 def trace(mode: T.unsafe(nil), **collector_options); end - # source://vernier//lib/vernier.rb#62 + # source://vernier//lib/vernier.rb#63 def trace_retained(**profile_options, &block); end end end @@ -37,7 +38,7 @@ class Vernier::Collector # source://vernier//lib/vernier/collector.rb#8 def initialize(mode, options = T.unsafe(nil)); end - # source://vernier//lib/vernier/collector.rb#53 + # source://vernier//lib/vernier/collector.rb#54 def add_marker(name:, start:, finish:, thread: T.unsafe(nil), phase: T.unsafe(nil), data: T.unsafe(nil)); end # Get the current time. @@ -46,38 +47,45 @@ class Vernier::Collector # integer nanoseconds. It's the same time used by Vernier internals and # can be used to generate timestamps for custom markers. # - # source://vernier//lib/vernier/collector.rb#49 + # source://vernier//lib/vernier/collector.rb#50 def current_time; end # Record an interval with a category and name. Yields to a block and # records the amount of time spent in the block as an interval marker. # - # source://vernier//lib/vernier/collector.rb#65 + # source://vernier//lib/vernier/collector.rb#66 def record_interval(category, name = T.unsafe(nil)); end + # source://vernier//lib/vernier/marker.rb#3 def sample; end + + # source://vernier//lib/vernier/marker.rb#3 def stack_table; end + + # source://vernier//lib/vernier/marker.rb#3 def start; end - # source://vernier//lib/vernier/collector.rb#78 + # source://vernier//lib/vernier/collector.rb#79 def stop; end private - # source://vernier//lib/vernier/collector.rb#32 + # source://vernier//lib/vernier/collector.rb#33 def add_hook(hook); end + # source://vernier//lib/vernier/marker.rb#3 def finish; end class << self + # source://vernier//lib/vernier/marker.rb#3 def _new(_arg0, _arg1); end - # source://vernier//lib/vernier.rb#67 + # source://vernier//lib/vernier.rb#68 def new(mode, options = T.unsafe(nil)); end end end -# source://vernier//lib/vernier.rb#16 +# source://vernier//lib/vernier.rb#17 class Vernier::Error < ::StandardError; end # source://vernier//lib/vernier/hooks.rb#4 @@ -160,9 +168,16 @@ Vernier::Marker::Type::THREAD_STALLED = T.let(T.unsafe(nil), Integer) Vernier::Marker::Type::THREAD_SUSPENDED = T.let(T.unsafe(nil), Integer) class Vernier::MemoryTracker + # source://vernier//lib/vernier/marker.rb#3 def record; end + + # source://vernier//lib/vernier/marker.rb#3 def results; end + + # source://vernier//lib/vernier/marker.rb#3 def start; end + + # source://vernier//lib/vernier/marker.rb#3 def stop; end end @@ -180,6 +195,48 @@ end # source://vernier//lib/vernier/output/filename_filter.rb#4 module Vernier::Output; end +# source://vernier//lib/vernier/output/cpuprofile.rb#5 +class Vernier::Output::Cpuprofile + # @return [Cpuprofile] a new instance of Cpuprofile + # + # source://vernier//lib/vernier/output/cpuprofile.rb#6 + def initialize(profile); end + + # source://vernier//lib/vernier/output/cpuprofile.rb#10 + def output; end + + private + + # source://vernier//lib/vernier/output/cpuprofile.rb#53 + def build_nodes; end + + # source://vernier//lib/vernier/output/cpuprofile.rb#128 + def calculate_time_deltas(timestamps); end + + # source://vernier//lib/vernier/output/cpuprofile.rb#85 + def create_node_for_stack(stack_idx, nodes, stack_table); end + + # source://vernier//lib/vernier/output/cpuprofile.rb#22 + def data; end + + # source://vernier//lib/vernier/output/cpuprofile.rb#43 + def empty_profile; end + + # source://vernier//lib/vernier/output/cpuprofile.rb#18 + def ns_to_us(timestamp); end + + # Returns the value of attribute profile. + # + # source://vernier//lib/vernier/output/cpuprofile.rb#16 + def profile; end + + # source://vernier//lib/vernier/output/cpuprofile.rb#70 + def root_node; end + + # source://vernier//lib/vernier/output/cpuprofile.rb#124 + def stack_to_node_id(stack_idx); end +end + # source://vernier//lib/vernier/output/file_listing.rb#8 class Vernier::Output::FileListing # @return [FileListing] a new instance of FileListing @@ -573,13 +630,13 @@ end class Vernier::Result # Returns the value of attribute stack_table. # - # source://vernier//lib/vernier/result.rb#3 + # source://vernier//lib/vernier/result.rb#4 def _stack_table; end - # source://vernier//lib/vernier/result.rb#49 + # source://vernier//lib/vernier/result.rb#61 def each_sample; end - # source://vernier//lib/vernier/result.rb#41 + # source://vernier//lib/vernier/result.rb#53 def elapsed_seconds; end # Returns the value of attribute end_time. @@ -611,7 +668,7 @@ class Vernier::Result # source://vernier//lib/vernier/result.rb#8 def hooks=(_arg0); end - # source://vernier//lib/vernier/result.rb#45 + # source://vernier//lib/vernier/result.rb#57 def inspect; end # source://vernier//lib/vernier/result.rb#15 @@ -659,7 +716,7 @@ class Vernier::Result # source://vernier//lib/vernier/result.rb#21 def samples; end - # source://vernier//lib/vernier/result.rb#58 + # source://vernier//lib/vernier/result.rb#70 def stack(idx); end # Returns the value of attribute stack_table. @@ -691,10 +748,16 @@ class Vernier::Result # source://vernier//lib/vernier/result.rb#11 def threads=(_arg0); end + # source://vernier//lib/vernier/result.rb#37 + def to_cpuprofile; end + # source://vernier//lib/vernier/result.rb#32 + def to_firefox(gzip: T.unsafe(nil)); end + + # source://vernier//lib/vernier/result.rb#35 def to_gecko(gzip: T.unsafe(nil)); end - # source://vernier//lib/vernier/result.rb#62 + # source://vernier//lib/vernier/result.rb#74 def total_bytes; end # TODO: remove these @@ -702,28 +765,52 @@ class Vernier::Result # source://vernier//lib/vernier/result.rb#20 def weights; end - # source://vernier//lib/vernier/result.rb#36 - def write(out:); end + # source://vernier//lib/vernier/result.rb#41 + def write(out:, format: T.unsafe(nil)); end end # source://vernier//lib/vernier/stack_table.rb#4 class Vernier::StackTable include ::Vernier::StackTableHelpers + # source://vernier//lib/vernier/marker.rb#3 def convert(_arg0, _arg1); end + + # source://vernier//lib/vernier/marker.rb#3 def current_stack(*_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def frame_count; end + + # source://vernier//lib/vernier/marker.rb#3 def frame_func_idx(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def frame_line_no(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def func_count; end + + # source://vernier//lib/vernier/marker.rb#3 def func_filename(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def func_first_lineno(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def func_name(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def stack_count; end + + # source://vernier//lib/vernier/marker.rb#3 def stack_frame_idx(_arg0); end + + # source://vernier//lib/vernier/marker.rb#3 def stack_parent_idx(_arg0); end class << self + # source://vernier//lib/vernier/marker.rb#3 def new; end end end @@ -781,7 +868,7 @@ class Vernier::StackTableHelpers::Frame < ::Vernier::StackTableHelpers::BaseType # source://vernier//lib/vernier/stack_table_helpers.rb#83 def line; end - # source://vernier//lib/vernier/stack_table_helpers.rb#74 + # source://vernier//lib/vernier/stack_table_helpers.rb#76 def name; end # source://vernier//lib/vernier/stack_table_helpers.rb#87 @@ -796,7 +883,7 @@ class Vernier::StackTableHelpers::Func < ::Vernier::StackTableHelpers::BaseType # source://vernier//lib/vernier/stack_table_helpers.rb#59 def label; end - # source://vernier//lib/vernier/stack_table_helpers.rb#59 + # source://vernier//lib/vernier/stack_table_helpers.rb#62 def name; end # source://vernier//lib/vernier/stack_table_helpers.rb#68 @@ -813,7 +900,7 @@ class Vernier::StackTableHelpers::Stack < ::Vernier::StackTableHelpers::BaseType # source://vernier//lib/vernier/stack_table_helpers.rb#93 def each; end - # source://vernier//lib/vernier/stack_table_helpers.rb#93 + # source://vernier//lib/vernier/stack_table_helpers.rb#103 def each_frame; end # source://vernier//lib/vernier/stack_table_helpers.rb#123 diff --git a/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb b/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb new file mode 100644 index 0000000000..24984b3114 --- /dev/null +++ b/Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb @@ -0,0 +1,37 @@ +# typed: strict +# frozen_string_literal: true + +require_relative "../../../../global" +require "cask/config" + +module Tapioca + module Compilers + class CaskConfig < Tapioca::Dsl::Compiler + ConstantType = type_member { { fixed: Module } } + + sig { override.returns(T::Enumerable[Module]) } + def self.gather_constants = [Cask::Config] + + sig { override.void } + def decorate + root.create_module("Cask") do |mod| + mod.create_class("Config") do |klass| + Cask::Config.defaults.each do |key, value| + return_type = if key == :languages + # :languages is a `LazyObject`, so it lazily evaluates to an + # array of strings when a method is called on it. + "T::Array[String]" + elsif key.end_with?("?") + "T::Boolean" + else + value.class.to_s + end + + klass.create_method(key.to_s, return_type:, class_method: false) + end + end + end + end + end + end +end diff --git a/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb b/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb index 86760ca502..4708f0ea0f 100644 --- a/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb +++ b/Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb @@ -33,8 +33,8 @@ module Tapioca source = constant.instance_method(method_name).source.lstrip # For more info on these DSLs: # https://www.rubydoc.info/gems/rubocop-ast/RuboCop/AST/NodePattern/Macros - # https://github.com/rubocop/rubocop-ast/blob/master/lib/rubocop/ast/node_pattern.rb - # https://github.com/rubocop/rubocop-ast/blob/master/lib/rubocop/ast/node_pattern/method_definer.rb + # https://github.com/rubocop/rubocop-ast/blob/HEAD/lib/rubocop/ast/node_pattern.rb + # https://github.com/rubocop/rubocop-ast/blob/HEAD/lib/rubocop/ast/node_pattern/method_definer.rb # The type signatures below could maybe be stronger, but I only wanted to avoid errors: case source when /\Adef_node_matcher/ diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 45c0943736..eda23c283c 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -86,14 +86,15 @@ module Homebrew end shfmt_result = files.present? && shell_files.empty? - shfmt_result ||= run_shfmt(shell_files, fix:) + shfmt_result ||= run_shfmt!(shell_files, fix:) + actionlint_files = github_workflow_files if files.blank? && actionlint_files.blank? has_actionlint_workflow = actionlint_files.any? do |path| path.to_s.end_with?("/.github/workflows/actionlint.yml") end odebug "actionlint workflow detected. Skipping actionlint checks." if has_actionlint_workflow actionlint_result = files.present? && (has_actionlint_workflow || actionlint_files.empty?) - actionlint_result ||= run_actionlint(actionlint_files) + actionlint_result ||= run_actionlint!(actionlint_files) if output_type == :json Offenses.new(rubocop_result + shellcheck_result) @@ -175,7 +176,7 @@ module Homebrew # Don't show the default formatter's progress dots # on CI or if only checking a single file. - args << "--format" << "clang" if ENV["CI"] || files.count { |f| !f.directory? } == 1 + args << "--format" << "clang" if ENV["CI"] || files.one? { |f| !f.directory? } args << "--color" if Tty.color? @@ -263,7 +264,7 @@ module Homebrew end end - def self.run_shfmt(files, fix: false) + def self.run_shfmt!(files, fix: false) files = shell_scripts if files.blank? # Do not format completions and Dockerfile files.delete(HOMEBREW_REPOSITORY/"completions/bash/brew") @@ -276,7 +277,7 @@ module Homebrew $CHILD_STATUS.success? end - def self.run_actionlint(files) + def self.run_actionlint!(files) files = github_workflow_files if files.blank? # the ignore is to avoid false positives in e.g. actions, homebrew-test-bot system actionlint, "-shellcheck", shellcheck, @@ -298,7 +299,7 @@ module Homebrew def self.shell_scripts [ - HOMEBREW_ORIGINAL_BREW_FILE, + HOMEBREW_ORIGINAL_BREW_FILE.realpath, HOMEBREW_REPOSITORY/"completions/bash/brew", HOMEBREW_REPOSITORY/"Dockerfile", *HOMEBREW_REPOSITORY.glob(".devcontainer/**/*.sh"), diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 737eea4322..b70e2d7583 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -6,7 +6,7 @@ require "shellwords" require "uri" require "context" -require "extend/io" +require "readline_nonblock" require "utils/timer" # Class for running sub-processes and capturing their output and exit status. @@ -361,7 +361,7 @@ class SystemCommand readable_sources.each do |source| loop do - line = source.readline_nonblock || "" + line = ReadlineNonblock.read(source) yield(sources.fetch(source), line) end rescue EOFError diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index b2f3be5ae8..3a1a53cb44 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -128,10 +128,12 @@ module SystemConfig out.puts "#{tap_name} origin: #{tap.remote}" if tap.remote != tap.default_remote out.puts "#{tap_name} HEAD: #{tap.git_head || "(none)"}" out.puts "#{tap_name} last commit: #{tap.git_last_commit || "never"}" - out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master" + default_branches = %w[main master].freeze + out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch) end - if (json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name) && json_file.exist? + json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name + if json_file.exist? out.puts "#{tap_name} JSON: #{json_file.mtime.utc.strftime("%d %b %H:%M UTC")}" elsif !tap.installed? out.puts "#{tap_name}: N/A" @@ -194,7 +196,6 @@ module SystemConfig out.puts hardware if hardware host_software_config(out) end - alias dump_generic_verbose_config dump_verbose_config end end diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 70f7118234..9acea83252 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -5,11 +5,14 @@ require "cxxstdlib" require "options" require "json" require "development_tools" -require "extend/cachable" +require "cachable" # Rather than calling `new` directly, use one of the class methods like {Tab.create}. class AbstractTab extend Cachable + extend T::Helpers + + abstract! FILENAME = "INSTALL_RECEIPT.json" @@ -25,14 +28,34 @@ class AbstractTab sig { returns(T.nilable(T::Boolean)) } # TODO: change this to always return a boolean attr_accessor :installed_on_request - attr_accessor :homebrew_version, :tabfile, :loaded_from_api, :time, :arch, :source, :built_on + sig { returns(T.nilable(String)) } + attr_accessor :homebrew_version + + attr_accessor :tabfile, :loaded_from_api, :time, :arch, :source, :built_on # Returns the formula or cask runtime dependencies. # # @api internal attr_accessor :runtime_dependencies + sig { params(attributes: T::Hash[String, T.untyped]).void } + def initialize(attributes = {}) + @installed_as_dependency = T.let(nil, T.nilable(T::Boolean)) + @installed_on_request = T.let(nil, T.nilable(T::Boolean)) + @homebrew_version = T.let(nil, T.nilable(String)) + @tabfile = T.let(nil, T.nilable(Pathname)) + @loaded_from_api = T.let(nil, T.nilable(T::Boolean)) + @time = T.let(nil, T.nilable(Integer)) + @arch = T.let(nil, T.nilable(String)) + @source = T.let(nil, T.nilable(T::Hash[String, T.untyped])) + @built_on = T.let(nil, T.nilable(T::Hash[String, T.untyped])) + @runtime_dependencies = T.let(nil, T.nilable(T::Array[T.untyped])) + + attributes.each { |key, value| instance_variable_set(:"@#{key}", value) } + end + # Instantiates a {Tab} for a new installation of a formula or cask. + sig { params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T.attached_class) } def self.create(formula_or_cask) attributes = { "homebrew_version" => HOMEBREW_VERSION, @@ -54,6 +77,7 @@ class AbstractTab # Returns the {Tab} for a formula or cask install receipt at `path`. # # NOTE: Results are cached. + sig { params(path: T.any(Pathname, String)).returns(T.attached_class) } def self.from_file(path) cache.fetch(path) do |p| content = File.read(p) @@ -64,6 +88,7 @@ class AbstractTab end # Like {from_file}, but bypass the cache. + sig { params(content: String, path: T.any(Pathname, String)).returns(T.attached_class) } def self.from_file_content(content, path) attributes = begin JSON.parse(content) @@ -75,6 +100,7 @@ class AbstractTab new(attributes) end + sig { returns(T.attached_class) } def self.empty attributes = { "homebrew_version" => HOMEBREW_VERSION, @@ -107,11 +133,9 @@ class AbstractTab end private_class_method :formula_to_dep_hash - def initialize(attributes = {}) - attributes.each { |key, value| instance_variable_set(:"@#{key}", value) } - end - + sig { returns(Version) } def parsed_homebrew_version + homebrew_version = self.homebrew_version return Version::NULL if homebrew_version.nil? Version.new(homebrew_version) @@ -123,11 +147,13 @@ class AbstractTab Tap.fetch(tap_name) if tap_name end + sig { params(tap: T.nilable(T.any(Tap, String))).void } def tap=(tap) - tap_name = tap.respond_to?(:name) ? tap.name : tap + tap_name = tap.is_a?(Tap) ? tap.name : tap source["tap"] = tap_name end + sig { void } def write self.class.cache[tabfile] = self tabfile.atomic_write(to_json) @@ -144,8 +170,30 @@ class Tab < AbstractTab attr_writer :used_options, :unused_options, :compiler, :source_modified_time attr_reader :tapped_from + sig { params(attributes: T::Hash[String, T.untyped]).void } + def initialize(attributes = {}) + @poured_from_bottle = T.let(nil, T.nilable(T::Boolean)) + @built_as_bottle = T.let(nil, T.nilable(T::Boolean)) + @changed_files = T.let(nil, T.nilable(T::Array[Pathname])) + @stdlib = T.let(nil, T.nilable(String)) + @aliases = T.let(nil, T.nilable(T::Array[String])) + @used_options = T.let(nil, T.nilable(T::Array[String])) + @unused_options = T.let(nil, T.nilable(T::Array[String])) + @compiler = T.let(nil, T.nilable(String)) + @source_modified_time = T.let(nil, T.nilable(Integer)) + @tapped_from = T.let(nil, T.nilable(String)) + + super + end + # Instantiates a {Tab} for a new installation of a formula. - def self.create(formula, compiler, stdlib) + sig { + override.params(formula_or_cask: T.any(Formula, Cask::Cask), compiler: T.any(Symbol, String), + stdlib: T.nilable(T.any(String, Symbol))).returns(T.attached_class) + } + def self.create(formula_or_cask, compiler = DevelopmentTools.default_compiler, stdlib = nil) + formula = T.cast(formula_or_cask, Formula) + tab = super(formula) build = formula.build runtime_deps = formula.runtime_dependencies(undeclared: false) @@ -172,10 +220,10 @@ class Tab < AbstractTab end # Like {from_file}, but bypass the cache. + sig { params(content: String, path: T.any(Pathname, String)).returns(T.attached_class) } def self.from_file_content(content, path) tab = super - tab.source_modified_time ||= 0 tab.source ||= {} tab.tap = tab.tapped_from if !tab.tapped_from.nil? && tab.tapped_from != "path or URL" @@ -220,6 +268,7 @@ class Tab < AbstractTab # Returns a {Tab} for the named formula's installation, # or a fake one if the formula is not installed. + sig { params(name: String).returns(T.attached_class) } def self.for_name(name) for_formula(Formulary.factory(name)) end @@ -237,6 +286,7 @@ class Tab < AbstractTab # Returns a {Tab} for an already installed formula, # or a fake one if the formula is not installed. + sig { params(formula: Formula).returns(T.attached_class) } def self.for_formula(formula) paths = [] @@ -276,6 +326,7 @@ class Tab < AbstractTab tab end + sig { returns(T.attached_class) } def self.empty tab = super @@ -293,6 +344,7 @@ class Tab < AbstractTab tab end + sig { returns(T::Hash[String, T.untyped]) } def self.empty_source_versions { "stable" => nil, @@ -308,6 +360,7 @@ class Tab < AbstractTab end end + sig { returns(T::Boolean) } def any_args_or_options? !used_options.empty? || !unused_options.empty? end @@ -324,14 +377,17 @@ class Tab < AbstractTab !with?(val) end + sig { params(opt: String).returns(T::Boolean) } def include?(opt) used_options.include? opt end + sig { returns(T::Boolean) } def head? spec == :head end + sig { returns(T::Boolean) } def stable? spec == :stable end @@ -344,10 +400,12 @@ class Tab < AbstractTab Options.create(@used_options) end + sig { returns(Options) } def unused_options Options.create(@unused_options) end + sig { returns(T.any(String, Symbol)) } def compiler @compiler || DevelopmentTools.default_compiler end @@ -358,36 +416,44 @@ class Tab < AbstractTab @runtime_dependencies if parsed_homebrew_version >= "1.1.6" end + sig { returns(CxxStdlib) } def cxxstdlib # Older tabs won't have these values, so provide sensible defaults lib = stdlib.to_sym if stdlib CxxStdlib.create(lib, compiler.to_sym) end + sig { returns(T::Boolean) } def built_bottle? built_as_bottle && !poured_from_bottle end + sig { returns(T::Boolean) } def bottle? built_as_bottle end + sig { returns(Symbol) } def spec source["spec"].to_sym end + sig { returns(T::Hash[String, T.untyped]) } def versions source["versions"] end + sig { returns(T.nilable(Version)) } def stable_version versions["stable"]&.then { Version.new(_1) } end + sig { returns(T.nilable(Version)) } def head_version versions["head"]&.then { Version.new(_1) } end + sig { returns(Integer) } def version_scheme versions["version_scheme"] || 0 end @@ -397,6 +463,7 @@ class Tab < AbstractTab Time.at(@source_modified_time || 0) end + sig { params(options: T.nilable(T::Hash[String, T.untyped])).returns(String) } def to_json(options = nil) attributes = { "homebrew_version" => homebrew_version, @@ -411,7 +478,7 @@ class Tab < AbstractTab "time" => time, "source_modified_time" => source_modified_time.to_i, "stdlib" => stdlib&.to_s, - "compiler" => compiler&.to_s, + "compiler" => compiler.to_s, "aliases" => aliases, "runtime_dependencies" => runtime_dependencies, "source" => source, @@ -424,13 +491,14 @@ class Tab < AbstractTab end # A subset of to_json that we care about for bottles. + sig { returns(T::Hash[String, T.untyped]) } def to_bottle_hash attributes = { "homebrew_version" => homebrew_version, "changed_files" => changed_files&.map(&:to_s), "source_modified_time" => source_modified_time.to_i, "stdlib" => stdlib&.to_s, - "compiler" => compiler&.to_s, + "compiler" => compiler.to_s, "runtime_dependencies" => runtime_dependencies, "arch" => arch, "built_on" => built_on, @@ -439,6 +507,7 @@ class Tab < AbstractTab attributes end + sig { void } def write # If this is a new installation, the cache of installed formulae # will no longer be valid. diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 1b487f52fa..31c36dbc04 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -590,8 +590,9 @@ class Tap end return unless remote - current_upstream_head = T.must(git_repository.origin_branch_name) - return if requested_remote.blank? && git_repository.origin_has_branch?(current_upstream_head) + current_upstream_head = git_repository.origin_branch_name + return if current_upstream_head.present? && requested_remote.blank? && + git_repository.origin_has_branch?(current_upstream_head) args = %w[fetch] args << "--quiet" if quiet @@ -600,6 +601,8 @@ class Tap safe_system "git", "-C", path, *args git_repository.set_head_origin_auto + current_upstream_head ||= T.must(git_repository.origin_branch_name) + new_upstream_head = T.must(git_repository.origin_branch_name) return if new_upstream_head == current_upstream_head @@ -985,19 +988,20 @@ class Tap # Array with autobump names sig { returns(T::Array[String]) } def autobump - # TODO: uncomment when official taps are prepared to use new autobump system - # - # autobump_packages = if core_cask_tap? - # Homebrew::API::Cask.all_casks - # elsif core_tap? - # Homebrew::API::Formula.all_formulae - # else - # {} - # end - # - # @autobump ||= autobump_packages.select do |_, p| - # p["autobump"] == true && !p["skip_livecheck"] && !(p["deprecated"] || p["disabled"]) - # end.keys + autobump_packages = if core_cask_tap? + Homebrew::API::Cask.all_casks + elsif core_tap? + Homebrew::API::Formula.all_formulae + else + {} + end + + @autobump ||= autobump_packages.select do |_, p| + next if p["deprecated"] || p["disabled"] + next if p["skip_livecheck"] + + p["autobump"] == true + end.keys if @autobump.blank? @autobump = if (autobump_file = path/HOMEBREW_TAP_AUTOBUMP_FILE).file? @@ -1076,15 +1080,12 @@ class Tap # All locally installed and core taps. Core taps might not be installed locally when using the API. sig { returns(T::Array[Tap]) } def self.all - cache[:all] ||= begin - core_taps = [ - CoreTap.instance, - # The conditional is valid here because we only want the cask tap on macOS. - (CoreCaskTap.instance if OS.mac?), # rubocop:disable Homebrew/MoveToExtendOS - ].compact + cache[:all] ||= installed | core_taps + end - installed | core_taps - end + sig { returns(T::Array[Tap]) } + def self.core_taps + [CoreTap.instance].freeze end # Enumerate all available {Tap}s. @@ -1514,3 +1515,5 @@ class TapConfig Homebrew::Settings.delete key, repo: tap.path end end + +require "extend/os/tap" diff --git a/Library/Homebrew/test/.brew-aliases/foo b/Library/Homebrew/test/.brew-aliases/foo deleted file mode 100755 index 2e3286c7a0..0000000000 --- a/Library/Homebrew/test/.brew-aliases/foo +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -# alias: brew foo -#: * `foo` [args...] -#: `brew foo` is an alias for `brew bar` -brew bar $* - diff --git a/Library/Homebrew/test/.brew-aliases/foo_test b/Library/Homebrew/test/.brew-aliases/foo_test new file mode 100755 index 0000000000..9c0e400370 --- /dev/null +++ b/Library/Homebrew/test/.brew-aliases/foo_test @@ -0,0 +1,6 @@ +#! /bin/bash +# alias: brew foo-test +#: * `foo-test` [args...] +#: `brew foo-test` is an alias for `brew bar` +brew bar $* + diff --git a/Library/Homebrew/test/api/cask_spec.rb b/Library/Homebrew/test/api/cask_spec.rb index 932897dbe8..372027293f 100644 --- a/Library/Homebrew/test/api/cask_spec.rb +++ b/Library/Homebrew/test/api/cask_spec.rb @@ -54,6 +54,7 @@ RSpec.describe Homebrew::API::Cask do end before do + allow(Homebrew::API).to receive(:fetch_json_api_file).and_return([[], true]) allow_any_instance_of(Homebrew::API::Download).to receive(:fetch) allow_any_instance_of(Homebrew::API::Download).to receive(:symlink_location).and_return( TEST_FIXTURE_DIR/"cask/Casks/everything.rb", diff --git a/Library/Homebrew/test/api_spec.rb b/Library/Homebrew/test/api_spec.rb index 9186fc625c..dbf590f73d 100644 --- a/Library/Homebrew/test/api_spec.rb +++ b/Library/Homebrew/test/api_spec.rb @@ -90,4 +90,84 @@ RSpec.describe Homebrew::API do end end end + + describe "::merge_variations" do + let(:arm64_sequoia_tag) { Utils::Bottles::Tag.new(system: :sequoia, arch: :arm) } + let(:sonoma_tag) { Utils::Bottles::Tag.new(system: :sonoma, arch: :intel) } + let(:x86_64_linux_tag) { Utils::Bottles::Tag.new(system: :linux, arch: :intel) } + + let(:json) do + { + "name" => "foo", + "foo" => "bar", + "baz" => ["test1", "test2"], + "variations" => { + "arm64_sequoia" => { "foo" => "new" }, + :sonoma => { "baz" => ["new1", "new2", "new3"] }, + }, + } + end + + let(:arm64_sequoia_result) do + { + "name" => "foo", + "foo" => "new", + "baz" => ["test1", "test2"], + } + end + + let(:sonoma_result) do + { + "name" => "foo", + "foo" => "bar", + "baz" => ["new1", "new2", "new3"], + } + end + + it "returns the original JSON if no variations are found" do + result = described_class.merge_variations(arm64_sequoia_result, bottle_tag: arm64_sequoia_tag) + expect(result).to eq arm64_sequoia_result + end + + it "returns the original JSON if no variations are found for the current system" do + result = described_class.merge_variations(arm64_sequoia_result) + expect(result).to eq arm64_sequoia_result + end + + it "returns the original JSON without the variations if no matching variation is found" do + result = described_class.merge_variations(json, bottle_tag: x86_64_linux_tag) + expect(result).to eq json.except("variations") + end + + it "returns the original JSON without the variations if no matching variation is found for the current system" do + Homebrew::SimulateSystem.with(os: :linux, arch: :intel) do + result = described_class.merge_variations(json) + expect(result).to eq json.except("variations") + end + end + + it "returns the JSON with the matching variation applied from a string key" do + result = described_class.merge_variations(json, bottle_tag: arm64_sequoia_tag) + expect(result).to eq arm64_sequoia_result + end + + it "returns the JSON with the matching variation applied from a string key for the current system" do + Homebrew::SimulateSystem.with(os: :sequoia, arch: :arm) do + result = described_class.merge_variations(json) + expect(result).to eq arm64_sequoia_result + end + end + + it "returns the JSON with the matching variation applied from a symbol key" do + result = described_class.merge_variations(json, bottle_tag: sonoma_tag) + expect(result).to eq sonoma_result + end + + it "returns the JSON with the matching variation applied from a symbol key for the current system" do + Homebrew::SimulateSystem.with(os: :sonoma, arch: :intel) do + result = described_class.merge_variations(json) + expect(result).to eq sonoma_result + end + end + end end diff --git a/Library/Homebrew/test/bundle/cask_dumper_spec.rb b/Library/Homebrew/test/bundle/cask_dumper_spec.rb index 857176b1d5..c9518ee92c 100644 --- a/Library/Homebrew/test/bundle/cask_dumper_spec.rb +++ b/Library/Homebrew/test/bundle/cask_dumper_spec.rb @@ -95,6 +95,27 @@ RSpec.describe Homebrew::Bundle::CaskDumper do end end + describe "#cask_oldnames" do + before do + described_class.reset! + end + + it "returns an empty string when no casks are installed" do + expect(dumper.cask_oldnames).to eql({}) + end + + it "returns a hash with installed casks old names" do + foo = instance_double(Cask::Cask, to_s: "foo", old_tokens: ["oldfoo"], full_name: "qux/quuz/foo") + bar = instance_double(Cask::Cask, to_s: "bar", old_tokens: [], full_name: "bar") + allow(Cask::Caskroom).to receive(:casks).and_return([foo, bar]) + allow(Homebrew::Bundle).to receive(:cask_installed?).and_return(true) + expect(dumper.cask_oldnames).to eql({ + "qux/quuz/oldfoo" => "qux/quuz/foo", + "oldfoo" => "qux/quuz/foo", + }) + end + end + describe "#formula_dependencies" do context "when the given casks don't have formula dependencies" do before do diff --git a/Library/Homebrew/test/bundle/cask_installer_spec.rb b/Library/Homebrew/test/bundle/cask_installer_spec.rb index 280ded80c4..4d5d9ca1b0 100644 --- a/Library/Homebrew/test/bundle/cask_installer_spec.rb +++ b/Library/Homebrew/test/bundle/cask_installer_spec.rb @@ -55,7 +55,7 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do it "skips" do expect(Homebrew::Bundle).not_to receive(:system) - expect(described_class.preinstall("google-chrome")).to be(false) + expect(described_class.preinstall!("google-chrome")).to be(false) end end @@ -69,8 +69,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "google-chrome", verbose: false) .and_return(true) - expect(described_class.preinstall("google-chrome")).to be(true) - expect(described_class.install("google-chrome")).to be(true) + expect(described_class.preinstall!("google-chrome")).to be(true) + expect(described_class.install!("google-chrome")).to be(true) end end @@ -85,8 +85,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--cask", "opera", verbose: false) .and_return(true) - expect(described_class.preinstall("opera", greedy: true)).to be(true) - expect(described_class.install("opera", greedy: true)).to be(true) + expect(described_class.preinstall!("opera", greedy: true)).to be(true) + expect(described_class.install!("opera", greedy: true)).to be(true) end end @@ -99,8 +99,8 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt", verbose: false) .and_return(true) - expect(described_class.preinstall("google-chrome")).to be(true) - expect(described_class.install("google-chrome")).to be(true) + expect(described_class.preinstall!("google-chrome")).to be(true) + expect(described_class.install!("google-chrome")).to be(true) end it "installs cask with arguments" do @@ -109,16 +109,16 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do verbose: false) .and_return(true), ) - expect(described_class.preinstall("firefox", args: { appdir: "/Applications" })).to be(true) - expect(described_class.install("firefox", args: { appdir: "/Applications" })).to be(true) + expect(described_class.preinstall!("firefox", args: { appdir: "/Applications" })).to be(true) + expect(described_class.install!("firefox", args: { appdir: "/Applications" })).to be(true) end it "reports a failure" do expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "google-chrome", "--adopt", verbose: false) .and_return(false) - expect(described_class.preinstall("google-chrome")).to be(true) - expect(described_class.install("google-chrome")).to be(false) + expect(described_class.preinstall!("google-chrome")).to be(true) + expect(described_class.install!("google-chrome")).to be(false) end context "with boolean arguments" do @@ -126,15 +126,15 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--force", verbose: false) .and_return(true) - expect(described_class.preinstall("iterm", args: { force: true })).to be(true) - expect(described_class.install("iterm", args: { force: true })).to be(true) + expect(described_class.preinstall!("iterm", args: { force: true })).to be(true) + expect(described_class.install!("iterm", args: { force: true })).to be(true) end it "does not include a flag if false" do expect(Homebrew::Bundle).to receive(:brew).with("install", "--cask", "iterm", "--adopt", verbose: false) .and_return(true) - expect(described_class.preinstall("iterm", args: { force: false })).to be(true) - expect(described_class.install("iterm", args: { force: false })).to be(true) + expect(described_class.preinstall!("iterm", args: { force: false })).to be(true) + expect(described_class.install!("iterm", args: { force: false })).to be(true) end end end @@ -150,14 +150,14 @@ RSpec.describe Homebrew::Bundle::CaskInstaller do it "runs the postinstall command" do expect(Kernel).to receive(:system).with("custom command").and_return(true) - expect(described_class.preinstall("google-chrome", postinstall: "custom command")).to be(true) - expect(described_class.install("google-chrome", postinstall: "custom command")).to be(true) + expect(described_class.preinstall!("google-chrome", postinstall: "custom command")).to be(true) + expect(described_class.install!("google-chrome", postinstall: "custom command")).to be(true) end it "reports a failure when postinstall fails" do expect(Kernel).to receive(:system).with("custom command").and_return(false) - expect(described_class.preinstall("google-chrome", postinstall: "custom command")).to be(true) - expect(described_class.install("google-chrome", postinstall: "custom command")).to be(false) + expect(described_class.preinstall!("google-chrome", postinstall: "custom command")).to be(true) + expect(described_class.install!("google-chrome", postinstall: "custom command")).to be(false) end end end diff --git a/Library/Homebrew/test/bundle/commands/check_spec.rb b/Library/Homebrew/test/bundle/commands/check_spec.rb index 2e62f9383c..330e26968d 100644 --- a/Library/Homebrew/test/bundle/commands/check_spec.rb +++ b/Library/Homebrew/test/bundle/commands/check_spec.rb @@ -6,13 +6,13 @@ require "bundle/brew_checker" require "bundle/cask_checker" require "bundle/mac_app_store_checker" require "bundle/vscode_extension_checker" -require "bundle/brew_installer" +require "bundle/formula_installer" require "bundle/cask_installer" require "bundle/mac_app_store_installer" require "bundle/dsl" require "bundle/skipper" -RSpec.describe Homebrew::Bundle::Commands::Check do +RSpec.describe Homebrew::Bundle::Commands::Check, :no_api do let(:do_check) do described_class.run(no_upgrade:, verbose:) end @@ -50,7 +50,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do it "raises an error" do allow(Homebrew::Bundle).to receive(:cask_installed?).and_return(true) allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("cask 'abc'") expect { do_check }.to raise_error(SystemExit) end @@ -61,7 +61,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do it "raises an error and outputs to stdout" do allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("brew 'abc'") expect { do_check }.to raise_error(SystemExit).and \ output(/brew bundle can't satisfy your Brewfile's dependencies/).to_stdout @@ -69,7 +69,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do it "partially outputs when HOMEBREW_BUNDLE_CHECK_ALREADY_OUTPUT_FORMULAE_ERRORS is set" do allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("brew 'abc'") ENV["HOMEBREW_BUNDLE_CHECK_ALREADY_OUTPUT_FORMULAE_ERRORS"] = "abc" expect { do_check }.to raise_error(SystemExit).and \ @@ -78,7 +78,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do it "does not raise error on skippable formula" do allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow(Homebrew::Bundle::Skipper).to receive(:skip?).and_return(true) allow_any_instance_of(Pathname).to receive(:read).and_return("brew 'abc'") expect { do_check }.not_to raise_error @@ -88,7 +88,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do context "when taps are not tapped" do it "raises an error" do allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("tap 'abc/def'") expect { do_check }.to raise_error(SystemExit) end @@ -97,7 +97,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do context "when apps are not installed", :needs_macos do it "raises an error" do allow(Homebrew::Bundle::MacAppStoreDumper).to receive(:app_ids).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("mas 'foo', id: 123") expect { do_check }.to raise_error(SystemExit) end @@ -118,8 +118,8 @@ RSpec.describe Homebrew::Bundle::Commands::Check do Homebrew::Bundle::Checker.reset! allow_any_instance_of(Homebrew::Bundle::Checker::MacAppStoreChecker).to \ receive(:installed_and_up_to_date?).and_return(false) - allow(Homebrew::Bundle::BrewInstaller).to receive_messages(installed_formulae: ["abc", "def"], - upgradable_formulae: []) + allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(installed_formulae: ["abc", "def"], + upgradable_formulae: []) allow(Homebrew::Bundle::BrewServices).to receive(:started?).with("abc").and_return(true) allow(Homebrew::Bundle::BrewServices).to receive(:started?).with("def").and_return(false) end @@ -128,7 +128,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do Homebrew::Bundle::Checker.reset! allow_any_instance_of(Pathname).to receive(:read).and_return("brew 'abc'") - expect(Homebrew::Bundle::BrewInstaller.installed_formulae).to include("abc") + expect(Homebrew::Bundle::FormulaInstaller.installed_formulae).to include("abc") expect(Homebrew::Bundle::CaskInstaller.installed_casks).not_to include("abc") expect(Homebrew::Bundle::BrewServices.started?("abc")).to be(true) @@ -171,7 +171,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do Homebrew::Bundle::Checker.reset! allow_any_instance_of(Homebrew::Bundle::Checker::MacAppStoreChecker).to \ receive(:installed_and_up_to_date?).and_return(false) - allow(Homebrew::Bundle::BrewInstaller).to receive(:installed_formulae).and_return(["abc", "def"]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:installed_formulae).and_return(["abc", "def"]) end it "raises an error that doesn't mention upgrade" do @@ -262,7 +262,7 @@ RSpec.describe Homebrew::Bundle::Commands::Check do context "when verbose mode is not enabled" do it "stops checking after the first missing formula" do allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([]) - allow(Homebrew::Bundle::BrewInstaller).to receive(:upgradable_formulae).and_return([]) + allow(Homebrew::Bundle::FormulaInstaller).to receive(:upgradable_formulae).and_return([]) allow_any_instance_of(Pathname).to receive(:read).and_return("brew 'abc'\nbrew 'def'") expect_any_instance_of(Homebrew::Bundle::Checker::BrewChecker).to \ diff --git a/Library/Homebrew/test/bundle/commands/cleanup_spec.rb b/Library/Homebrew/test/bundle/commands/cleanup_spec.rb index d234f07b1e..efecab654f 100644 --- a/Library/Homebrew/test/bundle/commands/cleanup_spec.rb +++ b/Library/Homebrew/test/bundle/commands/cleanup_spec.rb @@ -4,7 +4,7 @@ require "bundle" require "bundle/commands/cleanup" RSpec.describe Homebrew::Bundle::Commands::Cleanup do - describe "read Brewfile and current installation" do + describe "read Brewfile and current installation", :no_api do before do described_class.reset! @@ -38,7 +38,9 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do end it "computes which casks to uninstall" do - allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return(%w[123 456]) + cask_123 = instance_double(Cask::Cask, to_s: "123", old_tokens: []) + cask_456 = instance_double(Cask::Cask, to_s: "456", old_tokens: []) + allow(Homebrew::Bundle::CaskDumper).to receive(:casks).and_return([cask_123, cask_456]) expect(described_class.casks_to_uninstall).to eql(%w[456]) end @@ -70,7 +72,7 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do { name: "builddependency2", full_name: "builddependency2" }, { name: "caskdependency", full_name: "homebrew/tap/caskdependency" }, ].map { |formula| dependencies_arrays_hash.merge(formula) } - allow(Homebrew::Bundle::BrewDumper).to receive(:formulae).and_return(formulae_hash) + allow(Homebrew::Bundle::FormulaDumper).to receive(:formulae).and_return(formulae_hash) formulae_hash.each do |hash_formula| name = hash_formula[:name] @@ -106,7 +108,7 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do it "ignores formulae with .keepme references when computing which formulae to uninstall" do name = full_name ="c" - allow(Homebrew::Bundle::BrewDumper).to receive(:formulae).and_return([{ name:, full_name: }]) + allow(Homebrew::Bundle::FormulaDumper).to receive(:formulae).and_return([{ name:, full_name: }]) f = formula(name) { url "#{name}-1.0" } stub_formula_loader f, name @@ -158,6 +160,12 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do expect(described_class).to receive(:system_output_no_stderr).and_return("") expect { described_class.run(force: true) }.to output(/Uninstalled 2 casks/).to_stdout end + + it "does not uninstall casks if --formulae is disabled" do + expect(Kernel).not_to receive(:system) + expect(described_class).to receive(:system_output_no_stderr).and_return("") + expect { described_class.run(force: true, casks: false) }.not_to output.to_stdout + end end context "when there are casks to zap" do @@ -174,6 +182,12 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do expect(described_class).to receive(:system_output_no_stderr).and_return("") expect { described_class.run(force: true, zap: true) }.to output(/Uninstalled 2 casks/).to_stdout end + + it "does not uninstall casks if --casks is disabled" do + expect(Kernel).not_to receive(:system) + expect(described_class).to receive(:system_output_no_stderr).and_return("") + expect { described_class.run(force: true, zap: true, casks: false) }.not_to output.to_stdout + end end context "when there are formulae to uninstall" do @@ -190,6 +204,12 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do expect(described_class).to receive(:system_output_no_stderr).and_return("") expect { described_class.run(force: true) }.to output(/Uninstalled 2 formulae/).to_stdout end + + it "does not uninstall formulae if --casks is disabled" do + expect(Kernel).not_to receive(:system) + expect(described_class).to receive(:system_output_no_stderr).and_return("") + expect { described_class.run(force: true, formulae: false) }.not_to output.to_stdout + end end context "when there are taps to untap" do @@ -206,6 +226,12 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do expect(described_class).to receive(:system_output_no_stderr).and_return("") described_class.run(force: true) end + + it "does not untap taps if --taps is disabled" do + expect(Kernel).not_to receive(:system) + expect(described_class).to receive(:system_output_no_stderr).and_return("") + described_class.run(force: true, taps: false) + end end context "when there are VSCode extensions to uninstall" do @@ -223,6 +249,12 @@ RSpec.describe Homebrew::Bundle::Commands::Cleanup do expect(described_class).to receive(:system_output_no_stderr).and_return("") described_class.run(force: true) end + + it "does not uninstall extensions if --vscode is disabled" do + expect(Kernel).not_to receive(:system) + expect(described_class).to receive(:system_output_no_stderr).and_return("") + described_class.run(force: true, vscode: false) + end end context "when there are casks and formulae to uninstall and taps to untap but without passing `--force`" do diff --git a/Library/Homebrew/test/bundle/commands/dump_spec.rb b/Library/Homebrew/test/bundle/commands/dump_spec.rb index 325827fcda..e6cc083172 100644 --- a/Library/Homebrew/test/bundle/commands/dump_spec.rb +++ b/Library/Homebrew/test/bundle/commands/dump_spec.rb @@ -3,14 +3,14 @@ require "bundle" require "bundle/commands/dump" require "bundle/cask_dumper" -require "bundle/brew_dumper" +require "bundle/formula_dumper" require "bundle/tap_dumper" require "bundle/whalebrew_dumper" require "bundle/vscode_extension_dumper" RSpec.describe Homebrew::Bundle::Commands::Dump do subject(:dump) do - described_class.run(global:, file: nil, describe: false, force:, no_restart: false, taps: true, brews: true, + described_class.run(global:, file: nil, describe: false, force:, no_restart: false, taps: true, formulae: true, casks: true, mas: true, whalebrew: true, vscode: true) end @@ -19,7 +19,7 @@ RSpec.describe Homebrew::Bundle::Commands::Dump do before do Homebrew::Bundle::CaskDumper.reset! - Homebrew::Bundle::BrewDumper.reset! + Homebrew::Bundle::FormulaDumper.reset! Homebrew::Bundle::TapDumper.reset! Homebrew::Bundle::WhalebrewDumper.reset! Homebrew::Bundle::VscodeExtensionDumper.reset! @@ -39,7 +39,7 @@ RSpec.describe Homebrew::Bundle::Commands::Dump do it "exits before doing any work" do expect(Homebrew::Bundle::TapDumper).not_to receive(:dump) - expect(Homebrew::Bundle::BrewDumper).not_to receive(:dump) + expect(Homebrew::Bundle::FormulaDumper).not_to receive(:dump) expect(Homebrew::Bundle::CaskDumper).not_to receive(:dump) expect(Homebrew::Bundle::WhalebrewDumper).not_to receive(:dump) expect do diff --git a/Library/Homebrew/test/bundle/commands/exec_spec.rb b/Library/Homebrew/test/bundle/commands/exec_spec.rb index 101ab72f05..c11b989b46 100644 --- a/Library/Homebrew/test/bundle/commands/exec_spec.rb +++ b/Library/Homebrew/test/bundle/commands/exec_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Homebrew::Bundle::Commands::Exec do end end - context "when a Brewfile is found" do + context "when a Brewfile is found", :no_api do let(:brewfile_contents) { "brew 'openssl'" } before do diff --git a/Library/Homebrew/test/bundle/commands/install_spec.rb b/Library/Homebrew/test/bundle/commands/install_spec.rb index f32e3f28e3..fe1871e706 100644 --- a/Library/Homebrew/test/bundle/commands/install_spec.rb +++ b/Library/Homebrew/test/bundle/commands/install_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Homebrew::Bundle::Commands::Install do end end - context "when a Brewfile is found" do + context "when a Brewfile is found", :no_api do let(:brewfile_contents) do <<~EOS tap 'phinze/cask' @@ -28,28 +28,28 @@ RSpec.describe Homebrew::Bundle::Commands::Install do end it "does not raise an error" do - allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall).and_return(false) - allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall).and_return(false) - allow(Homebrew::Bundle::BrewInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) + allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall!).and_return(false) + allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall!).and_return(false) + allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) expect { described_class.run }.not_to raise_error end it "#dsl returns a valid DSL" do - allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall).and_return(false) - allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall).and_return(false) - allow(Homebrew::Bundle::BrewInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) + allow(Homebrew::Bundle::TapInstaller).to receive(:preinstall!).and_return(false) + allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive(:preinstall!).and_return(false) + allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) described_class.run expect(described_class.dsl.entries.first.name).to eql("phinze/cask") end it "does not raise an error when skippable" do - expect(Homebrew::Bundle::BrewInstaller).not_to receive(:install) + expect(Homebrew::Bundle::FormulaInstaller).not_to receive(:install!) allow(Homebrew::Bundle::Skipper).to receive(:skip?).and_return(true) allow_any_instance_of(Pathname).to receive(:read) @@ -58,22 +58,22 @@ RSpec.describe Homebrew::Bundle::Commands::Install do end it "exits on failures" do - allow(Homebrew::Bundle::BrewInstaller).to receive_messages(preinstall: true, install: false) - allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall: true, install: false) - allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: false) - allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall: true, install: false) - allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall: true, install: false) + allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: false) + allow(Homebrew::Bundle::CaskInstaller).to receive_messages(preinstall!: true, install!: false) + allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: false) + allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall!: true, install!: false) + allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall!: true, install!: false) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) expect { described_class.run }.to raise_error(SystemExit) end it "skips installs from failed taps" do - allow(Homebrew::Bundle::CaskInstaller).to receive(:preinstall).and_return(false) - allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall: true, install: false) - allow(Homebrew::Bundle::BrewInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall: true, install: true) - allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall: true, install: true) + allow(Homebrew::Bundle::CaskInstaller).to receive(:preinstall!).and_return(false) + allow(Homebrew::Bundle::TapInstaller).to receive_messages(preinstall!: true, install!: false) + allow(Homebrew::Bundle::FormulaInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::MacAppStoreInstaller).to receive_messages(preinstall!: true, install!: true) + allow(Homebrew::Bundle::VscodeExtensionInstaller).to receive_messages(preinstall!: true, install!: true) allow_any_instance_of(Pathname).to receive(:read).and_return(brewfile_contents) expect(Homebrew::Bundle).not_to receive(:system) diff --git a/Library/Homebrew/test/bundle/commands/list_spec.rb b/Library/Homebrew/test/bundle/commands/list_spec.rb index b87b83ae48..c92d42de11 100644 --- a/Library/Homebrew/test/bundle/commands/list_spec.rb +++ b/Library/Homebrew/test/bundle/commands/list_spec.rb @@ -4,9 +4,11 @@ require "bundle" require "bundle/commands/list" RSpec.describe Homebrew::Bundle::Commands::List do - subject(:list) { described_class.run(global: false, file: nil, brews:, casks:, taps:, mas:, whalebrew:, vscode:) } + subject(:list) do + described_class.run(global: false, file: nil, formulae:, casks:, taps:, mas:, whalebrew:, vscode:) + end - let(:brews) { true } + let(:formulae) { true } let(:casks) { false } let(:taps) { false } let(:mas) { false } @@ -38,7 +40,7 @@ RSpec.describe Homebrew::Bundle::Commands::List do describe "limiting when certain options are passed" do types_and_deps = { taps: "phinze/cask", - brews: "mysql", + formulae: "mysql", casks: "google-chrome", mas: "1Password", whalebrew: "whalebrew/imagemagick", @@ -56,7 +58,7 @@ RSpec.describe Homebrew::Bundle::Commands::List do verb = (options_list.length == 1 && "is") || "are" context "when #{opts} #{verb} passed" do - let(:brews) { args_hash[:brews] } + let(:formulae) { args_hash[:formulae] } let(:casks) { args_hash[:casks] } let(:taps) { args_hash[:taps] } let(:mas) { args_hash[:mas] } diff --git a/Library/Homebrew/test/bundle/dsl_spec.rb b/Library/Homebrew/test/bundle/dsl_spec.rb index 27f47bffd3..abdd1e729a 100644 --- a/Library/Homebrew/test/bundle/dsl_spec.rb +++ b/Library/Homebrew/test/bundle/dsl_spec.rb @@ -15,7 +15,7 @@ RSpec.describe Homebrew::Bundle::Dsl do cask_args appdir: '/Applications' tap 'homebrew/cask' tap 'telemachus/brew', 'https://telemachus@bitbucket.org/telemachus/brew.git' - tap 'auto/update', 'https://bitbucket.org/auto/update.git', force_auto_update: true + tap 'auto/update', 'https://bitbucket.org/auto/update.git' brew 'imagemagick' brew 'mysql@5.6', restart_service: true, link: true, conflicts_with: ['mysql'] brew 'emacs', args: ['with-cocoa', 'with-gnutls'], link: :overwrite @@ -40,10 +40,7 @@ RSpec.describe Homebrew::Bundle::Dsl do expect(dsl.entries[0].name).to eql("homebrew/cask") expect(dsl.entries[1].name).to eql("telemachus/brew") expect(dsl.entries[1].options).to eql(clone_target: "https://telemachus@bitbucket.org/telemachus/brew.git") - expect(dsl.entries[2].options).to eql( - clone_target: "https://bitbucket.org/auto/update.git", - force_auto_update: true, - ) + expect(dsl.entries[2].options).to eql(clone_target: "https://bitbucket.org/auto/update.git") expect(dsl.entries[3].name).to eql("imagemagick") expect(dsl.entries[4].name).to eql("mysql@5.6") expect(dsl.entries[4].options).to eql(restart_service: true, link: true, conflicts_with: ["mysql"]) diff --git a/Library/Homebrew/test/bundle/dumper_spec.rb b/Library/Homebrew/test/bundle/dumper_spec.rb index 2d9ea47bfa..957cfe90c2 100644 --- a/Library/Homebrew/test/bundle/dumper_spec.rb +++ b/Library/Homebrew/test/bundle/dumper_spec.rb @@ -2,7 +2,7 @@ require "bundle" require "bundle/dumper" -require "bundle/brew_dumper" +require "bundle/formula_dumper" require "bundle/tap_dumper" require "bundle/cask_dumper" require "bundle/mac_app_store_dumper" @@ -22,7 +22,7 @@ RSpec.describe Homebrew::Bundle::Dumper do cask_installed?: true, mas_installed?: false, whalebrew_installed?: false, vscode_installed?: false ) - Homebrew::Bundle::BrewDumper.reset! + Homebrew::Bundle::FormulaDumper.reset! Homebrew::Bundle::TapDumper.reset! Homebrew::Bundle::CaskDumper.reset! Homebrew::Bundle::MacAppStoreDumper.reset! @@ -49,7 +49,7 @@ RSpec.describe Homebrew::Bundle::Dumper do it "generates output" do expect(dumper.build_brewfile( - describe: false, no_restart: false, brews: true, taps: true, casks: true, mas: true, + describe: false, no_restart: false, formulae: true, taps: true, casks: true, mas: true, whalebrew: true, vscode: true )).to eql("cask \"google-chrome\"\ncask \"java\"\ncask \"iterm2-beta\"\n") end diff --git a/Library/Homebrew/test/bundle/brew_dumper_spec.rb b/Library/Homebrew/test/bundle/formula_dumper_spec.rb similarity index 98% rename from Library/Homebrew/test/bundle/brew_dumper_spec.rb rename to Library/Homebrew/test/bundle/formula_dumper_spec.rb index 08a92ae564..0d15e6b78a 100644 --- a/Library/Homebrew/test/bundle/brew_dumper_spec.rb +++ b/Library/Homebrew/test/bundle/formula_dumper_spec.rb @@ -2,7 +2,7 @@ require "ostruct" require "bundle" -require "bundle/brew_dumper" +require "bundle/formula_dumper" require "tsort" require "formula" require "tab" @@ -10,7 +10,7 @@ require "utils/bottles" # TODO: remove OpenStruct usage # rubocop:todo Style/OpenStructUse -RSpec.describe Homebrew::Bundle::BrewDumper do +RSpec.describe Homebrew::Bundle::FormulaDumper do subject(:dumper) { described_class } let(:foo) do @@ -184,7 +184,7 @@ RSpec.describe Homebrew::Bundle::BrewDumper do it "exits on cyclic exceptions" do expect(Formula).to receive(:installed).and_return([foo, bar, baz]) - expect_any_instance_of(Homebrew::Bundle::BrewDumper::Topo).to receive(:tsort).and_raise( + expect_any_instance_of(Homebrew::Bundle::FormulaDumper::Topo).to receive(:tsort).and_raise( TSort::Cyclic, 'topological sort failed: ["foo", "bar"]', ) diff --git a/Library/Homebrew/test/bundle/brew_installer_spec.rb b/Library/Homebrew/test/bundle/formula_installer_spec.rb similarity index 83% rename from Library/Homebrew/test/bundle/brew_installer_spec.rb rename to Library/Homebrew/test/bundle/formula_installer_spec.rb index ec6b0f738e..dec673217c 100644 --- a/Library/Homebrew/test/bundle/brew_installer_spec.rb +++ b/Library/Homebrew/test/bundle/formula_installer_spec.rb @@ -2,11 +2,11 @@ require "bundle" require "formula" -require "bundle/brew_installer" -require "bundle/brew_dumper" +require "bundle/formula_installer" +require "bundle/formula_dumper" require "bundle/brew_services" -RSpec.describe Homebrew::Bundle::BrewInstaller do +RSpec.describe Homebrew::Bundle::FormulaInstaller do let(:formula_name) { "mysql" } let(:options) { { args: ["with-option"] } } let(:installer) { described_class.new(formula_name, options) } @@ -37,15 +37,15 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do context "with a successful installation" do it "start service" do expect(Homebrew::Bundle::BrewServices).not_to receive(:start) - described_class.preinstall(formula_name, start_service: true) - described_class.install(formula_name, start_service: true) + described_class.preinstall!(formula_name, start_service: true) + described_class.install!(formula_name, start_service: true) end end context "with a skipped installation" do it "start service" do expect(Homebrew::Bundle::BrewServices).not_to receive(:start) - described_class.install(formula_name, preinstall: false, start_service: true) + described_class.install!(formula_name, preinstall: false, start_service: true) end end end @@ -59,8 +59,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "start service" do expect(Homebrew::Bundle::BrewServices).to \ receive(:start).with(formula_name, file: nil, verbose: false).and_return(true) - described_class.preinstall(formula_name, start_service: true) - described_class.install(formula_name, start_service: true) + described_class.preinstall!(formula_name, start_service: true) + described_class.install!(formula_name, start_service: true) end end @@ -68,7 +68,7 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "start service" do expect(Homebrew::Bundle::BrewServices).to \ receive(:start).with(formula_name, file: nil, verbose: false).and_return(true) - described_class.install(formula_name, preinstall: false, start_service: true) + described_class.install!(formula_name, preinstall: false, start_service: true) end end end @@ -84,8 +84,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "restart service" do expect(Homebrew::Bundle::BrewServices).to \ receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true) - described_class.preinstall(formula_name, restart_service: :always) - described_class.install(formula_name, restart_service: :always) + described_class.preinstall!(formula_name, restart_service: :always) + described_class.install!(formula_name, restart_service: :always) end end @@ -93,7 +93,7 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "restart service" do expect(Homebrew::Bundle::BrewServices).to \ receive(:restart).with(formula_name, file: nil, verbose: false).and_return(true) - described_class.install(formula_name, preinstall: false, restart_service: :always) + described_class.install!(formula_name, preinstall: false, restart_service: :always) end end end @@ -107,8 +107,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do allow_any_instance_of(described_class).to receive(:linked?).and_return(false) expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: true) - described_class.install(formula_name, link: true) + described_class.preinstall!(formula_name, link: true) + described_class.install!(formula_name, link: true) end it "force-links keg-only formula" do @@ -116,8 +116,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do allow_any_instance_of(described_class).to receive(:keg_only?).and_return(true) expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--force", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: true) - described_class.install(formula_name, link: true) + described_class.preinstall!(formula_name, link: true) + described_class.install!(formula_name, link: true) end end @@ -130,8 +130,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do allow_any_instance_of(described_class).to receive(:linked?).and_return(false) expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "--overwrite", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: :overwrite) - described_class.install(formula_name, link: :overwrite) + described_class.preinstall!(formula_name, link: :overwrite) + described_class.install!(formula_name, link: :overwrite) end end @@ -144,8 +144,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do allow_any_instance_of(described_class).to receive(:linked?).and_return(true) expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: false) - described_class.install(formula_name, link: false) + described_class.preinstall!(formula_name, link: false) + described_class.install!(formula_name, link: false) end end @@ -159,8 +159,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "links formula" do expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "link", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: nil) - described_class.install(formula_name, link: nil) + described_class.preinstall!(formula_name, link: nil) + described_class.install!(formula_name, link: nil) end end @@ -174,22 +174,22 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "unlinks formula" do expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "unlink", "mysql", verbose: false).and_return(true) - described_class.preinstall(formula_name, link: nil) + described_class.preinstall!(formula_name, link: nil) - described_class.install(formula_name, link: nil) + described_class.install!(formula_name, link: nil) end end context "when the conflicts_with option is provided" do before do - allow(Homebrew::Bundle::BrewDumper).to receive(:formulae_by_full_name).and_call_original - allow(Homebrew::Bundle::BrewDumper).to receive(:formulae_by_full_name).with("mysql").and_return( + allow(Homebrew::Bundle::FormulaDumper).to receive(:formulae_by_full_name).and_call_original + allow(Homebrew::Bundle::FormulaDumper).to receive(:formulae_by_full_name).with("mysql").and_return( name: "mysql", conflicts_with: ["mysql55"], ) allow(described_class).to receive(:formula_installed?).and_return(true) - allow_any_instance_of(described_class).to receive(:install!).and_return(true) - allow_any_instance_of(described_class).to receive(:upgrade!).and_return(true) + allow_any_instance_of(described_class).to receive(:install_formula!).and_return(true) + allow_any_instance_of(described_class).to receive(:upgrade_formula!).and_return(true) end it "unlinks conflicts and stops their services" do @@ -203,8 +203,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true) expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil, verbose:).and_return(true) - described_class.preinstall(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) - described_class.install(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) + described_class.preinstall!(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) + described_class.install!(formula_name, restart_service: :always, conflicts_with: ["mysql56"]) end it "prints a message" do @@ -219,8 +219,10 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do expect(Homebrew::Bundle::BrewServices).to receive(:stop).with("mysql56", verbose:).and_return(true) expect(Homebrew::Bundle::BrewServices).to receive(:restart).with(formula_name, file: nil, verbose:).and_return(true) - described_class.preinstall(formula_name, restart_service: :always, conflicts_with: ["mysql56"], verbose: true) - described_class.install(formula_name, restart_service: :always, conflicts_with: ["mysql56"], verbose: true) + described_class.preinstall!(formula_name, restart_service: :always, conflicts_with: ["mysql56"], + verbose: true) + described_class.install!(formula_name, restart_service: :always, conflicts_with: ["mysql56"], + verbose: true) end end @@ -237,14 +239,14 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "runs the postinstall command" do expect(Kernel).to receive(:system).with("custom command").and_return(true) - described_class.preinstall(formula_name, postinstall: "custom command") - described_class.install(formula_name, postinstall: "custom command") + described_class.preinstall!(formula_name, postinstall: "custom command") + described_class.install!(formula_name, postinstall: "custom command") end it "reports a failure" do expect(Kernel).to receive(:system).with("custom command").and_return(false) - described_class.preinstall(formula_name, postinstall: "custom command") - expect(described_class.install(formula_name, postinstall: "custom command")).to be(false) + described_class.preinstall!(formula_name, postinstall: "custom command") + expect(described_class.install!(formula_name, postinstall: "custom command")).to be(false) end end @@ -255,8 +257,8 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "does not run the postinstall command" do expect(Kernel).not_to receive(:system) - described_class.preinstall(formula_name, postinstall: "custom command") - described_class.install(formula_name, postinstall: "custom command") + described_class.preinstall!(formula_name, postinstall: "custom command") + described_class.install!(formula_name, postinstall: "custom command") end end end @@ -281,16 +283,16 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "writes the version to the file" do expect(File).to receive(:write).with(version_file, "#{version}\n") - described_class.preinstall(formula_name, version_file:) - described_class.install(formula_name, version_file:) + described_class.preinstall!(formula_name, version_file:) + described_class.install!(formula_name, version_file:) end end context "when using the latest formula" do it "writes the version to the file" do expect(File).to receive(:write).with(version_file, "#{version}\n") - described_class.preinstall(formula_name, version_file:) - described_class.install(formula_name, version_file:) + described_class.preinstall!(formula_name, version_file:) + described_class.install!(formula_name, version_file:) end end end @@ -304,14 +306,14 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "did not call restart service" do expect(Homebrew::Bundle::BrewServices).not_to receive(:restart) - described_class.preinstall(formula_name, restart_service: true) + described_class.preinstall!(formula_name, restart_service: true) end end describe ".outdated_formulae" do it "calls Homebrew" do described_class.reset! - expect(Homebrew::Bundle::BrewDumper).to receive(:formulae).and_return( + expect(Homebrew::Bundle::FormulaDumper).to receive(:formulae).and_return( [ { name: "a", outdated?: true }, { name: "b", outdated?: true }, @@ -325,7 +327,7 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do describe ".pinned_formulae" do it "calls Homebrew" do described_class.reset! - expect(Homebrew::Bundle::BrewDumper).to receive(:formulae).and_return( + expect(Homebrew::Bundle::FormulaDumper).to receive(:formulae).and_return( [ { name: "a", pinned?: true }, { name: "b", pinned?: true }, @@ -338,11 +340,11 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do describe ".formula_installed_and_up_to_date?" do before do - Homebrew::Bundle::BrewDumper.reset! + Homebrew::Bundle::FormulaDumper.reset! described_class.reset! allow(described_class).to receive(:outdated_formulae).and_return(%w[bar]) allow_any_instance_of(Formula).to receive(:outdated?).and_return(true) - allow(Homebrew::Bundle::BrewDumper).to receive(:formulae).and_return [ + allow(Homebrew::Bundle::FormulaDumper).to receive(:formulae).and_return [ { name: "foo", full_name: "homebrew/tap/foo", @@ -386,16 +388,16 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do expect(Homebrew::Bundle).to receive(:system) .with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false) .and_return(true) - expect(installer.preinstall).to be(true) - expect(installer.install).to be(true) + expect(installer.preinstall!).to be(true) + expect(installer.install!).to be(true) end it "reports a failure" do expect(Homebrew::Bundle).to receive(:system) .with(HOMEBREW_BREW_FILE, "install", "--formula", formula_name, "--with-option", verbose: false) .and_return(false) - expect(installer.preinstall).to be(true) - expect(installer.install).to be(false) + expect(installer.preinstall!).to be(true) + expect(installer.install!).to be(false) end end @@ -416,16 +418,16 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) .and_return(true) - expect(installer.preinstall).to be(true) - expect(installer.install).to be(true) + expect(installer.preinstall!).to be(true) + expect(installer.install!).to be(true) end it "reports a failure" do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) .and_return(false) - expect(installer.preinstall).to be(true) - expect(installer.install).to be(false) + expect(installer.preinstall!).to be(true) + expect(installer.install!).to be(false) end context "when formula pinned" do @@ -436,7 +438,7 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "does not upgrade formula" do expect(Homebrew::Bundle).not_to \ receive(:system).with(HOMEBREW_BREW_FILE, "upgrade", "--formula", formula_name, verbose: false) - expect(installer.preinstall).to be(false) + expect(installer.preinstall!).to be(false) end end @@ -447,7 +449,7 @@ RSpec.describe Homebrew::Bundle::BrewInstaller do it "does not upgrade formula" do expect(Homebrew::Bundle).not_to receive(:system) - expect(installer.preinstall).to be(false) + expect(installer.preinstall!).to be(false) end end end diff --git a/Library/Homebrew/test/bundle/mac_app_store_installer_spec.rb b/Library/Homebrew/test/bundle/mac_app_store_installer_spec.rb index 802ad87444..4ce1514cdc 100644 --- a/Library/Homebrew/test/bundle/mac_app_store_installer_spec.rb +++ b/Library/Homebrew/test/bundle/mac_app_store_installer_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do it "tries to install mas" do expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "mas", verbose: false).and_return(true) - expect { described_class.preinstall("foo", 123) }.to raise_error(RuntimeError) + expect { described_class.preinstall!("foo", 123) }.to raise_error(RuntimeError) end describe ".outdated_app_ids" do @@ -62,7 +62,7 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do it "skips" do expect(Homebrew::Bundle).not_to receive(:system) - expect(described_class.preinstall("foo", 123)).to be(false) + expect(described_class.preinstall!("foo", 123)).to be(false) end end @@ -73,8 +73,8 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do it "upgrades" do expect(Homebrew::Bundle).to receive(:system).with("mas", "upgrade", "123", verbose: false).and_return(true) - expect(described_class.preinstall("foo", 123)).to be(true) - expect(described_class.install("foo", 123)).to be(true) + expect(described_class.preinstall!("foo", 123)).to be(true) + expect(described_class.install!("foo", 123)).to be(true) end end @@ -85,8 +85,8 @@ RSpec.describe Homebrew::Bundle::MacAppStoreInstaller do it "installs app" do expect(Homebrew::Bundle).to receive(:system).with("mas", "install", "123", verbose: false).and_return(true) - expect(described_class.preinstall("foo", 123)).to be(true) - expect(described_class.install("foo", 123)).to be(true) + expect(described_class.preinstall!("foo", 123)).to be(true) + expect(described_class.install!("foo", 123)).to be(true) end end end diff --git a/Library/Homebrew/test/bundle/tap_installer_spec.rb b/Library/Homebrew/test/bundle/tap_installer_spec.rb index e49e90dee8..34418d5bc1 100644 --- a/Library/Homebrew/test/bundle/tap_installer_spec.rb +++ b/Library/Homebrew/test/bundle/tap_installer_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Homebrew::Bundle::TapInstaller do it "skips" do expect(Homebrew::Bundle).not_to receive(:system) - expect(described_class.preinstall("homebrew/cask")).to be(false) + expect(described_class.preinstall!("homebrew/cask")).to be(false) end end @@ -34,8 +34,8 @@ RSpec.describe Homebrew::Bundle::TapInstaller do it "taps" do expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", verbose: false).and_return(true) - expect(described_class.preinstall("homebrew/cask")).to be(true) - expect(described_class.install("homebrew/cask")).to be(true) + expect(described_class.preinstall!("homebrew/cask")).to be(true) + expect(described_class.install!("homebrew/cask")).to be(true) end context "with clone target" do @@ -43,36 +43,16 @@ RSpec.describe Homebrew::Bundle::TapInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path", verbose: false).and_return(true) - expect(described_class.preinstall("homebrew/cask", clone_target: "clone_target_path")).to be(true) - expect(described_class.install("homebrew/cask", clone_target: "clone_target_path")).to be(true) + expect(described_class.preinstall!("homebrew/cask", clone_target: "clone_target_path")).to be(true) + expect(described_class.install!("homebrew/cask", clone_target: "clone_target_path")).to be(true) end it "fails" do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", "clone_target_path", verbose: false).and_return(false) - expect(described_class.preinstall("homebrew/cask", clone_target: "clone_target_path")).to be(true) - expect(described_class.install("homebrew/cask", clone_target: "clone_target_path")).to be(false) - end - end - - context "with force_auto_update" do - it "taps" do - expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", - "--force-auto-update", - verbose: false) - .and_return(true) - expect(described_class.preinstall("homebrew/cask", force_auto_update: true)).to be(true) - expect(described_class.install("homebrew/cask", force_auto_update: true)).to be(true) - end - - it "fails" do - expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "tap", "homebrew/cask", - "--force-auto-update", - verbose: false) - .and_return(false) - expect(described_class.preinstall("homebrew/cask", force_auto_update: true)).to be(true) - expect(described_class.install("homebrew/cask", force_auto_update: true)).to be(false) + expect(described_class.preinstall!("homebrew/cask", clone_target: "clone_target_path")).to be(true) + expect(described_class.install!("homebrew/cask", clone_target: "clone_target_path")).to be(false) end end end diff --git a/Library/Homebrew/test/bundle/vscode_extension_installer_spec.rb b/Library/Homebrew/test/bundle/vscode_extension_installer_spec.rb index a0371f761f..f51895e880 100644 --- a/Library/Homebrew/test/bundle/vscode_extension_installer_spec.rb +++ b/Library/Homebrew/test/bundle/vscode_extension_installer_spec.rb @@ -15,7 +15,7 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(HOMEBREW_BREW_FILE, "install", "--cask", "visual-studio-code", verbose: false) .and_return(true) - expect { described_class.preinstall("foo") }.to raise_error(RuntimeError) + expect { described_class.preinstall!("foo") }.to raise_error(RuntimeError) end end @@ -31,12 +31,12 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do it "skips" do expect(Homebrew::Bundle).not_to receive(:system) - expect(described_class.preinstall("foo")).to be(false) + expect(described_class.preinstall!("foo")).to be(false) end it "skips ignoring case" do expect(Homebrew::Bundle).not_to receive(:system) - expect(described_class.preinstall("Foo")).to be(false) + expect(described_class.preinstall!("Foo")).to be(false) end end @@ -48,8 +48,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do it "installs extension" do expect(Homebrew::Bundle).to \ receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) - expect(described_class.preinstall("foo")).to be(true) - expect(described_class.install("foo")).to be(true) + expect(described_class.preinstall!("foo")).to be(true) + expect(described_class.install!("foo")).to be(true) end it "installs extension when euid != uid and Process::UID.re_exchangeable? returns true" do @@ -59,8 +59,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) - expect(described_class.preinstall("foo")).to be(true) - expect(described_class.install("foo")).to be(true) + expect(described_class.preinstall!("foo")).to be(true) + expect(described_class.install!("foo")).to be(true) end it "installs extension when euid != uid and Process::UID.re_exchangeable? returns false" do @@ -70,8 +70,8 @@ RSpec.describe Homebrew::Bundle::VscodeExtensionInstaller do expect(Homebrew::Bundle).to \ receive(:system).with(Pathname("code"), "--install-extension", "foo", verbose: false).and_return(true) - expect(described_class.preinstall("foo")).to be(true) - expect(described_class.install("foo")).to be(true) + expect(described_class.preinstall!("foo")).to be(true) + expect(described_class.install!("foo")).to be(true) end end end diff --git a/Library/Homebrew/test/bundle/whalebrew_installer_spec.rb b/Library/Homebrew/test/bundle/whalebrew_installer_spec.rb index 7cc5ee1c0c..b1444cfeb5 100644 --- a/Library/Homebrew/test/bundle/whalebrew_installer_spec.rb +++ b/Library/Homebrew/test/bundle/whalebrew_installer_spec.rb @@ -42,7 +42,7 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do expect(Homebrew::Bundle).to receive(:system).with(HOMEBREW_BREW_FILE, "install", "--formula", "whalebrew", verbose: false) .and_return(true) - expect { described_class.preinstall("whalebrew/wget") }.to raise_error(RuntimeError) + expect { described_class.preinstall!("whalebrew/wget") }.to raise_error(RuntimeError) end end @@ -61,7 +61,7 @@ RSpec.describe Homebrew::Bundle::WhalebrewInstaller do end it "skips" do - expect(described_class.preinstall("whalebrew/wget")).to be(false) + expect(described_class.preinstall!("whalebrew/wget")).to be(false) end end end diff --git a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb index 7359c29261..0ba85761da 100644 --- a/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb +++ b/Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Cask::Artifact::Artifact, :cask do end context "without target" do - it "fails to load" do + it "fails to load", :no_api do expect do Cask::CaskLoader.load("invalid-generic-artifact-no-target") end.to raise_error(Cask::CaskInvalidError, /Generic Artifact.*requires.*target/) diff --git a/Library/Homebrew/test/cask/artifact/manpage_spec.rb b/Library/Homebrew/test/cask/artifact/manpage_spec.rb index 23048504e1..022aee7519 100644 --- a/Library/Homebrew/test/cask/artifact/manpage_spec.rb +++ b/Library/Homebrew/test/cask/artifact/manpage_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Cask::Artifact::Manpage, :cask do context "without section" do let(:cask_token) { "invalid-manpage-no-section" } - it "fails to load a cask without section" do + it "fails to load a cask without section", :no_api do expect { cask }.to raise_error(Cask::CaskInvalidError, /is not a valid man page name/) end end diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index 43a7c6be40..03f5c9632f 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -49,13 +49,11 @@ RSpec.describe Cask::Audit, :cask do let(:only) { [] } let(:except) { [] } let(:strict) { nil } - let(:token_conflicts) { nil } let(:signing) { nil } let(:audit) do described_class.new(cask, online:, strict:, new_cask:, - token_conflicts:, signing:, only:, except:) @@ -72,10 +70,6 @@ RSpec.describe Cask::Audit, :cask do it "implies `strict`" do expect(audit).to be_strict end - - it "implies `token_conflicts`" do - expect(audit.token_conflicts?).to be true - end end context "when `online` is specified" do @@ -503,7 +497,7 @@ RSpec.describe Cask::Audit, :cask do end end - describe "livecheck should be skipped" do + describe "livecheck should be skipped", :no_api do let(:only) { ["livecheck_version"] } let(:online) { true } let(:message) { /Version '[^']*' differs from '[^']*' retrieved by livecheck\./ } @@ -949,34 +943,15 @@ RSpec.describe Cask::Audit, :cask do end describe "token conflicts" do - let(:only) { ["token_conflicts"] } let(:cask_token) { "with-binary" } - let(:token_conflicts) { true } context "when cask token conflicts with a core formula" do let(:formula_names) { %w[with-binary other-formula] } - context "when `--strict` is passed" do - let(:strict) { true } - - it "warns about duplicates" do - expect(audit).to receive(:core_formula_names).and_return(formula_names) - expect(run).to error_with(/possible duplicate/) - end + it "warns about conflicts" do + expect(audit).to receive(:core_formula_names).and_return(formula_names) + expect(run).to error_with(/cask token conflicts/) end - - context "when `--strict` is not passed" do - it "does not warn about duplicates" do - expect(audit).to receive(:core_formula_names).and_return(formula_names) - expect(run).not_to error_with(/possible duplicate/) - end - end - end - - context "when cask token does not conflict with a core formula" do - let(:formula_names) { %w[other-formula] } - - it { is_expected.to pass } end end diff --git a/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb index f066a098a9..3362c519b6 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb @@ -31,10 +31,6 @@ RSpec.describe Cask::CaskLoader::FromAPILoader, :cask do end context "when using the API" do - before do - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") - end - it "returns a loader for valid token" do expect(described_class.try_new(api_token)) .to be_a(described_class) diff --git a/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb index b01ccfa21f..4f01b7279c 100644 --- a/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb @@ -24,7 +24,7 @@ RSpec.describe Cask::CaskLoader::FromTapLoader do expect { described_class.new("foo/bar/baz").load(config: nil) }.to raise_error(Cask::CaskUnavailableError) end - context "with sharded Cask directory" do + context "with sharded Cask directory", :no_api do let(:cask_path) { tap.cask_dir/cask_name[0]/"#{cask_name}.rb" } it "returns a Cask" do diff --git a/Library/Homebrew/test/cask/cask_loader_spec.rb b/Library/Homebrew/test/cask/cask_loader_spec.rb index 4c18828c9e..e2671408fa 100644 --- a/Library/Homebrew/test/cask/cask_loader_spec.rb +++ b/Library/Homebrew/test/cask/cask_loader_spec.rb @@ -45,10 +45,6 @@ RSpec.describe Cask::CaskLoader, :cask do end context "when using the API" do - before do - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") - end - it "warns when using the short token" do expect do expect(described_class.for("version-newest")).to be_a Cask::CaskLoader::FromAPILoader diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb index 2dd30c87cc..e08e8f90e4 100644 --- a/Library/Homebrew/test/cask/cask_spec.rb +++ b/Library/Homebrew/test/cask/cask_spec.rb @@ -46,13 +46,13 @@ RSpec.describe Cask::Cask, :cask do expect(c.token).to eq("caffeine") end - it "returns an instance of the Cask from a URL", :needs_utils_curl, :no_api do + it "returns an instance of the Cask from a URL", :needs_utils_curl do c = Cask::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") expect(c).to be_a(described_class) expect(c.token).to eq("local-caffeine") end - it "raises an error when failing to download a Cask from a URL", :needs_utils_curl, :no_api do + it "raises an error when failing to download a Cask from a URL", :needs_utils_curl do expect do Cask::CaskLoader.load("file://#{tap_path}/Casks/notacask.rb") end.to raise_error(Cask::CaskUnavailableError) @@ -324,6 +324,9 @@ RSpec.describe Cask::Cask, :cask do let(:expected_versions_variations) do <<~JSON { + "tahoe": { + "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine/darwin/1.2.3/intel.zip" + }, "sequoia": { "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine/darwin/1.2.3/intel.zip" }, @@ -377,6 +380,10 @@ RSpec.describe Cask::Cask, :cask do let(:expected_sha256_variations) do <<~JSON { + "tahoe": { + "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine-intel.zip", + "sha256": "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" + }, "sequoia": { "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine-intel.zip", "sha256": "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" @@ -423,6 +430,10 @@ RSpec.describe Cask::Cask, :cask do let(:expected_sha256_variations_os) do <<~JSON { + "tahoe": { + "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine-intel-darwin.zip", + "sha256": "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" + }, "sequoia": { "url": "file://#{TEST_FIXTURE_DIR}/cask/caffeine-intel-darwin.zip", "sha256": "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" diff --git a/Library/Homebrew/test/cask/dsl_spec.rb b/Library/Homebrew/test/cask/dsl_spec.rb index c9b75cf482..b93c6a33ff 100644 --- a/Library/Homebrew/test/cask/dsl_spec.rb +++ b/Library/Homebrew/test/cask/dsl_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe Cask::DSL, :cask do +RSpec.describe Cask::DSL, :cask, :no_api do let(:cask) { Cask::CaskLoader.load(token) } let(:token) { "basic-cask" } diff --git a/Library/Homebrew/test/cask/reinstall_spec.rb b/Library/Homebrew/test/cask/reinstall_spec.rb index 76d8346050..7218ff9e06 100644 --- a/Library/Homebrew/test/cask/reinstall_spec.rb +++ b/Library/Homebrew/test/cask/reinstall_spec.rb @@ -34,7 +34,6 @@ RSpec.describe Cask::Reinstall, :cask do output = Regexp.new <<~EOS ==> Downloading file:.*caffeine.zip Already downloaded: .*--caffeine.zip - ==> Implied `brew uninstall --cask local-caffeine` ==> Backing App 'Caffeine.app' up to '.*Caffeine.app' ==> Removing App '.*Caffeine.app' ==> Dispatching zap stanza diff --git a/Library/Homebrew/test/cask/upgrade_spec.rb b/Library/Homebrew/test/cask/upgrade_spec.rb index d2bf61b2b9..244df29988 100644 --- a/Library/Homebrew/test/cask/upgrade_spec.rb +++ b/Library/Homebrew/test/cask/upgrade_spec.rb @@ -59,7 +59,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(renamed_app_new_path).not_to be_a_directory expect(renamed_app.installed_version).to eq "1.0.0" - described_class.upgrade_casks(dry_run: true, args:) + described_class.upgrade_casks!(dry_run: true, args:) expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -86,7 +86,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(local_transmission_path).to be_a_directory expect(local_transmission.installed_version).to eq "2.60" - described_class.upgrade_casks(local_caffeine, dry_run: true, args:) + described_class.upgrade_casks!(local_caffeine, dry_run: true, args:) expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -113,7 +113,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(renamed_app_new_path).not_to be_a_directory expect(renamed_app.installed_version).to eq "1.0.0" - described_class.upgrade_casks(local_caffeine, auto_updates, dry_run: true, args:) + described_class.upgrade_casks!(local_caffeine, auto_updates, dry_run: true, args:) expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -156,7 +156,7 @@ RSpec.describe Cask::Upgrade, :cask do version_latest.download_sha_path.write("fake download sha") expect(version_latest.outdated_download_sha?).to be(true) - described_class.upgrade_casks(greedy: true, dry_run: true, args:) + described_class.upgrade_casks!(greedy: true, dry_run: true, args:) expect(local_caffeine).to be_installed expect(local_caffeine_path).to be_a_directory @@ -186,7 +186,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(auto_updates_path).to be_a_directory expect(auto_updates.installed_version).to eq "2.57" - described_class.upgrade_casks(auto_updates, dry_run: true, greedy: true, args:) + described_class.upgrade_casks!(auto_updates, dry_run: true, greedy: true, args:) expect(auto_updates).to be_installed expect(auto_updates_path).to be_a_directory @@ -203,7 +203,7 @@ RSpec.describe Cask::Upgrade, :cask do version_latest.download_sha_path.write("fake download sha") expect(version_latest.outdated_download_sha?).to be(true) - described_class.upgrade_casks(version_latest, dry_run: true, greedy: true, args:) + described_class.upgrade_casks!(version_latest, dry_run: true, greedy: true, args:) expect(version_latest).to be_installed expect(version_latest_paths).to all be_a_directory @@ -234,7 +234,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(will_fail_if_upgraded.installed_version).to eq "1.2.2" expect do - described_class.upgrade_casks(will_fail_if_upgraded, args:) + described_class.upgrade_casks!(will_fail_if_upgraded, args:) end.to raise_error(Cask::CaskError).and output(output_reverted).to_stderr expect(will_fail_if_upgraded).to be_installed @@ -252,7 +252,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(bad_checksum.installed_version).to eq "1.2.2" expect do - described_class.upgrade_casks(bad_checksum, args:) + described_class.upgrade_casks!(bad_checksum, args:) end.to raise_error(ChecksumMismatchError).and(not_to_output(output_reverted).to_stderr) expect(bad_checksum).to be_installed @@ -291,7 +291,7 @@ RSpec.describe Cask::Upgrade, :cask do expect(bad_checksum_2.installed_version).to eq "1.2.2" expect do - described_class.upgrade_casks(args:) + described_class.upgrade_casks!(args:) end.to raise_error(Cask::MultipleCaskErrors) expect(bad_checksum).to be_installed diff --git a/Library/Homebrew/test/cask_dependent_spec.rb b/Library/Homebrew/test/cask_dependent_spec.rb index 48e09d16fe..38e9da163f 100644 --- a/Library/Homebrew/test/cask_dependent_spec.rb +++ b/Library/Homebrew/test/cask_dependent_spec.rb @@ -30,7 +30,7 @@ RSpec.describe CaskDependent, :needs_macos do end end - describe "#recursive_dependencies", :integration_test do + describe "#recursive_dependencies", :integration_test, :no_api do it "is all the dependencies of the cask" do setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/caveats_spec.rb b/Library/Homebrew/test/caveats_spec.rb index 7871177928..089c80c527 100644 --- a/Library/Homebrew/test/caveats_spec.rb +++ b/Library/Homebrew/test/caveats_spec.rb @@ -242,7 +242,7 @@ RSpec.describe Caveats do url "foo-1.0" end end - let(:caveats) { described_class.new(f).caveats } + let(:caveats) { described_class.new(f) } let(:path) { f.prefix.resolved_path } let(:bash_completion_dir) { path/"etc/bash_completion.d" } @@ -261,25 +261,25 @@ RSpec.describe Caveats do it "includes where Bash completions have been installed to" do bash_completion_dir.mkpath FileUtils.touch bash_completion_dir/f.name - expect(caveats).to include(HOMEBREW_PREFIX/"etc/bash_completion.d") + expect(caveats.completions_and_elisp.join).to include(HOMEBREW_PREFIX/"etc/bash_completion.d") end it "includes where fish completions have been installed to" do fish_vendor_completions.mkpath FileUtils.touch fish_vendor_completions/f.name - expect(caveats).to include(HOMEBREW_PREFIX/"share/fish/vendor_completions.d") + expect(caveats.completions_and_elisp.join).to include(HOMEBREW_PREFIX/"share/fish/vendor_completions.d") end it "includes where zsh completions have been installed to" do zsh_site_functions.mkpath FileUtils.touch zsh_site_functions/f.name - expect(caveats).to include(HOMEBREW_PREFIX/"share/zsh/site-functions") + expect(caveats.completions_and_elisp.join).to include(HOMEBREW_PREFIX/"share/zsh/site-functions") end it "includes where pwsh completions have been installed to" do pwsh_completion_dir.mkpath FileUtils.touch pwsh_completion_dir/f.name - expect(caveats).to include(HOMEBREW_PREFIX/"share/pwsh/completions") + expect(caveats.completions_and_elisp.join).to include(HOMEBREW_PREFIX/"share/pwsh/completions") end end end diff --git a/Library/Homebrew/test/cmd/alias_spec.rb b/Library/Homebrew/test/cmd/alias_spec.rb index 35442f0ad8..d8985c0a8f 100644 --- a/Library/Homebrew/test/cmd/alias_spec.rb +++ b/Library/Homebrew/test/cmd/alias_spec.rb @@ -7,12 +7,12 @@ RSpec.describe Homebrew::Cmd::Alias do it_behaves_like "parseable arguments" it "sets an alias", :integration_test do - expect { brew "alias", "foo=bar" } + expect { brew "alias", "foo-test=bar" } .to not_to_output.to_stdout .and not_to_output.to_stderr .and be_a_success expect { brew "alias" } - .to output(/brew alias foo='bar'/).to_stdout + .to output(/brew alias foo-test='bar'/).to_stdout .and not_to_output.to_stderr .and be_a_success end diff --git a/Library/Homebrew/test/cmd/casks_spec.rb b/Library/Homebrew/test/cmd/casks_spec.rb new file mode 100644 index 0000000000..d70b5daf34 --- /dev/null +++ b/Library/Homebrew/test/cmd/casks_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +RSpec.describe "brew casks", type: :system do + it "prints all installed Casks", :integration_test do + expect { brew_sh "casks" } + .to be_a_success + .and not_to_output.to_stderr + end +end diff --git a/Library/Homebrew/test/cmd/deps_spec.rb b/Library/Homebrew/test/cmd/deps_spec.rb index 80edb94337..f00566b29b 100644 --- a/Library/Homebrew/test/cmd/deps_spec.rb +++ b/Library/Homebrew/test/cmd/deps_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Homebrew::Cmd::Deps do it_behaves_like "parseable arguments" - it "outputs all of a Formula's dependencies and their dependencies on separate lines", :integration_test do + it "outputs all of a Formula's dependencies and their dependencies on separate lines", :integration_test, :no_api do # Included in output setup_test_formula "bar" setup_test_formula "foo" @@ -37,6 +37,6 @@ RSpec.describe Homebrew::Cmd::Deps do expect { brew "deps", "baz", "--include-test", "--missing", "--skip-recommended" } .to be_a_success .and output("bar\nfoo\ntest\n").to_stdout - .and not_to_output.to_stderr + .and output(/not the actual runtime dependencies/).to_stderr end end diff --git a/Library/Homebrew/test/cmd/desc_spec.rb b/Library/Homebrew/test/cmd/desc_spec.rb index 4313e56ac3..4c699e62f5 100644 --- a/Library/Homebrew/test/cmd/desc_spec.rb +++ b/Library/Homebrew/test/cmd/desc_spec.rb @@ -15,7 +15,7 @@ RSpec.describe Homebrew::Cmd::Desc do .and be_a_success end - it "errors when searching without --eval-all", :integration_test do + it "errors when searching without --eval-all", :integration_test, :no_api do setup_test_formula "testball" expect { brew "desc", "--search", "testball" } @@ -23,7 +23,7 @@ RSpec.describe Homebrew::Cmd::Desc do .and be_a_failure end - it "successfully searches with --search --eval-all", :integration_test do + it "successfully searches with --search --eval-all", :integration_test, :no_api do setup_test_formula "testball" expect { brew "desc", "--search", "--eval-all", "ball" } @@ -34,7 +34,6 @@ RSpec.describe Homebrew::Cmd::Desc do it "successfully searches without --eval-all, with API", :integration_test, :needs_network do setup_test_formula "testball" - expect { brew "desc", "--search", "testball", "HOMEBREW_NO_INSTALL_FROM_API" => nil } - .to be_a_success + expect { brew "desc", "--search", "testball" }.to be_a_success end end diff --git a/Library/Homebrew/test/cmd/formulae_spec.rb b/Library/Homebrew/test/cmd/formulae_spec.rb new file mode 100644 index 0000000000..714238aefa --- /dev/null +++ b/Library/Homebrew/test/cmd/formulae_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +RSpec.describe "brew formulae", type: :system do + it "prints all installed Formulae", :integration_test do + expect { brew_sh "formulae" } + .to be_a_success + .and not_to_output.to_stderr + end +end diff --git a/Library/Homebrew/test/cmd/install_spec.rb b/Library/Homebrew/test/cmd/install_spec.rb index ef74f06cc3..1e8d70948d 100644 --- a/Library/Homebrew/test/cmd/install_spec.rb +++ b/Library/Homebrew/test/cmd/install_spec.rb @@ -95,34 +95,4 @@ RSpec.describe Homebrew::Cmd::InstallCmd do expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file end - - it "installs with asking for user prompts with installed dependent checks", :integration_test do - setup_test_formula "testball1", <<~RUBY - depends_on "testball5" - # should work as its not building but test doesnt pass if dependant - # depends_on "build" => :build - depends_on "installed" - RUBY - setup_test_formula "installed" - setup_test_formula "testball5", <<~RUBY - depends_on "testball4" - RUBY - setup_test_formula "testball4", "" - setup_test_formula "hiop" - setup_test_formula "build" - - # Mock `Formula#any_version_installed?` by creating the tab in a plausible keg directory - keg_dir = HOMEBREW_CELLAR/"installed"/"1.0" - keg_dir.mkpath - touch keg_dir/AbstractTab::FILENAME - - expect do - brew "install", "--ask", "testball1" - end.to output(/.*Formulae\s*\(3\):\s*testball1\s*,?\s*testball5\s*,?\s*testball4.*/).to_stdout - .and not_to_output.to_stderr - - expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file - expect(HOMEBREW_CELLAR/"testball4/0.1/bin/testball4").to be_a_file - expect(HOMEBREW_CELLAR/"testball5/0.1/bin/testball5").to be_a_file - end end diff --git a/Library/Homebrew/test/cmd/leaves_spec.rb b/Library/Homebrew/test/cmd/leaves_spec.rb index 9e00a21ca1..089a032f11 100644 --- a/Library/Homebrew/test/cmd/leaves_spec.rb +++ b/Library/Homebrew/test/cmd/leaves_spec.rb @@ -31,7 +31,7 @@ RSpec.describe Homebrew::Cmd::Leaves do end end - context "when there are installed Formulae", :integration_test do + context "when there are installed Formulae", :integration_test, :no_api do it "prints all installed Formulae that are not dependencies of another installed Formula" do setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb index 97a6f1466a..62ff3c8004 100644 --- a/Library/Homebrew/test/cmd/list_spec.rb +++ b/Library/Homebrew/test/cmd/list_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Homebrew::Cmd::List do it_behaves_like "parseable arguments" - it "prints all installed Formulae", :integration_test do + it "prints all installed formulae", :integration_test do formulae.each do |f| (HOMEBREW_CELLAR/f/"1.0/somedir").mkpath end @@ -19,5 +19,9 @@ RSpec.describe Homebrew::Cmd::List do .and be_a_success end - # TODO: add a test for the shell fast-path (`brew_sh`) + it "prints all installed formulae and casks", :integration_test do + expect { brew_sh "list" } + .to be_a_success + .and not_to_output.to_stderr + end end diff --git a/Library/Homebrew/test/cmd/mcp-server_spec.rb b/Library/Homebrew/test/cmd/mcp-server_spec.rb new file mode 100644 index 0000000000..9a4ef1116f --- /dev/null +++ b/Library/Homebrew/test/cmd/mcp-server_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +RSpec.describe "brew mcp-server", type: :system do + it "starts the MCP server", :integration_test do + # This is the easiest way to handle a newline here. + # rubocop:disable Style/StringConcatenation + expect { brew_sh "mcp-server", "--ping" } + .to output("==> Started Homebrew MCP server...\n").to_stderr + .and output('{"jsonrpc":"2.0","id":1,"result":{}}' + "\n").to_stdout + .and be_a_success + # rubocop:enable Style/StringConcatenation + end +end diff --git a/Library/Homebrew/test/cmd/migrate_spec.rb b/Library/Homebrew/test/cmd/migrate_spec.rb index 0e592a3f03..913bfef608 100644 --- a/Library/Homebrew/test/cmd/migrate_spec.rb +++ b/Library/Homebrew/test/cmd/migrate_spec.rb @@ -6,7 +6,7 @@ require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Migrate do it_behaves_like "parseable arguments" - it "migrates a renamed Formula", :integration_test do + it "migrates a renamed Formula", :integration_test, :no_api do setup_test_formula "testball1" setup_test_formula "testball2" install_and_rename_coretap_formula "testball1", "testball2" diff --git a/Library/Homebrew/test/cmd/missing_spec.rb b/Library/Homebrew/test/cmd/missing_spec.rb index d1cbb37d8b..3cb7353747 100644 --- a/Library/Homebrew/test/cmd/missing_spec.rb +++ b/Library/Homebrew/test/cmd/missing_spec.rb @@ -6,7 +6,7 @@ require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::Missing do it_behaves_like "parseable arguments" - it "prints missing dependencies", :integration_test do + it "prints missing dependencies", :integration_test, :no_api do setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/cmd/pin_spec.rb b/Library/Homebrew/test/cmd/pin_spec.rb index 15c978f032..782d970402 100644 --- a/Library/Homebrew/test/cmd/pin_spec.rb +++ b/Library/Homebrew/test/cmd/pin_spec.rb @@ -11,4 +11,10 @@ RSpec.describe Homebrew::Cmd::Pin do expect { brew "pin", "testball" }.to be_a_success end + + it "fails with an uninstalled Formula", :integration_test do + setup_test_formula "testball" + + expect { brew "pin", "testball" }.to be_a_failure + end end diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb index 78adf8855c..6efb80fe83 100644 --- a/Library/Homebrew/test/cmd/search_spec.rb +++ b/Library/Homebrew/test/cmd/search_spec.rb @@ -6,7 +6,7 @@ require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::SearchCmd do it_behaves_like "parseable arguments" - it "finds formula in search", :integration_test do + it "finds formula in search", :integration_test, :no_api do setup_test_formula "testball" expect { brew "search", "testball" } diff --git a/Library/Homebrew/test/cmd/setup-ruby_spec.rb b/Library/Homebrew/test/cmd/setup-ruby_spec.rb new file mode 100644 index 0000000000..7bff28754e --- /dev/null +++ b/Library/Homebrew/test/cmd/setup-ruby_spec.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +RSpec.describe "brew setup-ruby", type: :system do + it "installs and configures Homebrew's Ruby", :integration_test do + expect { brew_sh "setup-ruby" } + .to output("").to_stdout + .and not_to_output.to_stderr + .and be_a_success + end +end diff --git a/Library/Homebrew/test/cmd/shellenv_spec.rb b/Library/Homebrew/test/cmd/shellenv_spec.rb new file mode 100644 index 0000000000..2a241b2270 --- /dev/null +++ b/Library/Homebrew/test/cmd/shellenv_spec.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +RSpec.describe "brew shellenv", type: :system do + it "prints export statements", :integration_test do + expect { brew_sh "shellenv" } + .to output(/.*/).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end +end diff --git a/Library/Homebrew/test/cmd/tap-info_spec.rb b/Library/Homebrew/test/cmd/tap-info_spec.rb index ada71038cd..78e96760da 100644 --- a/Library/Homebrew/test/cmd/tap-info_spec.rb +++ b/Library/Homebrew/test/cmd/tap-info_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Homebrew::Cmd::TapInfo do end it "display brief statistics for all installed taps", :integration_test, :needs_network do - expect { brew "tap-info", "HOMEBREW_NO_INSTALL_FROM_API" => nil } + expect { brew "tap-info" } .to output(/\d+ taps?, \d+ private/).to_stdout .and not_to_output.to_stderr .and be_a_success diff --git a/Library/Homebrew/test/cmd/tap_spec.rb b/Library/Homebrew/test/cmd/tap_spec.rb index 5d36439bfb..b01d2ec937 100644 --- a/Library/Homebrew/test/cmd/tap_spec.rb +++ b/Library/Homebrew/test/cmd/tap_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Homebrew::Cmd::TapCmd do it "taps a given Tap", :integration_test do path = setup_test_tap - expect { brew "tap", "--force-auto-update", "homebrew/bar", path/".git" } + expect { brew "tap", "homebrew/bar", path/".git" } .to output(/Tapped/).to_stderr .and be_a_success end diff --git a/Library/Homebrew/test/cmd/untap_spec.rb b/Library/Homebrew/test/cmd/untap_spec.rb index fb1d3a77b0..8100afc00e 100644 --- a/Library/Homebrew/test/cmd/untap_spec.rb +++ b/Library/Homebrew/test/cmd/untap_spec.rb @@ -18,7 +18,7 @@ RSpec.describe Homebrew::Cmd::Untap do end describe "#installed_formulae_for", :integration_test do - shared_examples "finds installed formulae in tap" do + shared_examples "finds installed formulae in tap", :no_api do def load_formula(name:, with_formula_file: false, mock_install: false) formula = if with_formula_file path = setup_test_formula(name, tap:) @@ -84,7 +84,7 @@ RSpec.describe Homebrew::Cmd::Untap do end describe "#installed_casks_for", :cask do - shared_examples "finds installed casks in tap" do + shared_examples "finds installed casks in tap", :no_api do def load_cask(token:, with_cask_file: false, mock_install: false) cask_loader = Cask::CaskLoader::FromContentLoader.new(<<~RUBY, tap:) cask '#{token}' do diff --git a/Library/Homebrew/test/cmd/update-report_spec.rb b/Library/Homebrew/test/cmd/update-report_spec.rb index 7f36c0d0e5..8ff6ddf93d 100644 --- a/Library/Homebrew/test/cmd/update-report_spec.rb +++ b/Library/Homebrew/test/cmd/update-report_spec.rb @@ -131,4 +131,92 @@ RSpec.describe Homebrew::Cmd::UpdateReport do end end end + + describe ReporterHub do + let(:hub) { described_class.new } + + before do + ENV["HOMEBREW_NO_COLOR"] = "1" + allow(hub).to receive(:select_formula_or_cask).and_return([]) + end + + it "dumps new formulae report" do + allow(hub).to receive(:select_formula_or_cask).with(:A).and_return(["foo", "bar", "baz"]) + allow(hub).to receive_messages(installed?: false, all_formula_json: [ + { "name" => "foo", "desc" => "foobly things" }, + { "name" => "baz", "desc" => "baz desc" }, + ]) + expect { hub.dump }.to output(<<~EOS).to_stdout + ==> New Formulae + bar + baz: baz desc + foo: foobly things + EOS + end + + it "dumps new casks report" do + allow(hub).to receive(:select_formula_or_cask).with(:AC).and_return(["foo/cask1", "foo/cask2", "foo/cask3"]) + allow(hub).to receive_messages(cask_installed?: false, all_cask_json: [ + { "token" => "cask1", "desc" => "desc1" }, + { "token" => "cask3", "desc" => "desc3" }, + ]) + allow(Cask::Caskroom).to receive(:any_casks_installed?).and_return(true) + expect { hub.dump }.to output(<<~EOS).to_stdout + ==> New Casks + cask1: desc1 + cask2 + cask3: desc3 + EOS + end + + it "dumps deleted installed formulae and casks report" do + allow(hub).to receive(:select_formula_or_cask).with(:D).and_return(["baz", "foo", "bar"]) + allow(hub).to receive(:installed?).with("baz").and_return(true) + allow(hub).to receive(:installed?).with("foo").and_return(true) + allow(hub).to receive(:installed?).with("bar").and_return(true) + allow(hub).to receive(:select_formula_or_cask).with(:A).and_return([]) + allow(hub).to receive(:select_formula_or_cask).with(:DC).and_return(["cask2", "cask1"]) + allow(hub).to receive(:cask_installed?).with("cask1").and_return(true) + allow(hub).to receive(:cask_installed?).with("cask2").and_return(true) + allow(Homebrew::SimulateSystem).to receive(:simulating_or_running_on_linux?).and_return(false) + expect { hub.dump }.to output(<<~EOS).to_stdout + ==> Deleted Installed Formulae + bar + baz + foo + ==> Deleted Installed Casks + cask1 + cask2 + EOS + end + + it "dumps outdated formulae and casks report" do + allow(Formula).to receive(:installed).and_return([ + instance_double(Formula, name: "foo", outdated?: true), + instance_double(Formula, name: "bar", outdated?: true), + ]) + allow(Cask::Caskroom).to receive(:casks).and_return([ + instance_double(Cask::Cask, token: "baz", outdated?: true), + instance_double(Cask::Cask, token: "qux", outdated?: true), + ]) + expect { hub.dump }.to output(<<~EOS).to_stdout + ==> Outdated Formulae + bar + foo + ==> Outdated Casks + baz + qux + + You have 2 outdated formulae and 2 outdated casks installed. + You can upgrade them with brew upgrade + or list them with brew outdated. + EOS + end + + it "prints nothing if there are no changes" do + allow(Formula).to receive(:installed).and_return([]) + allow(Cask::Caskroom).to receive(:casks).and_return([]) + expect { hub.dump }.not_to output.to_stdout + end + end end diff --git a/Library/Homebrew/test/cmd/upgrade_spec.rb b/Library/Homebrew/test/cmd/upgrade_spec.rb index 59918aaf02..cc82c242c4 100644 --- a/Library/Homebrew/test/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cmd/upgrade_spec.rb @@ -28,48 +28,4 @@ RSpec.describe Homebrew::Cmd::UpgradeCmd do expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist end - - it "upgrades with asking for user prompts with dependants checks", :integration_test do - setup_test_formula "testball", <<~RUBY - depends_on "testball5" - # should work as its not building but test doesnt pass if dependant - # depends_on "build" => :build - depends_on "installed" - RUBY - setup_test_formula "installed" - setup_test_formula "testball5", <<~RUBY - depends_on "testball4" - RUBY - setup_test_formula "testball4" - setup_test_formula "hiop" - setup_test_formula "build" - - (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - (HOMEBREW_CELLAR/"testball5/0.0.1/foo").mkpath - (HOMEBREW_CELLAR/"testball4/0.0.1/foo").mkpath - - keg_dir = HOMEBREW_CELLAR/"installed"/"1.0" - keg_dir.mkpath - touch keg_dir/AbstractTab::FILENAME - - regex = / - Formulae\s*\(3\):\s* - (testball|testball5|testball4) - \s*,\s* - ((?!\1)testball|testball5|testball4) - \s*,\s* - ((?!\1|\2)testball|testball5|testball4) - /x - expect do - brew "upgrade", "--ask" - end.to output(regex) - .to_stdout.and not_to_output.to_stderr - - expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory - expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist - expect(HOMEBREW_CELLAR/"testball5/0.1").to be_a_directory - expect(HOMEBREW_CELLAR/"testball5/0.0.1").not_to exist - expect(HOMEBREW_CELLAR/"testball4/0.1").to be_a_directory - expect(HOMEBREW_CELLAR/"testball4/0.0.1").not_to exist - end end diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index 9cea6ade8c..85a38abbfc 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Homebrew::Cmd::Uses do it_behaves_like "parseable arguments" - it "prints the Formulae a given Formula is used by", :integration_test do + it "prints the Formulae a given Formula is used by", :integration_test, :no_api do # Included in output setup_test_formula "bar" setup_test_formula "optional", <<~RUBY @@ -46,7 +46,7 @@ RSpec.describe Homebrew::Cmd::Uses do .and be_a_success end - it "handles unavailable formula", :integration_test do + it "handles unavailable formula", :integration_test, :no_api do setup_test_formula "foo" setup_test_formula "bar" setup_test_formula "optional", <<~RUBY diff --git a/Library/Homebrew/test/compiler_selector_spec.rb b/Library/Homebrew/test/compiler_selector_spec.rb index a4fe2a9956..91e3f5358f 100644 --- a/Library/Homebrew/test/compiler_selector_spec.rb +++ b/Library/Homebrew/test/compiler_selector_spec.rb @@ -23,7 +23,7 @@ RSpec.describe CompilerSelector do end end - describe "#compiler" do + describe "#compiler", :no_api do it "defaults to cc" do expect(selector.compiler).to eq(cc) end diff --git a/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb b/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb index 2152491e82..5d78ee310f 100644 --- a/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb +++ b/Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb @@ -6,7 +6,7 @@ require "dev-cmd/bump-cask-pr" RSpec.describe Homebrew::DevCmd::BumpCaskPr do subject(:bump_cask_pr) { described_class.new(["test"]) } - let(:newest_macos) { MacOSVersion::SYMBOLS.keys.first } + let(:newest_macos) { MacOSVersion.new(HOMEBREW_MACOS_NEWEST_SUPPORTED).to_sym } let(:c) do Cask::Cask.new("test") do diff --git a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb index 413e6287d2..e4cfa35649 100644 --- a/Library/Homebrew/test/dev-cmd/livecheck_spec.rb +++ b/Library/Homebrew/test/dev-cmd/livecheck_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Homebrew::DevCmd::LivecheckCmd do it "gives an error when no arguments are given and there's no watchlist", :integration_test do expect { brew "livecheck", "HOMEBREW_LIVECHECK_WATCHLIST" => ".this_should_not_exist" } - .to output(/Invalid usage: A watchlist file is required when no arguments are given\./).to_stderr + .to output(/Invalid usage: `brew livecheck` with no arguments needs a watchlist file to be present/).to_stderr .and not_to_output.to_stdout .and be_a_failure end diff --git a/Library/Homebrew/test/dev-cmd/typecheck_spec.rb b/Library/Homebrew/test/dev-cmd/typecheck_spec.rb index dec2de42d2..255f1a9eda 100644 --- a/Library/Homebrew/test/dev-cmd/typecheck_spec.rb +++ b/Library/Homebrew/test/dev-cmd/typecheck_spec.rb @@ -5,4 +5,32 @@ require "dev-cmd/typecheck" RSpec.describe Homebrew::DevCmd::Typecheck do it_behaves_like "parseable arguments" + + describe "#trim_rubocop_rbi" do + let(:rbi_file) { Pathname.new("#{TEST_FIXTURE_DIR}/rubocop@x.x.x.rbi") } + let(:typecheck) { described_class.new([]) } + + before do + allow(Dir).to receive(:glob).and_return([rbi_file.to_s]) + end + + it "trims RuboCop RBI file to only include allowlisted classes" do + old_content = rbi_file.read + + typecheck.trim_rubocop_rbi(path: rbi_file.to_s) + + new_content = rbi_file.read + + expect(new_content).to include("RuboCop::Config") + expect(new_content).to include("RuboCop::Cop::Base") + expect(new_content).to include("Parser::Source") + expect(new_content).to include("VERSION") + expect(new_content).to include("SOME_CONSTANT") + expect(new_content).not_to include("SomeUnusedCop") + expect(new_content).not_to include("UnusedModule") + expect(new_content).not_to include("CompletelyUnrelated") + + rbi_file.write(old_content) + end + end end diff --git a/Library/Homebrew/test/dev-cmd/update-perl-resources_spec.rb b/Library/Homebrew/test/dev-cmd/update-perl-resources_spec.rb new file mode 100644 index 0000000000..cec9170c24 --- /dev/null +++ b/Library/Homebrew/test/dev-cmd/update-perl-resources_spec.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require "cmd/shared_examples/args_parse" +require "dev-cmd/update-perl-resources" + +RSpec.describe Homebrew::DevCmd::UpdatePerlResources do + it_behaves_like "parseable arguments" +end diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 3e1d9c0563..6249670651 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -117,7 +117,6 @@ RSpec.describe Homebrew::Diagnostic::Checks do specify "#check_for_unnecessary_core_tap" do ENV.delete("HOMEBREW_DEVELOPER") - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") expect_any_instance_of(CoreTap).to receive(:installed?).and_return(true) @@ -126,7 +125,6 @@ RSpec.describe Homebrew::Diagnostic::Checks do specify "#check_for_unnecessary_cask_tap" do ENV.delete("HOMEBREW_DEVELOPER") - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") expect_any_instance_of(CoreCaskTap).to receive(:installed?).and_return(true) diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index 27d03c3239..58bdd2fce8 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -71,7 +71,7 @@ RSpec.describe "Exception" do end context "without a dependent" do - it(:to_s) { expect(error.to_s).to eq('No available formula with the name "foo".') } + it(:to_s) { expect(error.to_s).to match(/^No available formula with the name "foo"\./) } end context "with a dependent" do @@ -80,7 +80,7 @@ RSpec.describe "Exception" do end it(:to_s) do - expect(error.to_s).to eq('No available formula with the name "foo" (dependency of foobar).') + expect(error.to_s).to match(/^No available formula with the name "foo" \(dependency of foobar\)\./) end end end diff --git a/Library/Homebrew/test/extend/blank_spec.rb b/Library/Homebrew/test/extend/blank_spec.rb index 6c5d466692..0b80d56f01 100644 --- a/Library/Homebrew/test/extend/blank_spec.rb +++ b/Library/Homebrew/test/extend/blank_spec.rb @@ -5,9 +5,12 @@ require "extend/blank" RSpec.describe Object do let(:empty_true) do Class.new(described_class) do + # This API is intentionally non-ideal for testing. + # rubocop:disable Naming/PredicateMethod def empty? 0 end + # rubocop:enable Naming/PredicateMethod end end let(:empty_false) do diff --git a/Library/Homebrew/test/formatter_spec.rb b/Library/Homebrew/test/formatter_spec.rb index e02451a594..ba866ee8f5 100644 --- a/Library/Homebrew/test/formatter_spec.rb +++ b/Library/Homebrew/test/formatter_spec.rb @@ -110,4 +110,18 @@ RSpec.describe Formatter do expect(described_class.format_help_text(text, width: 80)).to eq expected end end + + describe "::truncate" do + it "returns the original string if it's shorter than max length" do + expect(described_class.truncate("short", max: 10)).to eq("short") + end + + it "truncates strings longer than max length" do + expect(described_class.truncate("this is a long string", max: 10)).to eq("this is...") + end + + it "uses custom omission string" do + expect(described_class.truncate("this is a long string", max: 10, omission: " [...]")).to eq("this [...]") + end + end end diff --git a/Library/Homebrew/test/formula_auditor_spec.rb b/Library/Homebrew/test/formula_auditor_spec.rb index 8b363aebd2..3d842a1e5b 100644 --- a/Library/Homebrew/test/formula_auditor_spec.rb +++ b/Library/Homebrew/test/formula_auditor_spec.rb @@ -519,7 +519,7 @@ RSpec.describe Homebrew::FormulaAuditor do fa.audit_specs expect(fa.problems.first[:message]) - .to match("resource name should be `FooSomething` to match the PyPI package name") + .to match("`resource` name should be 'FooSomething' to match the PyPI package name") end it "reports a problem if the resource name does not match the python wheel name" do @@ -538,7 +538,7 @@ RSpec.describe Homebrew::FormulaAuditor do fa.audit_specs expect(fa.problems.first[:message]) - .to match("resource name should be `FooSomething` to match the PyPI package name") + .to match("`resource` name should be 'FooSomething' to match the PyPI package name") end end @@ -788,7 +788,7 @@ RSpec.describe Homebrew::FormulaAuditor do RUBY fa.audit_specs - expect(fa.problems.first[:message]).to match "Versioned formulae should not have a `HEAD` spec" + expect(fa.problems.first[:message]).to match "Versioned formulae should not have a `head` spec" end it "allows versioned formulae on the allowlist to have a `HEAD` spec" do @@ -911,7 +911,7 @@ RSpec.describe Homebrew::FormulaAuditor do context "when uncommitted should not decrease" do before { formula_gsub "foo-1.0.tar.gz", "foo-0.9.tar.gz" } - it { is_expected.to match("stable version should not decrease (from 1.0 to 0.9)") } + it { is_expected.to match("Stable: version should not decrease (from 1.0 to 0.9)") } end context "when committed can decrease" do @@ -991,31 +991,31 @@ RSpec.describe Homebrew::FormulaAuditor do describe "with the same version, should not decrease" do before { formula_gsub_origin_commit "revision 2", "revision 1" } - it { is_expected.to match("revision should not decrease (from 2 to 1)") } + it { is_expected.to match("`revision` should not decrease (from 2 to 1)") } end describe "should not be removed with the same version" do before { formula_gsub_origin_commit "revision 2" } - it { is_expected.to match("revision should not decrease (from 2 to 0)") } + it { is_expected.to match("`revision` should not decrease (from 2 to 0)") } end describe "should not decrease with the same, uncommitted version" do before { formula_gsub "revision 2", "revision 1" } - it { is_expected.to match("revision should not decrease (from 2 to 1)") } + it { is_expected.to match("`revision` should not decrease (from 2 to 1)") } end describe "should be removed with a newer version" do before { formula_gsub_origin_commit "foo-1.0.tar.gz", "foo-1.1.tar.gz" } - it { is_expected.to match("'revision 2' should be removed") } + it { is_expected.to match("`revision 2` should be removed") } end describe "should be removed with a newer local version" do before { formula_gsub "foo-1.0.tar.gz", "foo-1.1.tar.gz" } - it { is_expected.to match("'revision 2' should be removed") } + it { is_expected.to match("`revision 2` should be removed") } end describe "should not warn on an newer version revision removal" do @@ -1044,7 +1044,7 @@ RSpec.describe Homebrew::FormulaAuditor do formula_gsub "revision 2", "revision 4" end - it { is_expected.to match("revisions should only increment by 1") } + it { is_expected.to match("`revision` should only increment by 1") } end describe "should not warn on past increment by more than 1" do @@ -1094,7 +1094,7 @@ RSpec.describe Homebrew::FormulaAuditor do describe "should not decrease with the same version" do before { formula_gsub_origin_commit "version_scheme 1" } - it { is_expected.to match("version_scheme should not decrease (from 1 to 0)") } + it { is_expected.to match("`version_scheme` should not decrease (from 1 to 0)") } end describe "should not decrease with a new version" do @@ -1104,7 +1104,7 @@ RSpec.describe Homebrew::FormulaAuditor do formula_gsub_origin_commit "version_scheme 1", "" end - it { is_expected.to match("version_scheme should not decrease (from 1 to 0)") } + it { is_expected.to match("`version_scheme` should not decrease (from 1 to 0)") } end describe "should only increment by 1" do @@ -1115,7 +1115,7 @@ RSpec.describe Homebrew::FormulaAuditor do formula_gsub_origin_commit "# no version_scheme", "version_scheme 3" end - it { is_expected.to match("version_schemes should only increment by 1") } + it { is_expected.to match("`version_scheme` should only increment by 1") } end end end @@ -1261,7 +1261,7 @@ RSpec.describe Homebrew::FormulaAuditor do allow(File).to receive(:open).and_return("") end - specify "it warns when conflicting with non-existing formula" do + specify "it warns when conflicting with non-existing formula", :no_api do foo = formula("foo") do url "https://brew.sh/bar-1.0.tgz" @@ -1275,7 +1275,7 @@ RSpec.describe Homebrew::FormulaAuditor do .to match("Can't find conflicting formula \"bar\"") end - specify "it warns when conflicting with itself" do + specify "it warns when conflicting with itself", :no_api do foo = formula("foo") do url "https://brew.sh/bar-1.0.tgz" @@ -1290,7 +1290,7 @@ RSpec.describe Homebrew::FormulaAuditor do .to match("Formula should not conflict with itself") end - specify "it warns when another formula does not have a symmetric conflict" do + specify "it warns when another formula does not have a symmetric conflict", :no_api do stub_formula_loader formula("gcc") { url "gcc-1.0" } stub_formula_loader formula("glibc") { url "glibc-1.0" } diff --git a/Library/Homebrew/test/formula_creator_spec.rb b/Library/Homebrew/test/formula_creator_spec.rb index a708686406..ab1fd26f10 100644 --- a/Library/Homebrew/test/formula_creator_spec.rb +++ b/Library/Homebrew/test/formula_creator_spec.rb @@ -3,28 +3,78 @@ require "formula_creator" RSpec.describe Homebrew::FormulaCreator do - it "gets name from GitHub archive URL" do - t = described_class.name_from_url("https://github.com/abitrolly/lapce/archive/v0.3.0.tar.gz") - expect(t).to eq("lapce") - end + describe ".new" do + tests = { + "generic tarball URL": { + url: "http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz", + expected_name: "synscan", + expected_version: "5.02", + }, + "gitweb URL": { + url: "http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary", + expected_name: "libzipper", + }, + "GitHub repository URL with .git": { + url: "https://github.com/Homebrew/brew.git", + fetch: true, + github_user_repository: ["Homebrew", "brew"], + expected_name: "brew", + expected_head: true, + }, + "GitHub archive URL": { + url: "https://github.com/Homebrew/brew/archive/4.5.7.tar.gz", + fetch: true, + github_user_repository: ["Homebrew", "brew"], + expected_name: "brew", + expected_version: "4.5.7", + }, + "GitHub releases URL": { + url: "https://github.com/stella-emu/stella/releases/download/6.7/stella-6.7-src.tar.xz", + fetch: true, + github_user_repository: ["stella-emu", "stella"], + expected_name: "stella", + expected_version: "6.7", + }, + "GitHub latest release": { + url: "https://github.com/buildpacks/pack", + fetch: true, + github_user_repository: ["buildpacks", "pack"], + latest_release: { "tag_name" => "v0.37.0" }, + expected_name: "pack", + expected_url: "https://github.com/buildpacks/pack/archive/refs/tags/v0.37.0.tar.gz", + expected_version: "v0.37.0", + }, + "GitHub URL with name override": { + url: "https://github.com/RooVetGit/Roo-Code", + name: "roo", + expected_name: "roo", + }, + } - it "gets name from gitweb URL" do - t = described_class.name_from_url("http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary") - expect(t).to eq("libzipper") - end + tests.each do |description, test| + it "parses #{description}" do + fetch = test.fetch(:fetch, false) + if fetch + github_user_repository = test.fetch(:github_user_repository) + allow(GitHub).to receive(:repository).with(*github_user_repository) + if (latest_release = test[:latest_release]) + expect(GitHub).to receive(:get_latest_release).with(*github_user_repository).and_return(latest_release) + end + end - it "gets name from GitHub repo URL" do - t = described_class.name_from_url("https://github.com/abitrolly/lapce.git") - expect(t).to eq("lapce") - end + formula_creator = described_class.new(url: test.fetch(:url), name: test[:name], fetch:) - it "gets name from GitHub download URL" do - t = described_class.name_from_url("https://github.com/stella-emu/stella/releases/download/6.7/stella-6.7-src.tar.xz") - expect(t).to eq("stella") - end - - it "gets name from generic tarball URL" do - t = described_class.name_from_url("http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz") - expect(t).to eq("synscan") + expect(formula_creator.name).to eq(test.fetch(:expected_name)) + if (expected_version = test[:expected_version]) + expect(formula_creator.version).to eq(expected_version) + else + expect(formula_creator.version).to be_null + end + if (expected_url = test[:expected_url]) + expect(formula_creator.url).to eq(expected_url) + end + expect(formula_creator.head).to eq(test.fetch(:expected_head, false)) + end + end end end diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 045b27b3a0..ada1618966 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1046,7 +1046,13 @@ RSpec.describe Formula do before do # Use a more limited os list to shorten the variations hash os_list = [:monterey, :big_sur, :catalina, :mojave, :linux] - stub_const("OnSystem::ALL_OS_ARCH_COMBINATIONS", os_list.product(OnSystem::ARCH_OPTIONS)) + valid_tags = os_list.product(OnSystem::ARCH_OPTIONS).filter_map do |os, arch| + tag = Utils::Bottles::Tag.new(system: os, arch:) + next unless tag.valid_combination? + + tag + end + stub_const("OnSystem::VALID_OS_ARCH_TAGS", valid_tags) # For consistency, always run on Monterey and ARM allow(MacOS).to receive(:version).and_return(MacOSVersion.new("12")) diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 3e344cad5c..64897d7c30 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -55,7 +55,7 @@ RSpec.describe Formulary do end describe "::factory" do - context "without the API" do + context "without the API", :no_api do before do formula_path.dirname.mkpath formula_path.write formula_content @@ -129,7 +129,7 @@ RSpec.describe Formulary do end.to raise_error(FormulaUnavailableError) end - it "returns a Formula when given a URL", :needs_utils_curl, :no_api do + it "returns a Formula when given a URL", :needs_utils_curl do formula = described_class.factory("file://#{formula_path}") expect(formula).to be_a(Formula) end @@ -398,8 +398,6 @@ RSpec.describe Formulary do end before do - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") - # avoid unnecessary network calls allow(Homebrew::API::Formula).to receive_messages(all_aliases: {}, all_renames: {}) allow(CoreTap.instance).to receive(:tap_migrations).and_return({}) @@ -645,16 +643,12 @@ RSpec.describe Formulary do end context "when given a tapped name" do - it "returns a `FromTapLoader`" do + it "returns a `FromTapLoader`", :no_api do expect(described_class.loader_for("homebrew/core/gcc")).to be_a Formulary::FromTapLoader end end - context "when not using the API" do - before do - ENV["HOMEBREW_NO_INSTALL_FROM_API"] = "1" - end - + context "when not using the API", :no_api do context "when a formula is migrated" do let(:token) { "foo" } diff --git a/Library/Homebrew/test/github_runner_matrix_spec.rb b/Library/Homebrew/test/github_runner_matrix_spec.rb index 2920ca6698..8e062d9aa2 100644 --- a/Library/Homebrew/test/github_runner_matrix_spec.rb +++ b/Library/Homebrew/test/github_runner_matrix_spec.rb @@ -3,23 +3,24 @@ require "github_runner_matrix" require "test/support/fixtures/testball" -RSpec.describe GitHubRunnerMatrix do +RSpec.describe GitHubRunnerMatrix, :no_api do before do allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_RUNNER").and_return("ubuntu-latest") allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_LONG_TIMEOUT", "false").and_return("false") allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_BUILD_ON_GITHUB_RUNNER", "false").and_return("false") allow(ENV).to receive(:fetch).with("GITHUB_RUN_ID").and_return("12345") - allow(ENV).to receive(:fetch).with("HOMEBREW_NO_INSTALL_FROM_API", nil).and_call_original allow(ENV).to receive(:fetch).with("HOMEBREW_EVAL_ALL", nil).and_call_original allow(ENV).to receive(:fetch).with("HOMEBREW_SIMULATE_MACOS_ON_LINUX", nil).and_call_original allow(ENV).to receive(:fetch).with("HOMEBREW_FORBID_PACKAGES_FROM_PATHS", nil).and_call_original + allow(ENV).to receive(:fetch).with("HOMEBREW_DEVELOPER", nil).and_call_original + allow(ENV).to receive(:fetch).with("HOMEBREW_NO_INSTALL_FROM_API", nil).and_call_original end let(:newest_supported_macos) do MacOSVersion::SYMBOLS.find { |k, _| k == described_class::NEWEST_HOMEBREW_CORE_MACOS_RUNNER } end - let(:testball) { TestRunnerFormula.new(Testball.new) } + let(:testball) { setup_test_runner_formula("testball") } let(:testball_depender) { setup_test_runner_formula("testball-depender", ["testball"]) } let(:testball_depender_linux) { setup_test_runner_formula("testball-depender-linux", ["testball", :linux]) } let(:testball_depender_macos) { setup_test_runner_formula("testball-depender-macos", ["testball", :macos]) } @@ -314,6 +315,7 @@ RSpec.describe GitHubRunnerMatrix do end end + stub_formula_loader f TestRunnerFormula.new(f) end end diff --git a/Library/Homebrew/test/keg_relocate/relocation_spec.rb b/Library/Homebrew/test/keg_relocate/relocation_spec.rb index a4e0f15be5..f256ed4c56 100644 --- a/Library/Homebrew/test/keg_relocate/relocation_spec.rb +++ b/Library/Homebrew/test/keg_relocate/relocation_spec.rb @@ -32,11 +32,11 @@ RSpec.describe Keg::Relocation do expect(relocation.replacement_pair_for(:library_placeholder)).to eq [library_placeholder, library] end - specify "#replace_text" do + specify "#replace_text!" do relocation = setup_relocation text = +"foo" - relocation.replace_text(text) + relocation.replace_text!(text) expect(text).to eq "foo" text = <<~TEXT @@ -47,7 +47,7 @@ RSpec.describe Keg::Relocation do #{repository_placeholder}/foo foo#{library_placeholder}/bar TEXT - relocation.replace_text(text) + relocation.replace_text!(text) expect(text).to eq <<~REPLACED #{prefix_placeholder}/foo #{cellar_placeholder}/foo diff --git a/Library/Homebrew/test/linux_runner_spec_spec.rb b/Library/Homebrew/test/linux_runner_spec_spec.rb index 8b986c1dd4..4e89a4a076 100644 --- a/Library/Homebrew/test/linux_runner_spec_spec.rb +++ b/Library/Homebrew/test/linux_runner_spec_spec.rb @@ -7,7 +7,7 @@ RSpec.describe LinuxRunnerSpec do described_class.new( name: "Linux", runner: "ubuntu-latest", - container: { image: "ghcr.io/homebrew/ubuntu22.04:master", options: "--user=linuxbrew" }, + container: { image: "ghcr.io/homebrew/ubuntu22.04:main", options: "--user=linuxbrew" }, workdir: "/github/home", timeout: 360, cleanup: false, diff --git a/Library/Homebrew/test/macos_version_spec.rb b/Library/Homebrew/test/macos_version_spec.rb index b6917f7797..706bcfc9a8 100644 --- a/Library/Homebrew/test/macos_version_spec.rb +++ b/Library/Homebrew/test/macos_version_spec.rb @@ -4,12 +4,15 @@ require "macos_version" RSpec.describe MacOSVersion do let(:version) { described_class.new("10.14") } + let(:tahoe_major) { described_class.new("26.0") } let(:big_sur_major) { described_class.new("11.0") } let(:big_sur_update) { described_class.new("11.1") } + let(:frozen_version) { described_class.new("10.14").freeze } - describe ".kernel_major_version" do + describe "::kernel_major_version" do it "returns the kernel major version" do expect(described_class.kernel_major_version(version)).to eq "18" + expect(described_class.kernel_major_version(tahoe_major)).to eq "25" expect(described_class.kernel_major_version(big_sur_major)).to eq "20" expect(described_class.kernel_major_version(big_sur_update)).to eq "20" end @@ -19,12 +22,43 @@ RSpec.describe MacOSVersion do end end + describe "::from_symbol" do + it "raises an error if the symbol is not a valid macOS version" do + expect do + described_class.from_symbol(:foo) + end.to raise_error(MacOSVersion::Error, "unknown or unsupported macOS version: :foo") + end + + it "creates a new version from a valid macOS version" do + symbol_version = described_class.from_symbol(:mojave) + expect(symbol_version).to eq(version) + end + end + + describe "#new" do + it "raises an error if the version is not a valid macOS version" do + expect do + described_class.new("1.2") + end.to raise_error(MacOSVersion::Error, 'unknown or unsupported macOS version: "1.2"') + end + + it "creates a new version from a valid macOS version" do + string_version = described_class.new("11") + expect(string_version).to eq(:big_sur) + end + end + specify "comparison with Symbol" do expect(version).to be > :high_sierra expect(version).to eq :mojave # We're explicitly testing the `===` operator results here. expect(version).to be === :mojave # rubocop:disable Style/CaseEquality expect(version).to be < :catalina + + # This should work like a normal comparison but the result won't be added + # to the `@comparison_cache` hash because the object is frozen. + expect(frozen_version).to eq :mojave + expect(frozen_version.instance_variable_get(:@comparison_cache)).to eq({}) end specify "comparison with Integer" do @@ -64,44 +98,90 @@ RSpec.describe MacOSVersion do end end - describe "#new" do - it "raises an error if the version is not a valid macOS version" do - expect do - described_class.new("1.2") - end.to raise_error(MacOSVersion::Error, 'unknown or unsupported macOS version: "1.2"') + describe "#strip_patch" do + let(:catalina_update) { described_class.new("10.15.1") } + + it "returns the version without the patch" do + expect(big_sur_update.strip_patch).to eq(described_class.new("11")) + expect(catalina_update.strip_patch).to eq(described_class.new("10.15")) end - it "creates a new version from a valid macOS version" do - string_version = described_class.new("11") - expect(string_version).to eq(:big_sur) + it "returns self if version is null" do + expect(described_class::NULL.strip_patch).to be described_class::NULL end end - describe "#from_symbol" do - it "raises an error if the symbol is not a valid macOS version" do - expect do - described_class.from_symbol(:foo) - end.to raise_error(MacOSVersion::Error, "unknown or unsupported macOS version: :foo") - end + specify "#to_sym" do + version_symbol = :mojave - it "creates a new version from a valid macOS version" do - symbol_version = described_class.from_symbol(:mojave) - expect(symbol_version).to eq(version) - end + # We call this more than once to exercise the caching logic + expect(version.to_sym).to eq(version_symbol) + expect(version.to_sym).to eq(version_symbol) + + # This should work like a normal but the symbol won't be stored as the + # `@sym` instance variable because the object is frozen. + expect(frozen_version.to_sym).to eq(version_symbol) + expect(frozen_version.instance_variable_get(:@sym)).to be_nil + + expect(described_class::NULL.to_sym).to eq(:dunno) end specify "#pretty_name" do + version_pretty_name = "Mojave" + expect(described_class.new("10.11").pretty_name).to eq("El Capitan") - expect(described_class.new("10.14").pretty_name).to eq("Mojave") + + # We call this more than once to exercise the caching logic + expect(version.pretty_name).to eq(version_pretty_name) + expect(version.pretty_name).to eq(version_pretty_name) + + # This should work like a normal but the computed name won't be stored as + # the `@pretty_name` instance variable because the object is frozen. + expect(frozen_version.pretty_name).to eq(version_pretty_name) + expect(frozen_version.instance_variable_get(:@pretty_name)).to be_nil end specify "#inspect" do expect(described_class.new("11").inspect).to eq("#") end - specify "#requires_nehalem_cpu?", :needs_macos do - expect(Hardware::CPU).to receive(:type).at_least(:twice).and_return(:intel) - expect(described_class.new("10.14").requires_nehalem_cpu?).to be true - expect(described_class.new("10.12").requires_nehalem_cpu?).to be false + specify "#outdated_release?" do + expect(described_class.new(described_class::SYMBOLS.values.first).outdated_release?).to be false + expect(described_class.new("10.0").outdated_release?).to be true + end + + specify "#prerelease?" do + expect(described_class.new("1000").prerelease?).to be true + end + + specify "#unsupported_release?" do + expect(described_class.new("10.0").unsupported_release?).to be true + expect(described_class.new("1000").prerelease?).to be true + end + + describe "#requires_nehalem_cpu?", :needs_macos do + context "when CPU is Intel" do + it "returns true if version requires a Nehalem CPU" do + allow(Hardware::CPU).to receive(:type).and_return(:intel) + expect(described_class.new("10.14").requires_nehalem_cpu?).to be true + end + + it "returns false if version does not require a Nehalem CPU" do + allow(Hardware::CPU).to receive(:type).and_return(:intel) + expect(described_class.new("10.12").requires_nehalem_cpu?).to be false + end + end + + context "when CPU is not Intel" do + it "raises an error" do + allow(Hardware::CPU).to receive(:type).and_return(:arm) + expect { described_class.new("10.14").requires_nehalem_cpu? } + .to raise_error(ArgumentError) + end + end + + it "returns false when version is null" do + expect(described_class::NULL.requires_nehalem_cpu?).to be false + end end end diff --git a/Library/Homebrew/test/mcp_server_spec.rb b/Library/Homebrew/test/mcp_server_spec.rb new file mode 100644 index 0000000000..96c303fe5e --- /dev/null +++ b/Library/Homebrew/test/mcp_server_spec.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +require "mcp_server" +require "stringio" +require "timeout" + +RSpec.describe Homebrew::McpServer do + let(:stdin) { StringIO.new } + let(:stdout) { StringIO.new } + let(:stderr) { StringIO.new } + let(:server) { described_class.new(stdin:, stdout:, stderr:) } + let(:jsonrpc) { Homebrew::McpServer::JSON_RPC_VERSION } + let(:id) { Random.rand(1000) } + let(:code) { Homebrew::McpServer::ERROR_CODE } + + describe "#initialize" do + it "sets debug_logging to false by default" do + expect(server.debug_logging?).to be(false) + end + + it "sets debug_logging to true if --debug is in ARGV" do + stub_const("ARGV", ["--debug"]) + expect(server.debug_logging?).to be(true) + end + + it "sets debug_logging to true if -d is in ARGV" do + stub_const("ARGV", ["-d"]) + expect(server.debug_logging?).to be(true) + end + end + + describe "#debug and #log" do + it "logs debug output when debug_logging is true" do + stub_const("ARGV", ["--debug"]) + server.debug("foo") + expect(stderr.string).to include("foo") + end + + it "does not log debug output when debug_logging is false" do + server.debug("foo") + expect(stderr.string).to eq("") + end + + it "logs to stderr" do + server.log("bar") + expect(stderr.string).to include("bar") + end + end + + describe "#handle_request" do + it "responds to initialize method" do + request = { "id" => id, "method" => "initialize" } + result = server.handle_request(request) + expect(result).to eq({ + jsonrpc:, + id:, + result: { + protocolVersion: Homebrew::McpServer::MCP_PROTOCOL_VERSION, + capabilities: { + tools: { listChanged: false }, + prompts: {}, + resources: {}, + logging: {}, + roots: {}, + }, + serverInfo: Homebrew::McpServer::SERVER_INFO, + }, + }) + end + + it "responds to resources/list" do + request = { "id" => id, "method" => "resources/list" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, result: { resources: [] } }) + end + + it "responds to resources/templates/list" do + request = { "id" => id, "method" => "resources/templates/list" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, result: { resourceTemplates: [] } }) + end + + it "responds to prompts/list" do + request = { "id" => id, "method" => "prompts/list" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, result: { prompts: [] } }) + end + + it "responds to ping" do + request = { "id" => id, "method" => "ping" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, result: {} }) + end + + it "responds to get_server_info" do + request = { "id" => id, "method" => "get_server_info" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, result: Homebrew::McpServer::SERVER_INFO }) + end + + it "responds to logging/setLevel with debug" do + request = { "id" => id, "method" => "logging/setLevel", "params" => { "level" => "debug" } } + result = server.handle_request(request) + expect(server.debug_logging?).to be(true) + expect(result).to eq({ jsonrpc:, id:, result: {} }) + end + + it "responds to logging/setLevel with non-debug" do + request = { "id" => id, "method" => "logging/setLevel", "params" => { "level" => "info" } } + result = server.handle_request(request) + expect(server.debug_logging?).to be(false) + expect(result).to eq({ jsonrpc:, id:, result: {} }) + end + + it "responds to notifications/initialized" do + request = { "id" => id, "method" => "notifications/initialized" } + expect(server.handle_request(request)).to be_nil + end + + it "responds to notifications/cancelled" do + request = { "id" => id, "method" => "notifications/cancelled" } + expect(server.handle_request(request)).to be_nil + end + + it "responds to tools/list" do + request = { "id" => id, "method" => "tools/list" } + result = server.handle_request(request) + expect(result[:result][:tools]).to match_array(Homebrew::McpServer::TOOLS.values) + end + + Homebrew::McpServer::TOOLS.each do |tool_name, tool_definition| + it "responds to tools/call for #{tool_name}" do + allow(server).to receive(:`).and_return("output for #{tool_name}") + arguments = {} + Array(tool_definition[:required]).each do |required_key| + arguments[required_key] = "dummy" + end + request = { + "id" => id, + "method" => "tools/call", + "params" => { + "name" => tool_name.to_s, + "arguments" => arguments, + }, + } + result = server.handle_request(request) + expect(result).to eq({ + jsonrpc: jsonrpc, + id: id, + result: { content: [{ type: "text", text: "output for #{tool_name}" }] }, + }) + end + end + + it "responds to tools/call for unknown tool" do + request = { "id" => id, "method" => "tools/call", "params" => { "name" => "not_a_tool", "arguments" => {} } } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, error: { message: "Unknown tool", code: } }) + end + + it "responds with error for unknown method" do + request = { "id" => id, "method" => "not_a_method" } + result = server.handle_request(request) + expect(result).to eq({ jsonrpc:, id:, error: { message: "Method not found", code: } }) + end + + it "returns nil if id is nil" do + request = { "method" => "initialize" } + expect(server.handle_request(request)).to be_nil + end + end + + describe "#respond_result" do + it "returns nil if id is nil" do + expect(server.send(:respond_result, nil, {})).to be_nil + end + + it "returns a result hash if id is present" do + result = server.respond_result(id, { foo: "bar" }) + expect(result).to eq({ jsonrpc:, id:, result: { foo: "bar" } }) + end + end + + describe "#respond_error" do + it "returns an error hash" do + result = server.respond_error(id, "fail") + expect(result).to eq({ jsonrpc:, id:, error: { message: "fail", code: } }) + end + end + + describe "#run" do + let(:sleep_time) { 0.001 } + + it "runs the loop and exits cleanly on interrupt" do + stub_const("ARGV", ["--debug"]) + stdin.puts({ id:, method: "ping" }.to_json) + stdin.rewind + server_thread = Thread.new do + server.run + rescue SystemExit + # expected, do nothing + end + + response_hash_string = "Response: {" + sleep(sleep_time) + server_thread.raise(Interrupt) + server_thread.join + + expect(stderr.string).to include(response_hash_string) + end + + it "runs the loop and logs 'Response: nil' when handle_request returns nil" do + stub_const("ARGV", ["--debug"]) + stdin.puts({ id:, method: "notifications/initialized" }.to_json) + stdin.rewind + server_thread = Thread.new do + server.run + rescue SystemExit + # expected, do nothing + end + + response_nil_string = "Response: nil" + sleep(sleep_time) + server_thread.raise(Interrupt) + server_thread.join + + expect(stderr.string).to include(response_nil_string) + end + + it "exits on Interrupt" do + stdin.puts + stdin.rewind + allow(stdin).to receive(:gets).and_raise(Interrupt) + expect do + server.run + rescue + SystemExit + end.to raise_error(SystemExit) + end + + it "exits on error" do + stdin.puts + stdin.rewind + allow(stdin).to receive(:gets).and_raise(StandardError, "fail") + expect do + server.run + rescue + SystemExit + end.to raise_error(SystemExit) + expect(stderr.string).to match(/Error: fail/) + end + end +end diff --git a/Library/Homebrew/test/requirements/macos_requirement_spec.rb b/Library/Homebrew/test/requirements/macos_requirement_spec.rb index ad15adc0c5..f983abd279 100644 --- a/Library/Homebrew/test/requirements/macos_requirement_spec.rb +++ b/Library/Homebrew/test/requirements/macos_requirement_spec.rb @@ -6,6 +6,7 @@ RSpec.describe MacOSRequirement do subject(:requirement) { described_class.new } let(:macos_oldest_allowed) { MacOSVersion.new(HOMEBREW_MACOS_OLDEST_ALLOWED) } + let(:macos_newest_allowed) { MacOSVersion.new(HOMEBREW_MACOS_NEWEST_UNSUPPORTED) } let(:big_sur_major) { MacOSVersion.new("11.0") } describe "#satisfied?" do @@ -37,6 +38,19 @@ RSpec.describe MacOSRequirement do expect(range_requirement.minimum_version).to eq big_sur_major end + specify "#maximum_version" do + no_requirement = described_class.new + max_requirement = described_class.new([:big_sur], comparator: "<=") + min_requirement = described_class.new([:big_sur], comparator: ">=") + exact_requirement = described_class.new([:big_sur], comparator: "==") + range_requirement = described_class.new([[:catalina, :big_sur]], comparator: "==") + expect(no_requirement.maximum_version).to eq macos_newest_allowed + expect(max_requirement.maximum_version).to eq big_sur_major + expect(min_requirement.maximum_version).to eq macos_newest_allowed + expect(exact_requirement.maximum_version).to eq big_sur_major + expect(range_requirement.maximum_version).to eq big_sur_major + end + specify "#allows?" do no_requirement = described_class.new max_requirement = described_class.new([:mojave], comparator: "<=") diff --git a/Library/Homebrew/test/rubocops/cask/no_autobump.rb b/Library/Homebrew/test/rubocops/cask/no_autobump.rb new file mode 100644 index 0000000000..c97fe0c13b --- /dev/null +++ b/Library/Homebrew/test/rubocops/cask/no_autobump.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +require "rubocops/rubocop-cask" + +RSpec.describe RuboCop::Cop::Cask::NoAutobump, :config do + it "reports no offenses if `reason` is acceptable" do + expect_no_offenses <<~CASK + cask 'foo' do + no_autobump! because: "some reason" + end + CASK + end + + it "reports no offenses if `reason` is acceptable as a symbol" do + expect_no_offenses <<~CASK + cask 'foo' do + no_autobump! because: :bumped_by_upstream + end + CASK + end + + it "reports an offense if `reason` is absent" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! + ^^^^^^^^^^^ Add a reason for exclusion from autobump: `no_autobump! because: "..."` + end + CASK + end + + it "reports an offense is `reason` should not be set manually" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! because: :extract_plist + ^^^^^^^^^^^^^^ `:extract_plist` reason should not be used directly + end + CASK + end + + it "reports and corrects an offense if `reason` starts with 'it'" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! because: "it does something" + ^^^^^^^^^^^^^^^^^^^ Do not start the reason with `it` + end + CASK + + expect_correction <<~CASK + cask 'foo' do + no_autobump! because: "does something" + end + CASK + end + + it "reports and corrects an offense if `reason` ends with a period" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! because: "does something." + ^^^^^^^^^^^^^^^^^ Do not end the reason with a punctuation mark + end + CASK + + expect_correction <<~CASK + cask 'foo' do + no_autobump! because: "does something" + end + CASK + end + + it "reports and corrects an offense if `reason` ends with an exclamation point" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! because: "does something!" + ^^^^^^^^^^^^^^^^^ Do not end the reason with a punctuation mark + end + CASK + + expect_correction <<~CASK + cask 'foo' do + no_autobump! because: "does something" + end + CASK + end + + it "reports and corrects an offense if `reason` ends with a question mark" do + expect_offense <<~CASK + cask 'foo' do + no_autobump! because: "does something?" + ^^^^^^^^^^^^^^^^^ Do not end the reason with a punctuation mark + end + CASK + + expect_correction <<~CASK + cask 'foo' do + no_autobump! because: "does something" + end + CASK + end +end diff --git a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb index 3b68c05a32..ba7de8e7b4 100644 --- a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb @@ -173,4 +173,43 @@ RSpec.describe RuboCop::Cop::Cask::NoOverrides, :config do end CASK end + + it "accepts when there is a top-level `depends_on macos:` stanza" do + expect_no_offenses <<~CASK + cask 'foo' do + version '1.2.3' + url 'https://brew.sh/foo.pkg' + + depends_on macos: ">= :sequoia" + + name 'Foo' + end + CASK + end + + it "reports an offense when `on_*` blocks contain a `depends_on macos:` stanza" do + expect_offense <<~CASK + cask 'foo' do + version '1.2.3' + + on_sequoia :or_newer do + sha256 "aaa" + url "https://brew.sh/foo-mac.dmg" + + depends_on macos: ">= :sequoia" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use a `depends_on macos:` stanza inside an `on_{system}` block. Add it once to specify the oldest macOS supported by any version in the cask. + end + + on_arm do + sha256 "bbb" + url "https://brew.sh/foo-arm.dmg" + + depends_on macos: ">= :sequoia" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use a `depends_on macos:` stanza inside an `on_{system}` block. Add it once to specify the oldest macOS supported by any version in the cask. + end + + name 'Foo' + end + CASK + end end diff --git a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb index 7777d226af..fbbc8fc645 100644 --- a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb @@ -19,7 +19,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do cask 'foo' do postflight do on_intel do - ^^^^^^^^ Don't use `on_intel` in `postflight do`, use `if Hardware::CPU.intel?` instead. + ^^^^^^^^ Instead of using `on_intel` in `postflight do`, use `if Hardware::CPU.intel?`. foobar end end @@ -43,7 +43,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do cask 'foo' do postflight do on_monterey do - ^^^^^^^^^^^ Don't use `on_monterey` in `postflight do`, use `if MacOS.version == :monterey` instead. + ^^^^^^^^^^^ Instead of using `on_monterey` in `postflight do`, use `if MacOS.version == :monterey`. foobar end end @@ -67,7 +67,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do cask 'foo' do postflight do on_monterey :or_older do - ^^^^^^^^^^^^^^^^^^^^^ Don't use `on_monterey :or_older` in `postflight do`, use `if MacOS.version <= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^ Instead of using `on_monterey :or_older` in `postflight do`, use `if MacOS.version <= :monterey`. foobar end end @@ -171,7 +171,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do expect_offense <<~CASK cask 'foo' do if Hardware::CPU.arm? && other_condition - ^^^^^^^^^^^^^^^^^^ Don't use `Hardware::CPU.arm?`, use `on_arm` and `on_intel` blocks instead. + ^^^^^^^^^^^^^^^^^^ Instead of `Hardware::CPU.arm?`, use `on_arm` and `on_intel` blocks. sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" else sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" @@ -184,7 +184,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do expect_offense <<~CASK cask 'foo' do if Hardware::CPU.intel? && other_condition - ^^^^^^^^^^^^^^^^^^^^ Don't use `Hardware::CPU.intel?`, use `on_arm` and `on_intel` blocks instead. + ^^^^^^^^^^^^^^^^^^^^ Instead of `Hardware::CPU.intel?`, use `on_arm` and `on_intel` blocks. sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" else sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b" @@ -200,7 +200,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" url "https://example.com/foo-#{version}-#{Hardware::CPU.arch}.zip" - ^^^^^^^^^^^^^^^^^^ Don't use `Hardware::CPU.arch`, use `on_arm` and `on_intel` blocks instead. + ^^^^^^^^^^^^^^^^^^ Instead of `Hardware::CPU.arch`, use `on_arm` and `on_intel` blocks. end CASK end @@ -211,7 +211,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do expect_offense <<~CASK cask 'foo' do if MacOS.version == :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version == :catalina`, use `on_catalina do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Instead of `if MacOS.version == :catalina`, use `on_catalina do`. version "1.0.0" else version "2.0.0" @@ -224,7 +224,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do expect_offense <<~CASK cask 'foo' do if MacOS.version <= :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version <= :catalina`, use `on_catalina :or_older do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Instead of `if MacOS.version <= :catalina`, use `on_catalina :or_older do`. version "1.0.0" else version "2.0.0" @@ -237,7 +237,7 @@ RSpec.describe RuboCop::Cop::Cask::OnSystemConditionals, :config do expect_offense <<~CASK cask 'foo' do if MacOS.version >= :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version >= :catalina`, use `on_catalina :or_newer do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Instead of `if MacOS.version >= :catalina`, use `on_catalina :or_newer do`. version "1.0.0" else version "2.0.0" diff --git a/Library/Homebrew/test/rubocops/caveats_spec.rb b/Library/Homebrew/test/rubocops/caveats_spec.rb index 93a80060be..7524d7df54 100644 --- a/Library/Homebrew/test/rubocops/caveats_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_spec.rb @@ -13,7 +13,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Caveats do url "https://brew.sh/foo-1.0.tgz" def caveats "setuid" - ^^^^^^^^ FormulaAudit/Caveats: Don't recommend `setuid` in the caveats, suggest `sudo` instead. + ^^^^^^^^ FormulaAudit/Caveats: Instead of recommending `setuid` in the caveats, suggest `sudo`. end end RUBY @@ -42,5 +42,35 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Caveats do end RUBY end + + it "reports an offense if dynamic logic (if/else/unless) is used in caveats" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + homepage "https://brew.sh/foo" + url "https://brew.sh/foo-1.0.tgz" + def caveats + if true + ^^^^^^^ FormulaAudit/Caveats: Don't use dynamic logic (if/else/unless) in caveats. + "foo" + else + "bar" + end + end + end + RUBY + + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + homepage "https://brew.sh/foo" + url "https://brew.sh/foo-1.0.tgz" + def caveats + unless false + ^^^^^^^^^^^^ FormulaAudit/Caveats: Don't use dynamic logic (if/else/unless) in caveats. + "foo" + end + end + end + RUBY + end end end diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb index c05e29827d..612a0b5383 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb @@ -13,12 +13,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ChecksumCase do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a" - ^ FormulaAudit/ChecksumCase: sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: `sha256` should be lowercase resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1Ae0a645b426b047aa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea9" - ^ FormulaAudit/ChecksumCase: sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: `sha256` should be lowercase end end end @@ -32,7 +32,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ChecksumCase do resource "foo-outside" do url "https://github.com/foo-lang/foo-outside/archive/0.18.0.tar.gz" sha256 "A4cc7cd3f7d1605ffa1ac5755cf6e1ae0a645b426b047a6a39a8b2268ddc7ea9" - ^ FormulaAudit/ChecksumCase: sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: `sha256` should be lowercase end stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb index a50b7122a7..b82593f96b 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb @@ -13,12 +13,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "" - ^^ FormulaAudit/Checksum: sha256 is empty + ^^ FormulaAudit/Checksum: `sha256` is empty resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "" - ^^ FormulaAudit/Checksum: sha256 is empty + ^^ FormulaAudit/Checksum: `sha256` is empty end end end @@ -32,12 +32,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: `sha256` should be 64 characters resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c047aaa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: `sha256` should be 64 characters end end end @@ -51,12 +51,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c0k7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a" - ^ FormulaAudit/Checksum: sha256 contains invalid characters + ^ FormulaAudit/Checksum: `sha256` contains invalid characters resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426x047aa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea9" - ^ FormulaAudit/Checksum: sha256 contains invalid characters + ^ FormulaAudit/Checksum: `sha256` contains invalid characters end end end @@ -70,7 +70,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do bottle do sha256 catalina: "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: `sha256` should be 64 characters end end RUBY @@ -83,7 +83,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do bottle do sha256 cellar: :any, catalina: "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: `sha256` should be 64 characters end end RUBY diff --git a/Library/Homebrew/test/rubocops/class/class_name_spec.rb b/Library/Homebrew/test/rubocops/class/class_name_spec.rb index 78050236a1..49fbc0812f 100644 --- a/Library/Homebrew/test/rubocops/class/class_name_spec.rb +++ b/Library/Homebrew/test/rubocops/class/class_name_spec.rb @@ -14,7 +14,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using ScriptFileFormula" do expect_offense(<<~RUBY) class Foo < ScriptFileFormula - ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: ScriptFileFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: `ScriptFileFormula` is deprecated, use `Formula` instead url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -24,7 +24,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using GithubGistFormula" do expect_offense(<<~RUBY) class Foo < GithubGistFormula - ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: GithubGistFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: `GithubGistFormula` is deprecated, use `Formula` instead url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -34,7 +34,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using AmazonWebServicesFormula" do expect_offense(<<~RUBY) class Foo < AmazonWebServicesFormula - ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: AmazonWebServicesFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: `AmazonWebServicesFormula` is deprecated, use `Formula` instead url 'https://brew.sh/foo-1.0.tgz' end RUBY diff --git a/Library/Homebrew/test/rubocops/class/test_spec.rb b/Library/Homebrew/test/rubocops/class/test_spec.rb index cabeddb71e..deb36fc66f 100644 --- a/Library/Homebrew/test/rubocops/class/test_spec.rb +++ b/Library/Homebrew/test/rubocops/class/test_spec.rb @@ -6,46 +6,46 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Test do subject(:cop) { described_class.new } it "reports and corrects an offense when /usr/local/bin is found in test calls" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' test do system "/usr/local/bin/test" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Test: use \#{bin} instead of /usr/local/bin in system + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Test: Use `#{bin}` instead of `/usr/local/bin` in `system` end end RUBY - expect_correction(<<~RUBY) + expect_correction(<<~'RUBY') class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' test do - system "\#{bin}/test" + system "#{bin}/test" end end RUBY end it "reports and corrects an offense when passing 0 as the second parameter to shell_output" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' test do - shell_output("\#{bin}/test", 0) - ^ FormulaAudit/Test: Passing 0 to shell_output() is redundant + shell_output("#{bin}/test", 0) + ^ FormulaAudit/Test: Passing 0 to `shell_output` is redundant end end RUBY - expect_correction(<<~RUBY) + expect_correction(<<~'RUBY') class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' test do - shell_output("\#{bin}/test") + shell_output("#{bin}/test") end end RUBY diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index 8fce98e573..a52843b836 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -511,7 +511,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_macos do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_macos` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_macos` block in a formula. depends_on "foo" end end @@ -527,7 +527,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_linux do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_linux` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_linux` block in a formula. depends_on "foo" end end @@ -543,7 +543,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_intel do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_intel` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_intel` block in a formula. depends_on "foo" end end @@ -559,7 +559,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_arm do - ^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_arm` block in a formula. + ^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_arm` block in a formula. depends_on "foo" end end @@ -575,7 +575,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_monterey do - ^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a formula. + ^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_monterey` block in a formula. depends_on "foo" end end @@ -591,7 +591,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_monterey :or_older do - ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a formula. + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_monterey` block in a formula. depends_on "foo" end end @@ -881,7 +881,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_macos` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_macos` block in a resource block. on_macos do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -902,7 +902,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_linux` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_linux` block in a resource block. on_linux do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -923,7 +923,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_intel` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_intel` block in a resource block. on_intel do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -944,7 +944,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_arm` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_arm` block in a resource block. on_arm do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -965,7 +965,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: There can only be one `on_monterey` block in a resource block. on_monterey do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" diff --git a/Library/Homebrew/test/rubocops/dependency_order_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_spec.rb index bbcfe253e4..80a465a938 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_spec.rb @@ -13,7 +13,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos "apple" if build.with? "foo" uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 5) should be put before dependency "apple" (line 4) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 5) should be put before `dependency "apple"` (line 4) end RUBY @@ -34,7 +34,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "foo" (line 4) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 5) should be put before `dependency "foo"` (line 4) end RUBY @@ -55,7 +55,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos FooRequirement uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 5) should be put before `dependency "FooRequirement"` (line 4) end RUBY @@ -77,13 +77,13 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do head do uses_from_macos "apple" if build.with? "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 6) should be put before `dependency "apple"` (line 5) uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 7) should be put before `dependency "apple"` (line 5) end uses_from_macos "apple" if build.with? "foo" uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 10) should be put before dependency "apple" (line 9) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 10) should be put before `dependency "apple"` (line 9) end RUBY @@ -122,9 +122,9 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do on_arm do uses_from_macos "apple" if build.with? "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 6) should be put before `dependency "apple"` (line 5) uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 7) should be put before `dependency "apple"` (line 5) end end RUBY @@ -151,7 +151,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on "apple" if build.with? "foo" depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 5) should be put before dependency "apple" (line 4) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 5) should be put before `dependency "apple"` (line 4) end RUBY @@ -172,7 +172,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "foo" (line 4) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 5) should be put before `dependency "foo"` (line 4) end RUBY @@ -193,7 +193,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on FooRequirement depends_on "bar" - ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 5) should be put before `dependency "FooRequirement"` (line 4) end RUBY @@ -215,13 +215,13 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do head do depends_on "apple" if build.with? "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 6) should be put before `dependency "apple"` (line 5) depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 7) should be put before `dependency "apple"` (line 5) end depends_on "apple" if build.with? "foo" depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 10) should be put before dependency "apple" (line 9) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 10) should be put before `dependency "apple"` (line 9) end RUBY @@ -260,9 +260,9 @@ RSpec.describe RuboCop::Cop::FormulaAudit::DependencyOrder do on_linux do depends_on "apple" if build.with? "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "bar"` (line 6) should be put before `dependency "apple"` (line 5) depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: `dependency "foo"` (line 7) should be put before `dependency "apple"` (line 5) end end RUBY diff --git a/Library/Homebrew/test/rubocops/desc_spec.rb b/Library/Homebrew/test/rubocops/desc_spec.rb index 29ecf06de7..173e07033d 100644 --- a/Library/Homebrew/test/rubocops/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/desc_spec.rb @@ -9,7 +9,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Desc do it "reports an offense when there is no `desc`" do expect_offense(<<~RUBY) class Foo < Formula - ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Desc: Formula should have a desc (Description). + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Desc: Formula should have a `desc` (description). url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -20,7 +20,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc '' - ^^^^^^^ FormulaAudit/Desc: The desc (description) should not be an empty string. + ^^^^^^^ FormulaAudit/Desc: The `desc` (description) should not be an empty string. end RUBY end diff --git a/Library/Homebrew/test/rubocops/homepage_spec.rb b/Library/Homebrew/test/rubocops/homepage_spec.rb index 6b845603c4..3857ee4bc8 100644 --- a/Library/Homebrew/test/rubocops/homepage_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_spec.rb @@ -19,7 +19,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "ftp://brew.sh/foo" - ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: The homepage should start with http or https. + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: The `homepage` should start with http or https. url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -29,7 +29,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://www.freedesktop.org/wiki/bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled `https://wiki.freedesktop.org/project_name` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled: https://wiki.freedesktop.org/project_name url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -39,7 +39,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://www.freedesktop.org/wiki/Software/baz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled `https://wiki.freedesktop.org/www/Software/project_name` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled: https://wiki.freedesktop.org/www/Software/project_name url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -79,7 +79,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do RUBY end - describe "for Sourceforge" do + describe "for SourceForge" do correct_formula = <<~RUBY class Foo < Formula homepage "https://foo.sourceforge.io/" @@ -91,7 +91,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sourceforge.net/" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: SourceForge homepages should be: https://foo.sourceforge.io/ url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -103,7 +103,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sourceforge.net" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: SourceForge homepages should be: https://foo.sourceforge.io/ url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -115,7 +115,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sf.net/" - ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: SourceForge homepages should be: https://foo.sourceforge.io/ url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -128,7 +128,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "https://foo.readthedocs.org" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Readthedocs homepages should be `https://foo.readthedocs.io` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Readthedocs homepages should be: https://foo.readthedocs.io url "https://brew.sh/foo-1.0.tgz" end RUBY diff --git a/Library/Homebrew/test/rubocops/lines/quictls_check_spec.rb b/Library/Homebrew/test/rubocops/lines/quictls_check_spec.rb index 3ee173448d..81150a2dee 100644 --- a/Library/Homebrew/test/rubocops/lines/quictls_check_spec.rb +++ b/Library/Homebrew/test/rubocops/lines/quictls_check_spec.rb @@ -13,7 +13,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::QuicTLSCheck do url 'https://brew.sh/foo-1.0.tgz' depends_on "quictls" - ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/QuicTLSCheck: Formulae in homebrew/core should use 'depends_on "openssl@3"' instead of 'depends_on "quictls"'. + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/QuicTLSCheck: Formulae in homebrew/core should use `depends_on "openssl@3"` instead of `depends_on "quictls"`. end RUBY end diff --git a/Library/Homebrew/test/rubocops/no_autobump.rb b/Library/Homebrew/test/rubocops/no_autobump.rb new file mode 100644 index 0000000000..2b66a85398 --- /dev/null +++ b/Library/Homebrew/test/rubocops/no_autobump.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +require "rubocops/no_autobump" + +RSpec.describe RuboCop::Cop::FormulaAudit::NoAutobump do + subject(:cop) { described_class.new } + + it "reports no offenses if `reason` is acceptable" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "some reason" + end + RUBY + end + + it "reports no offenses if `reason` is acceptable as a symbol" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: :bumped_by_upstream + end + RUBY + end + + it "reports an offense if `reason` is absent" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! + ^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: Add a reason for exclusion from autobump: `no_autobump! because: "..."` + end + RUBY + end + + it "reports an offense is `reason` should not be set manually" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: :extract_plist + ^^^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: `:extract_plist` reason should not be used directly + end + RUBY + end + + it "reports and corrects an offense if `reason` starts with 'it'" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "it does something" + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: Do not start the reason with `it` + end + RUBY + + expect_correction(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something" + end + RUBY + end + + it "reports and corrects an offense if `reason` ends with a period" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something." + ^^^^^^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: Do not end the reason with a punctuation mark + end + RUBY + + expect_correction(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something" + end + RUBY + end + + it "reports and corrects an offense if `reason` ends with an exclamation point" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something!" + ^^^^^^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: Do not end the reason with a punctuation mark + end + RUBY + + expect_correction(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something" + end + RUBY + end + + it "reports and corrects an offense if `reason` ends with a question mark" do + expect_offense(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something?" + ^^^^^^^^^^^^^^^^^ FormulaAudit/NoAutobumpReason: Do not end the reason with a punctuation mark + end + RUBY + + expect_correction(<<~RUBY) + class Foo < Formula + url 'https://brew.sh/foo-1.0.tgz' + no_autobump! because: "does something" + end + RUBY + end +end diff --git a/Library/Homebrew/test/rubocops/options_spec.rb b/Library/Homebrew/test/rubocops/options_spec.rb index 5c1d2d376e..604fd98db7 100644 --- a/Library/Homebrew/test/rubocops/options_spec.rb +++ b/Library/Homebrew/test/rubocops/options_spec.rb @@ -32,7 +32,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Options do url 'https://brew.sh/foo-1.0.tgz' option :cxx11 option "examples", "with-examples" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Options: Options should begin with with/without. Migrate '--examples' with `deprecated_option`. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Options: Options should begin with `with` or `without`. Migrate '--examples' with `deprecated_option`. end RUBY end diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index 9f568fd453..00c60d1c2b 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -24,7 +24,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Patches do homepage "ftp://brew.sh/foo" url "https://brew.sh/foo-1.0.tgz" def patches - ^^^^^^^^^^^ FormulaAudit/Patches: Use the patch DSL instead of defining a 'patches' method + ^^^^^^^^^^^ FormulaAudit/Patches: Use the `patch` DSL instead of defining a `patches` method DATA end end @@ -83,7 +83,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Patches do commit = "b354c009a60bcd6d7fc04014e200a1ee9c45c167" fixed_url = "https://api.bitbucket.org/2.0/repositories/multicoreware/x265_git/diff/#{commit}" expect_offense_hash(message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source:) - FormulaAudit/Patches: Bitbucket patches should use the api url: #{fixed_url} + FormulaAudit/Patches: Bitbucket patches should use the API URL: #{fixed_url} EOS end expected_offense.zip([inspect_source(source).last]).each do |expected, actual| @@ -112,7 +112,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Patches do expected_offenses = [ { - message: "FormulaAudit/Patches: Use the patch DSL instead of defining a 'patches' method", + message: "FormulaAudit/Patches: Use the `patch` DSL instead of defining a `patches` method", severity: :convention, line: 4, column: 2, @@ -166,7 +166,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Patches do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' patch :DATA - ^^^^^^^^^^^ FormulaAudit/Patches: patch is missing '__END__' + ^^^^^^^^^^^ FormulaAudit/Patches: Patch is missing `__END__` end RUBY end @@ -177,7 +177,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Patches do url 'https://brew.sh/foo-1.0.tgz' end __END__ - ^^^^^^^ FormulaAudit/Patches: patch is missing 'DATA' + ^^^^^^^ FormulaAudit/Patches: Patch is missing `patch :DATA` patch content here RUBY end diff --git a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb index 0fa2145e8c..f43d070b46 100644 --- a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb @@ -12,7 +12,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ProvidedByMacos do homepage "https://brew.sh" keg_only :provided_by_macos - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ProvidedByMacos: Formulae that are `keg_only :provided_by_macos` should be added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repo) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ProvidedByMacos: Formulae that are `keg_only :provided_by_macos` should be added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repository) end RUBY end diff --git a/Library/Homebrew/test/rubocops/shell_commands_spec.rb b/Library/Homebrew/test/rubocops/shell_commands_spec.rb index bcd8601ea9..6d0e1734ff 100644 --- a/Library/Homebrew/test/rubocops/shell_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/shell_commands_spec.rb @@ -26,19 +26,19 @@ RSpec.describe RuboCop::Cop::Homebrew::ShellCommands do end it "reports and corrects an offense when `system` arguments involving interpolation should be separated" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula def install - system "\#{bin}/foo bar" - ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `system` commands into `"\#{bin}/foo", "bar"` + system "#{bin}/foo bar" + ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `system` commands into `"#{bin}/foo", "bar"` end end RUBY - expect_correction(<<~RUBY) + expect_correction(<<~'RUBY') class Foo < Formula def install - system "\#{bin}/foo", "bar" + system "#{bin}/foo", "bar" end end RUBY @@ -151,19 +151,19 @@ RSpec.describe RuboCop::Cop::Homebrew::ShellCommands do end it "reports and corrects an offense when `Utils.popen_read` arguments with interpolation are unseparated" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula def install - Utils.popen_read("\#{bin}/foo bar") - ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"\#{bin}/foo", "bar"` + Utils.popen_read("#{bin}/foo bar") + ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"#{bin}/foo", "bar"` end end RUBY - expect_correction(<<~RUBY) + expect_correction(<<~'RUBY') class Foo < Formula def install - Utils.popen_read("\#{bin}/foo", "bar") + Utils.popen_read("#{bin}/foo", "bar") end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb index baa6a32e6d..f3f15fecd3 100644 --- a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb +++ b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb @@ -12,7 +12,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' FileUtils.mv "hello" - ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Don't need 'FileUtils.' before mv + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: No need for `FileUtils.` before `mv` end RUBY end @@ -23,7 +23,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' inreplace "foo" do |longvar| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: "inreplace do |s|" is preferred over "|longvar|". + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `inreplace do |s|` is preferred over `|longvar|`. somerandomCall(longvar) end end @@ -37,7 +37,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' bottle do rebuild 0 - ^^^^^^^^^ FormulaAudit/Miscellaneous: 'rebuild 0' should be removed + ^^^^^^^^^ FormulaAudit/Miscellaneous: `rebuild 0` should be removed sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra end end @@ -53,7 +53,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra end fails_with :llvm do - ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: 'fails_with :llvm' is now a no-op so should be removed + ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `fails_with :llvm` is now a no-op and should be removed build 2335 cause "foo" end @@ -68,7 +68,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def test - ^^^^^^^^ FormulaAudit/Miscellaneous: Use new-style test definitions (test do) + ^^^^^^^^ FormulaAudit/Miscellaneous: Use new-style test definitions (`test do`) assert_equals "1", "1" end end @@ -165,7 +165,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' rm_rf Dir["src/{llvm,test,librustdoc,etc/snapshot.pyc}"] rm_rf Dir["src/snapshot.pyc"] - ^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Dir(["src/snapshot.pyc"]) is unnecessary; just use "src/snapshot.pyc" + ^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `Dir(["src/snapshot.pyc"])` is unnecessary; just use `src/snapshot.pyc` end RUBY end @@ -184,7 +184,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do it "reports an offense when top-level functions are defined outside of a class body" do expect_offense(<<~RUBY) def test - ^^^^^^^^ FormulaAudit/Miscellaneous: Define method test in the class body, not at the top-level + ^^^^^^^^ FormulaAudit/Miscellaneous: Define method `test` in the class body, not at the top-level nil end class Foo < Formula @@ -201,7 +201,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install man1.install man+"man8" => "faad.1" - ^^^^^^ FormulaAudit/Miscellaneous: "man+"man8"" should be "man8" + ^^^^^^ FormulaAudit/Miscellaneous: `man+"man8"` should be `man8` end end RUBY @@ -214,7 +214,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "/usr/bin/gcc", "foo" - ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cc}" instead of hard-coding "gcc" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `#{ENV.cc}` instead of hard-coding `gcc` end end RUBY @@ -227,7 +227,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "/usr/bin/g++", "-o", "foo", "foo.cc" - ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cxx}" instead of hard-coding "g++" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `#{ENV.cxx}` instead of hard-coding `g++` end end RUBY @@ -240,20 +240,20 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install ENV["COMPILER_PATH"] = "/usr/bin/c++" - ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cxx}" instead of hard-coding "c++" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `#{ENV.cxx}` instead of hard-coding `c++` end end RUBY end it "reports an offense when a hard-coded `gcc` is set as COMPILER_PATH" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula desc "foo" url 'https://brew.sh/foo-1.0.tgz' def install ENV["COMPILER_PATH"] = "/usr/bin/gcc" - ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "\#{ENV.cc}" instead of hard-coding "gcc" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `#{ENV.cc}` instead of hard-coding `gcc` end end RUBY @@ -266,7 +266,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install mv "#{share}/man", share - ^^^^ FormulaAudit/Miscellaneous: "#{share}/man" should be "#{man}" + ^^^^ FormulaAudit/Miscellaneous: `#{share}/man` should be `#{man}` end end RUBY @@ -279,7 +279,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install mv "#{prefix}/libexec", share - ^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/libexec" should be "#{libexec}" + ^^^^^^^^ FormulaAudit/Miscellaneous: `#{prefix}/libexec` should be `#{libexec}` end end RUBY @@ -292,7 +292,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "./configure", "--INFODIR=#{prefix}/share/info" - ^^^^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/share/info" should be "#{info}" + ^^^^^^^^^^^ FormulaAudit/Miscellaneous: `#{prefix}/share/info` should be `#{info}` end end RUBY @@ -305,7 +305,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "./configure", "--MANDIR=#{prefix}/share/man/man8" - ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/share/man/man8" should be "#{man8}" + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `#{prefix}/share/man/man8` should be `#{man8}` end end RUBY @@ -317,7 +317,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "lpeg" => :lua51 - ^^^^^^ FormulaAudit/Miscellaneous: lua modules should be vendored rather than use deprecated `depends_on "lpeg" => :lua51` + ^^^^^^ FormulaAudit/Miscellaneous: lua modules should be vendored rather than using deprecated `depends_on "lpeg" => :lua51` end RUBY end @@ -328,7 +328,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "export", "var=value" - ^^^^^^^^ FormulaAudit/Miscellaneous: Use ENV instead of invoking 'export' to modify the environment + ^^^^^^^^ FormulaAudit/Miscellaneous: Use `ENV` instead of invoking `export` to modify the environment end RUBY end @@ -339,7 +339,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "foo" => "with-bar" - ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency foo should not use option with-bar + ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency 'foo' should not use option `with-bar` end RUBY end @@ -351,9 +351,9 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' depends_on "httpd" => [:build, :test] depends_on "foo" => [:optional, "with-bar"] - ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency foo should not use option with-bar + ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency 'foo' should not use option `with-bar` depends_on "icu4c" => [:optional, "c++11"] - ^^^^^^^ FormulaAudit/Miscellaneous: Dependency icu4c should not use option c++11 + ^^^^^^^ FormulaAudit/Miscellaneous: Dependency 'icu4c' should not use option `c++11` end RUBY end @@ -364,7 +364,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' if version == "HEAD" - ^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use 'build.head?' instead of inspecting 'version' + ^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `build.head?` instead of inspecting `version` foo() end end @@ -378,8 +378,8 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' test do head = ARGV.include? "--HEAD" - ^^^^ FormulaAudit/Miscellaneous: Use build instead of ARGV to check options - ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "if build.head?" instead + ^^^^ FormulaAudit/Miscellaneous: Use `build.with?` or `build.without?` instead of `ARGV` to check options + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `if build.head?` instead end end RUBY @@ -391,7 +391,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' needs :openmp - ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: 'needs :openmp' should be replaced with 'depends_on "gcc"' + ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `needs :openmp` should be replaced with `depends_on "gcc"` end RUBY end @@ -403,7 +403,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' test do version = MACOS_VERSION - ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use MacOS.version instead of MACOS_VERSION + ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use `MacOS.version` instead of `MACOS_VERSION` end end RUBY @@ -415,7 +415,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "foo" if build.with? "foo" - ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on "foo" if build.with? "foo" with depends_on "foo" => :optional + ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace `depends_on "foo" if build.with? "foo"` with `depends_on "foo" => :optional` end RUBY end @@ -426,7 +426,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on :foo unless build.without? "foo" - ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on :foo unless build.without? "foo" with depends_on :foo => :recommended + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace `depends_on :foo unless build.without? "foo"` with `depends_on :foo => :recommended` end RUBY end @@ -437,7 +437,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on :foo unless build.include? "without-foo" - ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on :foo unless build.include? "without-foo" with depends_on :foo => :recommended + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace `depends_on :foo unless build.include? "without-foo"` with `depends_on :foo => :recommended` end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb index 986f689c75..0ccedc8c52 100644 --- a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb +++ b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb @@ -12,7 +12,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::MpiCheck do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "mpich" - ^^^^^^^^^^^^^^^^^^ FormulaAudit/MpiCheck: Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'. + ^^^^^^^^^^^^^^^^^^ FormulaAudit/MpiCheck: Formulae in homebrew/core should use `depends_on "open-mpi"` instead of `depends_on "mpich"`. end RUBY diff --git a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb index 9757208197..aec211e200 100644 --- a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb @@ -11,7 +11,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if OS.linux? - ^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if OS.linux?`, use `on_linux do` instead. + ^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if OS.linux?`, use `on_linux do`. url 'https://brew.sh/linux-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -37,7 +37,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if OS.mac? - ^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if OS.mac?`, use `on_macos do` instead. + ^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if OS.mac?`, use `on_macos do`. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -66,7 +66,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_macos do - ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_macos` in `def install`, use `if OS.mac?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_macos` in `def install`, use `if OS.mac?`. true end end @@ -95,7 +95,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_linux do - ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_linux` in `def install`, use `if OS.linux?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_linux` in `def install`, use `if OS.linux?`. true end end @@ -124,7 +124,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_macos do - ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_macos` in `test do`, use `if OS.mac?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_macos` in `test do`, use `if OS.mac?`. true end end @@ -152,7 +152,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if Hardware::CPU.arm? - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if Hardware::CPU.arm?`, use `on_arm do` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if Hardware::CPU.arm?`, use `on_arm do`. url 'https://brew.sh/linux-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -178,7 +178,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if Hardware::CPU.intel? - ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if Hardware::CPU.intel?`, use `on_intel do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if Hardware::CPU.intel?`, use `on_intel do`. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -207,7 +207,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_intel do - ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_intel` in `def install`, use `if Hardware::CPU.intel?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_intel` in `def install`, use `if Hardware::CPU.intel?`. true end end @@ -236,7 +236,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_arm do - ^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_arm` in `def install`, use `if Hardware::CPU.arm?` instead. + ^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_arm` in `def install`, use `if Hardware::CPU.arm?`. true end end @@ -265,7 +265,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_intel do - ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_intel` in `test do`, use `if Hardware::CPU.intel?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_intel` in `test do`, use `if Hardware::CPU.intel?`. true end end @@ -293,7 +293,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version == :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version == :monterey`, use `on_monterey do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if MacOS.version == :monterey`, use `on_monterey do`. url 'https://brew.sh/linux-1.0.tgz' end end @@ -314,7 +314,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version <= :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version <= :monterey`, use `on_system :linux, macos: :monterey_or_older do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if MacOS.version <= :monterey`, use `on_system :linux, macos: :monterey_or_older do`. url 'https://brew.sh/mac-1.0.tgz' end end @@ -335,7 +335,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version < :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version < :monterey`, use `on_system do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if MacOS.version < :monterey`, use `on_system do`. url 'https://brew.sh/mac-1.0.tgz' end end @@ -347,7 +347,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version >= :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version >= :monterey`, use `on_monterey :or_newer do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if MacOS.version >= :monterey`, use `on_monterey :or_newer do`. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -361,7 +361,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version > :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version > :monterey`, use `on_monterey do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of `if MacOS.version > :monterey`, use `on_monterey do`. url 'https://brew.sh/mac-1.0.tgz' end end @@ -376,7 +376,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey do - ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey` in `def install`, use `if MacOS.version == :monterey` instead. + ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_monterey` in `def install`, use `if MacOS.version == :monterey`. true end end @@ -405,7 +405,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey :or_older do - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey :or_older` in `def install`, use `if MacOS.version <= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_monterey :or_older` in `def install`, use `if MacOS.version <= :monterey`. true end end @@ -434,7 +434,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey :or_newer do - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey :or_newer` in `def install`, use `if MacOS.version >= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_monterey :or_newer` in `def install`, use `if MacOS.version >= :monterey`. true end end @@ -463,7 +463,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_system :linux, macos: :monterey_or_newer do - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_system :linux, macos: :monterey_or_newer` in `def install`, use `if OS.linux? || MacOS.version >= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_system :linux, macos: :monterey_or_newer` in `def install`, use `if OS.linux? || MacOS.version >= :monterey`. true end end @@ -492,7 +492,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_monterey do - ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey` in `test do`, use `if MacOS.version == :monterey` instead. + ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_monterey` in `test do`, use `if MacOS.version == :monterey`. true end end @@ -521,7 +521,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_system :linux, macos: :monterey do - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_system :linux, macos: :monterey` in `test do`, use `if OS.linux? || MacOS.version == :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Instead of using `on_system :linux, macos: :monterey` in `test do`, use `if OS.linux? || MacOS.version == :monterey`. true end end diff --git a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb index b14e6daafd..34f4b668a7 100644 --- a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb +++ b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb @@ -57,7 +57,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return unless build.without? "bar" - ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use if build.with? "bar" instead of unless build.without? "bar" + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use `if build.with? "bar"` instead of `unless build.without? "bar"` end end RUBY @@ -70,7 +70,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return unless build.with? "bar" - ^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use if build.without? "bar" instead of unless build.with? "bar" + ^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use `if build.without? "bar"` instead of `unless build.with? "bar"` end end RUBY @@ -83,7 +83,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if !build.with? "bar" - ^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't negate 'build.with?': use 'build.without?' + ^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Instead of negating `build.with?`, use `build.without?` end end RUBY @@ -96,7 +96,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if !build.without? "bar" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't negate 'build.without?': use 'build.with?' + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Instead of negating `build.without?`, use `build.with?` end end RUBY @@ -109,7 +109,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.without? "--without-bar" - ^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't duplicate 'without': Use `build.without? "bar"` to check for "--without-bar" + ^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Instead of duplicating `without`, use `build.without? "bar"` to check for "--without-bar" end end RUBY @@ -122,7 +122,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.with? "--with-bar" - ^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't duplicate 'with': Use `build.with? "bar"` to check for "--with-bar" + ^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Instead of duplicating `with`, use `build.with? "bar"` to check for '--with-bar' end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb index ddf39dc3cc..aa7c7b9100 100644 --- a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb +++ b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb @@ -64,19 +64,19 @@ RSpec.describe RuboCop::Cop::FormulaAudit::ShellVariables do end it "reports and corrects unexpanded shell variables while preserving string interpolation" do - expect_offense(<<~RUBY) + expect_offense(<<~'RUBY') class Foo < Formula def install - Utils.popen "SHELL=bash \#{bin}/foo" - ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.popen({ "SHELL" => "bash" }, "\#{bin}/foo")` instead of `Utils.popen "SHELL=bash \#{bin}/foo"` + Utils.popen "SHELL=bash #{bin}/foo" + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.popen({ "SHELL" => "bash" }, "#{bin}/foo")` instead of `Utils.popen "SHELL=bash #{bin}/foo"` end end RUBY - expect_correction(<<~RUBY) + expect_correction(<<~'RUBY') class Foo < Formula def install - Utils.popen({ "SHELL" => "bash" }, "\#{bin}/foo") + Utils.popen({ "SHELL" => "bash" }, "#{bin}/foo") end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/std_npm_args_spec.rb b/Library/Homebrew/test/rubocops/text/std_npm_args_spec.rb index c0bb9e97ed..2c5ea62337 100644 --- a/Library/Homebrew/test/rubocops/text/std_npm_args_spec.rb +++ b/Library/Homebrew/test/rubocops/text/std_npm_args_spec.rb @@ -22,7 +22,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::StdNpmArgs do class Foo < Formula def install system "npm", "install", *Language::Node.local_npm_install_args, "--production" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use 'std_npm_args' instead of 'local_npm_install_args'. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use `std_npm_args` instead of `local_npm_install_args`. end end RUBY @@ -41,7 +41,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::StdNpmArgs do class Foo < Formula def install system "npm", "install", *Language::Node.std_npm_install_args(libexec), "--production" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use 'std_npm_args' instead of 'std_npm_install_args'. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use `std_npm_args` instead of `std_npm_install_args`. end end RUBY @@ -60,7 +60,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::StdNpmArgs do class Foo < Formula def install system "npm", "install", *Language::Node.std_npm_install_args(buildpath), "--production" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use 'std_npm_args' instead of 'std_npm_install_args'. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/StdNpmArgs: Use `std_npm_args` instead of `std_npm_install_args`. end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/strict_spec.rb b/Library/Homebrew/test/rubocops/text/strict_spec.rb index dde8271967..b57143c46b 100644 --- a/Library/Homebrew/test/rubocops/text/strict_spec.rb +++ b/Library/Homebrew/test/rubocops/text/strict_spec.rb @@ -29,29 +29,29 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do end it %Q(reports an offense if "\#{share}/" is present) do - expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_offense(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula def install - ohai "\#{share}/foo" - ^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foo` + ohai "#{share}/foo" + ^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `#{pkgshare}` instead of `#{share}/foo` end end RUBY - expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_offense(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula def install - ohai "\#{share}/foo/bar" - ^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foo` + ohai "#{share}/foo/bar" + ^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `#{pkgshare}` instead of `#{share}/foo` end end RUBY - expect_offense(<<~RUBY, "/homebrew-core/Formula/foolibc++.rb") + expect_offense(<<~'RUBY', "/homebrew-core/Formula/foolibc++.rb") class Foolibcxx < Formula def install - ohai "\#{share}/foolibc++" - ^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foolibc++` + ohai "#{share}/foolibc++" + ^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `#{pkgshare}` instead of `#{share}/foolibc++` end end RUBY @@ -87,10 +87,10 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do end it %Q(reports no offenses if "\#{share}/" doesn't match formula name) do - expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_no_offenses(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula def install - ohai "\#{share}/foo-bar" + ohai "#{share}/foo-bar" end end RUBY @@ -123,10 +123,10 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do end it %Q(reports no offenses if formula name appears after "\#{share}/") do - expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_no_offenses(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula def install - ohai "\#{share}/bar/foo" + ohai "#{share}/bar/foo" end end RUBY @@ -134,13 +134,13 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do context "for interpolated bin paths" do it 'reports an offense & autocorrects if "\#{bin}/" or other dashed binaries too are present' do - expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_offense(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula test do - system "\#{bin}/foo", "-v" - ^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `bin/"foo"` instead of `"\#{bin}/foo"` - system "\#{bin}/foo-bar", "-v" - ^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `bin/"foo-bar"` instead of `"\#{bin}/foo-bar"` + system "#{bin}/foo", "-v" + ^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `bin/"foo"` instead of `"#{bin}/foo"` + system "#{bin}/foo-bar", "-v" + ^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `bin/"foo-bar"` instead of `"#{bin}/foo-bar"` end end RUBY @@ -156,12 +156,12 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do end it 'does not report an offense if \#{bin}/foo and then a space and more text' do - expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_no_offenses(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula test do - shell_output("\#{bin}/foo --version") - assert_match "help", shell_output("\#{bin}/foo-something --help 2>&1") - assert_match "OK", shell_output("\#{bin}/foo-something_else --check 2>&1") + shell_output("#{bin}/foo --version") + assert_match "help", shell_output("#{bin}/foo-something --help 2>&1") + assert_match "OK", shell_output("#{bin}/foo-something_else --check 2>&1") end end RUBY @@ -169,11 +169,11 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do end it 'does not report an offense if "\#{bin}/foo" is in a word array' do - expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo.rb") + expect_no_offenses(<<~'RUBY', "/homebrew-core/Formula/foo.rb") class Foo < Formula test do cmd = %W[ - \#{bin}/foo + #{bin}/foo version ] assert_match version.to_s, shell_output(cmd) diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index df7dc19b4b..8a8ca38e0b 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -30,7 +30,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do url "https://brew.sh/foo-1.0.tgz" homepage "https://brew.sh" revision 0 - ^^^^^^^^^^ FormulaAudit/Text: "revision 0" is unnecessary + ^^^^^^^^^^ FormulaAudit/Text: `revision 0` is unnecessary end RUBY end @@ -103,7 +103,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `xcodebuild *args` instead of `system 'xcodebuild', *args` end end RUBY @@ -117,7 +117,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `xcodebuild *args` instead of `system 'xcodebuild', *args` end def plist @@ -140,7 +140,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do it 'reports an offense if `require "language/go"` is present' do expect_offense(<<~RUBY) require "language/go" - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: require "language/go" is no longer necessary or correct + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: `require "language/go"` is no longer necessary or correct class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -162,7 +162,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do def install Formula.factory(name) - ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: "Formula.factory(name)" is deprecated in favor of "Formula[name]" + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: `Formula.factory(name)` is deprecated in favour of `Formula[name]` end end RUBY @@ -176,7 +176,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do def install system "dep", "ensure" - ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "dep", "ensure", "-vendor-only" + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `"dep", "ensure", "-vendor-only"` end end RUBY @@ -190,7 +190,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do def install system "cargo", "build" - ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "cargo", "install", *std_cargo_args + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `"cargo", "install", *std_cargo_args` end end RUBY @@ -221,11 +221,24 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Text do end it "reports an offense if paths are concatenated in string interpolation" do + expect_offense(<<~'RUBY') + class Foo < Formula + def install + ohai "foo #{bar + "baz"}" + ^^^^^^^^^^^^^^ FormulaAudit/Text: Do not concatenate paths in string interpolation + end + end + RUBY + end + + it 'reports offenses if eg `lib+"thing"` is present' do expect_offense(<<~RUBY) class Foo < Formula def install - ohai "foo \#{bar + "baz"}" - ^^^^^^^^^^^^^^ FormulaAudit/Text: Do not concatenate paths in string interpolation + (lib+"foo").install + ^^^^^^^^^ FormulaAudit/Text: Use `lib/"foo"` instead of `lib+"foo"` + (bin+"foobar").install + ^^^^^^^^^^^^ FormulaAudit/Text: Use `bin/"foobar"` instead of `bin+"foobar"` end end RUBY diff --git a/Library/Homebrew/test/rubocops/urls/git_spec.rb b/Library/Homebrew/test/rubocops/urls/git_spec.rb index c95deae3e2..329b3b8d86 100644 --- a/Library/Homebrew/test/rubocops/urls/git_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_spec.rb @@ -55,7 +55,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for Git URLs tag: "v1.0.0" end RUBY @@ -66,7 +66,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for Git URLs shallow: false, tag: "v1.0.0" end diff --git a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb index 1e511173d1..5015133cda 100644 --- a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb @@ -46,7 +46,7 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for Git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" end RUBY @@ -57,7 +57,7 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for Git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", shallow: false end diff --git a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb index f4d1186ead..a7f35253f9 100644 --- a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb @@ -11,7 +11,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::PyPiUrls do class Foo < Formula desc "foo" url "https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: Use the "Source" URL found on the PyPI downloads page (https://pypi.org/project/foo/#files) end RUBY end @@ -21,7 +21,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::PyPiUrls do class Foo < Formula desc "foo" url "https://files.pythonhosted.org/packages/source/f/foo/foo-0.1.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: Use the "Source" URL found on the PyPI downloads page (https://pypi.org/project/foo/#files) end RUBY end diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index 80bf49199a..a5574f9ddc 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -8,11 +8,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do let(:offense_list) do [{ "url" => "https://ftpmirror.gnu.org/lightning/lightning-2.1.0.tar.gz", - "msg" => 'Please use "https://ftp.gnu.org/gnu/lightning/lightning-2.1.0.tar.gz" instead of https://ftpmirror.gnu.org/lightning/lightning-2.1.0.tar.gz.', + "msg" => "https://ftpmirror.gnu.org/lightning/lightning-2.1.0.tar.gz should be: " \ + "https://ftp.gnu.org/gnu/lightning/lightning-2.1.0.tar.gz", "col" => 2, }, { "url" => "https://fossies.org/linux/privat/monit-5.23.0.tar.gz", - "msg" => "Please don't use fossies.org in the url (using as a mirror is fine)", + "msg" => "Please don't use \"fossies.org\" in the `url` (using as a mirror is fine)", "col" => 2, }, { "url" => "http://tools.ietf.org/tools/rfcmarkup/rfcmarkup-1.119.tgz", @@ -20,23 +21,23 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do "col" => 2, }, { "url" => "https://apache.org/dyn/closer.cgi?path=/apr/apr-1.7.0.tar.bz2", - "msg" => "https://apache.org/dyn/closer.cgi?path=/apr/apr-1.7.0.tar.bz2 should be " \ - "`https://www.apache.org/dyn/closer.lua?path=apr/apr-1.7.0.tar.bz2`", + "msg" => "https://apache.org/dyn/closer.cgi?path=/apr/apr-1.7.0.tar.bz2 should be: " \ + "https://www.apache.org/dyn/closer.lua?path=apr/apr-1.7.0.tar.bz2", "col" => 2, }, { "url" => "http://search.mcpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.003.tar.gz", - "msg" => "http://search.mcpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.003.tar.gz should be " \ - "`https://cpan.metacpan.org/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.003.tar.gz`", + "msg" => "http://search.mcpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.003.tar.gz should be: " \ + "https://cpan.metacpan.org/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.003.tar.gz", "col" => 2, }, { "url" => "http://ftp.gnome.org/pub/GNOME/binaries/mac/banshee/banshee-2.macosx.intel.dmg", - "msg" => "http://ftp.gnome.org/pub/GNOME/binaries/mac/banshee/banshee-2.macosx.intel.dmg should be " \ - "`https://download.gnome.org/binaries/mac/banshee/banshee-2.macosx.intel.dmg`", + "msg" => "http://ftp.gnome.org/pub/GNOME/binaries/mac/banshee/banshee-2.macosx.intel.dmg should be: " \ + "https://download.gnome.org/binaries/mac/banshee/banshee-2.macosx.intel.dmg", "col" => 2, }, { "url" => "git://anonscm.debian.org/users/foo/foostrap.git", - "msg" => "git://anonscm.debian.org/users/foo/foostrap.git should be " \ - "`https://anonscm.debian.org/git/users/foo/foostrap.git`", + "msg" => "git://anonscm.debian.org/users/foo/foostrap.git should be: " \ + "https://anonscm.debian.org/git/users/foo/foostrap.git", "col" => 2, }, { "url" => "ftp://ftp.mirrorservice.org/foo-1.tar.gz", @@ -44,31 +45,31 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do "col" => 2, }, { "url" => "ftp://ftp.cpan.org/pub/CPAN/foo-1.tar.gz", - "msg" => "ftp://ftp.cpan.org/pub/CPAN/foo-1.tar.gz should be `http://search.cpan.org/CPAN/foo-1.tar.gz`", + "msg" => "ftp://ftp.cpan.org/pub/CPAN/foo-1.tar.gz should be: http://search.cpan.org/CPAN/foo-1.tar.gz", "col" => 2, }, { "url" => "http://sourceforge.net/projects/something/files/Something-1.2.3.dmg", - "msg" => "Use https://downloads.sourceforge.net to get geolocation (url is " \ + "msg" => "Use \"https://downloads.sourceforge.net\" to get geolocation (`url` is " \ "http://sourceforge.net/projects/something/files/Something-1.2.3.dmg).", "col" => 2, }, { "url" => "https://downloads.sourceforge.net/project/foo/download", - "msg" => "Don't use /download in SourceForge urls (url is " \ + "msg" => "Don't use \"/download\" in SourceForge URLs (`url` is " \ "https://downloads.sourceforge.net/project/foo/download).", "col" => 2, }, { "url" => "https://sourceforge.net/project/foo", - "msg" => "Use https://downloads.sourceforge.net to get geolocation " \ - "(url is https://sourceforge.net/project/foo).", + "msg" => "Use \"https://downloads.sourceforge.net\" to get geolocation (`url` is " \ + "https://sourceforge.net/project/foo).", "col" => 2, }, { "url" => "http://prdownloads.sourceforge.net/foo/foo-1.tar.gz", - "msg" => "Don't use prdownloads in SourceForge urls " \ - "(url is http://prdownloads.sourceforge.net/foo/foo-1.tar.gz).", + "msg" => "Don't use \"prdownloads\" in SourceForge URLs (`url` is " \ + "http://prdownloads.sourceforge.net/foo/foo-1.tar.gz).", "col" => 2, }, { "url" => "http://foo.dl.sourceforge.net/sourceforge/foozip/foozip_1.0.tar.bz2", - "msg" => "Don't use specific dl mirrors in SourceForge urls (url is " \ + "msg" => "Don't use specific \"dl\" mirrors in SourceForge URLs (`url` is " \ "http://foo.dl.sourceforge.net/sourceforge/foozip/foozip_1.0.tar.bz2).", "col" => 2, }, { @@ -124,12 +125,12 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do "msg" => "Please use https:// for http://github.com/foo/foo5.git", "col" => 2, }, { - "url" => "https://github.com/foo/foobar/archive/master.zip", + "url" => "https://github.com/foo/foobar/archive/main.zip", "msg" => "Use versioned rather than branch tarballs for stable checksums.", "col" => 2, }, { "url" => "https://github.com/foo/bar/tarball/v1.2.3", - "msg" => "Use /archive/ URLs for GitHub tarballs (url is https://github.com/foo/bar/tarball/v1.2.3).", + "msg" => "Use /archive/ URLs for GitHub tarballs (`url` is https://github.com/foo/bar/tarball/v1.2.3).", "col" => 2, }, { "url" => "https://codeload.github.com/foo/bar/tar.gz/v0.1.1", @@ -142,8 +143,8 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do "col" => 2, }, { "url" => "https://central.maven.org/maven2/com/bar/foo/1.1/foo-1.1.jar", - "msg" => "https://central.maven.org/maven2/com/bar/foo/1.1/foo-1.1.jar should be " \ - "`https://search.maven.org/remotecontent?filepath=com/bar/foo/1.1/foo-1.1.jar`", + "msg" => "https://central.maven.org/maven2/com/bar/foo/1.1/foo-1.1.jar should be: " \ + "https://search.maven.org/remotecontent?filepath=com/bar/foo/1.1/foo-1.1.jar", "col" => 2, }, { "url" => "https://brew.sh/example-darwin.x86_64.tar.gz", @@ -159,23 +160,31 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Urls do "formula_tap" => "homebrew-core", }, { "url" => "cvs://brew.sh/foo/bar", - "msg" => "Use of the cvs:// scheme is deprecated, pass `:using => :cvs` instead", + "msg" => "Use of the \"cvs://\" scheme is deprecated, pass `using: :cvs` instead", "col" => 2, }, { "url" => "bzr://brew.sh/foo/bar", - "msg" => "Use of the bzr:// scheme is deprecated, pass `:using => :bzr` instead", + "msg" => "Use of the \"bzr://\" scheme is deprecated, pass `using: :bzr` instead", "col" => 2, }, { "url" => "hg://brew.sh/foo/bar", - "msg" => "Use of the hg:// scheme is deprecated, pass `:using => :hg` instead", + "msg" => "Use of the \"hg://\" scheme is deprecated, pass `using: :hg` instead", "col" => 2, }, { "url" => "fossil://brew.sh/foo/bar", - "msg" => "Use of the fossil:// scheme is deprecated, pass `:using => :fossil` instead", + "msg" => "Use of the \"fossil://\" scheme is deprecated, pass `using: :fossil` instead", "col" => 2, }, { "url" => "svn+http://brew.sh/foo/bar", - "msg" => "Use of the svn+http:// scheme is deprecated, pass `:using => :svn` instead", + "msg" => "Use of the \"svn+http://\" scheme is deprecated, pass `using: :svn` instead", + "col" => 2, + }, { + "url" => "https://🫠.sh/foo/bar", + "msg" => "Please use the ASCII (Punycode-encoded host, URL-encoded path and query) version of https://🫠.sh/foo/bar.", + "col" => 2, + }, { + "url" => "https://ßrew.sh/foo/bar", + "msg" => "Please use the ASCII (Punycode-encoded host, URL-encoded path and query) version of https://ßrew.sh/foo/bar.", "col" => 2, }] end diff --git a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb index 5d00eb4f7c..7bd5e15349 100644 --- a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb @@ -13,7 +13,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::UsesFromMacos do homepage "https://brew.sh" uses_from_macos "postgresql" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not postgresql. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not 'postgresql'. end RUBY end @@ -25,10 +25,10 @@ RSpec.describe RuboCop::Cop::FormulaAudit::UsesFromMacos do homepage "https://brew.sh" uses_from_macos "boost" - ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not boost. + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not 'boost'. uses_from_macos "bzip2" uses_from_macos "postgresql" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not postgresql. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not 'postgresql'. uses_from_macos "zlib" end RUBY diff --git a/Library/Homebrew/test/rubocops/version_spec.rb b/Library/Homebrew/test/rubocops/version_spec.rb index c4c9dfef1e..1f8329db49 100644 --- a/Library/Homebrew/test/rubocops/version_spec.rb +++ b/Library/Homebrew/test/rubocops/version_spec.rb @@ -11,7 +11,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "" - ^^^^^^^^^^ FormulaAudit/Version: version is set to an empty string + ^^^^^^^^^^ FormulaAudit/Version: Version is set to an empty string end RUBY end @@ -21,7 +21,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "v1.0" - ^^^^^^^^^^^^^^ FormulaAudit/Version: version v1.0 should not have a leading 'v' + ^^^^^^^^^^^^^^ FormulaAudit/Version: Version v1.0 should not have a leading 'v' end RUBY end @@ -31,7 +31,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "1_0" - ^^^^^^^^^^^^^ FormulaAudit/Version: version 1_0 should not end with an underline and a number + ^^^^^^^^^^^^^ FormulaAudit/Version: Version 1_0 should not end with an underline and a number end RUBY end diff --git a/Library/Homebrew/test/rubocops/zero_zero_zero_zero_spec.rb b/Library/Homebrew/test/rubocops/zero_zero_zero_zero_spec.rb new file mode 100644 index 0000000000..96aafc0125 --- /dev/null +++ b/Library/Homebrew/test/rubocops/zero_zero_zero_zero_spec.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +require "rubocops/zero_zero_zero_zero" + +RSpec.describe RuboCop::Cop::FormulaAudit::ZeroZeroZeroZero do + subject(:cop) { described_class.new } + + it "reports no offenses when 0.0.0.0 is used inside test do blocks" do + expect_no_offenses(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + test do + system "echo", "0.0.0.0" + end + end + RUBY + end + + it "reports no offenses for valid IP ranges like 10.0.0.0" do + expect_no_offenses(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def install + system "echo", "10.0.0.0" + end + end + RUBY + end + + it "reports no offenses for IP range notation like 0.0.0.0-255.255.255.255" do + expect_no_offenses(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def install + system "echo", "0.0.0.0-255.255.255.255" + end + end + RUBY + end + + it "reports no offenses for private IP ranges" do + expect_no_offenses(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def install + system "echo", "192.168.1.1" + system "echo", "172.16.0.1" + system "echo", "10.0.0.1" + end + end + RUBY + end + + it "reports no offenses when outside of homebrew-core" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + service do + run [bin/"foo", "--host", "0.0.0.0"] + end + end + RUBY + end + + it "reports offenses when 0.0.0.0 is used in service blocks" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + service do + run [bin/"foo", "--host", "0.0.0.0"] + ^^^^^^^^^ FormulaAudit/ZeroZeroZeroZero: Do not use 0.0.0.0 as it can be a security risk. + end + end + RUBY + end + + it "reports offenses when 0.0.0.0 is used outside of test do blocks" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def install + system "echo", "0.0.0.0" + ^^^^^^^^^ FormulaAudit/ZeroZeroZeroZero: Do not use 0.0.0.0 as it can be a security risk. + end + end + RUBY + end + + it "reports offenses for 0.0.0.0 in method definitions outside test blocks" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def configure + system "./configure", "--bind-address=0.0.0.0" + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ZeroZeroZeroZero: Do not use 0.0.0.0 as it can be a security risk. + end + end + RUBY + end + + it "reports multiple offenses when 0.0.0.0 is used in multiple places" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + desc "A test formula" + + def install + system "echo", "0.0.0.0" + ^^^^^^^^^ FormulaAudit/ZeroZeroZeroZero: Do not use 0.0.0.0 as it can be a security risk. + end + + def post_install + system "echo", "0.0.0.0" + ^^^^^^^^^ FormulaAudit/ZeroZeroZeroZero: Do not use 0.0.0.0 as it can be a security risk. + end + end + RUBY + end +end diff --git a/Library/Homebrew/test/services/cli_spec.rb b/Library/Homebrew/test/services/cli_spec.rb index e1ab8457c7..000039475d 100644 --- a/Library/Homebrew/test/services/cli_spec.rb +++ b/Library/Homebrew/test/services/cli_spec.rb @@ -42,16 +42,16 @@ RSpec.describe Homebrew::Services::Cli do end end - describe "#check" do + describe "#check!" do it "checks the input does not exist" do expect do - services_cli.check([]) + services_cli.check!([]) end.to raise_error(UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all") end it "checks the input exists" do expect do - services_cli.check("hello") + services_cli.check!("hello") end.not_to raise_error(UsageError, "Invalid usage: Formula(e) missing, please provide a formula name or use --all") end diff --git a/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb b/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb deleted file mode 100644 index 9f50418353..0000000000 --- a/Library/Homebrew/test/sorbet/tapioca/compilers/args_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -require "tapioca/dsl" -require "sorbet/tapioca/compilers/args" - -RSpec.describe Tapioca::Compilers::Args do - let(:compiler) { described_class.new(Tapioca::Dsl::Pipeline.new(requested_constants: []), RBI::Tree.new, Homebrew) } - let(:list_parser) do - require "cmd/list" - Homebrew::Cmd::List.parser - end - - # Good testing candidate because it has multiple for each of `switch`, `flag` and `comma_array` args: - let(:update_python_resources_parser) do - require "dev-cmd/update-python-resources" - Homebrew::DevCmd::UpdatePythonResources.parser - end - - describe "#args_table" do - it "returns a mapping of list args to default values" do - expect(compiler.args_table(list_parser)).to contain_exactly( - :"1?", :built_from_source?, :cask?, :casks?, :d?, :debug?, :formula?, :formulae?, :full_name?, :h?, :help?, - :installed_as_dependency?, :installed_on_request?, :l?, :multiple?, :pinned?, :poured_from_bottle?, :q?, - :quiet?, :r?, :t?, :v?, :verbose?, :versions? - ) - end - - it "returns a mapping of update-python-resources args to default values" do - expect(compiler.args_table(update_python_resources_parser)).to contain_exactly( - :d?, :debug?, :exclude_packages, :extra_packages, :h?, :help?, :ignore_errors?, :ignore_non_pypi_packages?, - :install_dependencies?, :p?, :package_name, :print_only?, :q?, :quiet?, :s?, :silent?, :v?, :verbose?, - :version - ) - end - end - - describe "#comma_arrays" do - it "returns an empty list when there are no comma_array args" do - expect(compiler.comma_arrays(list_parser)).to eq([]) - end - - it "returns the comma_array args when they exist" do - expect(compiler.comma_arrays(update_python_resources_parser)).to eq([:extra_packages, :exclude_packages]) - end - end - - describe "#get_return_type" do - let(:comma_arrays) { compiler.comma_arrays(update_python_resources_parser) } - - it "returns the correct type for switches" do - expect(compiler.get_return_type(:silent?, comma_arrays)).to eq("T::Boolean") - end - - it "returns the correct type for flags" do - expect(compiler.get_return_type(:package_name, comma_arrays)).to eq("T.nilable(String)") - end - - it "returns the correct type for comma_arrays" do - expect(compiler.get_return_type(:extra_packages, comma_arrays)).to eq("T.nilable(T::Array[String])") - end - end -end diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index a40023c2c6..8bf8ea63d0 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -59,6 +59,7 @@ TEST_DIRECTORIES = [ CoreTap.instance.path/"Formula", HOMEBREW_CACHE, HOMEBREW_CACHE_FORMULA, + HOMEBREW_CACHE/"api", HOMEBREW_CELLAR, HOMEBREW_LOCKS, HOMEBREW_LOGS, @@ -249,6 +250,11 @@ RSpec.configure do |config| @__stderr = $stderr.clone @__stdin = $stdin.clone + # Link original API cache files to test cache directory. + Pathname("#{ENV.fetch("HOMEBREW_CACHE")}/api").glob("*.json").each do |path| + FileUtils.ln_s path, HOMEBREW_CACHE/"api/#{path.basename}" + end + begin if example.metadata.keys.exclude?(:focus) && !ENV.key?("HOMEBREW_VERBOSE_TESTS") $stdout.reopen(File::NULL) diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.arm64_tahoe.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.arm64_tahoe.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.arm64_tahoe.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.tahoe.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.tahoe.bottle.tar.gz new file mode 120000 index 0000000000..3e989830ba --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.tahoe.bottle.tar.gz @@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb index bbde7db9c3..a65cde70d0 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb @@ -1,20 +1,18 @@ cask "with-depends-on-macos-failure" do - version "1.2.3" - sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" - # guarantee a mismatched release - on_mojave :or_older do - depends_on macos: :catalina + on_big_sur :or_older do + version "1.2.3" + sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" end - on_catalina do - depends_on macos: :mojave - end - on_big_sur :or_newer do - depends_on macos: :catalina + on_ventura :or_newer do + version "1.2.3" + sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94" end url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/with-depends-on-macos-failure" + depends_on macos: :monterey + app "Caffeine.app" end diff --git a/Library/Homebrew/test/support/fixtures/rubocop@x.x.x.rbi b/Library/Homebrew/test/support/fixtures/rubocop@x.x.x.rbi new file mode 100644 index 0000000000..476e7f2a25 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/rubocop@x.x.x.rbi @@ -0,0 +1,78 @@ +# typed: strict + +# This file is autogenerated. Do not edit it by hand. +# To regenerate, run `brew typecheck --update rubocop`. + +class Parser::Source::Comment + include ::RuboCop::Ext::Comment +end + +class Parser::Source::Range + include ::RuboCop::Ext::Range +end + +RuboCop::CLI::STATUS_OFFENSES = T.let(T.unsafe(nil).freeze, Integer) + +RuboCop::CLI::STATUS_SUCCESS = T.let(T.unsafe(nil).freeze, Integer) + +RuboCop::CommentConfig::CONFIG_DISABLED_LINE_RANGE_MIN = T.let(T.unsafe(nil).freeze, Float) + +class RuboCop::Config + include ::RuboCop::PathUtil + include ::RuboCop::FileFinder + extend ::RuboCop::SimpleForwardable + + # @return [Config] a new instance of Config + # + # source://rubocop//lib/rubocop/config.rb#31 + def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end + + # source://rubocop-ast/1.44.1/lib/rubocop/ast/utilities/simple_forwardable.rb#19 + def [](*_arg0, **_arg1, &_arg2); end +end + +RuboCop::Token = RuboCop::AST::Token + +class RuboCop::Cop::Base + include ::RuboCop::AST::Sexp + include ::RuboCop::PathUtil + include ::RuboCop::Cop::Util + include ::RuboCop::Cop::IgnoredNode + include ::RuboCop::Cop::AutocorrectLogic + extend ::RuboCop::AST::Sexp + extend ::RuboCop::AST::NodePattern::Macros + extend ::RuboCop::ExcludeLimit + + # @return [Base] a new instance of Base + # + # source://rubocop//lib/rubocop/cop/base.rb#156 + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end +end + +class RuboCop::Cop::SomeUnusedCop < RuboCop::Cop::Base + def on_send(_node); end +end + +module RuboCop::Cop::UnusedModule; end + +class CompletelyUnrelated + def bananas; end +end + +module RuboCop::Version + class << self + # @api private + # + # source://rubocop//lib/rubocop/version.rb#121 + def config_for_pwd(env); end + + # @api private + # + # source://rubocop//lib/rubocop/version.rb#151 + def document_version; end + end +end + +VERSION = "x.x.x".freeze + +SOME_CONSTANT = "some constant value".freeze diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1-linux.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1-linux.tbz deleted file mode 100644 index 72957a4c13..0000000000 Binary files a/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1-linux.tbz and /dev/null differ diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1.tbz deleted file mode 100644 index c7c57aee5f..0000000000 Binary files a/Library/Homebrew/test/support/fixtures/tarballs/testball4-0.1.tbz and /dev/null differ diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1-linux.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1-linux.tbz deleted file mode 100644 index 4d35e20d2b..0000000000 Binary files a/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1-linux.tbz and /dev/null differ diff --git a/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1.tbz deleted file mode 100644 index 06def51fbd..0000000000 Binary files a/Library/Homebrew/test/support/fixtures/tarballs/testball5-0.1.tbz and /dev/null differ diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index f8f3b0f60a..6c24f3635e 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -75,14 +75,15 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin ].compact.join(File::PATH_SEPARATOR) env.merge!( - "PATH" => path, - "HOMEBREW_PATH" => path, - "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", - "HOMEBREW_INTEGRATION_TEST" => command_id, - "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, - "HOMEBREW_DEV_CMD_RUN" => "true", - "HOMEBREW_USE_RUBY_FROM_PATH" => ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", nil), - "GEM_HOME" => nil, + "PATH" => path, + "HOMEBREW_PATH" => path, + "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", + "HOMEBREW_INTEGRATION_TEST" => command_id, + "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, + "HOMEBREW_DEV_CMD_RUN" => "true", + "HOMEBREW_USE_RUBY_FROM_PATH" => ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", nil), + "HOMEBREW_NO_INSTALL_FROM_API" => ENV.fetch("HOMEBREW_NO_INSTALL_FROM_API", nil), + "GEM_HOME" => nil, ) @ruby_args ||= begin @@ -134,21 +135,13 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin bottle_block: nil, tab_attributes: nil) case name when /^testball/ - case name - when "testball4", "testball5" - prefix = name - program_name = name - when "testball2" - prefix = name - program_name = "test" + # Use a different tarball for testball2 to avoid lock errors when writing concurrency tests + prefix = (name == "testball2") ? "testball2" : "testball" + tarball = if OS.linux? + TEST_FIXTURE_DIR/"tarballs/#{prefix}-0.1-linux.tbz" else - prefix = "testball" - program_name = "test" + TEST_FIXTURE_DIR/"tarballs/#{prefix}-0.1.tbz" end - - tarball_name = "#{prefix}-0.1#{"-linux" if OS.linux?}.tbz" - tarball = TEST_FIXTURE_DIR / "tarballs/#{tarball_name}" - content = <<~RUBY desc "Some test" homepage "https://brew.sh/#{name}" @@ -158,12 +151,12 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin option "with-foo", "Build with foo" #{bottle_block} def install - (prefix/"foo"/"#{program_name}").write("#{program_name}") if build.with? "foo" + (prefix/"foo"/"test").write("test") if build.with? "foo" prefix.install Dir["*"] - (buildpath/"#{program_name}.c").write \ - "#include \\nint main(){printf(\\"#{program_name}\\");return 0;}" + (buildpath/"test.c").write \ + "#include \\nint main(){printf(\\"test\\");return 0;}" bin.mkpath - system ENV.cc, "#{program_name}.c", "-o", bin/"#{program_name}" + system ENV.cc, "test.c", "-o", bin/"test" end #{content} @@ -187,6 +180,7 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin end formula_path = Formulary.find_formula_in_tap(name.downcase, tap).tap do |path| + path.dirname.mkpath path.write <<~RUBY class #{Formulary.class_s(name)} < Formula #{content.gsub(/^(?!$)/, " ")} diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 8bea008043..6f60403281 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -500,7 +500,6 @@ RSpec.describe Tap do end it "includes the core tap with the api" do - ENV.delete("HOMEBREW_NO_INSTALL_FROM_API") expect(described_class.to_a).to include(CoreTap.instance) end @@ -580,7 +579,7 @@ RSpec.describe Tap do let(:cask_tap) { CoreCaskTap.instance } let(:core_tap) { CoreTap.instance } - it "returns expected renames" do + it "returns expected renames", :no_api do [ [cask_tap, "gimp", []], [core_tap, "schism-tracker", []], @@ -744,11 +743,11 @@ RSpec.describe Tap do expect(core_tap).to be_a_core_tap end - specify "forbidden operations" do + specify "forbidden operations", :no_api do expect { core_tap.uninstall }.to raise_error(RuntimeError) end - specify "files" do + specify "files", :no_api do path = HOMEBREW_TAP_DIRECTORY/"homebrew/homebrew-core" formula_file = core_tap.formula_dir/"foo.rb" core_tap.formula_dir.mkpath diff --git a/Library/Homebrew/test/utils/cpan_spec.rb b/Library/Homebrew/test/utils/cpan_spec.rb new file mode 100644 index 0000000000..eceacb07c4 --- /dev/null +++ b/Library/Homebrew/test/utils/cpan_spec.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require "utils/cpan" + +RSpec.describe CPAN do + let(:cpan_package_url) do + "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.68.tar.gz" + end + let(:cpan_tgz_url) do + "https://cpan.metacpan.org/authors/id/S/ST/STBEY/Example-Module-1.23.tgz" + end + let(:non_cpan_package_url) do + "https://github.com/example/package/archive/v1.0.0.tar.gz" + end + + describe CPAN::Package do + let(:package_from_cpan_url) { described_class.new("Scalar::Util", cpan_package_url) } + let(:package_from_tgz_url) { described_class.new("Example::Module", cpan_tgz_url) } + let(:package_from_non_cpan_url) { described_class.new("SomePackage", non_cpan_package_url) } + + describe "initialize" do + it "initializes resource name" do + expect(package_from_cpan_url.name).to eq "Scalar::Util" + end + + it "extracts version from CPAN url" do + expect(package_from_cpan_url.current_version).to eq "1.68" + end + + it "handles .tgz extensions" do + expect(package_from_tgz_url.current_version).to eq "1.23" + end + end + + describe ".valid_cpan_package?" do + it "is true for CPAN URLs" do + expect(package_from_cpan_url.valid_cpan_package?).to be true + end + + it "is false for non-CPAN URLs" do + expect(package_from_non_cpan_url.valid_cpan_package?).to be false + end + end + + describe ".to_s" do + it "returns resource name" do + expect(package_from_cpan_url.to_s).to eq "Scalar::Util" + end + end + end +end diff --git a/Library/Homebrew/test/utils/github_spec.rb b/Library/Homebrew/test/utils/github_spec.rb index e07f093e7c..d4b6ca2ac6 100644 --- a/Library/Homebrew/test/utils/github_spec.rb +++ b/Library/Homebrew/test/utils/github_spec.rb @@ -71,14 +71,6 @@ RSpec.describe GitHub do ) expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/1969725476/zip"]) end - - it "supports pattern matching" do - urls = described_class.get_artifact_urls( - described_class.get_workflow_run("Homebrew", "brew", "17068", - workflow_id: "pkg-installer.yml", artifact_pattern: "Homebrew-*.pkg"), - ) - expect(urls).to eq(["https://api.github.com/repos/Homebrew/brew/actions/artifacts/1405050842/zip"]) - end end describe "::pull_request_commits", :needs_network do diff --git a/Library/Homebrew/test/utils/shell_spec.rb b/Library/Homebrew/test/utils/shell_spec.rb index 66cf8edfd8..bd07c39d71 100644 --- a/Library/Homebrew/test/utils/shell_spec.rb +++ b/Library/Homebrew/test/utils/shell_spec.rb @@ -107,18 +107,34 @@ RSpec.describe Utils::Shell do end describe "::shell_with_prompt" do + let(:home) { HOMEBREW_TEMP } + let(:notice) { "" } + let(:prompt) { "test" } + let(:path) { "/some/path" } + it "returns zsh-specific prompt configuration" do - ENV["SHELL"] = "/bin/zsh" - expect(described_class.shell_with_prompt("test", preferred_path: "/bin/zsh", notice: "")).to eq( - "PROMPT='%B%F{green}test%f %F{blue}$%f%b ' RPROMPT='[%B%F{red}%~%f%b]' /bin/zsh -f", - ) + preferred_path = "/bin/zsh" + ENV["SHELL"] = preferred_path + ENV["PATH"] = path + zdotdir = "#{HOMEBREW_TEMP}/brew-zsh-prompt-#{Process.euid}" + expect(described_class.shell_with_prompt(prompt, preferred_path:, notice:, home:)).to eq \ + "BREW_PROMPT_PATH=\"#{path}\" BREW_PROMPT_TYPE=\"#{prompt}\" ZDOTDIR=\"#{zdotdir}\" #{preferred_path}" + end + + it "returns bash-specific prompt configuration" do + preferred_path = "/bin/bash" + ENV["SHELL"] = "/bin/bash" + ENV["PATH"] = path + rcfile = "#{HOMEBREW_LIBRARY_PATH}/utils/bash/brew-sh-prompt-bashrc.bash" + expect(described_class.shell_with_prompt(prompt, preferred_path:, notice:, home:)).to eq \ + "BREW_PROMPT_PATH=\"#{path}\" BREW_PROMPT_TYPE=\"#{prompt}\" #{preferred_path} --rcfile \"#{rcfile}\"" end it "returns generic shell prompt configuration" do - ENV["SHELL"] = "/bin/bash" - expect(described_class.shell_with_prompt("test", preferred_path: "/bin/bash", notice: "")).to eq( - "PS1=\"\\[\\033[1;32m\\]brew \\[\\033[1;31m\\]\\w \\[\\033[1;34m\\]$\\[\\033[0m\\] \" /bin/bash", - ) + preferred_path = "/bin/dash" + ENV["SHELL"] = preferred_path + expect(described_class.shell_with_prompt(prompt, preferred_path:, notice:, home:)).to eq \ + "PS1=\"\\[\\033[1;32m\\]#{prompt} \\[\\033[1;31m\\]\\w \\[\\033[1;34m\\]$\\[\\033[0m\\] \" #{preferred_path}" end it "outputs notice when provided" do diff --git a/Library/Homebrew/test_runner_formula.rb b/Library/Homebrew/test_runner_formula.rb index e3c3c987d6..34c617d77f 100644 --- a/Library/Homebrew/test_runner_formula.rb +++ b/Library/Homebrew/test_runner_formula.rb @@ -77,8 +77,6 @@ class TestRunnerFormula macos_version.public_send(requirement.comparator, requirement.version) end - SIMULATE_SYSTEM_SYMBOLS = T.let({ arm64: :arm, x86_64: :intel }.freeze, T::Hash[Symbol, Symbol]) - sig { params( platform: Symbol, @@ -98,7 +96,7 @@ class TestRunnerFormula with_env(HOMEBREW_EVAL_ALL: eval_all_env) do os = macos_version || platform - arch = SIMULATE_SYSTEM_SYMBOLS.fetch(arch) + arch = Homebrew::SimulateSystem.arch_symbols.fetch(arch) Homebrew::SimulateSystem.with(os:, arch:) do Formula.public_send(formula_selector) diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index ba03abc04f..6acafea7eb 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -48,7 +48,7 @@ module Homebrew if rack.directory? versions = rack.subdirs.map(&:basename) puts <<~EOS - #{keg.name} #{versions.to_sentence} #{(versions.count == 1) ? "is" : "are"} still installed. + #{keg.name} #{versions.to_sentence} #{versions.one? ? "is" : "are"} still installed. To remove all versions, run: brew uninstall --force #{keg.name} EOS @@ -67,7 +67,18 @@ module Homebrew end unversioned_name = f.name.gsub(/@.+$/, "") - maybe_paths = Dir.glob("#{f.etc}/*#{unversioned_name}*") + maybe_paths = Dir.glob("#{f.etc}/#{unversioned_name}*") + excluded_names = Homebrew::API::Formula.all_formulae.keys + maybe_paths = maybe_paths.reject do |path| + # Remove extension only if a file + # (f.e. directory with name "openssl@1.1" will be trimmed to "openssl@1") + basename = if File.directory?(path) + File.basename(path) + else + File.basename(path, ".*") + end + excluded_names.include?(basename) + end maybe_paths -= paths if paths.present? if maybe_paths.present? puts @@ -97,13 +108,13 @@ module Homebrew return if ignore_dependencies all_kegs = kegs_by_rack.values.flatten(1) - check_for_dependents(all_kegs, casks:, named_args:) + check_for_dependents!(all_kegs, casks:, named_args:) rescue MethodDeprecatedError # Silently ignore deprecations when uninstalling. nil end - def self.check_for_dependents(kegs, casks: [], named_args: []) + def self.check_for_dependents!(kegs, casks: [], named_args: []) return false unless (result = InstalledDependents.find_some_installed_dependents(kegs, casks:)) DependentsMessage.new(*result, named_args:).output @@ -122,7 +133,7 @@ module Homebrew def output ofail <<~EOS Refusing to uninstall #{reqs.to_sentence} - because #{(reqs.count == 1) ? "it" : "they"} #{are_required_by_deps}. + because #{reqs.one? ? "it" : "they"} #{are_required_by_deps}. You can override this and force removal with: #{sample_command} EOS @@ -135,8 +146,8 @@ module Homebrew end def are_required_by_deps - "#{(reqs.count == 1) ? "is" : "are"} required by #{deps.to_sentence}, " \ - "which #{(deps.count == 1) ? "is" : "are"} currently installed" + "#{reqs.one? ? "is" : "are"} required by #{deps.to_sentence}, " \ + "which #{deps.one? ? "is" : "are"} currently installed" end end diff --git a/Library/Homebrew/unversioned_cask_checker.rb b/Library/Homebrew/unversioned_cask_checker.rb index 6570507469..195ecdd184 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -72,17 +72,17 @@ module Homebrew sig { returns(T::Boolean) } def single_app_cask? - apps.count == 1 + apps.one? end sig { returns(T::Boolean) } def single_qlplugin_cask? - qlplugins.count == 1 + qlplugins.one? end sig { returns(T::Boolean) } def single_pkg_cask? - pkgs.count == 1 + pkgs.one? end # Filter paths to `Info.plist` files so that ones belonging @@ -222,14 +222,14 @@ module Homebrew unique_info_plist_versions = top_level_info_plist_paths.filter_map { |i| BundleVersion.from_info_plist(i)&.nice_version } .uniq - return unique_info_plist_versions.first if unique_info_plist_versions.count == 1 + return unique_info_plist_versions.first if unique_info_plist_versions.one? package_info_path = extract_dir/"PackageInfo" if package_info_path.exist? if (version = BundleVersion.from_package_info(package_info_path)) return version.nice_version end - elsif packages.count == 1 + elsif packages.one? onoe "#{pkg_path.basename} does not contain a `PackageInfo` file." end diff --git a/Library/Homebrew/upgrade.rb b/Library/Homebrew/upgrade.rb index 112893aac1..9bfbbd7c54 100644 --- a/Library/Homebrew/upgrade.rb +++ b/Library/Homebrew/upgrade.rb @@ -11,7 +11,9 @@ require "utils/topological_hash" module Homebrew # Helper functions for upgrading formulae. module Upgrade - def self.upgrade_formulae( + Dependents = Struct.new(:upgradeable, :pinned, :skipped) + + def self.formula_installers( formulae_to_install, flags:, dry_run: false, @@ -48,7 +50,7 @@ module Homebrew raise CyclicDependencyError, dependency_graph.strongly_connected_components if Homebrew::EnvConfig.developer? end - formula_installers = formulae_to_install.filter_map do |formula| + formulae_to_install.filter_map do |formula| Migrator.migrate_if_needed(formula, force:, dry_run:) begin fi = create_formula_installer( @@ -65,18 +67,19 @@ module Homebrew quiet:, verbose:, ) - unless dry_run - fi.prelude + fi.fetch_bottle_tab(quiet: !debug) + all_runtime_deps_installed = fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash| + minimum_version = Version.new(hash["version"]) if hash["version"].present? + Dependency.new(dependency).installed?(minimum_version:, minimum_revision: hash["revision"]) + end + + if !dry_run && dependents && all_runtime_deps_installed # Don't need to install this bottle if all of the runtime # dependencies have the same or newer version already installed. - next if dependents && fi.bottle_tab_runtime_dependencies.presence&.all? do |dependency, hash| - minimum_version = Version.new(hash["version"]) if hash["version"].present? - Dependency.new(dependency).installed?(minimum_version:, minimum_revision: hash["revision"]) - end - - fi.fetch + next end + fi rescue CannotInstallFormulaError => e ofail e @@ -86,6 +89,19 @@ module Homebrew nil end end + end + + def self.upgrade_formulae(formula_installers, dry_run: false, verbose: false) + unless dry_run + formula_installers.each do |fi| + fi.prelude + fi.fetch + rescue CannotInstallFormulaError => e + ofail e + rescue UnsatisfiedRequirements, DownloadError => e + ofail "#{fi.formula.full_name}: #{e}" + end + end formula_installers.each do |fi| upgrade_formula(fi, dry_run:, verbose:) @@ -250,10 +266,11 @@ module Homebrew @puts_no_installed_dependents_check_disable_message_if_not_already = true end - def self.check_installed_dependents( + def self.dependants( formulae, flags:, dry_run: false, + ask: false, installed_on_request: false, force_bottle: false, build_from_source_formulae: [], @@ -274,35 +291,26 @@ module Homebrew end return end + formulae_to_install = formulae.dup + formulae_to_install.reject! { |f| f.core_formula? && f.versioned_formula? } + return if formulae_to_install.empty? - installed_formulae = (dry_run ? formulae : FormulaInstaller.installed.to_a).dup - installed_formulae.reject! { |f| f.core_formula? && f.versioned_formula? } - return if installed_formulae.empty? - - already_broken_dependents = check_broken_dependents(installed_formulae) + already_broken_dependents = check_broken_dependents(formulae_to_install) # TODO: this should be refactored to use FormulaInstaller new logic outdated_dependents = - installed_formulae.flat_map(&:runtime_installed_formula_dependents) - .uniq - .select(&:outdated?) + formulae_to_install.flat_map(&:runtime_installed_formula_dependents) + .uniq + .select(&:outdated?) # Ensure we never attempt a source build for outdated dependents of upgraded formulae. outdated_dependents, skipped_dependents = outdated_dependents.partition do |dependent| dependent.bottled? && dependent.deps.map(&:to_formula).all?(&:bottled?) end - if skipped_dependents.present? - opoo <<~EOS - The following dependents of upgraded formulae are outdated but will not - be upgraded because they are not bottled: - #{skipped_dependents * "\n "} - EOS - end - return if outdated_dependents.blank? && already_broken_dependents.blank? - outdated_dependents -= installed_formulae if dry_run + outdated_dependents -= formulae_to_install if dry_run upgradeable_dependents = outdated_dependents.reject(&:pinned?) @@ -311,24 +319,52 @@ module Homebrew outdated_dependents.select(&:pinned?) .sort { |a, b| depends_on(a, b) } - if pinned_dependents.present? - plural = Utils.pluralize("dependent", pinned_dependents.count) - opoo "Not upgrading #{pinned_dependents.count} pinned #{plural}:" - puts(pinned_dependents.map do |f| + Dependents.new(upgradeable_dependents, pinned_dependents, skipped_dependents) + end + + def self.upgrade_dependents(deps, formulae, + flags:, + dry_run: false, + installed_on_request: false, + force_bottle: false, + build_from_source_formulae: [], + interactive: false, + keep_tmp: false, + debug_symbols: false, + force: false, + debug: false, + quiet: false, + verbose: false) + return if deps.blank? + + upgradeable = deps.upgradeable + pinned = deps.pinned + skipped = deps.skipped + if pinned.present? + plural = Utils.pluralize("dependent", pinned.count) + opoo "Not upgrading #{pinned.count} pinned #{plural}:" + puts(pinned.map do |f| "#{f.full_specified_name} #{f.pkg_version}" end.join(", ")) end - + if skipped.present? + opoo <<~EOS + The following dependents of upgraded formulae are outdated but will not + be upgraded because they are not bottled: + #{skipped * "\n "} + EOS + end # Print the upgradable dependents. - if upgradeable_dependents.blank? + if upgradeable.blank? ohai "No outdated dependents to upgrade!" unless dry_run else + installed_formulae = (dry_run ? formulae : FormulaInstaller.installed.to_a).dup formula_plural = Utils.pluralize("formula", installed_formulae.count, plural: "e") upgrade_verb = dry_run ? "Would upgrade" : "Upgrading" - ohai "#{upgrade_verb} #{Utils.pluralize("dependent", upgradeable_dependents.count, + ohai "#{upgrade_verb} #{Utils.pluralize("dependent", upgradeable.count, include_count: true)} of upgraded #{formula_plural}:" Upgrade.puts_no_installed_dependents_check_disable_message_if_not_already! - formulae_upgrades = upgradeable_dependents.map do |f| + formulae_upgrades = upgradeable.map do |f| name = f.full_specified_name if f.optlinked? "#{name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}" @@ -339,9 +375,13 @@ module Homebrew puts formulae_upgrades.join(", ") end + upgradeable.reject! { |f| FormulaInstaller.installed.include?(f) } + + return if upgradeable.blank? + unless dry_run - upgrade_formulae( - upgradeable_dependents, + dependent_installers = formula_installers( + upgradeable, flags:, force_bottle:, build_from_source_formulae:, @@ -354,6 +394,7 @@ module Homebrew quiet:, verbose:, ) + upgrade_formulae(dependent_installers, dry_run: dry_run, verbose: verbose) end # Update installed formulae after upgrading @@ -409,7 +450,7 @@ module Homebrew return if dry_run reinstallable_broken_dependents.each do |formula| - Reinstall.reinstall_formula( + formula_installer = Reinstall.build_install_context( formula, flags:, force_bottle:, @@ -422,6 +463,19 @@ module Homebrew quiet:, verbose:, ) + Reinstall.reinstall_formula( + formula_installer, + flags:, + force_bottle:, + build_from_source_formulae:, + interactive:, + keep_tmp:, + debug_symbols:, + force:, + debug:, + quiet:, + verbose:, + ) rescue FormulaInstallationAlreadyAttemptedError # We already attempted to reinstall f as part of the dependency tree of # another formula. In that case, don't generate an error, just move on. diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 3c61fba3df..6e261ebdfa 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -6,6 +6,8 @@ require "context" module Homebrew extend Context + # Need to keep this naming as-is for backwards compatibility. + # rubocop:disable Naming/PredicateMethod def self._system(cmd, *args, **options) pid = fork do yield if block_given? @@ -20,6 +22,7 @@ module Homebrew Process.wait(T.must(pid)) $CHILD_STATUS.success? end + # rubocop:enable Naming/PredicateMethod def self.system(cmd, *args, **options) if verbose? diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 54674b019f..b06ecea5e9 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -4,7 +4,7 @@ require "context" require "erb" require "settings" -require "extend/cachable" +require "cachable" module Utils # Helper module for fetching and reporting analytics data. @@ -445,7 +445,7 @@ module Utils format "%#{index_width}s", index_header formatted_name_with_options_header = format "%-#{name_with_options_width}s", - name_with_options_header[0..name_with_options_width-1] + name_with_options_header[0..(name_with_options_width-1)] formatted_count_header = format "%#{count_width}s", count_header formatted_percent_header = @@ -464,7 +464,7 @@ module Utils formatted_index = format "%-#{index_width}s", formatted_index formatted_name_with_options = format "%-#{name_with_options_width}s", - name_with_options[0..name_with_options_width-1] + name_with_options[0..(name_with_options_width-1)] formatted_count = format "%#{count_width}s", format_count(count) formatted_percent = if total_count.zero? format "%#{percent_width}s", format_percent(0) diff --git a/Library/Homebrew/utils/backtrace.rb b/Library/Homebrew/utils/backtrace.rb index b04f349729..376e5fc5c9 100644 --- a/Library/Homebrew/utils/backtrace.rb +++ b/Library/Homebrew/utils/backtrace.rb @@ -31,7 +31,8 @@ module Utils def self.print_backtrace_message return if @print_backtrace_message - opoo "Removed Sorbet lines from backtrace!" + # This is just unactionable noise in GitHub Actions. + opoo_outside_github_actions "Removed Sorbet lines from backtrace!" puts "Rerun with `--verbose` to see the original backtrace" unless Homebrew::EnvConfig.no_env_hints? @print_backtrace_message = true diff --git a/Library/Homebrew/utils/bash/brew-sh-prompt-bashrc.bash b/Library/Homebrew/utils/bash/brew-sh-prompt-bashrc.bash new file mode 100644 index 0000000000..d4d9dd7e3e --- /dev/null +++ b/Library/Homebrew/utils/bash/brew-sh-prompt-bashrc.bash @@ -0,0 +1,12 @@ +# Read the user's ~/.bashrc first +if [[ -f "${HOME}/.bashrc" ]] +then + source "${HOME}/.bashrc" +fi + +# Override the user's Bash prompt with our custom prompt +export PS1="\\[\\033[1;32m\\]${BREW_PROMPT_TYPE} \\[\\033[1;31m\\]\\w \\[\\033[1;34m\\]$\\[\\033[0m\\] " + +# Add the Homebrew PATH in front of the user's PATH +export PATH="${BREW_PROMPT_PATH}:${PATH}" +unset BREW_PROMPT_TYPE BREW_PROMPT_PATH diff --git a/Library/Homebrew/utils/cpan.rb b/Library/Homebrew/utils/cpan.rb new file mode 100644 index 0000000000..bd44987eb2 --- /dev/null +++ b/Library/Homebrew/utils/cpan.rb @@ -0,0 +1,194 @@ +# typed: strict +# frozen_string_literal: true + +require "utils/inreplace" + +# Helper functions for updating CPAN resources. +module CPAN + METACPAN_URL_PREFIX = "https://cpan.metacpan.org/authors/id/" + CPAN_ARCHIVE_REGEX = /^(.+)-([0-9.v]+)\.(?:tar\.gz|tgz)$/ + private_constant :METACPAN_URL_PREFIX, :CPAN_ARCHIVE_REGEX + + # Represents a Perl package from an existing resource. + class Package + sig { params(resource_name: String, resource_url: String).void } + def initialize(resource_name, resource_url) + @cpan_info = T.let(nil, T.nilable(T::Array[String])) + @resource_name = resource_name + @resource_url = resource_url + @is_cpan_url = T.let(resource_url.start_with?(METACPAN_URL_PREFIX), T::Boolean) + end + + sig { returns(String) } + def name + @resource_name + end + + sig { returns(T.nilable(String)) } + def current_version + extract_version_from_url if @current_version.blank? + @current_version + end + + sig { returns(T::Boolean) } + def valid_cpan_package? + @is_cpan_url + end + + # Get latest release information from MetaCPAN API. + sig { returns(T.nilable(T::Array[String])) } + def latest_cpan_info + return @cpan_info if @cpan_info.present? + return unless valid_cpan_package? + + metadata_url = "https://fastapi.metacpan.org/v1/download_url/#{@resource_name}" + result = Utils::Curl.curl_output(metadata_url, "--location", "--fail") + return unless result.status.success? + + begin + json = JSON.parse(result.stdout) + rescue JSON::ParserError + return + end + + download_url = json["download_url"] + return unless download_url + + checksum = json["checksum_sha256"] + return unless checksum + + @cpan_info = [@resource_name, download_url, checksum, json["version"]] + end + + sig { returns(String) } + def to_s + @resource_name + end + + private + + sig { returns(T.nilable(String)) } + def extract_version_from_url + return unless @is_cpan_url + + match = File.basename(@resource_url).match(CPAN_ARCHIVE_REGEX) + return unless match + + @current_version = T.let(match[2], T.nilable(String)) + end + end + + # Update CPAN resources in a formula. + sig { + params( + formula: Formula, + print_only: T.nilable(T::Boolean), + silent: T.nilable(T::Boolean), + verbose: T.nilable(T::Boolean), + ignore_errors: T.nilable(T::Boolean), + ).returns(T.nilable(T::Boolean)) + } + def self.update_perl_resources!(formula, print_only: false, silent: false, verbose: false, ignore_errors: false) + cpan_resources = formula.resources.select { |resource| resource.url.start_with?(METACPAN_URL_PREFIX) } + + odie "\"#{formula.name}\" has no CPAN resources to update." if cpan_resources.empty? + + show_info = !print_only && !silent + + non_cpan_resources = formula.resources.reject { |resource| resource.url.start_with?(METACPAN_URL_PREFIX) } + ohai "Skipping #{non_cpan_resources.length} non-CPAN resources" if non_cpan_resources.any? && show_info + ohai "Found #{cpan_resources.length} CPAN resources to update" if show_info + + new_resource_blocks = "" + package_errors = "" + updated_count = 0 + + cpan_resources.each do |resource| + package = Package.new(resource.name, resource.url) + + unless package.valid_cpan_package? + if ignore_errors + package_errors += " # RESOURCE-ERROR: \"#{resource.name}\" is not a valid CPAN resource\n" + next + else + odie "\"#{resource.name}\" is not a valid CPAN resource" + end + end + + ohai "Checking \"#{resource.name}\" for updates..." if show_info + + info = package.latest_cpan_info + + unless info + if ignore_errors + package_errors += " # RESOURCE-ERROR: Unable to resolve \"#{resource.name}\"\n" + next + else + odie "Unable to resolve \"#{resource.name}\"" + end + end + + name, url, checksum, new_version = info + current_version = package.current_version + + if current_version && new_version && current_version != new_version + ohai "\"#{resource.name}\": #{current_version} -> #{new_version}" if show_info + updated_count += 1 + elsif show_info + ohai "\"#{resource.name}\": already up to date (#{current_version})" if current_version + end + + new_resource_blocks += <<-EOS + resource "#{name}" do + url "#{url}" + sha256 "#{checksum}" + end + + EOS + end + + package_errors += "\n" if package_errors.present? + resource_section = "#{package_errors}#{new_resource_blocks}" + + if print_only + puts resource_section.chomp + return true + end + + if formula.resources.all? { |resource| resource.name.start_with?("homebrew-") } + inreplace_regex = / def install/ + resource_section += " def install" + else + inreplace_regex = / + \ \ ( + (\#\ RESOURCE-ERROR:\ .*\s+)* + resource\ .*\ do\s+ + url\ .*\s+ + sha256\ .*\s+ + ((\#.*\s+)* + patch\ (.*\ )?do\s+ + url\ .*\s+ + sha256\ .*\s+ + end\s+)* + end\s+)+ + /x + resource_section += " " + end + + ohai "Updating resource blocks" unless silent + Utils::Inreplace.inreplace formula.path do |s| + if T.must(s.inreplace_string.split(/^ test do\b/, 2).first).scan(inreplace_regex).length > 1 + odie "Unable to update resource blocks for \"#{formula.name}\" automatically. Please update them manually." + end + s.sub! inreplace_regex, resource_section + end + + if package_errors.present? + ofail "Unable to resolve some dependencies. Please check #{formula.path} for RESOURCE-ERROR comments." + elsif updated_count.positive? + ohai "Updated #{updated_count} CPAN resource#{"s" if updated_count != 1}" unless silent + end + + true + end +end diff --git a/Library/Homebrew/utils/formatter.rb b/Library/Homebrew/utils/formatter.rb index 9815425204..3e7428c80e 100644 --- a/Library/Homebrew/utils/formatter.rb +++ b/Library/Homebrew/utils/formatter.rb @@ -54,6 +54,19 @@ module Formatter label(label, string, :red) end + # Truncate a string to a specific length. + # + # @api internal + sig { params(string: String, max: Integer, omission: String).returns(String) } + def self.truncate(string, max: 30, omission: "...") + return string if string.length <= max + + length_with_room_for_omission = max - omission.length + truncated = string[0, length_with_room_for_omission] + + "#{truncated}#{omission}" + end + # Wraps text to fit within a given number of columns using regular expressions that: # # 1. convert hard-wrapped paragraphs to a single line diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 5493bd335f..a2928de8a7 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -627,6 +627,12 @@ module GitHub pull_requests || [] end + # Check for duplicate pull requests that modify the same file. + # + # Exits the process on duplicates if `strict` or both `version` and + # `official_tap`, otherwise warns. + # + # @api internal sig { params( name: String, @@ -636,10 +642,11 @@ module GitHub state: T.nilable(String), version: T.nilable(String), official_tap: T::Boolean, + strict: T::Boolean, ).void } def self.check_for_duplicate_pull_requests(name, tap_remote_repo, file:, quiet: false, state: nil, - version: nil, official_tap: true) + version: nil, official_tap: true, strict: false) pull_requests = fetch_pull_requests(name, tap_remote_repo, state:, version:) pull_requests.select! do |pr| @@ -659,13 +666,13 @@ module GitHub Manually open these PRs if you are sure that they are not duplicates (and tell us that in the PR). EOS - if !official_tap - opoo duplicates_message - elsif version + if strict || (version && official_tap) odie <<~EOS #{duplicates_message.chomp} #{error_message} EOS + elsif !official_tap + opoo duplicates_message elsif quiet opoo error_message else @@ -961,8 +968,12 @@ module GitHub pull_requests.fetch("pageInfo") end rescue => e - # Ignore SAML access errors (https://github.com/Homebrew/brew/issues/18610) - raise unless e.message.include?("Resource protected by organization SAML enforcement") + # Ignore SAML access errors (https://github.com/Homebrew/brew/issues/18610) and related + # IP allow list errors (https://github.com/orgs/Homebrew/discussions/6263) + return false if e.message.include?("Resource protected by organization SAML enforcement") || + e.message.include?("your IP address is not permitted to access this resource") + + raise end false diff --git a/Library/Homebrew/utils/github/actions.rb b/Library/Homebrew/utils/github/actions.rb index 1d7cade0f2..45390fcdd1 100644 --- a/Library/Homebrew/utils/github/actions.rb +++ b/Library/Homebrew/utils/github/actions.rb @@ -45,7 +45,7 @@ module GitHub line: T.nilable(Integer) ).returns(T::Boolean) } - def self.puts_annotation_if_env_set(type, message, file: nil, line: nil) + def self.puts_annotation_if_env_set!(type, message, file: nil, line: nil) # Don't print annotations during tests, too messy to handle these. return false if ENV.fetch("HOMEBREW_TESTS", false) return false unless env_set? diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 6891ebf740..dba7173124 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -1,9 +1,10 @@ -# typed: true # rubocop:todo Sorbet/StrictSigil +# typed: strict # frozen_string_literal: true require "system_command" module GitHub + sig { params(scopes: T::Array[String]).returns(String) } def self.pat_blurb(scopes = ALL_SCOPES) require "utils/formatter" require "utils/shell" @@ -16,20 +17,21 @@ module GitHub EOS end - API_URL = "https://api.github.com" - API_MAX_PAGES = 50 + API_URL = T.let("https://api.github.com", String) + API_MAX_PAGES = T.let(50, Integer) private_constant :API_MAX_PAGES - API_MAX_ITEMS = 5000 + API_MAX_ITEMS = T.let(5000, Integer) private_constant :API_MAX_ITEMS - PAGINATE_RETRY_COUNT = 3 + PAGINATE_RETRY_COUNT = T.let(3, Integer) private_constant :PAGINATE_RETRY_COUNT - CREATE_GIST_SCOPES = ["gist"].freeze - CREATE_ISSUE_FORK_OR_PR_SCOPES = ["repo"].freeze - CREATE_WORKFLOW_SCOPES = ["workflow"].freeze - ALL_SCOPES = (CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES + CREATE_WORKFLOW_SCOPES).freeze + CREATE_GIST_SCOPES = T.let(["gist"].freeze, T::Array[String]) + CREATE_ISSUE_FORK_OR_PR_SCOPES = T.let(["repo"].freeze, T::Array[String]) + CREATE_WORKFLOW_SCOPES = T.let(["workflow"].freeze, T::Array[String]) + ALL_SCOPES = T.let((CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES + CREATE_WORKFLOW_SCOPES).freeze, + T::Array[String]) private_constant :ALL_SCOPES - GITHUB_PERSONAL_ACCESS_TOKEN_REGEX = /^(?:[a-f0-9]{40}|(?:gh[pousr]|github_pat)_\w{36,251})$/ + GITHUB_PERSONAL_ACCESS_TOKEN_REGEX = T.let(/^(?:[a-f0-9]{40}|(?:gh[pousr]|github_pat)_\w{36,251})$/, Regexp) private_constant :GITHUB_PERSONAL_ACCESS_TOKEN_REGEX # Helper functions for accessing the GitHub API. @@ -40,46 +42,60 @@ module GitHub # Generic API error. class Error < RuntimeError + sig { returns(T.nilable(String)) } attr_reader :github_message + + sig { params(message: T.nilable(String), github_message: String).void } + def initialize(message = nil, github_message = T.unsafe(nil)) + @github_message = T.let(github_message, T.nilable(String)) + super(message) + end end # Error when the requested URL is not found. class HTTPNotFoundError < Error + sig { params(github_message: String).void } def initialize(github_message) - @github_message = github_message - super + super(nil, github_message) end end # Error when the API rate limit is exceeded. class RateLimitExceededError < Error + sig { params(reset: Integer, github_message: String).void } def initialize(reset, github_message) - @github_message = github_message new_pat_message = ", or:\n#{GitHub.pat_blurb}" if API.credentials.blank? - super <<~EOS + message = <<~EOS GitHub API Error: #{github_message} Try again in #{pretty_ratelimit_reset(reset)}#{new_pat_message} EOS + super(message, github_message) end + sig { params(reset: Integer).returns(String) } def pretty_ratelimit_reset(reset) pretty_duration(Time.at(reset) - Time.now) end end - GITHUB_IP_ALLOWLIST_ERROR = Regexp.new("Although you appear to have the correct authorization credentials, " \ - "the `(.+)` organization has an IP allow list enabled, " \ - "and your IP address is not permitted to access this resource").freeze + GITHUB_IP_ALLOWLIST_ERROR = T.let( + Regexp.new( + "Although you appear to have the correct authorization credentials, " \ + "the `(.+)` organization has an IP allow list enabled, " \ + "and your IP address is not permitted to access this resource", + ).freeze, + Regexp, + ) - NO_CREDENTIALS_MESSAGE = <<~MESSAGE.freeze + NO_CREDENTIALS_MESSAGE = T.let <<~MESSAGE.freeze, String No GitHub credentials found in macOS Keychain, GitHub CLI or the environment. #{GitHub.pat_blurb} MESSAGE # Error when authentication fails. class AuthenticationFailedError < Error + sig { params(credentials_type: Symbol, github_message: String).void } def initialize(credentials_type, github_message) - @github_message = github_message message = "GitHub API Error: #{github_message}\n" message << case credentials_type when :github_cli_token @@ -103,12 +119,13 @@ module GitHub when :none NO_CREDENTIALS_MESSAGE end - super message.freeze + super message.freeze, github_message end end # Error when the user has no GitHub API credentials set at all (macOS keychain, GitHub CLI or envvar). class MissingAuthenticationError < Error + sig { void } def initialize super NO_CREDENTIALS_MESSAGE end @@ -116,24 +133,21 @@ module GitHub # Error when the API returns a validation error. class ValidationFailedError < Error + sig { params(github_message: String, errors: T::Array[String]).void } def initialize(github_message, errors) - @github_message = if errors.empty? - github_message - else - "#{github_message}: #{errors}" - end + github_message = "#{github_message}: #{errors}" unless errors.empty? - super(@github_message) + super(github_message, github_message) end end - ERRORS = [ + ERRORS = T.let([ AuthenticationFailedError, HTTPNotFoundError, RateLimitExceededError, Error, JSON::ParserError, - ].freeze + ].freeze, T::Array[T.any(T.class_of(Error), T.class_of(JSON::ParserError))]) # Gets the token from the GitHub CLI for github.com. sig { returns(T.nilable(String)) } @@ -151,7 +165,7 @@ module GitHub print_stderr: false return unless result.success? - gh_out.chomp + gh_out.chomp.presence end end @@ -178,14 +192,16 @@ module GitHub # https://github.com/Homebrew/brew/issues/6862#issuecomment-572610344 return unless GITHUB_PERSONAL_ACCESS_TOKEN_REGEX.match?(github_password) - github_password + github_password.presence end end + sig { returns(T.nilable(String)) } def self.credentials + @credentials ||= T.let(nil, T.nilable(String)) @credentials ||= Homebrew::EnvConfig.github_api_token.presence - @credentials ||= github_cli_token.presence - @credentials ||= keychain_username_password.presence + @credentials ||= github_cli_token + @credentials ||= keychain_username_password end sig { returns(Symbol) } @@ -201,18 +217,19 @@ module GitHub end end - CREDENTIAL_NAMES = { + CREDENTIAL_NAMES = T.let({ env_token: "HOMEBREW_GITHUB_API_TOKEN", github_cli_token: "GitHub CLI login", keychain_username_password: "macOS Keychain GitHub", - }.freeze + }.freeze, T::Hash[Symbol, String]) # Given an API response from GitHub, warn the user if their credentials # have insufficient permissions. + sig { params(response_headers: T::Hash[String, String], needed_scopes: T::Array[String]).void } def self.credentials_error_message(response_headers, needed_scopes) return if response_headers.empty? - scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ") + scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ").presence needed_scopes = Set.new(scopes || needed_scopes) credentials_scopes = response_headers["x-oauth-scopes"] return if needed_scopes.subset?(Set.new(credentials_scopes.to_s.split(", "))) @@ -222,17 +239,35 @@ module GitHub credentials_scopes = "none" if credentials_scopes.blank? what = CREDENTIAL_NAMES.fetch(credentials_type) - @credentials_error_message ||= onoe <<~EOS - Your #{what} credentials do not have sufficient scope! - Scopes required: #{needed_scopes} - Scopes present: #{credentials_scopes} - #{github_permission_link} - EOS + @credentials_error_message ||= T.let(begin + error_message = <<~EOS + Your #{what} credentials do not have sufficient scope! + Scopes required: #{needed_scopes} + Scopes present: #{credentials_scopes} + #{github_permission_link} + EOS + onoe error_message + error_message + end, T.nilable(String)) end - def self.open_rest( - url, data: nil, data_binary_path: nil, request_method: nil, scopes: [].freeze, parse_json: true - ) + sig { + params( + url: T.any(String, URI::Generic), + data: T::Hash[Symbol, T.untyped], + data_binary_path: String, + request_method: Symbol, + scopes: T::Array[String], + parse_json: T::Boolean, + _block: T.nilable( + T.proc + .params(data: T::Hash[String, T.untyped]) + .returns(T.untyped), + ), + ).returns(T.untyped) + } + def self.open_rest(url, data: T.unsafe(nil), data_binary_path: T.unsafe(nil), request_method: T.unsafe(nil), + scopes: [].freeze, parse_json: true, &_block) # This is a no-op if the user is opting out of using the GitHub API. return block_given? ? yield({}) : {} if Homebrew::EnvConfig.no_github_api? @@ -289,7 +324,7 @@ module GitHub begin if !http_code.start_with?("2") || !result.status.success? - raise_error(output, result.stderr, http_code, headers, scopes) + raise_error(output, result.stderr, http_code, headers || "", scopes) end return if http_code == "204" # No Content @@ -305,7 +340,18 @@ module GitHub end end - def self.paginate_rest(url, additional_query_params: nil, per_page: 100, scopes: [].freeze) + sig { + params( + url: T.any(String, URI::Generic), + additional_query_params: String, + per_page: Integer, + scopes: T::Array[String], + _block: T.proc + .params(result: T.untyped, page: Integer) + .returns(T.untyped), + ).void + } + def self.paginate_rest(url, additional_query_params: T.unsafe(nil), per_page: 100, scopes: [].freeze, &_block) (1..API_MAX_PAGES).each do |page| retry_count = 1 result = begin @@ -324,9 +370,17 @@ module GitHub end end - def self.open_graphql(query, variables: nil, scopes: [].freeze, raise_errors: true) + sig { + params( + query: String, + variables: T::Hash[Symbol, T.untyped], + scopes: T::Array[String], + raise_errors: T::Boolean, + ).returns(T.untyped) + } + def self.open_graphql(query, variables: {}, scopes: [].freeze, raise_errors: true) data = { query:, variables: } - result = open_rest("#{API_URL}/graphql", scopes:, data:, request_method: "POST") + result = open_rest("#{API_URL}/graphql", scopes:, data:, request_method: :POST) if raise_errors raise Error, result["errors"].map { |e| e["message"] }.join("\n") if result["errors"].present? @@ -340,17 +394,16 @@ module GitHub sig { params( query: String, - variables: T.nilable(T::Hash[Symbol, T.untyped]), + variables: T::Hash[Symbol, T.untyped], scopes: T::Array[String], raise_errors: T::Boolean, - _block: T.proc.params(data: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]), + _block: T.proc.params(data: T::Hash[String, T.untyped]).returns(T.untyped), ).void } - def self.paginate_graphql(query, variables: nil, scopes: [].freeze, raise_errors: true, &_block) + def self.paginate_graphql(query, variables: {}, scopes: [].freeze, raise_errors: true, &_block) result = API.open_graphql(query, variables:, scopes:, raise_errors:) has_next_page = T.let(true, T::Boolean) - variables ||= {} while has_next_page page_info = yield result has_next_page = page_info["hasNextPage"] @@ -361,6 +414,15 @@ module GitHub end end + sig { + params( + output: String, + errors: String, + http_code: String, + headers: String, + scopes: T::Array[String], + ).void + } def self.raise_error(output, errors, http_code, headers, scopes) json = begin JSON.parse(output) diff --git a/Library/Homebrew/utils/github/artifacts.rb b/Library/Homebrew/utils/github/artifacts.rb index 1bfc967d4f..e0463e9fd0 100644 --- a/Library/Homebrew/utils/github/artifacts.rb +++ b/Library/Homebrew/utils/github/artifacts.rb @@ -11,11 +11,11 @@ module GitHub # @param artifact_id [String] a value that uniquely identifies the downloaded artifact sig { params(url: String, artifact_id: String).void } def self.download_artifact(url, artifact_id) - raise API::MissingAuthenticationError if API.credentials == :none + token = API.credentials + raise API::MissingAuthenticationError if token.blank? # We use a download strategy here to leverage the Homebrew cache # to avoid repeated downloads of (possibly large) bottles. - token = API.credentials downloader = GitHubArtifactDownloadStrategy.new(url, artifact_id, token:) downloader.fetch downloader.stage diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 4582542438..bb9396d5fd 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -153,14 +153,28 @@ module Utils str end - sig { params(type: String, preferred_path: String, notice: T.nilable(String)).returns(String) } - def shell_with_prompt(type, preferred_path:, notice:) + sig { params(type: String, preferred_path: String, notice: T.nilable(String), home: String).returns(String) } + def shell_with_prompt(type, preferred_path:, notice:, home: Dir.home) preferred = from_path(preferred_path) + path = ENV.fetch("PATH") subshell = case preferred when :zsh - "PROMPT='%B%F{green}#{type}%f %F{blue}$%f%b ' RPROMPT='[%B%F{red}%~%f%b]' #{preferred_path} -f" + zdotdir = Pathname.new(HOMEBREW_TEMP/"brew-zsh-prompt-#{Process.euid}") + zdotdir.mkpath + FileUtils.chmod_R(0700, zdotdir) + FileUtils.cp(HOMEBREW_LIBRARY_PATH/"utils/zsh/brew-sh-prompt-zshrc.zsh", zdotdir/".zshrc") + %w[.zcompdump .zsh_history .zsh_sessions].each do |file| + FileUtils.ln_sf("#{home}/#{file}", zdotdir/file) + end + <<~ZSH.strip + BREW_PROMPT_PATH="#{path}" BREW_PROMPT_TYPE="#{type}" ZDOTDIR="#{zdotdir}" #{preferred_path} + ZSH + when :bash + <<~BASH.strip + BREW_PROMPT_PATH="#{path}" BREW_PROMPT_TYPE="#{type}" #{preferred_path} --rcfile "#{HOMEBREW_LIBRARY_PATH}/utils/bash/brew-sh-prompt-bashrc.bash" + BASH else - "PS1=\"\\[\\033[1;32m\\]brew \\[\\033[1;31m\\]\\w \\[\\033[1;34m\\]$\\[\\033[0m\\] \" #{preferred_path}" + "PS1=\"\\[\\033[1;32m\\]#{type} \\[\\033[1;31m\\]\\w \\[\\033[1;34m\\]$\\[\\033[0m\\] \" #{preferred_path}" end puts notice if notice.present? diff --git a/Library/Homebrew/utils/zsh/brew-sh-prompt-zshrc.zsh b/Library/Homebrew/utils/zsh/brew-sh-prompt-zshrc.zsh new file mode 100644 index 0000000000..8ef8cda5ac --- /dev/null +++ b/Library/Homebrew/utils/zsh/brew-sh-prompt-zshrc.zsh @@ -0,0 +1,13 @@ +# Read the user's ~/.zshrc first +if [[ -f "${HOME}/.zshrc" ]] +then + source "${HOME}/.zshrc" +fi + +# Override the user's ZSH prompt with our custom prompt +export PROMPT="%B%F{green}${BREW_PROMPT_TYPE}%f %F{blue}$%f%b " +export RPROMPT="[%B%F{red}%~%f%b]" + +# Add the Homebrew PATH in front of the user's PATH +export PATH="${BREW_PROMPT_PATH}:${PATH}" +unset BREW_PROMPT_TYPE BREW_PROMPT_PATH diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index f58f1245dc..a2367191c1 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -37,21 +37,21 @@ end $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/public_suffix-6.0.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/addressable-2.8.7/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ast-2.4.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/base64-0.2.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.1.9") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.1.9/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/base64-0.3.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/benchmark-0.4.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/bigdecimal-3.2.2") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bigdecimal-3.2.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/bindata-2.5.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/coderay-1.1.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/csv-3.3.4/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/csv-3.3.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/diff-lcs-1.6.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/docile-1.4.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/elftools-1.3.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/erubi-1.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/hana-1.3.7/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.12.0") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.12.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/json-2.12.2") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json-2.12.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/regexp_parser-2.10.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simpleidn-0.2.3/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/json_schemer-2.4.0/lib") @@ -64,7 +64,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.25.5/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/netrc-0.11.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel-1.27.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-5.2.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parallel_tests-5.3.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/racc-1.8.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/racc-1.8.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parser-3.3.8.0/lib") @@ -76,48 +76,49 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/pycall-1.5.2") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pycall-1.5.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-3.9.4") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-3.9.4/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.12117/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.3.3/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/rbs-4.0.0.dev.4") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbs-4.0.0.dev.4/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.3.6/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/redcarpet-3.6.1") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/redcarpet-3.6.1/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.13.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.13.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.13.4/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-mocks-3.13.4/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-3.13.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/require-hooks-0.2.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-support-3.13.4/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-core-3.13.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-expectations-3.13.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-mocks-3.13.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-3.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-github-3.0.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-retry-0.6.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.12222/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-sorbet-1.9.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec_junit_formatter-0.6.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.44.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.45.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-emoji-4.0.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-3.1.4/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.75.6/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.77.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-md-2.0.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.25.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-3.6.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.10.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-lsp-0.23.21/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.10.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-lsp-0.24.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-macho-4.1.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/ruby-prof-1.7.1") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-prof-1.7.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/ruby-prof-1.7.2") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-prof-1.7.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-html-0.13.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov_json_formatter-0.1.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-0.22.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/simplecov-cobertura-2.1.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.12117-universal-darwin/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.12117/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.12117/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-0.5.12222-universal-darwin/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-0.5.12222/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-static-and-runtime-0.5.12222/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/thor-1.3.2/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.6.3/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/spoom-1.7.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/stackprof-0.2.27") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/stackprof-0.2.27/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-0.9.37/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/yard-sorbet-0.9.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tapioca-0.16.11/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/vernier-1.7.1") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/vernier-1.7.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tapioca-0.17.5/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/vernier-1.8.0") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/vernier-1.8.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/warning-1.5.0/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt deleted file mode 100644 index a009caefea..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/lib/base64.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.3.0/lib/base64.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/lib/base64.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.3.0/lib/base64.rb index cd2ecc18ea..8c0145d258 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/lib/base64.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/base64-0.3.0/lib/base64.rb @@ -2,7 +2,7 @@ # # \Module \Base64 provides methods for: # -# - Encoding a binary string (containing non-ASCII characters) +# - \Encoding a binary string (containing non-ASCII characters) # as a string of printable ASCII characters. # - Decoding such an encoded string. # @@ -27,7 +27,7 @@ # # require 'base64' # -# == Encoding Character Sets +# == \Encoding Character Sets # # A \Base64-encoded string consists only of characters from a 64-character set: # @@ -140,7 +140,7 @@ # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError # -# \Method Base64.urlsafe_decode64 allows padding in +str+, +# \Method Base64.urlsafe_decode64 allows padding in the encoded string, # which if present, must be correct: # see {Padding}[Base64.html#module-Base64-label-Padding], above: # @@ -183,11 +183,14 @@ # module Base64 - VERSION = "0.2.0" + VERSION = "0.3.0" module_function - # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. # # Per RFC 2045, the returned string may contain the URL-unsafe characters # + or /; @@ -220,19 +223,22 @@ module Base64 [bin].pack("m") end + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # # Returns a string containing the decoding of an RFC-2045-compliant - # \Base64-encoded string +str+: + # \Base64-encoded string +encoded_string+: # # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" # - # Non-\Base64 characters in +str+ are ignored; + # Non-\Base64 characters in +encoded_string+ are ignored; # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # these include newline characters and characters - and /: # # Base64.decode64("\x00\n-_") # => "" # - # Padding in +str+ (even if incorrect) is ignored: + # Padding in +encoded_string+ (even if incorrect) is ignored: # # Base64.decode64("MDEyMzQ1Njc") # => "01234567" # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" @@ -242,7 +248,10 @@ module Base64 str.unpack1("m") end - # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. # # Per RFC 2045, the returned string may contain the URL-unsafe characters # + or /; @@ -274,13 +283,16 @@ module Base64 [bin].pack("m0") end + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # # Returns a string containing the decoding of an RFC-2045-compliant - # \Base64-encoded string +str+: + # \Base64-encoded string +encoded_string+: # # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" # - # Non-\Base64 characters in +str+ not allowed; + # Non-\Base64 characters in +encoded_string+ are not allowed; # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # these include newline characters and characters - and /: # @@ -288,7 +300,7 @@ module Base64 # Base64.strict_decode64('-') # Raises ArgumentError # Base64.strict_decode64('_') # Raises ArgumentError # - # Padding in +str+, if present, must be correct: + # Padding in +encoded_string+, if present, must be correct: # # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" @@ -298,7 +310,10 @@ module Base64 str.unpack1("m0") end - # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. # # Per RFC 4648, the returned string will not contain the URL-unsafe characters # + or /, @@ -332,16 +347,19 @@ module Base64 str end - # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string # - # +str+ may not contain non-Base64 characters; + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: # # Base64.urlsafe_decode64('+') # Raises ArgumentError. # Base64.urlsafe_decode64('/') # Raises ArgumentError. # Base64.urlsafe_decode64("\n") # Raises ArgumentError. # - # Padding in +str+, if present, must be correct: + # Padding in +encoded_string+, if present, must be correct: # see {Padding}[Base64.html#module-Base64-label-Padding], above: # # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/sorbet-runtime.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/sorbet-runtime.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/sorbet-runtime.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/sorbet-runtime.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/_types.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/_types.rb similarity index 99% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/_types.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/_types.rb index 55401ca76d..259ffdcf5f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/_types.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/_types.rb @@ -27,7 +27,7 @@ module T def self.any(type_a, type_b, *types) type_a = T::Utils.coerce(type_a) type_b = T::Utils.coerce(type_b) - types = types.map {|t| T::Utils.coerce(t)} if !types.empty? + types = types.map { |t| T::Utils.coerce(t) } if !types.empty? T::Types::Union::Private::Pool.union_of_types(type_a, type_b, types) end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/abstract_utils.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/abstract_utils.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/abstract_utils.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/abstract_utils.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/boolean.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/boolean.rb similarity index 79% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/boolean.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/boolean.rb index 8763d8707d..0308662a36 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/boolean.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/boolean.rb @@ -4,5 +4,5 @@ module T # T::Boolean is a type alias helper for the common `T.any(TrueClass, FalseClass)`. # Defined separately from _types.rb because it has a dependency on T::Types::Union. - Boolean = T.type_alias {T.any(TrueClass, FalseClass)} + Boolean = T.type_alias { T.any(TrueClass, FalseClass) } end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/compatibility_patches.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/compatibility_patches.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/compatibility_patches.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/compatibility_patches.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/configuration.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/configuration.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/configuration.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/configuration.rb index d598fa4e7e..81a10810e1 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/configuration.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/configuration.rb @@ -419,12 +419,12 @@ module T::Configuration if values.nil? @scalar_types = values else - bad_values = values.reject {|v| v.class == String} + bad_values = values.reject { |v| v.class == String } unless bad_values.empty? raise ArgumentError.new("Provided values must all be class name strings.") end - @scalar_types = values.each_with_object({}) {|x, acc| acc[x] = true}.freeze + @scalar_types = values.each_with_object({}) { |x, acc| acc[x] = true }.freeze end end @@ -449,9 +449,9 @@ module T::Configuration private_constant :MODULE_NAME @default_module_name_mangler = if T::Configuration::AT_LEAST_RUBY_2_7 - ->(type) {MODULE_NAME.bind_call(type)} + ->(type) { MODULE_NAME.bind_call(type) } else - ->(type) {MODULE_NAME.bind(type).call} # rubocop:disable Performance/BindCall + ->(type) { MODULE_NAME.bind(type).call } # rubocop:disable Performance/BindCall end @module_name_mangler = nil diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/enum.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/enum.rb similarity index 84% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/enum.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/enum.rb index 38eea14f5a..a2e43d2eca 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/enum.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/enum.rb @@ -44,11 +44,11 @@ class T::Enum extend T::Props::CustomType # TODO(jez) Might want to restrict this, or make subclasses provide this type - SerializedVal = T.type_alias {T.untyped} + SerializedVal = T.type_alias { T.untyped } private_constant :SerializedVal ### Enum class methods ### - sig {returns(T::Array[T.attached_class])} + sig { returns(T::Array[T.attached_class]) } def self.values if @values.nil? raise "Attempting to access values of #{self.class} before it has been initialized." \ @@ -59,7 +59,7 @@ class T::Enum # This exists for compatibility with the interface of `Hash` & mostly to support # the HashEachMethods Rubocop. - sig {params(blk: T.nilable(T.proc.params(arg0: T.attached_class).void)).returns(T.any(T::Enumerator[T.attached_class], T::Array[T.attached_class]))} + sig { params(blk: T.nilable(T.proc.params(arg0: T.attached_class).void)).returns(T.any(T::Enumerator[T.attached_class], T::Array[T.attached_class])) } def self.each_value(&blk) if blk values.each(&blk) @@ -72,7 +72,7 @@ class T::Enum # # Note: It would have been nice to make this method final before people started overriding it. # Note: Failed CriticalMethodsNoRuntimeTypingTest - sig {params(serialized_val: SerializedVal).returns(T.nilable(T.attached_class)).checked(:never)} + sig { params(serialized_val: SerializedVal).returns(T.nilable(T.attached_class)).checked(:never) } def self.try_deserialize(serialized_val) if @mapping.nil? raise "Attempting to access serialization map of #{self.class} before it has been initialized." \ @@ -88,7 +88,7 @@ class T::Enum # # @return [self] # @raise [KeyError] if serialized value does not match any instance. - sig {overridable.params(serialized_val: SerializedVal).returns(T.attached_class).checked(:never)} + sig { overridable.params(serialized_val: SerializedVal).returns(T.attached_class).checked(:never) } def self.from_serialized(serialized_val) res = try_deserialize(serialized_val) if res.nil? @@ -99,7 +99,7 @@ class T::Enum # Note: It would have been nice to make this method final before people started overriding it. # @return [Boolean] Does the given serialized value correspond with any of this enum's values. - sig {overridable.params(serialized_val: SerializedVal).returns(T::Boolean).checked(:never)} + sig { overridable.params(serialized_val: SerializedVal).returns(T::Boolean).checked(:never) } def self.has_serialized?(serialized_val) if @mapping.nil? raise "Attempting to access serialization map of #{self.class} before it has been initialized." \ @@ -109,7 +109,7 @@ class T::Enum end # Note: Failed CriticalMethodsNoRuntimeTypingTest - sig {override.params(instance: T.nilable(T::Enum)).returns(SerializedVal).checked(:never)} + sig { override.params(instance: T.nilable(T::Enum)).returns(SerializedVal).checked(:never) } def self.serialize(instance) # This is needed otherwise if a Chalk::ODM::Document with a property of the shape # T::Hash[T.nilable(MyEnum), Integer] and a value that looks like {nil => 0} is @@ -126,7 +126,7 @@ class T::Enum end # Note: Failed CriticalMethodsNoRuntimeTypingTest - sig {override.params(mongo_value: SerializedVal).returns(T.attached_class).checked(:never)} + sig { override.params(mongo_value: SerializedVal).returns(T.attached_class).checked(:never) } def self.deserialize(mongo_value) if self == T::Enum raise "Cannot call T::Enum.deserialize directly. You must call on a specific child class." @@ -136,46 +136,46 @@ class T::Enum ### Enum instance methods ### - sig {returns(T.self_type)} + sig { returns(T.self_type) } def dup self end - sig {returns(T.self_type).checked(:tests)} + sig { returns(T.self_type).checked(:tests) } def clone self end # Note: Failed CriticalMethodsNoRuntimeTypingTest - sig {returns(SerializedVal).checked(:never)} + sig { returns(SerializedVal).checked(:never) } def serialize assert_bound! @serialized_val end - sig {params(args: T.untyped).returns(T.untyped)} + sig { params(args: T.untyped).returns(T.untyped) } def to_json(*args) serialize.to_json(*args) end - sig {params(args: T.untyped).returns(T.untyped)} + sig { params(args: T.untyped).returns(T.untyped) } def as_json(*args) serialized_val = serialize return serialized_val unless serialized_val.respond_to?(:as_json) serialized_val.as_json(*args) end - sig {returns(String)} + sig { returns(String) } def to_s inspect end - sig {returns(String)} + sig { returns(String) } def inspect "#<#{self.class.name}::#{@const_name || '__UNINITIALIZED__'}>" end - sig {params(other: BasicObject).returns(T.nilable(Integer))} + sig { params(other: BasicObject).returns(T.nilable(Integer)) } def <=>(other) case other when self.class @@ -192,7 +192,7 @@ class T::Enum # responds to the `to_str` method. It does not actually call `to_str` however. # # See https://ruby-doc.org/core-2.4.0/String.html#method-i-3D-3D - T::Sig::WithoutRuntime.sig {returns(String)} + T::Sig::WithoutRuntime.sig { returns(String) } def to_str msg = 'Implicit conversion of Enum instances to strings is not allowed. Call #serialize instead.' if T::Configuration.legacy_t_enum_migration_mode? @@ -200,7 +200,7 @@ class T::Enum msg, storytime: { class: self.class.name, - caller_location: Kernel.caller_locations(1..1)&.[](0)&.then {"#{_1.path}:#{_1.lineno}"}, + caller_location: Kernel.caller_locations(1..1)&.[](0)&.then { "#{_1.path}:#{_1.lineno}" }, }, ) serialize.to_s @@ -217,12 +217,12 @@ class T::Enum if T.unsafe(false) # Declare to the type system that the `serialize` method for sure exists # on whatever we mix this into. - T::Sig::WithoutRuntime.sig {abstract.returns(T.untyped)} + T::Sig::WithoutRuntime.sig { abstract.returns(T.untyped) } def serialize; end end # WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth - T::Sig::WithoutRuntime.sig {params(other: BasicObject).returns(T::Boolean)} + T::Sig::WithoutRuntime.sig { params(other: BasicObject).returns(T::Boolean) } def ==(other) case other when String @@ -238,7 +238,7 @@ class T::Enum end # WithoutRuntime so that comparison_assertion_failed can assume a constant stack depth - T::Sig::WithoutRuntime.sig {params(other: BasicObject).returns(T::Boolean)} + T::Sig::WithoutRuntime.sig { params(other: BasicObject).returns(T::Boolean) } def ===(other) case other when String @@ -255,7 +255,7 @@ class T::Enum # WithoutRuntime so that caller_locations can assume a constant stack depth # (Otherwise, the first call would be the method with the wrapping, which would have a different stack depth.) - T::Sig::WithoutRuntime.sig {params(method: Symbol, other: T.untyped).void} + T::Sig::WithoutRuntime.sig { params(method: Symbol, other: T.untyped).void } private def comparison_assertion_failed(method, other) T::Configuration.soft_assert_handler( 'Enum to string comparison not allowed. Compare to the Enum instance directly instead. See go/enum-migration', @@ -265,7 +265,7 @@ class T::Enum other: other, other_class: other.class.name, method: method, - caller_location: Kernel.caller_locations(2..2)&.[](0)&.then {"#{_1.path}:#{_1.lineno}"}, + caller_location: Kernel.caller_locations(2..2)&.[](0)&.then { "#{_1.path}:#{_1.lineno}" }, } ) end @@ -276,7 +276,7 @@ class T::Enum UNSET = T.let(Module.new.freeze, Module) private_constant :UNSET - sig {params(serialized_val: SerializedVal).void} + sig { params(serialized_val: SerializedVal).void } def initialize(serialized_val=UNSET) raise 'T::Enum is abstract' if self.class == T::Enum if !self.class.started_initializing? @@ -292,7 +292,7 @@ class T::Enum self.class._register_instance(self) end - sig {returns(NilClass).checked(:never)} + sig { returns(NilClass).checked(:never) } private def assert_bound! if @const_name.nil? raise "Attempting to access Enum value on #{self.class} before it has been initialized." \ @@ -300,14 +300,14 @@ class T::Enum end end - sig {params(const_name: Symbol).void} + sig { params(const_name: Symbol).void } def _bind_name(const_name) @const_name = const_name @serialized_val = const_to_serialized_val(const_name) if @serialized_val.equal?(UNSET) freeze end - sig {params(const_name: Symbol).returns(String)} + sig { params(const_name: Symbol).returns(String) } private def const_to_serialized_val(const_name) # Historical note: We convert to lowercase names because the majority of existing calls to # `make_accessible` were arrays of lowercase strings. Doing this conversion allowed for the @@ -315,7 +315,7 @@ class T::Enum -const_name.to_s.downcase.freeze end - sig {returns(T::Boolean)} + sig { returns(T::Boolean) } def self.started_initializing? unless defined?(@started_initializing) @started_initializing = T.let(false, T.nilable(T::Boolean)) @@ -323,7 +323,7 @@ class T::Enum T.must(@started_initializing) end - sig {returns(T::Boolean)} + sig { returns(T::Boolean) } def self.fully_initialized? unless defined?(@fully_initialized) @fully_initialized = T.let(false, T.nilable(T::Boolean)) @@ -332,7 +332,7 @@ class T::Enum end # Maintains the order in which values are defined - sig {params(instance: T.untyped).void} + sig { params(instance: T.untyped).void } def self._register_instance(instance) @values ||= [] @values << T.cast(instance, T.attached_class) @@ -340,7 +340,7 @@ class T::Enum # Entrypoint for allowing people to register new enum values. # All enum values must be defined within this block. - sig {params(blk: T.proc.void).void} + sig { params(blk: T.proc.void).void } def self.enums(&blk) raise "enums cannot be defined for T::Enum" if self == T::Enum raise "Enum #{self} was already initialized" if fully_initialized? @@ -375,13 +375,13 @@ class T::Enum orphaned_instances = T.must(@values) - @mapping.values if !orphaned_instances.empty? - raise "Enum values must be assigned to constants: #{orphaned_instances.map {|v| v.instance_variable_get('@serialized_val')}}" + raise "Enum values must be assigned to constants: #{orphaned_instances.map { |v| v.instance_variable_get('@serialized_val') }}" end @fully_initialized = true end - sig {params(child_class: T::Class[T.anything]).void} + sig { params(child_class: T::Class[T.anything]).void } def self.inherited(child_class) super @@ -394,12 +394,12 @@ class T::Enum end # Marshal support - sig {params(_level: Integer).returns(String)} + sig { params(_level: Integer).returns(String) } def _dump(_level) Marshal.dump(serialize) end - sig {params(args: String).returns(T.attached_class)} + sig { params(args: String).returns(T.attached_class) } def self._load(args) deserialize(Marshal.load(args)) # rubocop:disable Security/MarshalLoad end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/generic.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/generic.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/generic.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/generic.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/helpers.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/helpers.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/helpers.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/helpers.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/non_forcing_constants.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/non_forcing_constants.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/non_forcing_constants.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/non_forcing_constants.rb index 0459b92610..73cd2204d9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/non_forcing_constants.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/non_forcing_constants.rb @@ -4,7 +4,7 @@ module T::NonForcingConstants # NOTE: This method is documented on the RBI in Sorbet's payload, so that it # shows up in the hover/completion documentation via LSP. - T::Sig::WithoutRuntime.sig {params(val: BasicObject, klass: String).returns(T::Boolean)} + T::Sig::WithoutRuntime.sig { params(val: BasicObject, klass: String).returns(T::Boolean) } def self.non_forcing_is_a?(val, klass) method_name = "T::NonForcingConstants.non_forcing_is_a?" if klass.empty? diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/data.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/data.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/data.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/data.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/declare.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/declare.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/declare.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/declare.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/hooks.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/hooks.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/hooks.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/hooks.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/validate.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/validate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/abstract/validate.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/abstract/validate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/caller_utils.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/caller_utils.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/caller_utils.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/caller_utils.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/casts.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/casts.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/casts.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/casts.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/class_utils.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/class_utils.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/class_utils.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/class_utils.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/decl_state.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/decl_state.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/decl_state.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/decl_state.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/final.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/final.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/final.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/final.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/_methods.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/_methods.rb index 4a8b689eb3..f412525854 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/_methods.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/_methods.rb @@ -25,7 +25,7 @@ module T::Private::Methods # twice is permitted). we could do this with two tables, but it seems slightly # cleaner with a single table. # Effectively T::Hash[Module, T.nilable(Set))] - @modules_with_final = Hash.new {|hash, key| hash[key] = nil}.compare_by_identity + @modules_with_final = Hash.new { |hash, key| hash[key] = nil }.compare_by_identity # this stores the old [included, extended] hooks for Module and inherited hook for Class that we override when # enabling final checks for when those hooks are called. the 'hooks' here don't have anything to do with the 'hooks' # in installed_hooks. @@ -168,7 +168,7 @@ module T::Private::Methods definition_file, definition_line = T::Private::Methods.signature_for_method(ancestor.instance_method(method_name)).method.source_location is_redefined = target == ancestor - caller_loc = T::Private::CallerUtils.find_caller {|loc| !loc.path.to_s.start_with?(SORBET_RUNTIME_LIB_PATH)} + caller_loc = T::Private::CallerUtils.find_caller { |loc| !loc.path.to_s.start_with?(SORBET_RUNTIME_LIB_PATH) } extra_info = "\n" if caller_loc extra_info = (is_redefined ? "Redefined" : "Overridden") + " here: #{caller_loc.path}:#{caller_loc.lineno}\n" @@ -471,7 +471,7 @@ module T::Private::Methods end def self.all_checked_tests_sigs - @signatures_by_method.values.select {|sig| sig.check_level == :tests} + @signatures_by_method.values.select { |sig| sig.check_level == :tests } end # the module target is adding the methods from the module source to itself. we need to check that for all instance @@ -589,6 +589,22 @@ module T::Private::Methods mod.extend(SingletonMethodHooks) end + # `name` must be an instance method (for class methods, pass in mod.singleton_class) + def self.visibility_method_name(mod, name) + if mod.public_method_defined?(name) + :public + elsif mod.protected_method_defined?(name) + :protected + elsif mod.private_method_defined?(name) + :private + else + # Raises a NameError formatted like the Ruby VM would (the exact text formatting + # of these errors changed across Ruby VM versions, in ways that would sometimes + # cause tests to fail if they were dependent on hard coding errors). + mod.method(name) + end + end + # use this directly if you don't want/need to box up the method into an object to pass to method_to_key. private_class_method def self.method_owner_and_name_to_key(owner, name) "#{owner.object_id}##{name}" diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation.rb index 2d2169f8e9..85ee341edf 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation.rb @@ -12,7 +12,7 @@ module T::Private::Methods::CallValidation # @param method_sig [T::Private::Methods::Signature] # @return [UnboundMethod] the new wrapper method (or the original one if we didn't wrap it) def self.wrap_method_if_needed(mod, method_sig, original_method) - original_visibility = visibility_method_name(mod, method_sig.method_name) + original_visibility = T::Private::Methods.visibility_method_name(mod, method_sig.method_name) if method_sig.mode == T::Private::Methods::Modes.abstract create_abstract_wrapper(mod, method_sig, original_method, original_visibility) # Do nothing in this case; this method was not wrapped in _on_method_added. @@ -69,11 +69,11 @@ module T::Private::Methods::CallValidation def self.create_validator_method(mod, original_method, method_sig, original_visibility) has_fixed_arity = method_sig.kwarg_types.empty? && !method_sig.has_rest && !method_sig.has_keyrest && - original_method.parameters.all? {|(kind, _name)| kind == :req || kind == :block} + original_method.parameters.all? { |(kind, _name)| kind == :req || kind == :block } can_skip_block_type = method_sig.block_type.nil? || method_sig.block_type.valid?(nil) ok_for_fast_path = has_fixed_arity && can_skip_block_type && !method_sig.bind && method_sig.arg_types.length < 5 && is_allowed_to_have_fast_path - all_args_are_simple = ok_for_fast_path && method_sig.arg_types.all? {|_name, type| type.is_a?(T::Types::Simple)} + all_args_are_simple = ok_for_fast_path && method_sig.arg_types.all? { |_name, type| type.is_a?(T::Types::Simple) } simple_method = all_args_are_simple && method_sig.return_type.is_a?(T::Types::Simple) simple_procedure = all_args_are_simple && method_sig.return_type.is_a?(T::Private::Types::Void) @@ -330,19 +330,6 @@ module T::Private::Methods::CallValidation location: caller_loc ) end - - # `name` must be an instance method (for class methods, pass in mod.singleton_class) - private_class_method def self.visibility_method_name(mod, name) - if mod.public_method_defined?(name) - :public - elsif mod.protected_method_defined?(name) - :protected - elsif mod.private_method_defined?(name) - :private - else - mod.method(name) # Raises - end - end end if T::Configuration::AT_LEAST_RUBY_2_7 diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation_2_6.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation_2_6.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation_2_6.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation_2_6.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation_2_7.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation_2_7.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/call_validation_2_7.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/call_validation_2_7.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/decl_builder.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/decl_builder.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/decl_builder.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/decl_builder.rb index 74a3ec6543..383aacee85 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/decl_builder.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/decl_builder.rb @@ -154,7 +154,12 @@ module T::Private::Methods case decl.mode when Modes.standard decl.mode = Modes.override - decl.override_allow_incompatible = allow_incompatible + case allow_incompatible + when true, false, :visibility + decl.override_allow_incompatible = allow_incompatible + else + raise BuilderError.new(".override(allow_incompatible: ...) only accepts `true`, `false`, or `:visibility`, got: #{allow_incompatible.inspect}") + end when Modes.override, Modes.overridable_override raise BuilderError.new(".override cannot be repeated in a single signature") when Modes.overridable diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/modes.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/modes.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/modes.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/modes.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature.rb index 79772957a7..60d846753c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature.rb @@ -68,14 +68,14 @@ class T::Private::Methods::Signature writer_method = !(raw_arg_types.size == 1 && raw_arg_types.key?(nil)) && parameters == UNNAMED_REQUIRED_PARAMETERS && method_name[-1] == "=" # For writer methods, map the single parameter to the method name without the "=" at the end parameters = [[:req, method_name[0...-1].to_sym]] if writer_method - is_name_missing = parameters.any? {|_, name| !raw_arg_types.key?(name)} + is_name_missing = parameters.any? { |_, name| !raw_arg_types.key?(name) } if is_name_missing - param_names = parameters.map {|_, name| name} + param_names = parameters.map { |_, name| name } missing_names = param_names - raw_arg_types.keys raise "The declaration for `#{method.name}` is missing parameter(s): #{missing_names.join(', ')}" elsif parameters.length != raw_arg_types.size - param_names = parameters.map {|_, name| name} - has_extra_names = parameters.count {|_, name| raw_arg_types.key?(name)} < raw_arg_types.size + param_names = parameters.map { |_, name| name } + has_extra_names = parameters.count { |_, name| raw_arg_types.key?(name) } < raw_arg_types.size if has_extra_names extra_names = raw_arg_types.keys - param_names raise "The declaration for `#{method.name}` has extra parameter(s): #{extra_names.join(', ')}" @@ -95,7 +95,7 @@ class T::Private::Methods::Signature # always precede optional keyword arguments. We can't tell # whether the culprit is the Ruby reordering or user error, so # we error but include a note - if param_kind == :keyreq && parameters.any? {|k, _| k == :key} + if param_kind == :keyreq && parameters.any? { |k, _| k == :key } hint = "\n\nNote: Any required keyword arguments must precede any optional keyword " \ "arguments. If your method declaration matches your `def`, try reordering any " \ "optional keyword parameters to the end of the method list." @@ -103,7 +103,7 @@ class T::Private::Methods::Signature raise "Parameter `#{type_name}` is declared out of order (declared as arg number " \ "#{i + 1}, defined in the method as arg number " \ - "#{parameters.index {|_, name| name == type_name} + 1}).#{hint}\nMethod: #{method_desc}" + "#{parameters.index { |_, name| name == type_name } + 1}).#{hint}\nMethod: #{method_desc}" end type = T::Utils.coerce(raw_type) @@ -245,8 +245,8 @@ class T::Private::Methods::Signature end def force_type_init - @arg_types.each {|_, type| type.build_type} - @kwarg_types.each {|_, type| type.build_type} + @arg_types.each { |_, type| type.build_type } + @kwarg_types.each { |_, type| type.build_type } @block_type&.build_type @rest_type&.build_type @keyrest_type&.build_type diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature_validation.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature_validation.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature_validation.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature_validation.rb index 07a33d73ac..75cfc2a188 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/methods/signature_validation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/methods/signature_validation.rb @@ -72,7 +72,7 @@ module T::Private::Methods::SignatureValidation # If the super_method has any kwargs we can't build a # Signature for it, so we'll just skip validation in that case. - if !super_signature && !super_method.parameters.select {|kind, _| kind == :rest || kind == :kwrest}.empty? + if !super_signature && !super_method.parameters.select { |kind, _| kind == :rest || kind == :kwrest }.empty? nil else # super_signature can be nil when we're overriding a method (perhaps a builtin) that didn't use @@ -89,6 +89,7 @@ module T::Private::Methods::SignatureValidation validate_override_mode(signature, super_signature) validate_override_shape(signature, super_signature) validate_override_types(signature, super_signature) + validate_override_visibility(signature, super_signature) end else validate_non_override_mode(signature) @@ -175,7 +176,7 @@ module T::Private::Methods::SignatureValidation end def self.validate_override_shape(signature, super_signature) - return if signature.override_allow_incompatible + return if signature.override_allow_incompatible == true return if super_signature.mode == Modes.untyped method_name = signature.method_name @@ -231,7 +232,7 @@ module T::Private::Methods::SignatureValidation end def self.validate_override_types(signature, super_signature) - return if signature.override_allow_incompatible + return if signature.override_allow_incompatible == true return if super_signature.mode == Modes.untyped return unless [signature, super_signature].all? do |sig| sig.check_level == :always || (sig.check_level == :tests && T::Private::RuntimeLevels.check_tests?) @@ -276,6 +277,38 @@ module T::Private::Methods::SignatureValidation end end + def self.validate_override_visibility(signature, super_signature) + return if super_signature.mode == Modes.untyped + # This departs from the behavior of other `validate_override_whatever` functions in that it + # only comes into effect when the child signature explicitly says the word `override`. This was + # done because the primary method for silencing these errors (`allow_incompatible: :visibility`) + # requires an `override` node to attach to. Once we have static override checking for implicitly + # overridden methods, we can remove this. + return unless [Modes.override, Modes.overridable_override].include?(signature.mode) + return if [:visibility, true].include?(signature.override_allow_incompatible) + method = signature.method + super_method = super_signature.method + mode_noun = super_signature.mode == Modes.abstract ? 'implementation' : 'override' + vis = method_visibility(method) + super_vis = method_visibility(super_method) + + if visibility_strength(vis) > visibility_strength(super_vis) + raise "Incompatible visibility for #{mode_noun} of method #{method.name}\n" \ + "* Base: #{super_vis} (in #{method_loc_str(super_method)})\n" \ + "* #{mode_noun.capitalize}: #{vis} (in #{method_loc_str(method)})\n" \ + "(The override must be at least as permissive as the supermethod)" \ + end + end + + private_class_method def self.method_visibility(method) + T::Private::Methods.visibility_method_name(method.owner, method.name) + end + + # Higher = more restrictive. + private_class_method def self.visibility_strength(vis) + %i[public protected private].find_index(vis) + end + private_class_method def self.base_override_loc_str(signature, super_signature) mode_noun = super_signature.mode == Modes.abstract ? 'Implementation' : 'Override' "\n * Base definition: in #{method_loc_str(super_signature.method)}" \ diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/mixins/mixins.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/mixins/mixins.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/mixins/mixins.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/mixins/mixins.rb index 01eb42bd3a..3660cfb577 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/mixins/mixins.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/mixins/mixins.rb @@ -5,7 +5,7 @@ module T::Private module MixesInClassMethods def included(other) mods = Abstract::Data.get(self, :class_methods_mixins) - mods.each {|mod| other.extend(mod)} + mods.each { |mod| other.extend(mod) } super end end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/retry.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/retry.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/retry.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/retry.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/runtime_levels.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/runtime_levels.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/runtime_levels.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/runtime_levels.rb index dbf0884195..0769fd07bd 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/runtime_levels.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/runtime_levels.rb @@ -32,7 +32,7 @@ module T::Private::RuntimeLevels def self.enable_checking_in_tests if !@check_tests && @wrapped_tests_with_validation all_checked_tests_sigs = T::Private::Methods.all_checked_tests_sigs - locations = all_checked_tests_sigs.map {|sig| sig.method.source_location.join(':')}.join("\n- ") + locations = all_checked_tests_sigs.map { |sig| sig.method.source_location.join(':') }.join("\n- ") raise "Toggle `:tests`-level runtime type checking earlier. " \ "There are already some methods wrapped with `sig.checked(:tests)`:\n" \ "- #{locations}" diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/sealed.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/sealed.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/sealed.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/sealed.rb index 7fb8475f75..87230bd2b3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/sealed.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/sealed.rb @@ -5,7 +5,7 @@ module T::Private::Sealed module NoInherit def inherited(child) super - caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'inherited'} + caller_loc = T::Private::CallerUtils.find_caller { |loc| loc.base_label != 'inherited' } T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'inherited') @sorbet_sealed_module_all_subclasses << child end @@ -22,14 +22,14 @@ module T::Private::Sealed module NoIncludeExtend def included(child) super - caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'included'} + caller_loc = T::Private::CallerUtils.find_caller { |loc| loc.base_label != 'included' } T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'included') @sorbet_sealed_module_all_subclasses << child end def extended(child) super - caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'extended'} + caller_loc = T::Private::CallerUtils.find_caller { |loc| loc.base_label != 'extended' } T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'extended') @sorbet_sealed_module_all_subclasses << child end @@ -81,7 +81,7 @@ module T::Private::Sealed if !this_file.start_with?(decl_file) whitelist = T::Configuration.sealed_violation_whitelist - if !whitelist.nil? && whitelist.any? {|pattern| this_file =~ pattern} + if !whitelist.nil? && whitelist.any? { |pattern| this_file =~ pattern } return end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/not_typed.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/not_typed.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/not_typed.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/not_typed.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/simple_pair_union.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/simple_pair_union.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/simple_pair_union.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/simple_pair_union.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/string_holder.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/string_holder.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/string_holder.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/string_holder.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/type_alias.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/type_alias.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/type_alias.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/type_alias.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/void.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/void.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/private/types/void.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/private/types/void.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/_props.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/_props.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/_props.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/_props.rb index 420e1d2651..0b8fb3694b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/_props.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/_props.rb @@ -109,7 +109,7 @@ module T::Props # form. # # @return [void] - sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void} + sig { params(name: Symbol, cls: T.untyped, rules: T.untyped).void } def prop(name, cls, **rules) cls = T::Utils.coerce(cls) if !cls.is_a?(Module) decorator.prop_defined(name, cls, rules) @@ -132,7 +132,7 @@ module T::Props end # Shorthand helper to define a `prop` with `immutable => true` - sig {params(name: Symbol, cls_or_args: T.untyped, args: T.untyped).void} + sig { params(name: Symbol, cls_or_args: T.untyped, args: T.untyped).void } def const(name, cls_or_args, **args) if (cls_or_args.is_a?(Hash) && cls_or_args.key?(:immutable)) || args.key?(:immutable) Kernel.raise ArgumentError.new("Cannot pass 'immutable' argument when using 'const' keyword to define a prop") diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/constructor.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/constructor.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/constructor.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/constructor.rb index 570c068ac4..ae7fa87a14 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/constructor.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/constructor.rb @@ -15,7 +15,7 @@ module T::Props::Constructor::DecoratorMethods # we'll use to check for any unrecognized input.) # # checked(:never) - O(runtime object construction) - sig {params(instance: T::Props::Constructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never)} + sig { params(instance: T::Props::Constructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never) } def construct_props_without_defaults(instance, hash) # Use `each_pair` rather than `count` because, as of Ruby 2.6, the latter delegates to Enumerator # and therefore allocates for each entry. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/custom_type.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/custom_type.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/custom_type.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/custom_type.rb index a09b6a76c5..eb477dfdfb 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/custom_type.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/custom_type.rb @@ -39,7 +39,7 @@ module T::Props # # @param [Object] instance # @return An instance of one of T::Configuration.scalar_types - sig {abstract.params(instance: T.untyped).returns(T.untyped).checked(:never)} + sig { abstract.params(instance: T.untyped).returns(T.untyped).checked(:never) } def serialize(instance); end # Given the serialized form of your type, this returns an instance @@ -47,17 +47,17 @@ module T::Props # # @param scalar One of T::Configuration.scalar_types # @return Object - sig {abstract.params(scalar: T.untyped).returns(T.untyped).checked(:never)} + sig { abstract.params(scalar: T.untyped).returns(T.untyped).checked(:never) } def deserialize(scalar); end - sig {override.params(_base: Module).void} + sig { override.params(_base: Module).void } def self.included(_base) super raise 'Please use "extend", not "include" to attach this module' end - sig(:final) {params(val: T.untyped).returns(T::Boolean).checked(:never)} + sig(:final) { params(val: T.untyped).returns(T::Boolean).checked(:never) } def self.scalar_type?(val) # We don't need to check for val's included modules in # T::Configuration.scalar_types, because T::Configuration.scalar_types @@ -74,7 +74,7 @@ module T::Props # implement set-like fields that store a unique-array, but forbid # hashes; Custom hash types should be implemented via an emebdded # T::Struct (or a subclass like Chalk::ODM::Document) or via T. - sig(:final) {params(val: Object).returns(T::Boolean).checked(:never)} + sig(:final) { params(val: Object).returns(T::Boolean).checked(:never) } def self.valid_serialization?(val) case val when Array diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/decorator.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/decorator.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/decorator.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/decorator.rb index f2bd63c4d7..0e15a81aa9 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/decorator.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/decorator.rb @@ -10,17 +10,17 @@ class T::Props::Decorator extend T::Sig - Rules = T.type_alias {T::Hash[Symbol, T.untyped]} - DecoratedInstance = T.type_alias {Object} # Would be T::Props, but that produces circular reference errors in some circumstances - PropType = T.type_alias {T::Types::Base} - PropTypeOrClass = T.type_alias {T.any(PropType, Module)} + Rules = T.type_alias { T::Hash[Symbol, T.untyped] } + DecoratedInstance = T.type_alias { Object } # Would be T::Props, but that produces circular reference errors in some circumstances + PropType = T.type_alias { T::Types::Base } + PropTypeOrClass = T.type_alias { T.any(PropType, Module) } class NoRulesError < StandardError; end EMPTY_PROPS = T.let({}.freeze, T::Hash[Symbol, Rules], checked: false) private_constant :EMPTY_PROPS - sig {params(klass: T.untyped).void.checked(:never)} + sig { params(klass: T.untyped).void.checked(:never) } def initialize(klass) @class = T.let(klass, T.all(Module, T::Props::ClassMethods)) @class.plugins.each do |mod| @@ -30,22 +30,22 @@ class T::Props::Decorator end # checked(:never) - O(prop accesses) - sig {returns(T::Hash[Symbol, Rules]).checked(:never)} + sig { returns(T::Hash[Symbol, Rules]).checked(:never) } attr_reader :props - sig {returns(T::Array[Symbol])} + sig { returns(T::Array[Symbol]) } def all_props props.keys end # checked(:never) - O(prop accesses) - sig {params(prop: T.any(Symbol, String)).returns(Rules).checked(:never)} + sig { params(prop: T.any(Symbol, String)).returns(Rules).checked(:never) } def prop_rules(prop) props[prop.to_sym] || raise("No such prop: #{prop.inspect}") end # checked(:never) - Rules hash is expensive to check - sig {params(prop: Symbol, rules: Rules).void.checked(:never)} + sig { params(prop: Symbol, rules: Rules).void.checked(:never) } def add_prop_definition(prop, rules) override = rules.delete(:override) @@ -79,16 +79,16 @@ class T::Props::Decorator extra setter_validate _tnilable - ].to_h {|k| [k, true]}.freeze, T::Hash[Symbol, T::Boolean], checked: false) + ].to_h { |k| [k, true] }.freeze, T::Hash[Symbol, T::Boolean], checked: false) private_constant :VALID_RULE_KEYS - sig {params(key: Symbol).returns(T::Boolean).checked(:never)} + sig { params(key: Symbol).returns(T::Boolean).checked(:never) } def valid_rule_key?(key) !!VALID_RULE_KEYS[key] end # checked(:never) - O(prop accesses) - sig {returns(T.all(Module, T::Props::ClassMethods)).checked(:never)} + sig { returns(T.all(Module, T::Props::ClassMethods)).checked(:never) } def decorated_class @class end @@ -98,7 +98,7 @@ class T::Props::Decorator # Use this to validate that a value will validate for a given prop. Useful for knowing whether a value can be set on a model without setting it. # # checked(:never) - potentially O(prop accesses) depending on usage pattern - sig {params(prop: Symbol, val: T.untyped).void.checked(:never)} + sig { params(prop: Symbol, val: T.untyped).void.checked(:never) } def validate_prop_value(prop, val) prop_rules(prop).fetch(:value_validate_proc).call(val) end @@ -202,7 +202,7 @@ class T::Props::Decorator end # TODO: we should really be checking all the methods on `cls`, not just Object - BANNED_METHOD_NAMES = T.let(Object.instance_methods.each_with_object({}) {|x, acc| acc[x] = true}.freeze, T::Hash[Symbol, TrueClass], checked: false) + BANNED_METHOD_NAMES = T.let(Object.instance_methods.each_with_object({}) { |x, acc| acc[x] = true }.freeze, T::Hash[Symbol, TrueClass], checked: false) # checked(:never) - Rules hash is expensive to check sig do @@ -223,7 +223,7 @@ class T::Props::Decorator "to 'sensitivity:' (in prop #{@class.name}.#{name})") end - if rules.keys.any? {|k| !valid_rule_key?(k)} + if rules.keys.any? { |k| !valid_rule_key?(k) } raise ArgumentError.new("At least one invalid prop arg supplied in #{self}: #{rules.keys.inspect}") end @@ -247,7 +247,7 @@ class T::Props::Decorator SAFE_NAME = T.let(/\A[A-Za-z_][A-Za-z0-9_-]*\z/.freeze, Regexp, checked: false) # Used to validate both prop names and serialized forms - sig {params(name: T.any(Symbol, String)).void.checked(:never)} + sig { params(name: T.any(Symbol, String)).void.checked(:never) } private def validate_prop_name(name) if !name.match?(SAFE_NAME) raise ArgumentError.new("Invalid prop name in #{@class.name}: #{name}") @@ -255,7 +255,7 @@ class T::Props::Decorator end # This converts the type from a T::Type to a regular old ruby class. - sig {params(type: T::Types::Base).returns(Module).checked(:never)} + sig { params(type: T::Types::Base).returns(Module).checked(:never) } private def convert_type_to_class(type) case type when T::Types::TypedArray, T::Types::FixedArray @@ -392,7 +392,7 @@ class T::Props::Decorator end # checked(:never) - Rules hash is expensive to check - sig {params(name: Symbol, rules: Rules).void.checked(:never)} + sig { params(name: Symbol, rules: Rules).void.checked(:never) } private def define_getter_and_setter(name, rules) T::Configuration.without_ruby_warnings do if !rules[:immutable] @@ -440,7 +440,7 @@ class T::Props::Decorator end # checked(:never) - Rules hash is expensive to check - sig {params(prop_name: Symbol, rules: Rules).void.checked(:never)} + sig { params(prop_name: Symbol, rules: Rules).void.checked(:never) } private def validate_not_missing_sensitivity(prop_name, rules) if rules[:sensitivity].nil? if rules[:redaction] @@ -612,7 +612,7 @@ class T::Props::Decorator # # This gets called when a module or class that extends T::Props gets included, extended, # prepended, or inherited. - sig {params(child: Module).void.checked(:never)} + sig { params(child: Module).void.checked(:never) } def model_inherited(child) child.extend(T::Props::ClassMethods) child = T.cast(child, T.all(Module, T::Props::ClassMethods)) @@ -656,19 +656,19 @@ class T::Props::Decorator end end - sig {params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never)} + sig { params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never) } private def clobber_getter?(child, prop) !!(child.decorator.method(:prop_get).owner != method(:prop_get).owner && child.instance_method(prop).source_location&.first == __FILE__) end - sig {params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never)} + sig { params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never) } private def clobber_setter?(child, prop) !!(child.decorator.method(:prop_set).owner != method(:prop_set).owner && child.instance_method("#{prop}=").source_location&.first == __FILE__) end - sig {params(mod: Module).void.checked(:never)} + sig { params(mod: Module).void.checked(:never) } def plugin(mod) decorated_class.plugins << mod T::Props::Plugin::Private.apply_class_methods(mod, decorated_class) diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/errors.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/errors.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/errors.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/errors.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/generated_code_validation.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/generated_code_validation.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/generated_code_validation.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/generated_code_validation.rb index 91f256799d..4155e293ad 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/generated_code_validation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/generated_code_validation.rb @@ -159,7 +159,7 @@ module T::Props assert_equal(:resbody, rescue_body.type) exceptions, assignment, handler = rescue_body.children assert_equal(:array, exceptions.type) - exceptions.children.each {|c| assert_equal(:const, c.type)} + exceptions.children.each { |c| assert_equal(:const, c.type) } assert_equal(:lvasgn, assignment.type) assert_equal([:e], assignment.children) @@ -169,7 +169,7 @@ module T::Props receiver, method, *args = deserialization_error.children assert_equal(nil, receiver) assert_equal(:raise_deserialization_error, method) - args.each {|a| validate_lack_of_side_effects(a, whitelisted_methods_for_deserialize)} + args.each { |a| validate_lack_of_side_effects(a, whitelisted_methods_for_deserialize) } validate_lack_of_side_effects(val_return, whitelisted_methods_for_deserialize) else @@ -222,12 +222,12 @@ module T::Props # Primitives & self are ok when :lvar, :arg, :ivar # Reading local & instance variables & arguments is ok - unless node.children.all? {|c| c.is_a?(Symbol)} + unless node.children.all? { |c| c.is_a?(Symbol) } raise ValidationError.new("Unexpected child for #{node.type}: #{node.inspect}") end when :args, :mlhs, :block, :begin, :if # Blocks etc are read-only if their contents are read-only - node.children.each {|c| validate_lack_of_side_effects(c, whitelisted_methods_by_receiver_type) if c} + node.children.each { |c| validate_lack_of_side_effects(c, whitelisted_methods_by_receiver_type) if c } when :send # Sends are riskier so check a whitelist receiver, method, *args = node.children diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/has_lazily_specialized_methods.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/has_lazily_specialized_methods.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/has_lazily_specialized_methods.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/has_lazily_specialized_methods.rb index a82f699032..22ba87bfce 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/has_lazily_specialized_methods.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/has_lazily_specialized_methods.rb @@ -30,12 +30,12 @@ module T::Props # # Note it does _not_ prevent explicit calls to `eagerly_define_lazy_methods!` # from working. - sig {void} + sig { void } def self.disable_lazy_evaluation! @lazy_evaluation_disabled ||= true end - sig {returns(T::Boolean)} + sig { returns(T::Boolean) } def self.lazy_evaluation_enabled? !defined?(@lazy_evaluation_disabled) || !@lazy_evaluation_disabled end @@ -43,17 +43,17 @@ module T::Props module DecoratorMethods extend T::Sig - sig {returns(T::Hash[Symbol, T.proc.returns(String)]).checked(:never)} + sig { returns(T::Hash[Symbol, T.proc.returns(String)]).checked(:never) } private def lazily_defined_methods @lazily_defined_methods ||= {} end - sig {returns(T::Hash[Symbol, T.untyped]).checked(:never)} + sig { returns(T::Hash[Symbol, T.untyped]).checked(:never) } private def lazily_defined_vm_methods @lazily_defined_vm_methods ||= {} end - sig {params(name: Symbol).void} + sig { params(name: Symbol).void } private def eval_lazily_defined_method!(name) if !HasLazilySpecializedMethods.lazy_evaluation_enabled? raise SourceEvaluationDisabled.new @@ -68,7 +68,7 @@ module T::Props cls.send(:private, name) end - sig {params(name: Symbol).void} + sig { params(name: Symbol).void } private def eval_lazily_defined_vm_method!(name) if !HasLazilySpecializedMethods.lazy_evaluation_enabled? raise SourceEvaluationDisabled.new @@ -80,7 +80,7 @@ module T::Props cls.send(:private, name) end - sig {params(name: Symbol, blk: T.proc.returns(String)).void} + sig { params(name: Symbol, blk: T.proc.returns(String)).void } private def enqueue_lazy_method_definition!(name, &blk) lazily_defined_methods[name] = blk @@ -100,7 +100,7 @@ module T::Props cls.send(:private, name) end - sig {params(name: Symbol, blk: T.untyped).void} + sig { params(name: Symbol, blk: T.untyped).void } private def enqueue_lazy_vm_method_definition!(name, &blk) lazily_defined_vm_methods[name] = blk @@ -115,7 +115,7 @@ module T::Props cls.send(:private, name) end - sig {void} + sig { void } def eagerly_define_lazy_methods! return if lazily_defined_methods.empty? @@ -125,18 +125,18 @@ module T::Props cls = decorated_class cls.class_eval(source) - lazily_defined_methods.each_key {|name| cls.send(:private, name)} + lazily_defined_methods.each_key { |name| cls.send(:private, name) } lazily_defined_methods.clear end - sig {void} + sig { void } def eagerly_define_lazy_vm_methods! return if lazily_defined_vm_methods.empty? lazily_defined_vm_methods.values.map(&:call) cls = decorated_class - lazily_defined_vm_methods.each_key {|name| cls.send(:private, name)} + lazily_defined_vm_methods.each_key { |name| cls.send(:private, name) } lazily_defined_vm_methods.clear end end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/optional.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/optional.rb similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/optional.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/optional.rb index 4f482beac3..acf9eda67f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/optional.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/optional.rb @@ -43,11 +43,11 @@ module T::Props::Optional::DecoratorMethods end # checked(:never) - O(runtime object construction) - sig {returns(T::Hash[Symbol, T::Props::Private::ApplyDefault]).checked(:never)} + sig { returns(T::Hash[Symbol, T::Props::Private::ApplyDefault]).checked(:never) } attr_reader :props_with_defaults # checked(:never) - O(runtime object construction) - sig {returns(T::Hash[Symbol, T::Props::Private::SetterFactory::SetterProc]).checked(:never)} + sig { returns(T::Hash[Symbol, T::Props::Private::SetterFactory::SetterProc]).checked(:never) } attr_reader :props_without_defaults def add_prop_definition(prop, rules) diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/plugin.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/plugin.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/plugin.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/plugin.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/pretty_printable.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/pretty_printable.rb similarity index 89% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/pretty_printable.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/pretty_printable.rb index 8a472ff4be..b090f701a5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/pretty_printable.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/pretty_printable.rb @@ -49,21 +49,21 @@ module T::Props::PrettyPrintable module DecoratorMethods extend T::Sig - sig {params(key: Symbol).returns(T::Boolean).checked(:never)} + sig { params(key: Symbol).returns(T::Boolean).checked(:never) } def valid_rule_key?(key) super || key == :inspect end # Overridable method to specify how the first part of a `pretty_print`d object's class should look like # NOTE: This is just to support Stripe's `PrettyPrintableModel` case, and not recommended to be overridden - sig {params(instance: T::Props::PrettyPrintable).returns(String)} + sig { params(instance: T::Props::PrettyPrintable).returns(String) } def inspect_class_with_decoration(instance) T.unsafe(instance).class.to_s end # Overridable method to add anything that is not a prop # NOTE: This is to support cases like Serializable's `@_extra_props`, and Stripe's `PrettyPrintableModel#@_deleted` - sig {params(instance: T::Props::PrettyPrintable, pp: T.any(PrettyPrint, PP::SingleLine)).void} + sig { params(instance: T::Props::PrettyPrintable, pp: T.any(PrettyPrint, PP::SingleLine)).void } def pretty_print_extra(instance, pp); end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/apply_default.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/apply_default.rb similarity index 79% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/apply_default.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/apply_default.rb index b86f506f9a..edeede5d8b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/apply_default.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/apply_default.rb @@ -9,28 +9,28 @@ module T::Props abstract! # checked(:never) - O(object construction x prop count) - sig {returns(SetterFactory::SetterProc).checked(:never)} + sig { returns(SetterFactory::SetterProc).checked(:never) } attr_reader :setter_proc # checked(:never) - We do this with `T.let` instead - sig {params(accessor_key: Symbol, setter_proc: SetterFactory::SetterProc).void.checked(:never)} + sig { params(accessor_key: Symbol, setter_proc: SetterFactory::SetterProc).void.checked(:never) } def initialize(accessor_key, setter_proc) @accessor_key = T.let(accessor_key, Symbol) @setter_proc = T.let(setter_proc, SetterFactory::SetterProc) end # checked(:never) - O(object construction x prop count) - sig {abstract.returns(T.untyped).checked(:never)} + sig { abstract.returns(T.untyped).checked(:never) } def default; end # checked(:never) - O(object construction x prop count) - sig {abstract.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never)} + sig { abstract.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) } def set_default(instance); end NO_CLONE_TYPES = T.let([TrueClass, FalseClass, NilClass, Symbol, Numeric, T::Enum].freeze, T::Array[Module]) # checked(:never) - Rules hash is expensive to check - sig {params(cls: Module, rules: T::Hash[Symbol, T.untyped]).returns(T.nilable(ApplyDefault)).checked(:never)} + sig { params(cls: Module, rules: T::Hash[Symbol, T.untyped]).returns(T.nilable(ApplyDefault)).checked(:never) } def self.for(cls, rules) accessor_key = rules.fetch(:accessor_key) setter = rules.fetch(:setter_proc) @@ -67,7 +67,7 @@ module T::Props abstract! # checked(:never) - We do this with `T.let` instead - sig {params(default: BasicObject, accessor_key: Symbol, setter_proc: SetterFactory::SetterProc).void.checked(:never)} + sig { params(default: BasicObject, accessor_key: Symbol, setter_proc: SetterFactory::SetterProc).void.checked(:never) } def initialize(default, accessor_key, setter_proc) # FIXME: Ideally we'd check here that the default is actually a valid # value for this field, but existing code relies on the fact that we don't. @@ -80,7 +80,7 @@ module T::Props end # checked(:never) - O(object construction x prop count) - sig {override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never)} + sig { override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) } def set_default(instance) instance.instance_variable_set(@accessor_key, default) end @@ -88,13 +88,13 @@ module T::Props class ApplyPrimitiveDefault < ApplyFixedDefault # checked(:never) - O(object construction x prop count) - sig {override.returns(T.untyped).checked(:never)} + sig { override.returns(T.untyped).checked(:never) } attr_reader :default end class ApplyComplexDefault < ApplyFixedDefault # checked(:never) - O(object construction x prop count) - sig {override.returns(T.untyped).checked(:never)} + sig { override.returns(T.untyped).checked(:never) } def default T::Props::Utils.deep_clone_object(@default) end @@ -105,13 +105,13 @@ module T::Props # `some_empty_array.dup` class ApplyEmptyArrayDefault < ApplyDefault # checked(:never) - O(object construction x prop count) - sig {override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never)} + sig { override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) } def set_default(instance) instance.instance_variable_set(@accessor_key, []) end # checked(:never) - O(object construction x prop count) - sig {override.returns(T::Array[T.untyped]).checked(:never)} + sig { override.returns(T::Array[T.untyped]).checked(:never) } def default [] end @@ -122,13 +122,13 @@ module T::Props # `some_empty_hash.dup` class ApplyEmptyHashDefault < ApplyDefault # checked(:never) - O(object construction x prop count) - sig {override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never)} + sig { override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) } def set_default(instance) instance.instance_variable_set(@accessor_key, {}) end # checked(:never) - O(object construction x prop count) - sig {override.returns(T::Hash[T.untyped, T.untyped]).checked(:never)} + sig { override.returns(T::Hash[T.untyped, T.untyped]).checked(:never) } def default {} end @@ -153,7 +153,7 @@ module T::Props end # checked(:never) - O(object construction x prop count) - sig {override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never)} + sig { override.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) } def set_default(instance) # Use the actual setter to validate the factory returns a legitimate # value every time @@ -161,7 +161,7 @@ module T::Props end # checked(:never) - O(object construction x prop count) - sig {override.returns(T.untyped).checked(:never)} + sig { override.returns(T.untyped).checked(:never) } def default @class.class_exec(&@factory) end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/deserializer_generator.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/deserializer_generator.rb similarity index 98% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/deserializer_generator.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/deserializer_generator.rb index 8a2f6858be..fccc569c8b 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/deserializer_generator.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/deserializer_generator.rb @@ -29,7 +29,7 @@ module T::Props .checked(:never) end def self.generate(props, defaults) - stored_props = props.reject {|_, rules| rules[:dont_store]} + stored_props = props.reject { |_, rules| rules[:dont_store] } parts = stored_props.map do |prop, rules| # All of these strings should already be validated (directly or # indirectly) in `validate_prop_name`, so we don't bother with a nice diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/parser.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/parser.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/parser.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/parser.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serde_transform.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serde_transform.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serde_transform.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serde_transform.rb index e0b37a376d..dd45a94600 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serde_transform.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serde_transform.rb @@ -10,7 +10,7 @@ module T::Props private_constant :Serialize class Deserialize; end private_constant :Deserialize - ModeType = T.type_alias {T.any(Serialize, Deserialize)} + ModeType = T.type_alias { T.any(Serialize, Deserialize) } private_constant :ModeType module Mode @@ -63,7 +63,7 @@ module T::Props end when T::Types::Simple raw = type.raw_type - if NO_TRANSFORM_TYPES.any? {|cls| raw <= cls} + if NO_TRANSFORM_TYPES.any? { |cls| raw <= cls } nil elsif raw <= Float case mode @@ -99,7 +99,7 @@ module T::Props else "#{varname}.nil? ? nil : #{inner}" end - elsif type.types.all? {|t| generate(t, mode, varname).nil?} + elsif type.types.all? { |t| generate(t, mode, varname).nil? } # Handle, e.g., T::Boolean nil else @@ -122,8 +122,8 @@ module T::Props # NB: This deliberately does include `nil`, which means we know we # don't need to do any transforming. inner_known = type.types - .map {|t| generate(t, mode, varname)} - .reject {|t| t == dynamic_fallback} + .map { |t| generate(t, mode, varname) } + .reject { |t| t == dynamic_fallback } .uniq if inner_known.size != 1 @@ -151,7 +151,7 @@ module T::Props end end - sig {params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never)} + sig { params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never) } private_class_method def self.handle_serializable_subtype(varname, type, mode) case mode when Serialize @@ -164,7 +164,7 @@ module T::Props end end - sig {params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never)} + sig { params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never) } private_class_method def self.handle_custom_type(varname, type, mode) case mode when Serialize @@ -177,7 +177,7 @@ module T::Props end end - sig {params(type: Module).returns(T.nilable(String)).checked(:never)} + sig { params(type: Module).returns(T.nilable(String)).checked(:never) } private_class_method def self.module_name(type) T::Configuration.module_name_mangler.call(type) end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serializer_generator.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serializer_generator.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serializer_generator.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serializer_generator.rb index 0d49a46e0f..68aeb9650f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/serializer_generator.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/serializer_generator.rb @@ -24,7 +24,7 @@ module T::Props .checked(:never) end def self.generate(props) - stored_props = props.reject {|_, rules| rules[:dont_store]} + stored_props = props.reject { |_, rules| rules[:dont_store] } parts = stored_props.map do |prop, rules| # All of these strings should already be validated (directly or # indirectly) in `validate_prop_name`, so we don't bother with a nice diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/setter_factory.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/setter_factory.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/setter_factory.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/setter_factory.rb index 95ff986300..a2680c209c 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/private/setter_factory.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/private/setter_factory.rb @@ -6,9 +6,9 @@ module T::Props module SetterFactory extend T::Sig - SetterProc = T.type_alias {T.proc.params(val: T.untyped).void} - ValueValidationProc = T.type_alias {T.proc.params(val: T.untyped).void} - ValidateProc = T.type_alias {T.proc.params(prop: Symbol, value: T.untyped).void} + SetterProc = T.type_alias { T.proc.params(val: T.untyped).void } + ValueValidationProc = T.type_alias { T.proc.params(val: T.untyped).void } + ValidateProc = T.type_alias { T.proc.params(prop: Symbol, value: T.untyped).void } sig do params( @@ -236,7 +236,7 @@ module T::Props base_message = "Can't set #{klass.name}.#{prop} to #{val.inspect} (instance of #{val.class}) - need a #{type}" pretty_message = "Parameter '#{prop}': #{base_message}\n" - caller_loc = caller_locations.find {|l| !l.to_s.include?('sorbet-runtime/lib/types/props')} + caller_loc = caller_locations.find { |l| !l.to_s.include?('sorbet-runtime/lib/types/props') } if caller_loc pretty_message += "Caller: #{caller_loc.path}:#{caller_loc.lineno}\n" end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/serializable.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/serializable.rb similarity index 95% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/serializable.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/serializable.rb index 6a58b8664b..155c8a3499 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/serializable.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/serializable.rb @@ -78,7 +78,7 @@ module T::Props::Serializable if hash.size > hash_keys_matching_props serialized_forms = self.class.decorator.prop_by_serialized_forms - extra = hash.reject {|k, _| serialized_forms.key?(k)} + extra = hash.reject { |k, _| serialized_forms.key?(k) } # `extra` could still be empty here if the input matches a `dont_store` prop; # historically, we just ignore those @@ -111,7 +111,7 @@ module T::Props::Serializable new_obj[k.to_s] = recursive_stringify_keys(v) end elsif obj.is_a?(Array) - new_obj = obj.map {|v| recursive_stringify_keys(v)} + new_obj = obj.map { |v| recursive_stringify_keys(v) } else new_obj = obj end @@ -126,7 +126,7 @@ module T::Props::Serializable if old_extra != new_extra difference = if old_extra - new_extra.reject {|k, v| old_extra[k] == v} + new_extra.reject { |k, v| old_extra[k] == v } else new_extra end @@ -195,7 +195,7 @@ module T::Props::Serializable::DecoratorMethods end def required_props - @class.props.select {|_, v| T::Props::Utils.required_prop?(v)}.keys + @class.props.select { |_, v| T::Props::Utils.required_prop?(v) }.keys end def prop_dont_store?(prop) @@ -228,11 +228,11 @@ module T::Props::Serializable::DecoratorMethods res = super prop_by_serialized_forms[serialized_form] = prop if T::Configuration.use_vm_prop_serde? - enqueue_lazy_vm_method_definition!(:__t_props_generated_serialize) {generate_serialize2} - enqueue_lazy_vm_method_definition!(:__t_props_generated_deserialize) {generate_deserialize2} + enqueue_lazy_vm_method_definition!(:__t_props_generated_serialize) { generate_serialize2 } + enqueue_lazy_vm_method_definition!(:__t_props_generated_deserialize) { generate_deserialize2 } else - enqueue_lazy_method_definition!(:__t_props_generated_serialize) {generate_serialize_source} - enqueue_lazy_method_definition!(:__t_props_generated_deserialize) {generate_deserialize_source} + enqueue_lazy_method_definition!(:__t_props_generated_serialize) { generate_serialize_source } + enqueue_lazy_method_definition!(:__t_props_generated_deserialize) { generate_deserialize_source } end res end @@ -263,7 +263,7 @@ module T::Props::Serializable::DecoratorMethods def message_with_generated_source_context(error, generated_method, generate_source_method) generated_method = generated_method.to_s if error.backtrace_locations - line_loc = error.backtrace_locations.find {|l| l.base_label == generated_method} + line_loc = error.backtrace_locations.find { |l| l.base_label == generated_method } return unless line_loc line_num = line_loc.lineno @@ -275,7 +275,7 @@ module T::Props::Serializable::DecoratorMethods # in `__t_props_generated_serialize'" "in `#{generated_method}'" end - line_label = error.backtrace.find {|l| l.end_with?(label)} + line_label = error.backtrace.find { |l| l.end_with?(label) } return unless line_label line_num = if line_label.start_with?("(eval)") diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/type_validation.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/type_validation.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/type_validation.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/type_validation.rb index 8a7dc9a4df..4fb520564e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/type_validation.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/type_validation.rb @@ -11,7 +11,7 @@ module T::Props::TypeValidation module DecoratorMethods extend T::Sig - sig {params(key: Symbol).returns(T::Boolean).checked(:never)} + sig { params(key: Symbol).returns(T::Boolean).checked(:never) } def valid_rule_key?(key) super || key == :DEPRECATED_underspecified_type end @@ -58,19 +58,19 @@ module T::Props::TypeValidation # If the type is fully valid, returns nil. # # checked(:never) - called potentially many times recursively - sig {params(type: T::Types::Base).returns(T.nilable(T::Types::Base)).checked(:never)} + sig { params(type: T::Types::Base).returns(T.nilable(T::Types::Base)).checked(:never) } private def find_invalid_subtype(type) case type when T::Types::TypedEnumerable find_invalid_subtype(type.type) when T::Types::FixedHash - type.types.values.map {|subtype| find_invalid_subtype(subtype)}.compact.first + type.types.values.map { |subtype| find_invalid_subtype(subtype) }.compact.first when T::Types::Union, T::Types::FixedArray # `T.any` is valid if all of the members are valid - type.types.map {|subtype| find_invalid_subtype(subtype)}.compact.first + type.types.map { |subtype| find_invalid_subtype(subtype) }.compact.first when T::Types::Intersection # `T.all` is valid if at least one of the members is valid - invalid = type.types.map {|subtype| find_invalid_subtype(subtype)}.compact + invalid = type.types.map { |subtype| find_invalid_subtype(subtype) }.compact if invalid.length == type.types.length invalid.first else diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/utils.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/utils.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/utils.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/utils.rb index 33d1abadce..a9048f56ed 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/utils.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/utils.rb @@ -13,7 +13,7 @@ module T::Props::Utils when Symbol, NilClass, Numeric what when Array - what.map {|v| deep_clone_object(v, freeze: freeze)} + what.map { |v| deep_clone_object(v, freeze: freeze) } when Hash h = what.class.new what.each do |k, v| diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/weak_constructor.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/weak_constructor.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/weak_constructor.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/weak_constructor.rb index 3ffe1be695..0611ac93cc 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/props/weak_constructor.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/props/weak_constructor.rb @@ -6,7 +6,7 @@ module T::Props::WeakConstructor extend T::Sig # checked(:never) - O(runtime object construction) - sig {params(hash: T::Hash[Symbol, T.untyped]).void.checked(:never)} + sig { params(hash: T::Hash[Symbol, T.untyped]).void.checked(:never) } def initialize(hash={}) decorator = self.class.decorator @@ -28,7 +28,7 @@ module T::Props::WeakConstructor::DecoratorMethods # we'll use to check for any unrecognized input.) # # checked(:never) - O(runtime object construction) - sig {params(instance: T::Props::WeakConstructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never)} + sig { params(instance: T::Props::WeakConstructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never) } def construct_props_without_defaults(instance, hash) # Use `each_pair` rather than `count` because, as of Ruby 2.6, the latter delegates to Enumerator # and therefore allocates for each entry. @@ -49,7 +49,7 @@ module T::Props::WeakConstructor::DecoratorMethods # we'll use to check for any unrecognized input.) # # checked(:never) - O(runtime object construction) - sig {params(instance: T::Props::WeakConstructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never)} + sig { params(instance: T::Props::WeakConstructor, hash: T::Hash[Symbol, T.untyped]).returns(Integer).checked(:never) } def construct_props_with_defaults(instance, hash) # Use `each_pair` rather than `count` because, as of Ruby 2.6, the latter delegates to Enumerator # and therefore allocates for each entry. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/sig.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/sig.rb similarity index 78% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/sig.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/sig.rb index 3112adf861..bcfc01c63d 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/sig.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/sig.rb @@ -14,7 +14,7 @@ module T::Sig # At runtime, does nothing, but statically it is treated exactly the same # as T::Sig#sig. Only use it in cases where you can't use T::Sig#sig. - T::Sig::WithoutRuntime.sig {params(arg0: T.nilable(Symbol), blk: T.proc.bind(T::Private::Methods::DeclBuilder).void).void} + T::Sig::WithoutRuntime.sig { params(arg0: T.nilable(Symbol), blk: T.proc.bind(T::Private::Methods::DeclBuilder).void).void } def self.sig(arg0=nil, &blk); end # rubocop:disable Lint/DuplicateMethods $VERBOSE = original_verbose @@ -23,7 +23,7 @@ module T::Sig # Declares a method with type signatures and/or # abstract/override/... helpers. See the documentation URL on # {T::Helpers} - T::Sig::WithoutRuntime.sig {params(arg0: T.nilable(Symbol), blk: T.proc.bind(T::Private::Methods::DeclBuilder).void).void} + T::Sig::WithoutRuntime.sig { params(arg0: T.nilable(Symbol), blk: T.proc.bind(T::Private::Methods::DeclBuilder).void).void } def sig(arg0=nil, &blk) T::Private::Methods.declare_sig(self, Kernel.caller_locations(1, 1)&.first, arg0, &blk) end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/struct.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/struct.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/struct.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/struct.rb index 3ca17fe459..b888ec20ee 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/struct.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/struct.rb @@ -30,7 +30,7 @@ class T::ImmutableStruct < T::InexactStruct end # Matches the one in WeakConstructor, but freezes the object - sig {params(hash: T::Hash[Symbol, T.untyped]).void.checked(:never)} + sig { params(hash: T::Hash[Symbol, T.untyped]).void.checked(:never) } def initialize(hash={}) super @@ -38,7 +38,7 @@ class T::ImmutableStruct < T::InexactStruct end # Matches the signature in Props, but raises since this is an immutable struct and only const is allowed - sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void} + sig { params(name: Symbol, cls: T.untyped, rules: T.untyped).void } def self.prop(name, cls, **rules) return super if (cls.is_a?(Hash) && cls[:immutable]) || rules[:immutable] diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/anything.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/anything.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/anything.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/anything.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/attached_class.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/attached_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/attached_class.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/attached_class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/base.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/base.rb similarity index 92% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/base.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/base.rb index b3a882553b..ad647e6c2f 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/base.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/base.rb @@ -83,27 +83,27 @@ module T::Types # Note: order of cases here matters! if t1.is_a?(T::Types::Union) # 7, 8, 9 # this will be incorrect if/when we have Type members - return t1.types.all? {|t1_member| t1_member.subtype_of?(t2)} + return t1.types.all? { |t1_member| t1_member.subtype_of?(t2) } end if t2.is_a?(T::Types::Intersection) # 2, 5 # this will be incorrect if/when we have Type members - return t2.types.all? {|t2_member| t1.subtype_of?(t2_member)} + return t2.types.all? { |t2_member| t1.subtype_of?(t2_member) } end if t2.is_a?(T::Types::Union) if t1.is_a?(T::Types::Intersection) # 6 # dropping either of parts eagerly make subtype test be too strict. # we have to try both cases, when we normally try only one - return t2.types.any? {|t2_member| t1.subtype_of?(t2_member)} || - t1.types.any? {|t1_member| t1_member.subtype_of?(t2)} + return t2.types.any? { |t2_member| t1.subtype_of?(t2_member) } || + t1.types.any? { |t1_member| t1_member.subtype_of?(t2) } end - return t2.types.any? {|t2_member| t1.subtype_of?(t2_member)} # 3 + return t2.types.any? { |t2_member| t1.subtype_of?(t2_member) } # 3 end if t1.is_a?(T::Types::Intersection) # 4 # this will be incorrect if/when we have Type members - return t1.types.any? {|t1_member| t1_member.subtype_of?(t2)} + return t1.types.any? { |t1_member| t1_member.subtype_of?(t2) } end # 1; Start with some special cases diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/class_of.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/class_of.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/class_of.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/class_of.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/enum.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/enum.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/enum.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/enum.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_array.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_array.rb similarity index 97% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_array.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_array.rb index 967273d99f..ccdfc1eb83 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_array.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_array.rb @@ -11,7 +11,7 @@ module T::Types end def types - @types ||= @inner_types.map {|type| T::Utils.coerce(type)} + @types ||= @inner_types.map { |type| T::Utils.coerce(type) } end def build_type diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_hash.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_hash.rb similarity index 82% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_hash.rb index 2bb805be5a..6e6a21c53a 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/fixed_hash.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/fixed_hash.rb @@ -10,7 +10,7 @@ module T::Types end def types - @types ||= @inner_types.transform_values {|v| T::Utils.coerce(v)} + @types ||= @inner_types.transform_values { |v| T::Utils.coerce(v) } end def build_type @@ -26,16 +26,16 @@ module T::Types # overrides Base def recursively_valid?(obj) return false unless obj.is_a?(Hash) - return false if types.any? {|key, type| !type.recursively_valid?(obj[key])} - return false if obj.any? {|key, _| !types[key]} + return false if types.any? { |key, type| !type.recursively_valid?(obj[key]) } + return false if obj.any? { |key, _| !types[key] } true end # overrides Base def valid?(obj) return false unless obj.is_a?(Hash) - return false if types.any? {|key, type| !type.valid?(obj[key])} - return false if obj.any? {|key, _| !types[key]} + return false if types.any? { |key, type| !type.valid?(obj[key]) } + return false if obj.any? { |key, _| !types[key] } true end @@ -48,7 +48,7 @@ module T::Types when TypedHash # warning: covariant hashes - key1, key2, *keys_rest = types.keys.map {|key| T::Utils.coerce(key.class)} + key1, key2, *keys_rest = types.keys.map { |key| T::Utils.coerce(key.class) } key_type = if !key2.nil? T::Types::Union::Private::Pool.union_of_types(key1, key2, keys_rest) elsif key1.nil? diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/intersection.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/intersection.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/intersection.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/intersection.rb index bc17acbb79..19a4ad904e 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/intersection.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/intersection.rb @@ -32,12 +32,12 @@ module T::Types # overrides Base def recursively_valid?(obj) - types.all? {|type| type.recursively_valid?(obj)} + types.all? { |type| type.recursively_valid?(obj) } end # overrides Base def valid?(obj) - types.all? {|type| type.valid?(obj)} + types.all? { |type| type.valid?(obj) } end # overrides Base diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/noreturn.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/noreturn.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/noreturn.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/noreturn.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/proc.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/proc.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/proc.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/proc.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/self_type.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/self_type.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/self_type.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/self_type.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/simple.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/simple.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/simple.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/simple.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/t_enum.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/t_enum.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/t_enum.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/t_enum.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_member.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_member.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_member.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_member.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_parameter.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_parameter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_parameter.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_parameter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_template.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_template.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_template.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_template.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_variable.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_variable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/type_variable.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/type_variable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_array.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_array.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_array.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_array.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_class.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_class.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_class.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_class.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerable.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerable.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerable.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerable.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator_chain.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator_chain.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator_chain.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator_chain.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator_lazy.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator_lazy.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_enumerator_lazy.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_enumerator_lazy.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_hash.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_hash.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_hash.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_hash.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_range.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_range.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_range.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_range.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_set.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_set.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/typed_set.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/typed_set.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/union.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/union.rb similarity index 90% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/union.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/union.rb index 28a2d5ea0e..de3a779159 100644 --- a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/union.rb +++ b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/union.rb @@ -44,11 +44,11 @@ module T::Types nilable = T::Utils.coerce(NilClass) trueclass = T::Utils.coerce(TrueClass) falseclass = T::Utils.coerce(FalseClass) - if types.any? {|t| t == nilable} - remaining_types = types.reject {|t| t == nilable} + if types.any? { |t| t == nilable } + remaining_types = types.reject { |t| t == nilable } "T.nilable(#{type_shortcuts(remaining_types)})" - elsif types.any? {|t| t == trueclass} && types.any? {|t| t == falseclass} - remaining_types = types.reject {|t| t == trueclass || t == falseclass} + elsif types.any? { |t| t == trueclass } && types.any? { |t| t == falseclass } + remaining_types = types.reject { |t| t == trueclass || t == falseclass } type_shortcuts([T::Private::Types::StringHolder.new("T::Boolean")] + remaining_types) else names = types.map(&:name).compact.sort @@ -58,12 +58,12 @@ module T::Types # overrides Base def recursively_valid?(obj) - types.any? {|type| type.recursively_valid?(obj)} + types.any? { |type| type.recursively_valid?(obj) } end # overrides Base def valid?(obj) - types.any? {|type| type.valid?(obj)} + types.any? { |type| type.valid?(obj) } end # overrides Base @@ -72,7 +72,7 @@ module T::Types end def unwrap_nilable - non_nil_types = types.reject {|t| t == T::Utils::Nilable::NIL_TYPE} + non_nil_types = types.reject { |t| t == T::Utils::Nilable::NIL_TYPE } return nil if types.length == non_nil_types.length case non_nil_types.length when 0 then nil diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/untyped.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/untyped.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/types/untyped.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/types/untyped.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/utils.rb b/Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/utils.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12117/lib/types/utils.rb rename to Library/Homebrew/vendor/bundle/ruby/3.4.0/gems/sorbet-runtime-0.5.12222/lib/types/utils.rb diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 8d455e75fb..769fdd62d4 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -776,6 +776,6 @@ class Version sig { params(first: Integer, second: Integer).returns(Integer) } def max(first, second) - (first > second) ? first : second + [first, second].max end end diff --git a/README.md b/README.md index b83f445de2..764e854d1d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Homebrew [![GitHub release](https://img.shields.io/github/release/Homebrew/brew.svg)](https://github.com/Homebrew/brew/releases) -[![License](https://img.shields.io/github/license/Homebrew/brew)](https://github.com/Homebrew/brew/blob/master/LICENSE.txt) +[![License](https://img.shields.io/github/license/Homebrew/brew)](https://github.com/Homebrew/brew/blob/HEAD/LICENSE.txt) Features, usage and installation instructions are [summarised on the homepage](https://brew.sh). Terminology (e.g. the difference between a Cellar, Tap, Cask and so forth) is [explained here](https://docs.brew.sh/Formula-Cookbook#homebrew-terminology). @@ -59,7 +59,7 @@ Homebrew's [Project Leader](https://docs.brew.sh/Homebrew-Governance#6-project-l Homebrew's [Project Leadership Committee](https://docs.brew.sh/Homebrew-Governance#4-project-leadership-committee) is [Colin Dean](https://github.com/colindean), [Michka Popoff](https://github.com/iMichka), [Mike McQuaid](https://github.com/MikeMcQuaid), [Patrick Linnane](https://github.com/p-linnane) and [Vanessa Gennarelli](https://github.com/mozzadrella). -Homebrew's [Technical Steering Committee](https://docs.brew.sh/Homebrew-Governance#7-technical-steering-committee) is [Bo Anderson](https://github.com/Bo98), [FX Coudert](https://github.com/fxcoudert), [Mike McQuaid](https://github.com/MikeMcQuaid) and [Rylan Polster](https://github.com/Rylan12). +Homebrew's [Technical Steering Committee](https://docs.brew.sh/Homebrew-Governance#7-technical-steering-committee) is [Bo Anderson](https://github.com/Bo98), [Issy Long](https://github.com/issyl0), [Michael Cho](https://github.com/cho-m), [Mike McQuaid](https://github.com/MikeMcQuaid) and [Ruoyu Zhong](https://github.com/ZhongRuoyu). Homebrew's maintainers are [Alexander Bayandin](https://github.com/bayandin), [Bevan Kay](https://github.com/bevanjkay), [Bo Anderson](https://github.com/Bo98), [Branch Vincent](https://github.com/branchvincent), [Caleb Xu](https://github.com/alebcay), [Carlo Cabrera](https://github.com/carlocab), [Daeho Ro](https://github.com/daeho-ro), [Douglas Eichelberger](https://github.com/dduugg), [Dustin Rodrigues](https://github.com/dtrodrigues), [Eric Knibbe](https://github.com/EricFromCanada), [FX Coudert](https://github.com/fxcoudert), [Issy Long](https://github.com/issyl0), [Justin Krehel](https://github.com/krehel), [Klaus Hipp](https://github.com/khipp), [Markus Reiter](https://github.com/reitermarkus), [Michael Cho](https://github.com/cho-m), [Michka Popoff](https://github.com/iMichka), [Mike McQuaid](https://github.com/MikeMcQuaid), [Nanda H Krishna](https://github.com/nandahkrishna), [Patrick Linnane](https://github.com/p-linnane), [Rui Chen](https://github.com/chenrui333), [Ruoyu Zhong](https://github.com/ZhongRuoyu), [Rylan Polster](https://github.com/Rylan12), [Sam Ford](https://github.com/samford), [Sean Molenaar](https://github.com/SMillerDev), [Štefan Baebler](https://github.com/stefanb), [Thierry Moisan](https://github.com/Moisan), [Timothy Sutton](https://github.com/timsutton) and [William Woodruff](https://github.com/woodruffw). @@ -85,6 +85,6 @@ Secure password storage and syncing is provided by [1Password for Teams](https:/ [![DNSimple](https://cdn.dnsimple.com/assets/resolving-with-us/logo-light.png)](https://dnsimple.com/resolving/homebrew#gh-light-mode-only) [![DNSimple](https://cdn.dnsimple.com/assets/resolving-with-us/logo-dark.png)](https://dnsimple.com/resolving/homebrew#gh-dark-mode-only) -Homebrew is generously supported by [GitHub](https://github.com/github), [Custom Ink](https://github.com/customink), [Randy Reddig](https://github.com/ydnar), [Codecademy](https://github.com/Codecademy), [mikadelbert](https://github.com/mikadelbert), [Workbrew](https://github.com/Workbrew) and many other users and organisations via [GitHub Sponsors](https://github.com/sponsors/Homebrew). +Homebrew is generously supported by [GitHub](https://github.com/github), [Custom Ink](https://github.com/customink), [Randy Reddig](https://github.com/ydnar), [Codecademy](https://github.com/Codecademy), [Workbrew](https://github.com/Workbrew) and many other users and organisations via [GitHub Sponsors](https://github.com/sponsors/Homebrew). [![GitHub](https://github.com/github.png?size=64)](https://github.com/github) diff --git a/bin/brew b/bin/brew index 3ccf7f68a2..3ed923d1e4 100755 --- a/bin/brew +++ b/bin/brew @@ -57,22 +57,6 @@ do done unset cmd -# Avoid picking up any random `sudo` in `PATH`. -if [[ -x /usr/bin/sudo ]] -then - SUDO=/usr/bin/sudo -else - # Do this after ensuring we're using default Bash builtins. - SUDO="$(command -v sudo 2>/dev/null)" -fi - -# Reset sudo timestamp to avoid running unauthorized sudo commands -if [[ -n "${SUDO}" ]] -then - "${SUDO}" --reset-timestamp 2>/dev/null || true -fi -unset SUDO - # Take the HOMEBREW_PATH if we are running brew within brew, otherwise we would lose the original path. if [[ -n "${HOMEBREW_BREW_FILE:-}" && -n "${HOMEBREW_PATH:-}" ]] then @@ -199,8 +183,8 @@ MANPAGE_VARS=( ) for VAR in "${MANPAGE_VARS[@]}" do - # Skip if variable value is empty. - [[ -z "${!VAR:-}" ]] && continue + # Skip if variable value is empty or set to 0. + [[ -z "${!VAR:-}" || "${!VAR:-}" = "0" ]] && continue VAR_NEW="HOMEBREW_${VAR}" # Skip if existing HOMEBREW_* variable is set. diff --git a/completions/bash/brew b/completions/bash/brew index ff172835c2..b887c28c24 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -444,7 +444,6 @@ _brew_audit() { --skip-style --strict --tap - --token-conflicts --verbose " return @@ -836,6 +835,7 @@ _brew_create() { __brewcomp " --HEAD --autotools + --cabal --cask --cmake --crystal @@ -1796,6 +1796,22 @@ _brew_ls() { __brew_complete_installed_casks } +_brew_mcp_server() { + local cur="${COMP_WORDS[COMP_CWORD]}" + case "${cur}" in + -*) + __brewcomp " + --debug + --help + --quiet + --verbose + " + return + ;; + *) ;; + esac +} + _brew_migrate() { local cur="${COMP_WORDS[COMP_CWORD]}" case "${cur}" in @@ -2571,6 +2587,7 @@ _brew_tests() { --fail-fast --generic --help + --no-parallel --online --only --profile @@ -2853,6 +2870,26 @@ _brew_update_maintainers() { esac } +_brew_update_perl_resources() { + local cur="${COMP_WORDS[COMP_CWORD]}" + case "${cur}" in + -*) + __brewcomp " + --debug + --help + --ignore-errors + --print-only + --quiet + --silent + --verbose + " + return + ;; + *) ;; + esac + __brew_complete_formulae +} + _brew_update_python_resources() { local cur="${COMP_WORDS[COMP_CWORD]}" case "${cur}" in @@ -3190,6 +3227,7 @@ _brew() { ln) _brew_ln ;; log) _brew_log ;; ls) _brew_ls ;; + mcp-server) _brew_mcp_server ;; migrate) _brew_migrate ;; missing) _brew_missing ;; nodenv-sync) _brew_nodenv_sync ;; @@ -3240,6 +3278,7 @@ _brew() { update-if-needed) _brew_update_if_needed ;; update-license-data) _brew_update_license_data ;; update-maintainers) _brew_update_maintainers ;; + update-perl-resources) _brew_update_perl_resources ;; update-python-resources) _brew_update_python_resources ;; update-report) _brew_update_report ;; update-reset) _brew_update_reset ;; diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index e569c1be4f..544da34d88 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -277,7 +277,7 @@ __fish_brew_complete_arg '-S' -l closed -d 'Search for only closed GitHub pull r __fish_brew_complete_arg '-S' -l debian -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l debug -d 'Display any debugging information' __fish_brew_complete_arg '-S' -l desc -d 'Search for formulae with a description matching text and casks with a name or description matching text' -__fish_brew_complete_arg '-S' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg '-S' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg '-S' -l fedora -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l fink -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l formula -d 'Search for formulae' @@ -305,7 +305,7 @@ __fish_brew_complete_arg 'abv' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'abv' -l category -d 'Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`' __fish_brew_complete_arg 'abv' -l days -d 'How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`' __fish_brew_complete_arg 'abv' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'abv' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'abv' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON' __fish_brew_complete_arg 'abv' -l fetch-manifest -d 'Fetch GitHub Packages manifest for extra information when formula is not installed' __fish_brew_complete_arg 'abv' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'abv' -l github -d 'Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask' @@ -319,7 +319,7 @@ __fish_brew_complete_arg 'abv; and not __fish_seen_argument -l cask -l casks' -a __fish_brew_complete_arg 'abv; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)' -__fish_brew_complete_cmd 'alias' 'Show existing aliases' +__fish_brew_complete_cmd 'alias' 'Show an alias\'s command' __fish_brew_complete_arg 'alias' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'alias' -l edit -d 'Edit aliases in a text editor. Either one or all aliases may be opened at once. If the given alias doesn\'t exist it\'ll be pre-populated with a template' __fish_brew_complete_arg 'alias' -l help -d 'Show this message' @@ -344,7 +344,7 @@ __fish_brew_complete_arg 'audit' -l audit-debug -d 'Enable debugging and profili __fish_brew_complete_arg 'audit' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'audit' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'audit' -l display-filename -d 'Prefix every line of output with the file or formula name being audited, to make output easy to grep' -__fish_brew_complete_arg 'audit' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if `HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'audit' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to audit them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'audit' -l except -d 'Specify a comma-separated method list to skip running the methods named `audit_`method' __fish_brew_complete_arg 'audit' -l except-cops -d 'Specify a comma-separated cops list to skip checking for violations of the listed RuboCop cops' __fish_brew_complete_arg 'audit' -l fix -d 'Fix style violations automatically using RuboCop\'s auto-correct feature' @@ -363,7 +363,6 @@ __fish_brew_complete_arg 'audit' -l signing -d 'Audit for app signatures, which __fish_brew_complete_arg 'audit' -l skip-style -d 'Skip running non-RuboCop style checks. Useful if you plan on running `brew style` separately. Enabled by default unless a formula is specified by name' __fish_brew_complete_arg 'audit' -l strict -d 'Run additional, stricter style checks' __fish_brew_complete_arg 'audit' -l tap -d 'Check formulae and casks within the given tap, specified as user`/`repo' -__fish_brew_complete_arg 'audit' -l token-conflicts -d 'Audit for token conflicts' __fish_brew_complete_arg 'audit' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'audit; and not __fish_seen_argument -l cask -l casks' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_arg 'audit; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)' @@ -402,7 +401,7 @@ __fish_brew_complete_cmd 'bump' 'Displays out-of-date packages and the latest ve __fish_brew_complete_arg 'bump' -l bump-synced -d 'Bump additional formulae marked as synced with the given formulae' __fish_brew_complete_arg 'bump' -l cask -d 'Check only casks' __fish_brew_complete_arg 'bump' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'bump' -l eval-all -d 'Evaluate all formulae and casks' +__fish_brew_complete_arg 'bump' -l eval-all -d 'Evaluate all formulae and casks. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'bump' -l formula -d 'Check only formulae' __fish_brew_complete_arg 'bump' -l full-name -d 'Print formulae/casks with fully-qualified names' __fish_brew_complete_arg 'bump' -l help -d 'Show this message' @@ -506,28 +505,28 @@ __fish_brew_complete_sub_cmd 'bundle' 'sh' __fish_brew_complete_sub_cmd 'bundle' 'env' __fish_brew_complete_sub_cmd 'bundle' 'edit' __fish_brew_complete_arg 'bundle' -l all -d '`list` all dependencies' -__fish_brew_complete_arg 'bundle' -l cask -d '`list` or `dump` Homebrew cask dependencies' +__fish_brew_complete_arg 'bundle' -l cask -d '`list`, `dump` or `cleanup` Homebrew cask dependencies' __fish_brew_complete_arg 'bundle' -l check -d 'Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`' -__fish_brew_complete_arg 'bundle' -l cleanup -d '`install` performs cleanup operation, same as running `cleanup --force`. This is enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed' +__fish_brew_complete_arg 'bundle' -l cleanup -d '`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed' __fish_brew_complete_arg 'bundle' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'bundle' -l describe -d '`dump` adds a description comment above each line, unless the dependency does not have a description. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set' +__fish_brew_complete_arg 'bundle' -l describe -d '`dump` adds a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set' __fish_brew_complete_arg 'bundle' -l file -d 'Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout' __fish_brew_complete_arg 'bundle' -l force -d '`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations' -__fish_brew_complete_arg 'bundle' -l formula -d '`list` or `dump` Homebrew formula dependencies' +__fish_brew_complete_arg 'bundle' -l formula -d '`list`, `dump` or `cleanup` Homebrew formula dependencies' __fish_brew_complete_arg 'bundle' -l global -d 'Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise' __fish_brew_complete_arg 'bundle' -l help -d 'Show this message' __fish_brew_complete_arg 'bundle' -l install -d 'Run `install` before continuing to other operations e.g. `exec`' __fish_brew_complete_arg 'bundle' -l mas -d '`list` or `dump` Mac App Store dependencies' __fish_brew_complete_arg 'bundle' -l no-restart -d '`dump` does not add `restart_service` to formula lines' -__fish_brew_complete_arg 'bundle' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' -__fish_brew_complete_arg 'bundle' -l no-vscode -d '`dump` without VSCode (and forks/variants) extensions. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set' +__fish_brew_complete_arg 'bundle' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' +__fish_brew_complete_arg 'bundle' -l no-vscode -d '`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set' __fish_brew_complete_arg 'bundle' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' -__fish_brew_complete_arg 'bundle' -l tap -d '`list` or `dump` Homebrew tap dependencies' +__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set' +__fish_brew_complete_arg 'bundle' -l tap -d '`list`, `dump` or `cleanup` Homebrew tap dependencies' __fish_brew_complete_arg 'bundle' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_arg 'bundle' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set' __fish_brew_complete_arg 'bundle' -l verbose -d '`install` prints output from commands as they are run. `check` lists all missing dependencies' -__fish_brew_complete_arg 'bundle' -l vscode -d '`list` or `dump` VSCode (and forks/variants) extensions' +__fish_brew_complete_arg 'bundle' -l vscode -d '`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions' __fish_brew_complete_arg 'bundle' -l whalebrew -d '`list` or `dump` Whalebrew dependencies' __fish_brew_complete_arg 'bundle' -l zap -d '`cleanup` casks using the `zap` command instead of `uninstall`' @@ -611,6 +610,7 @@ __fish_brew_complete_arg 'contributions' -l verbose -d 'Make some output more ve __fish_brew_complete_cmd 'create' 'Generate a formula or, with `--cask`, a cask for the downloadable file at URL and open it in the editor' __fish_brew_complete_arg 'create' -l HEAD -d 'Indicate that URL points to the package\'s repository rather than a file' __fish_brew_complete_arg 'create' -l autotools -d 'Create a basic template for an Autotools-style build' +__fish_brew_complete_arg 'create' -l cabal -d 'Create a basic template for a Cabal build' __fish_brew_complete_arg 'create' -l cask -d 'Create a basic template for a cask' __fish_brew_complete_arg 'create' -l cmake -d 'Create a basic template for a CMake-style build' __fish_brew_complete_arg 'create' -l crystal -d 'Create a basic template for a Crystal build' @@ -679,7 +679,7 @@ __fish_brew_complete_cmd 'desc' 'Display formula\'s name and one-line descriptio __fish_brew_complete_arg 'desc' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'desc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'desc' -l description -d 'Search just descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression' -__fish_brew_complete_arg 'desc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'desc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'desc' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'desc' -l help -d 'Show this message' __fish_brew_complete_arg 'desc' -l name -d 'Search just names for text. If text is flanked by slashes, it is interpreted as a regular expression' @@ -693,8 +693,8 @@ __fish_brew_complete_arg 'desc; and not __fish_seen_argument -l formula -l formu __fish_brew_complete_cmd 'determine-test-runners' 'Determines the runners used to test formulae or their dependents' __fish_brew_complete_arg 'determine-test-runners' -l all-supported -d 'Instead of selecting runners based on the chosen formula, return all supported runners' __fish_brew_complete_arg 'determine-test-runners' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'determine-test-runners' -l dependents -d 'Determine runners for testing dependents. Requires `--eval-all` or `HOMEBREW_EVAL_ALL`' -__fish_brew_complete_arg 'determine-test-runners' -l eval-all -d 'Evaluate all available formulae, whether installed or not, to determine testing dependents' +__fish_brew_complete_arg 'determine-test-runners' -l dependents -d 'Determine runners for testing dependents. Requires `--eval-all` or `$HOMEBREW_EVAL_ALL` to be set' +__fish_brew_complete_arg 'determine-test-runners' -l eval-all -d 'Evaluate all available formulae, whether installed or not, to determine testing dependents. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'determine-test-runners' -l help -d 'Show this message' __fish_brew_complete_arg 'determine-test-runners' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'determine-test-runners' -l verbose -d 'Make some output more verbose' @@ -755,7 +755,7 @@ __fish_brew_complete_arg 'dr' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'dr' -a '(__fish_brew_suggest_diagnostic_checks)' -__fish_brew_complete_cmd 'edit' 'Open a formula, cask or tap in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided' +__fish_brew_complete_cmd 'edit' 'Open a formula, cask or tap in the editor set by `$EDITOR` or `$HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided' __fish_brew_complete_arg 'edit' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'edit' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'edit' -l formula -d 'Treat all named arguments as formulae' @@ -803,9 +803,9 @@ __fish_brew_complete_arg 'fetch' -l force -d 'Remove a previously cached version __fish_brew_complete_arg 'fetch' -l force-bottle -d 'Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation' __fish_brew_complete_arg 'fetch' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'fetch' -l help -d 'Show this message' -__fish_brew_complete_arg 'fetch' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'fetch' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'fetch' -l os -d 'Download for the given operating system. (Pass `all` to download for all operating systems.)' -__fish_brew_complete_arg 'fetch' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'fetch' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'fetch' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'fetch' -l retry -d 'Retry if downloading fails or re-download if the checksum of a previously cached version no longer matches. Tries at most 5 times with exponential backoff' __fish_brew_complete_arg 'fetch' -l verbose -d 'Do a verbose VCS checkout, if the URL represents a VCS. This is useful for seeing if an existing VCS cache has been updated' @@ -933,7 +933,7 @@ __fish_brew_complete_arg 'info' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'info' -l category -d 'Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`' __fish_brew_complete_arg 'info' -l days -d 'How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`' __fish_brew_complete_arg 'info' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'info' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'info' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON' __fish_brew_complete_arg 'info' -l fetch-manifest -d 'Fetch GitHub Packages manifest for extra information when formula is not installed' __fish_brew_complete_arg 'info' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'info' -l github -d 'Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask' @@ -951,9 +951,9 @@ __fish_brew_complete_arg 'instal' -l HEAD -d 'If formula defines it, install the __fish_brew_complete_arg 'instal' -l adopt -d 'Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`' __fish_brew_complete_arg 'instal' -l appdir -d 'Target location for Applications (default: `/Applications`)' __fish_brew_complete_arg 'instal' -l as-dependency -d 'Install but mark as installed as a dependency and not installed on request' -__fish_brew_complete_arg 'instal' -l ask -d 'Ask for confirmation before downloading and installing formulae. Print bottles and dependencies download size and install size' +__fish_brew_complete_arg 'instal' -l ask -d 'Ask for confirmation before downloading and installing formulae. Print download and install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set' __fish_brew_complete_arg 'instal' -l audio-unit-plugindir -d 'Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)' -__fish_brew_complete_arg 'instal' -l binaries -d 'Disable/enable linking of helper executables (default: enabled)' +__fish_brew_complete_arg 'instal' -l binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' __fish_brew_complete_arg 'instal' -l bottle-arch -d 'Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on' __fish_brew_complete_arg 'instal' -l build-bottle -d 'Prepare the formula for eventual bottling during installation, skipping any post-install steps' __fish_brew_complete_arg 'instal' -l build-from-source -d 'Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available' @@ -963,7 +963,7 @@ __fish_brew_complete_arg 'instal' -l colorpickerdir -d 'Target location for Colo __fish_brew_complete_arg 'instal' -l debug -d 'If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory' __fish_brew_complete_arg 'instal' -l debug-symbols -d 'Generate debug symbols on build. Source will be retained in a cache directory' __fish_brew_complete_arg 'instal' -l dictionarydir -d 'Target location for Dictionaries (default: `~/Library/Dictionaries`)' -__fish_brew_complete_arg 'instal' -l display-times -d 'Print install times for each package at the end of the run' +__fish_brew_complete_arg 'instal' -l display-times -d 'Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set' __fish_brew_complete_arg 'instal' -l dry-run -d 'Show what would be installed, but do not actually install anything' __fish_brew_complete_arg 'instal' -l fetch-HEAD -d 'Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository\'s HEAD will only be checked for updates when a new stable or development version has been released' __fish_brew_complete_arg 'instal' -l fontdir -d 'Target location for Fonts (default: `~/Library/Fonts`)' @@ -981,15 +981,15 @@ __fish_brew_complete_arg 'instal' -l keep-tmp -d 'Retain the temporary files cre __fish_brew_complete_arg 'instal' -l keyboard-layoutdir -d 'Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)' __fish_brew_complete_arg 'instal' -l language -d 'Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask\'s default language. The default value is the language of your system' __fish_brew_complete_arg 'instal' -l mdimporterdir -d 'Target location for Spotlight Plugins (default: `~/Library/Spotlight`)' -__fish_brew_complete_arg 'instal' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled)' -__fish_brew_complete_arg 'instal' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'instal' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' +__fish_brew_complete_arg 'instal' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'instal' -l only-dependencies -d 'Install the dependencies with specified options but do not install the formula itself' __fish_brew_complete_arg 'instal' -l overwrite -d 'Delete files that already exist in the prefix while linking' __fish_brew_complete_arg 'instal' -l prefpanedir -d 'Target location for Preference Panes (default: `~/Library/PreferencePanes`)' __fish_brew_complete_arg 'instal' -l qlplugindir -d 'Target location for Quick Look Plugins (default: `~/Library/QuickLook`)' -__fish_brew_complete_arg 'instal' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'instal' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'instal' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'instal' -l require-sha -d 'Require all casks to have a checksum' +__fish_brew_complete_arg 'instal' -l require-sha -d 'Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set' __fish_brew_complete_arg 'instal' -l screen-saverdir -d 'Target location for Screen Savers (default: `~/Library/Screen Savers`)' __fish_brew_complete_arg 'instal' -l servicedir -d 'Target location for Services (default: `~/Library/Services`)' __fish_brew_complete_arg 'instal' -l skip-cask-deps -d 'Skip installing cask dependencies' @@ -1008,9 +1008,9 @@ __fish_brew_complete_arg 'install' -l HEAD -d 'If formula defines it, install th __fish_brew_complete_arg 'install' -l adopt -d 'Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`' __fish_brew_complete_arg 'install' -l appdir -d 'Target location for Applications (default: `/Applications`)' __fish_brew_complete_arg 'install' -l as-dependency -d 'Install but mark as installed as a dependency and not installed on request' -__fish_brew_complete_arg 'install' -l ask -d 'Ask for confirmation before downloading and installing formulae. Print bottles and dependencies download size and install size' +__fish_brew_complete_arg 'install' -l ask -d 'Ask for confirmation before downloading and installing formulae. Print download and install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set' __fish_brew_complete_arg 'install' -l audio-unit-plugindir -d 'Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)' -__fish_brew_complete_arg 'install' -l binaries -d 'Disable/enable linking of helper executables (default: enabled)' +__fish_brew_complete_arg 'install' -l binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' __fish_brew_complete_arg 'install' -l bottle-arch -d 'Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on' __fish_brew_complete_arg 'install' -l build-bottle -d 'Prepare the formula for eventual bottling during installation, skipping any post-install steps' __fish_brew_complete_arg 'install' -l build-from-source -d 'Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available' @@ -1020,7 +1020,7 @@ __fish_brew_complete_arg 'install' -l colorpickerdir -d 'Target location for Col __fish_brew_complete_arg 'install' -l debug -d 'If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory' __fish_brew_complete_arg 'install' -l debug-symbols -d 'Generate debug symbols on build. Source will be retained in a cache directory' __fish_brew_complete_arg 'install' -l dictionarydir -d 'Target location for Dictionaries (default: `~/Library/Dictionaries`)' -__fish_brew_complete_arg 'install' -l display-times -d 'Print install times for each package at the end of the run' +__fish_brew_complete_arg 'install' -l display-times -d 'Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set' __fish_brew_complete_arg 'install' -l dry-run -d 'Show what would be installed, but do not actually install anything' __fish_brew_complete_arg 'install' -l fetch-HEAD -d 'Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository\'s HEAD will only be checked for updates when a new stable or development version has been released' __fish_brew_complete_arg 'install' -l fontdir -d 'Target location for Fonts (default: `~/Library/Fonts`)' @@ -1038,15 +1038,15 @@ __fish_brew_complete_arg 'install' -l keep-tmp -d 'Retain the temporary files cr __fish_brew_complete_arg 'install' -l keyboard-layoutdir -d 'Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)' __fish_brew_complete_arg 'install' -l language -d 'Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask\'s default language. The default value is the language of your system' __fish_brew_complete_arg 'install' -l mdimporterdir -d 'Target location for Spotlight Plugins (default: `~/Library/Spotlight`)' -__fish_brew_complete_arg 'install' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled)' -__fish_brew_complete_arg 'install' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'install' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' +__fish_brew_complete_arg 'install' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'install' -l only-dependencies -d 'Install the dependencies with specified options but do not install the formula itself' __fish_brew_complete_arg 'install' -l overwrite -d 'Delete files that already exist in the prefix while linking' __fish_brew_complete_arg 'install' -l prefpanedir -d 'Target location for Preference Panes (default: `~/Library/PreferencePanes`)' __fish_brew_complete_arg 'install' -l qlplugindir -d 'Target location for Quick Look Plugins (default: `~/Library/QuickLook`)' -__fish_brew_complete_arg 'install' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'install' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'install' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'install' -l require-sha -d 'Require all casks to have a checksum' +__fish_brew_complete_arg 'install' -l require-sha -d 'Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set' __fish_brew_complete_arg 'install' -l screen-saverdir -d 'Target location for Screen Savers (default: `~/Library/Screen Savers`)' __fish_brew_complete_arg 'install' -l servicedir -d 'Target location for Services (default: `~/Library/Services`)' __fish_brew_complete_arg 'install' -l skip-cask-deps -d 'Skip installing cask dependencies' @@ -1073,7 +1073,7 @@ __fish_brew_complete_cmd 'irb' 'Enter the interactive Homebrew Ruby shell' __fish_brew_complete_arg 'irb' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'irb' -l examples -d 'Show several examples' __fish_brew_complete_arg 'irb' -l help -d 'Show this message' -__fish_brew_complete_arg 'irb' -l pry -d 'Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set' +__fish_brew_complete_arg 'irb' -l pry -d 'Use Pry instead of IRB. Enabled by default if `$HOMEBREW_PRY` is set' __fish_brew_complete_arg 'irb' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'irb' -l verbose -d 'Make some output more verbose' @@ -1120,7 +1120,7 @@ __fish_brew_complete_arg 'link' -a '(__fish_brew_suggest_formulae_installed)' __fish_brew_complete_cmd 'linkage' 'Check the library links from the given formula kegs' -__fish_brew_complete_arg 'linkage' -l cached -d 'Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous `brew linkage` run' +__fish_brew_complete_arg 'linkage' -l cached -d 'Print the cached linkage values stored in `$HOMEBREW_CACHE`, set by a previous `brew linkage` run' __fish_brew_complete_arg 'linkage' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'linkage' -l help -d 'Show this message' __fish_brew_complete_arg 'linkage' -l quiet -d 'Make some output more quiet' @@ -1225,6 +1225,13 @@ __fish_brew_complete_arg 'ls; and not __fish_seen_argument -l cask -l casks' -a __fish_brew_complete_arg 'ls; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_installed)' +__fish_brew_complete_cmd 'mcp-server' 'Starts the Homebrew MCP (Model Context Protocol) server' +__fish_brew_complete_arg 'mcp-server' -l debug -d 'Enable debug logging to stderr' +__fish_brew_complete_arg 'mcp-server' -l help -d 'Show this message' +__fish_brew_complete_arg 'mcp-server' -l quiet -d 'Make some output more quiet' +__fish_brew_complete_arg 'mcp-server' -l verbose -d 'Make some output more verbose' + + __fish_brew_complete_cmd 'migrate' 'Migrate renamed packages to new names, where formula are old names of packages' __fish_brew_complete_arg 'migrate' -l cask -d 'Only migrate casks' __fish_brew_complete_arg 'migrate' -l debug -d 'Display any debugging information' @@ -1258,7 +1265,7 @@ __fish_brew_complete_cmd 'options' 'Show install options specific to formula' __fish_brew_complete_arg 'options' -l command -d 'Show options for the specified command' __fish_brew_complete_arg 'options' -l compact -d 'Show all options on a single line separated by spaces' __fish_brew_complete_arg 'options' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'options' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their options' +__fish_brew_complete_arg 'options' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their options. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'options' -l help -d 'Show this message' __fish_brew_complete_arg 'options' -l installed -d 'Show options for formulae that are currently installed' __fish_brew_complete_arg 'options' -l quiet -d 'Make some output more quiet' @@ -1271,7 +1278,7 @@ __fish_brew_complete_arg 'outdated' -l cask -d 'List only outdated casks' __fish_brew_complete_arg 'outdated' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'outdated' -l fetch-HEAD -d 'Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository\'s HEAD will only be checked for updates when a new stable or development version has been released' __fish_brew_complete_arg 'outdated' -l formula -d 'List only outdated formulae' -__fish_brew_complete_arg 'outdated' -l greedy -d 'Also include outdated casks with `auto_updates true` or `version :latest`' +__fish_brew_complete_arg 'outdated' -l greedy -d 'Also include outdated casks with `auto_updates true` or `version :latest`. Enabled by default if `$HOMEBREW_UPGRADE_GREEDY` is set' __fish_brew_complete_arg 'outdated' -l greedy-auto-updates -d 'Also include outdated casks including those with `auto_updates true`' __fish_brew_complete_arg 'outdated' -l greedy-latest -d 'Also include outdated casks including those with `version :latest`' __fish_brew_complete_arg 'outdated' -l help -d 'Show this message' @@ -1403,7 +1410,7 @@ __fish_brew_complete_cmd 'readall' 'Import all items from the specified tap, or __fish_brew_complete_arg 'readall' -l aliases -d 'Verify any alias symlinks in each tap' __fish_brew_complete_arg 'readall' -l arch -d 'Read using the given CPU architecture. (Pass `all` to simulate all architectures.)' __fish_brew_complete_arg 'readall' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'readall' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'readall' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'readall' -l help -d 'Show this message' __fish_brew_complete_arg 'readall' -l no-simulate -d 'Don\'t simulate other system configurations when checking formulae and casks' __fish_brew_complete_arg 'readall' -l os -d 'Read using the given operating system. (Pass `all` to simulate all operating systems.)' @@ -1416,16 +1423,16 @@ __fish_brew_complete_arg 'readall' -a '(__fish_brew_suggest_taps_installed)' __fish_brew_complete_cmd 'reinstall' 'Uninstall and then reinstall a formula or cask using the same options it was originally installed with, plus any appended options specific to a formula' __fish_brew_complete_arg 'reinstall' -l adopt -d 'Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`' __fish_brew_complete_arg 'reinstall' -l appdir -d 'Target location for Applications (default: `/Applications`)' -__fish_brew_complete_arg 'reinstall' -l ask -d 'Ask for confirmation before downloading and upgrading formulae. Print bottles and dependencies download size, install and net install size' +__fish_brew_complete_arg 'reinstall' -l ask -d 'Ask for confirmation before downloading and upgrading formulae. Print download, install and net install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set' __fish_brew_complete_arg 'reinstall' -l audio-unit-plugindir -d 'Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)' -__fish_brew_complete_arg 'reinstall' -l binaries -d 'Disable/enable linking of helper executables (default: enabled)' +__fish_brew_complete_arg 'reinstall' -l binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' __fish_brew_complete_arg 'reinstall' -l build-from-source -d 'Compile formula from source even if a bottle is available' __fish_brew_complete_arg 'reinstall' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'reinstall' -l colorpickerdir -d 'Target location for Color Pickers (default: `~/Library/ColorPickers`)' __fish_brew_complete_arg 'reinstall' -l debug -d 'If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory' __fish_brew_complete_arg 'reinstall' -l debug-symbols -d 'Generate debug symbols on build. Source will be retained in a cache directory' __fish_brew_complete_arg 'reinstall' -l dictionarydir -d 'Target location for Dictionaries (default: `~/Library/Dictionaries`)' -__fish_brew_complete_arg 'reinstall' -l display-times -d 'Print install times for each package at the end of the run' +__fish_brew_complete_arg 'reinstall' -l display-times -d 'Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set' __fish_brew_complete_arg 'reinstall' -l fontdir -d 'Target location for Fonts (default: `~/Library/Fonts`)' __fish_brew_complete_arg 'reinstall' -l force -d 'Install without checking for previously installed keg-only or non-migrated versions' __fish_brew_complete_arg 'reinstall' -l force-bottle -d 'Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation' @@ -1439,13 +1446,13 @@ __fish_brew_complete_arg 'reinstall' -l keep-tmp -d 'Retain the temporary files __fish_brew_complete_arg 'reinstall' -l keyboard-layoutdir -d 'Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)' __fish_brew_complete_arg 'reinstall' -l language -d 'Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask\'s default language. The default value is the language of your system' __fish_brew_complete_arg 'reinstall' -l mdimporterdir -d 'Target location for Spotlight Plugins (default: `~/Library/Spotlight`)' -__fish_brew_complete_arg 'reinstall' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled)' -__fish_brew_complete_arg 'reinstall' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'reinstall' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' +__fish_brew_complete_arg 'reinstall' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'reinstall' -l prefpanedir -d 'Target location for Preference Panes (default: `~/Library/PreferencePanes`)' __fish_brew_complete_arg 'reinstall' -l qlplugindir -d 'Target location for Quick Look Plugins (default: `~/Library/QuickLook`)' -__fish_brew_complete_arg 'reinstall' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'reinstall' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'reinstall' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'reinstall' -l require-sha -d 'Require all casks to have a checksum' +__fish_brew_complete_arg 'reinstall' -l require-sha -d 'Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set' __fish_brew_complete_arg 'reinstall' -l screen-saverdir -d 'Target location for Screen Savers (default: `~/Library/Screen Savers`)' __fish_brew_complete_arg 'reinstall' -l servicedir -d 'Target location for Services (default: `~/Library/Services`)' __fish_brew_complete_arg 'reinstall' -l skip-cask-deps -d 'Skip installing cask dependencies' @@ -1526,7 +1533,7 @@ __fish_brew_complete_arg 'search' -l closed -d 'Search for only closed GitHub pu __fish_brew_complete_arg 'search' -l debian -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'search' -l desc -d 'Search for formulae with a description matching text and casks with a name or description matching text' -__fish_brew_complete_arg 'search' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'search' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'search' -l fedora -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l fink -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l formula -d 'Search for formulae' @@ -1574,7 +1581,7 @@ __fish_brew_complete_arg 'setup-ruby' -a '(__fish_brew_suggest_commands)' __fish_brew_complete_cmd 'sh' 'Enter an interactive shell for Homebrew\'s build environment' __fish_brew_complete_arg 'sh' -l cmd -d 'Execute commands in a non-interactive shell' __fish_brew_complete_arg 'sh' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'sh' -l env -d 'Use the standard `PATH` instead of superenv\'s when `std` is passed' +__fish_brew_complete_arg 'sh' -l env -d 'Use the standard `$PATH` instead of superenv\'s when `std` is passed' __fish_brew_complete_arg 'sh' -l help -d 'Show this message' __fish_brew_complete_arg 'sh' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'sh' -l verbose -d 'Make some output more verbose' @@ -1619,7 +1626,7 @@ __fish_brew_complete_arg 'tab; and not __fish_seen_argument -l formula -l formul __fish_brew_complete_cmd 'tap' 'Tap a formula repository' __fish_brew_complete_arg 'tap' -l custom-remote -d 'Install or change a tap with a custom remote. Useful for mirrors' __fish_brew_complete_arg 'tap' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'tap' -l eval-all -d 'Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `$HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'tap' -l eval-all -d 'Evaluate all formulae, casks and aliases in the new tap to check their validity. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'tap' -l force -d 'Force install core taps even under API mode' __fish_brew_complete_arg 'tap' -l help -d 'Show this message' __fish_brew_complete_arg 'tap' -l quiet -d 'Make some output more quiet' @@ -1679,12 +1686,13 @@ __fish_brew_complete_arg 'test' -a '(__fish_brew_suggest_formulae_installed)' __fish_brew_complete_cmd 'tests' 'Run Homebrew\'s unit and integration tests' -__fish_brew_complete_arg 'tests' -l changed -d 'Only runs tests on files that were changed from the master branch' +__fish_brew_complete_arg 'tests' -l changed -d 'Only runs tests on files that were changed from the `main` branch' __fish_brew_complete_arg 'tests' -l coverage -d 'Generate code coverage reports' __fish_brew_complete_arg 'tests' -l debug -d 'Enable debugging using `ruby/debug`, or surface the standard `odebug` output' __fish_brew_complete_arg 'tests' -l fail-fast -d 'Exit early on the first failing test' __fish_brew_complete_arg 'tests' -l generic -d 'Run only OS-agnostic tests' __fish_brew_complete_arg 'tests' -l help -d 'Show this message' +__fish_brew_complete_arg 'tests' -l no-parallel -d 'Run tests serially' __fish_brew_complete_arg 'tests' -l online -d 'Include tests that use the GitHub API and tests that use any of the taps for official external commands' __fish_brew_complete_arg 'tests' -l only -d 'Run only `test_script_spec.rb`. Appending `:line_number` will start at a specific line' __fish_brew_complete_arg 'tests' -l profile -d 'Run the test suite serially to find the n slowest tests' @@ -1719,7 +1727,7 @@ __fish_brew_complete_arg 'unalias' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'unbottled' 'Show the unbottled dependents of formulae' __fish_brew_complete_arg 'unbottled' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'unbottled' -l dependents -d 'Skip getting analytics data and sort by number of dependents instead' -__fish_brew_complete_arg 'unbottled' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them. Implied if `HOMEBREW_EVAL_ALL` is set' +__fish_brew_complete_arg 'unbottled' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'unbottled' -l help -d 'Show this message' __fish_brew_complete_arg 'unbottled' -l lost -d 'Print the `homebrew/core` commits where bottles were lost in the last week' __fish_brew_complete_arg 'unbottled' -l quiet -d 'Make some output more quiet' @@ -1835,6 +1843,17 @@ __fish_brew_complete_arg 'update-maintainers' -l quiet -d 'Make some output more __fish_brew_complete_arg 'update-maintainers' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_cmd 'update-perl-resources' 'Update versions for CPAN resource blocks in formula' +__fish_brew_complete_arg 'update-perl-resources' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'update-perl-resources' -l help -d 'Show this message' +__fish_brew_complete_arg 'update-perl-resources' -l ignore-errors -d 'Continue processing even if some resources can\'t be resolved' +__fish_brew_complete_arg 'update-perl-resources' -l print-only -d 'Print the updated resource blocks instead of changing formula' +__fish_brew_complete_arg 'update-perl-resources' -l quiet -d 'Make some output more quiet' +__fish_brew_complete_arg 'update-perl-resources' -l silent -d 'Suppress any output' +__fish_brew_complete_arg 'update-perl-resources' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_arg 'update-perl-resources' -a '(__fish_brew_suggest_formulae_all)' + + __fish_brew_complete_cmd 'update-python-resources' 'Update versions for PyPI resource blocks in formula' __fish_brew_complete_arg 'update-python-resources' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'update-python-resources' -l exclude-packages -d 'Exclude these packages when finding resources' @@ -1881,22 +1900,22 @@ __fish_brew_complete_arg 'update-test' -l debug -d 'Display any debugging inform __fish_brew_complete_arg 'update-test' -l help -d 'Show this message' __fish_brew_complete_arg 'update-test' -l keep-tmp -d 'Retain the temporary directory containing the new repository clone' __fish_brew_complete_arg 'update-test' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'update-test' -l to-tag -d 'Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags' +__fish_brew_complete_arg 'update-test' -l to-tag -d 'Set `$HOMEBREW_UPDATE_TO_TAG` to test updating between tags' __fish_brew_complete_arg 'update-test' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'upgrade' 'Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options' __fish_brew_complete_arg 'upgrade' -l appdir -d 'Target location for Applications (default: `/Applications`)' -__fish_brew_complete_arg 'upgrade' -l ask -d 'Ask for confirmation before downloading and upgrading formulae. Print bottles and dependencies download size, install and net install size' +__fish_brew_complete_arg 'upgrade' -l ask -d 'Ask for confirmation before downloading and upgrading formulae. Print download, install and net install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set' __fish_brew_complete_arg 'upgrade' -l audio-unit-plugindir -d 'Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)' -__fish_brew_complete_arg 'upgrade' -l binaries -d 'Disable/enable linking of helper executables (default: enabled)' +__fish_brew_complete_arg 'upgrade' -l binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' __fish_brew_complete_arg 'upgrade' -l build-from-source -d 'Compile formula from source even if a bottle is available' __fish_brew_complete_arg 'upgrade' -l cask -d 'Treat all named arguments as casks. If no named arguments are specified, upgrade only outdated casks' __fish_brew_complete_arg 'upgrade' -l colorpickerdir -d 'Target location for Color Pickers (default: `~/Library/ColorPickers`)' __fish_brew_complete_arg 'upgrade' -l debug -d 'If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory' __fish_brew_complete_arg 'upgrade' -l debug-symbols -d 'Generate debug symbols on build. Source will be retained in a cache directory' __fish_brew_complete_arg 'upgrade' -l dictionarydir -d 'Target location for Dictionaries (default: `~/Library/Dictionaries`)' -__fish_brew_complete_arg 'upgrade' -l display-times -d 'Print install times for each package at the end of the run' +__fish_brew_complete_arg 'upgrade' -l display-times -d 'Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set' __fish_brew_complete_arg 'upgrade' -l dry-run -d 'Show what would be upgraded, but do not actually upgrade anything' __fish_brew_complete_arg 'upgrade' -l fetch-HEAD -d 'Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository\'s HEAD will only be checked for updates when a new stable or development version has been released' __fish_brew_complete_arg 'upgrade' -l fontdir -d 'Target location for Fonts (default: `~/Library/Fonts`)' @@ -1914,14 +1933,14 @@ __fish_brew_complete_arg 'upgrade' -l keep-tmp -d 'Retain the temporary files cr __fish_brew_complete_arg 'upgrade' -l keyboard-layoutdir -d 'Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)' __fish_brew_complete_arg 'upgrade' -l language -d 'Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask\'s default language. The default value is the language of your system' __fish_brew_complete_arg 'upgrade' -l mdimporterdir -d 'Target location for Spotlight Plugins (default: `~/Library/Spotlight`)' -__fish_brew_complete_arg 'upgrade' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled)' -__fish_brew_complete_arg 'upgrade' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'upgrade' -l no-binaries -d 'Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set' +__fish_brew_complete_arg 'upgrade' -l no-quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'upgrade' -l overwrite -d 'Delete files that already exist in the prefix while linking' __fish_brew_complete_arg 'upgrade' -l prefpanedir -d 'Target location for Preference Panes (default: `~/Library/PreferencePanes`)' __fish_brew_complete_arg 'upgrade' -l qlplugindir -d 'Target location for Quick Look Plugins (default: `~/Library/QuickLook`)' -__fish_brew_complete_arg 'upgrade' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled)' +__fish_brew_complete_arg 'upgrade' -l quarantine -d 'Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set' __fish_brew_complete_arg 'upgrade' -l quiet -d 'Make some output more quiet' -__fish_brew_complete_arg 'upgrade' -l require-sha -d 'Require all casks to have a checksum' +__fish_brew_complete_arg 'upgrade' -l require-sha -d 'Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set' __fish_brew_complete_arg 'upgrade' -l screen-saverdir -d 'Target location for Screen Savers (default: `~/Library/Screen Savers`)' __fish_brew_complete_arg 'upgrade' -l servicedir -d 'Target location for Services (default: `~/Library/Services`)' __fish_brew_complete_arg 'upgrade' -l skip-cask-deps -d 'Skip installing cask dependencies' @@ -1935,7 +1954,7 @@ __fish_brew_complete_arg 'upgrade; and not __fish_seen_argument -l formula -l fo __fish_brew_complete_cmd 'uses' 'Show formulae and casks that specify formula as a dependency; that is, show dependents of formula' __fish_brew_complete_arg 'uses' -l cask -d 'Include only casks' __fish_brew_complete_arg 'uses' -l debug -d 'Display any debugging information' -__fish_brew_complete_arg 'uses' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their dependents' +__fish_brew_complete_arg 'uses' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their dependents. Enabled by default if `$HOMEBREW_EVAL_ALL` is set' __fish_brew_complete_arg 'uses' -l formula -d 'Include only formulae' __fish_brew_complete_arg 'uses' -l help -d 'Show this message' __fish_brew_complete_arg 'uses' -l include-build -d 'Include formulae that specify formula as a `:build` dependency' diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index b0e7542097..5790791bce 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -68,6 +68,7 @@ livecheck ln log ls +mcp-server migrate missing nodenv-sync @@ -117,6 +118,7 @@ update update-if-needed update-license-data update-maintainers +update-perl-resources update-python-resources update-reset update-sponsors diff --git a/completions/zsh/_brew b/completions/zsh/_brew index bdba3d7058..e2064824d7 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -139,7 +139,7 @@ __brew_internal_commands() { '--prefix:Display Homebrew'\''s install path' '--repository:Display where Homebrew'\''s Git repository is located' '--version:Print the version numbers of Homebrew, Homebrew/homebrew-core and Homebrew/homebrew-cask (if tapped) to standard output' - 'alias:Show existing aliases' + 'alias:Show an alias'\''s command' 'analytics:Control Homebrew'\''s anonymous aggregate user behaviour analytics' 'audit:Check formula or cask for Homebrew coding style violations' 'autoremove:Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed' @@ -167,7 +167,7 @@ __brew_internal_commands() { 'dispatch-build-bottle:Build bottles for these formulae with GitHub Actions' 'docs:Open Homebrew'\''s online documentation at https://docs.brew.sh in a browser' 'doctor:Check your system for potential problems' - 'edit:Open a formula, cask or tap in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided' + 'edit:Open a formula, cask or tap in the editor set by `$EDITOR` or `$HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided' 'extract:Look through repository history to find the most recent version of formula and create a copy in tap' 'fetch:Download a bottle (if available) or source packages for formulae and binaries for casks' 'formula:Display the path where formula is located' @@ -191,6 +191,7 @@ __brew_internal_commands() { 'list:List all installed formulae and casks' 'livecheck:Check for newer versions of formulae and/or casks from upstream' 'log:Show the `git log` for formula or cask, or show the log for the Homebrew repository if no formula or cask is provided' + 'mcp-server:Starts the Homebrew MCP (Model Context Protocol) server' 'migrate:Migrate renamed packages to new names, where formula are old names of packages' 'missing:Check the given formula kegs for missing dependencies' 'nodenv-sync:Create symlinks for Homebrew'\''s installed NodeJS versions in `~/.nodenv/versions`' @@ -235,6 +236,7 @@ __brew_internal_commands() { 'update-if-needed:Runs `brew update --auto-update` only if needed' 'update-license-data:Update SPDX license data in the Homebrew repository' 'update-maintainers:Update the list of maintainers in the `Homebrew/brew` README' + 'update-perl-resources:Update versions for CPAN resource blocks in formula' 'update-python-resources:Update versions for PyPI resource blocks in formula' 'update-report:The Ruby implementation of `brew update`' 'update-reset:Fetch and reset Homebrew and all tap repositories (or any specified repository) using `git`(1) to their latest `origin/HEAD`' @@ -391,7 +393,7 @@ _brew__s() { '(--repology --macports --fink --opensuse --fedora --archlinux --ubuntu)--debian[Search for text in the given database]' \ '--debug[Display any debugging information]' \ '(--pull-request)--desc[Search for formulae with a description matching text and casks with a name or description matching text]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '(--repology --macports --fink --opensuse --archlinux --debian --ubuntu)--fedora[Search for text in the given database]' \ '(--repology --macports --opensuse --fedora --archlinux --debian --ubuntu)--fink[Search for text in the given database]' \ '--formula[Search for formulae]' \ @@ -422,7 +424,7 @@ _brew_abv() { '--category[Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`]' \ '--days[How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`]' \ '--debug[Display any debugging information]' \ - '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON]' \ '(--cask --json)--fetch-manifest[Fetch GitHub Packages manifest for extra information when formula is not installed]' \ '--github[Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask]' \ '--help[Show this message]' \ @@ -467,7 +469,7 @@ _brew_audit() { '--audit-debug[Enable debugging and profiling of audit methods]' \ '--debug[Display any debugging information]' \ '--display-filename[Prefix every line of output with the file or formula name being audited, to make output easy to grep]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if `HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to audit them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '(--only)--except[Specify a comma-separated method list to skip running the methods named `audit_`method]' \ '(--only-cops --strict --only-cops --only)--except-cops[Specify a comma-separated cops list to skip checking for violations of the listed RuboCop cops]' \ '--fix[Fix style violations automatically using RuboCop'\''s auto-correct feature]' \ @@ -485,7 +487,6 @@ _brew_audit() { '--skip-style[Skip running non-RuboCop style checks. Useful if you plan on running `brew style` separately. Enabled by default unless a formula is specified by name]' \ '(--only-cops --except-cops)--strict[Run additional, stricter style checks]' \ '--tap[Check formulae and casks within the given tap, specified as user`/`repo]' \ - '--token-conflicts[Audit for token conflicts]' \ '--verbose[Make some output more verbose]' \ - formula \ '(--cask)--formula[Treat all named arguments as formulae]' \ @@ -536,7 +537,7 @@ _brew_bump() { _arguments \ '--bump-synced[Bump additional formulae marked as synced with the given formulae]' \ '--debug[Display any debugging information]' \ - '(--installed)--eval-all[Evaluate all formulae and casks]' \ + '(--installed)--eval-all[Evaluate all formulae and casks. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--full-name[Print formulae/casks with fully-qualified names]' \ '--help[Show this message]' \ '(--tap --eval-all --auto)--installed[Check formulae and casks that are currently installed]' \ @@ -566,7 +567,7 @@ _brew_bump_cask_pr() { '--fork-org[Use the specified GitHub organization for forking]' \ '--help[Show this message]' \ '--message[Prepend message to the default pull request message]' \ - '(--online)--no-audit[Don'\''t run `brew audit` before opening the PR]' \ + '--no-audit[Don'\''t run `brew audit` before opening the PR]' \ '--no-browse[Print the pull request URL instead of opening in a browser]' \ '--no-fork[Don'\''t try to fork the repository]' \ '--no-style[Don'\''t run `brew style --fix` before opening the PR]' \ @@ -649,28 +650,28 @@ _brew_bump_unversioned_casks() { _brew_bundle() { _arguments \ '(--no-vscode)--all[`list` all dependencies]' \ - '--cask[`list` or `dump` Homebrew cask dependencies]' \ + '--cask[`list`, `dump` or `cleanup` Homebrew cask dependencies]' \ '--check[Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`]' \ - '--cleanup[`install` performs cleanup operation, same as running `cleanup --force`. This is enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \ + '--cleanup[`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \ '--debug[Display any debugging information]' \ - '--describe[`dump` adds a description comment above each line, unless the dependency does not have a description. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set]' \ + '--describe[`dump` adds a description comment above each line, unless the dependency does not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set]' \ '--file[Read from or write to the `Brewfile` from this location. Use `--file=-` to pipe to stdin/stdout]' \ '--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \ - '--formula[`list` or `dump` Homebrew formula dependencies]' \ + '--formula[`list`, `dump` or `cleanup` Homebrew formula dependencies]' \ '--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \ '--help[Show this message]' \ '(--upgrade)--install[Run `install` before continuing to other operations e.g. `exec`]' \ '--mas[`list` or `dump` Mac App Store dependencies]' \ '--no-restart[`dump` does not add `restart_service` to formula lines]' \ - '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ - '(--all --vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \ + '--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ + '(--all --vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \ '--quiet[Make some output more quiet]' \ - '--services[Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ - '--tap[`list` or `dump` Homebrew tap dependencies]' \ + '--services[Temporarily start services while running the `exec` or `sh` command. Enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \ + '--tap[`list`, `dump` or `cleanup` Homebrew tap dependencies]' \ '(--install)--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \ '--verbose[`install` prints output from commands as they are run. `check` lists all missing dependencies]' \ - '(--no-vscode)--vscode[`list` or `dump` VSCode (and forks/variants) extensions]' \ + '(--no-vscode)--vscode[`list`, `dump` or `cleanup` VSCode (and forks/variants) extensions]' \ '--whalebrew[`list` or `dump` Whalebrew dependencies]' \ '--zap[`cleanup` casks using the `zap` command instead of `uninstall`]' \ - subcommand \ @@ -777,28 +778,29 @@ _brew_contributions() { _brew_create() { _arguments \ '(--cask)--HEAD[Indicate that URL points to the package'\''s repository rather than a file]' \ - '(--cmake --crystal --go --meson --node --perl --python --ruby --rust --zig --cask)--autotools[Create a basic template for an Autotools-style build]' \ - '(--autotools --cmake --crystal --go --meson --node --perl --python --ruby --rust --zig --HEAD --set-license)--cask[Create a basic template for a cask]' \ - '(--autotools --crystal --go --meson --node --perl --python --ruby --rust --zig --cask)--cmake[Create a basic template for a CMake-style build]' \ - '(--autotools --cmake --go --meson --node --perl --python --ruby --rust --zig --cask)--crystal[Create a basic template for a Crystal build]' \ + '(--cabal --cmake --crystal --go --meson --node --perl --python --ruby --rust --zig --cask)--autotools[Create a basic template for an Autotools-style build]' \ + '(--autotools --cmake --crystal --go --meson --node --perl --python --ruby --rust --zig --cask)--cabal[Create a basic template for a Cabal build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --node --perl --python --ruby --rust --zig --HEAD --set-license)--cask[Create a basic template for a cask]' \ + '(--autotools --cabal --crystal --go --meson --node --perl --python --ruby --rust --zig --cask)--cmake[Create a basic template for a CMake-style build]' \ + '(--autotools --cabal --cmake --go --meson --node --perl --python --ruby --rust --zig --cask)--crystal[Create a basic template for a Crystal build]' \ '--debug[Display any debugging information]' \ '--force[Ignore errors for disallowed formula names and names that shadow aliases]' \ - '(--autotools --cmake --crystal --meson --node --perl --python --ruby --rust --zig --cask)--go[Create a basic template for a Go build]' \ + '(--autotools --cabal --cmake --crystal --meson --node --perl --python --ruby --rust --zig --cask)--go[Create a basic template for a Go build]' \ '--help[Show this message]' \ - '(--autotools --cmake --crystal --go --node --perl --python --ruby --rust --zig --cask)--meson[Create a basic template for a Meson-style build]' \ + '(--autotools --cabal --cmake --crystal --go --node --perl --python --ruby --rust --zig --cask)--meson[Create a basic template for a Meson-style build]' \ '--no-fetch[Homebrew will not download URL to the cache and will thus not add its SHA-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage)]' \ - '(--autotools --cmake --crystal --go --meson --perl --python --ruby --rust --zig --cask)--node[Create a basic template for a Node build]' \ - '(--autotools --cmake --crystal --go --meson --node --python --ruby --rust --zig --cask)--perl[Create a basic template for a Perl build]' \ - '(--autotools --cmake --crystal --go --meson --node --perl --ruby --rust --zig --cask)--python[Create a basic template for a Python build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --perl --python --ruby --rust --zig --cask)--node[Create a basic template for a Node build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --node --python --ruby --rust --zig --cask)--perl[Create a basic template for a Perl build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --node --perl --ruby --rust --zig --cask)--python[Create a basic template for a Python build]' \ '--quiet[Make some output more quiet]' \ - '(--autotools --cmake --crystal --go --meson --node --perl --python --rust --zig --cask)--ruby[Create a basic template for a Ruby build]' \ - '(--autotools --cmake --crystal --go --meson --node --perl --python --ruby --zig --cask)--rust[Create a basic template for a Rust build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --node --perl --python --rust --zig --cask)--ruby[Create a basic template for a Ruby build]' \ + '(--autotools --cabal --cmake --crystal --go --meson --node --perl --python --ruby --zig --cask)--rust[Create a basic template for a Rust build]' \ '(--cask)--set-license[Explicitly set the license of the new formula]' \ '--set-name[Explicitly set the name of the new formula or cask]' \ '--set-version[Explicitly set the version of the new formula or cask]' \ '--tap[Generate the new formula within the given tap, specified as user`/`repo]' \ '--verbose[Make some output more verbose]' \ - '(--autotools --cmake --crystal --go --meson --node --perl --python --ruby --rust --cask)--zig[Create a basic template for a Zig build]' + '(--autotools --cabal --cmake --crystal --go --meson --node --perl --python --ruby --rust --cask)--zig[Create a basic template for a Zig build]' } # brew debugger @@ -854,7 +856,7 @@ _brew_desc() { _arguments \ '--debug[Display any debugging information]' \ '(--search --name)--description[Search just descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '(--search --description)--name[Search just names for text. If text is flanked by slashes, it is interpreted as a regular expression]' \ '--quiet[Make some output more quiet]' \ @@ -873,8 +875,8 @@ _brew_determine_test_runners() { _arguments \ '(--dependents)--all-supported[Instead of selecting runners based on the chosen formula, return all supported runners]' \ '--debug[Display any debugging information]' \ - '(--all-supported)--dependents[Determine runners for testing dependents. Requires `--eval-all` or `HOMEBREW_EVAL_ALL`]' \ - '--eval-all[Evaluate all available formulae, whether installed or not, to determine testing dependents]' \ + '(--all-supported)--dependents[Determine runners for testing dependents. Requires `--eval-all` or `$HOMEBREW_EVAL_ALL` to be set]' \ + '--eval-all[Evaluate all available formulae, whether installed or not, to determine testing dependents. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' @@ -1007,9 +1009,9 @@ _brew_fetch() { '--force[Remove a previously cached version and re-fetch]' \ '(--build-from-source --build-bottle --bottle-tag --cask)--force-bottle[Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation]' \ '--help[Show this message]' \ - '--no-quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--no-quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '(--bottle-tag)--os[Download for the given operating system. (Pass `all` to download for all operating systems.)]' \ - '--quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '--quiet[Make some output more quiet]' \ '--retry[Retry if downloading fails or re-download if the checksum of a previously cached version no longer matches. Tries at most 5 times with exponential backoff]' \ '--verbose[Do a verbose VCS checkout, if the URL represents a VCS. This is useful for seeing if an existing VCS cache has been updated]' \ @@ -1171,7 +1173,7 @@ _brew_info() { '--category[Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`]' \ '--days[How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`]' \ '--debug[Display any debugging information]' \ - '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON]' \ '(--cask --json)--fetch-manifest[Fetch GitHub Packages manifest for extra information when formula is not installed]' \ '--github[Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask]' \ '--help[Show this message]' \ @@ -1195,9 +1197,9 @@ _brew_instal() { '(--formula --force)--adopt[Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`]' \ '(--formula)--appdir[Target location for Applications (default: `/Applications`)]' \ '(--cask)--as-dependency[Install but mark as installed as a dependency and not installed on request]' \ - '--ask[Ask for confirmation before downloading and installing formulae. Print bottles and dependencies download size and install size]' \ + '--ask[Ask for confirmation before downloading and installing formulae. Print download and install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set]' \ '(--formula)--audio-unit-plugindir[Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)]' \ - '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled)]' \ + '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ '(--cask)--bottle-arch[Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on]' \ '(--cask --build-from-source --force-bottle)--build-bottle[Prepare the formula for eventual bottling during installation, skipping any post-install steps]' \ '(--cask --build-bottle --force-bottle)--build-from-source[Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available]' \ @@ -1206,7 +1208,7 @@ _brew_instal() { '--debug[If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory]' \ '(--cask)--debug-symbols[Generate debug symbols on build. Source will be retained in a cache directory]' \ '(--formula)--dictionarydir[Target location for Dictionaries (default: `~/Library/Dictionaries`)]' \ - '--display-times[Print install times for each package at the end of the run]' \ + '--display-times[Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set]' \ '--dry-run[Show what would be installed, but do not actually install anything]' \ '(--cask)--fetch-HEAD[Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository'\''s HEAD will only be checked for updates when a new stable or development version has been released]' \ '(--formula)--fontdir[Target location for Fonts (default: `~/Library/Fonts`)]' \ @@ -1223,15 +1225,15 @@ _brew_instal() { '(--formula)--keyboard-layoutdir[Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)]' \ '(--formula)--language[Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask'\''s default language. The default value is the language of your system]' \ '(--formula)--mdimporterdir[Target location for Spotlight Plugins (default: `~/Library/Spotlight`)]' \ - '--no-binaries[Disable/enable linking of helper executables (default: enabled)]' \ - '--no-quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--no-binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ + '--no-quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '(--cask --ignore-dependencies)--only-dependencies[Install the dependencies with specified options but do not install the formula itself]' \ '(--cask)--overwrite[Delete files that already exist in the prefix while linking]' \ '(--formula)--prefpanedir[Target location for Preference Panes (default: `~/Library/PreferencePanes`)]' \ '(--formula)--qlplugindir[Target location for Quick Look Plugins (default: `~/Library/QuickLook`)]' \ - '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '--quiet[Make some output more quiet]' \ - '(--formula)--require-sha[Require all casks to have a checksum]' \ + '(--formula)--require-sha[Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set]' \ '(--formula)--screen-saverdir[Target location for Screen Savers (default: `~/Library/Screen Savers`)]' \ '(--formula)--servicedir[Target location for Services (default: `~/Library/Services`)]' \ '(--formula)--skip-cask-deps[Skip installing cask dependencies]' \ @@ -1256,9 +1258,9 @@ _brew_install() { '(--formula --force)--adopt[Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`]' \ '(--formula)--appdir[Target location for Applications (default: `/Applications`)]' \ '(--cask)--as-dependency[Install but mark as installed as a dependency and not installed on request]' \ - '--ask[Ask for confirmation before downloading and installing formulae. Print bottles and dependencies download size and install size]' \ + '--ask[Ask for confirmation before downloading and installing formulae. Print download and install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set]' \ '(--formula)--audio-unit-plugindir[Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)]' \ - '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled)]' \ + '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ '(--cask)--bottle-arch[Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on]' \ '(--cask --build-from-source --force-bottle)--build-bottle[Prepare the formula for eventual bottling during installation, skipping any post-install steps]' \ '(--cask --build-bottle --force-bottle)--build-from-source[Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available]' \ @@ -1267,7 +1269,7 @@ _brew_install() { '--debug[If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory]' \ '(--cask)--debug-symbols[Generate debug symbols on build. Source will be retained in a cache directory]' \ '(--formula)--dictionarydir[Target location for Dictionaries (default: `~/Library/Dictionaries`)]' \ - '--display-times[Print install times for each package at the end of the run]' \ + '--display-times[Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set]' \ '--dry-run[Show what would be installed, but do not actually install anything]' \ '(--cask)--fetch-HEAD[Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository'\''s HEAD will only be checked for updates when a new stable or development version has been released]' \ '(--formula)--fontdir[Target location for Fonts (default: `~/Library/Fonts`)]' \ @@ -1284,15 +1286,15 @@ _brew_install() { '(--formula)--keyboard-layoutdir[Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)]' \ '(--formula)--language[Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask'\''s default language. The default value is the language of your system]' \ '(--formula)--mdimporterdir[Target location for Spotlight Plugins (default: `~/Library/Spotlight`)]' \ - '--no-binaries[Disable/enable linking of helper executables (default: enabled)]' \ - '--no-quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--no-binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ + '--no-quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '(--cask --ignore-dependencies)--only-dependencies[Install the dependencies with specified options but do not install the formula itself]' \ '(--cask)--overwrite[Delete files that already exist in the prefix while linking]' \ '(--formula)--prefpanedir[Target location for Preference Panes (default: `~/Library/PreferencePanes`)]' \ '(--formula)--qlplugindir[Target location for Quick Look Plugins (default: `~/Library/QuickLook`)]' \ - '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '--quiet[Make some output more quiet]' \ - '(--formula)--require-sha[Require all casks to have a checksum]' \ + '(--formula)--require-sha[Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set]' \ '(--formula)--screen-saverdir[Target location for Screen Savers (default: `~/Library/Screen Savers`)]' \ '(--formula)--servicedir[Target location for Services (default: `~/Library/Services`)]' \ '(--formula)--skip-cask-deps[Skip installing cask dependencies]' \ @@ -1327,7 +1329,7 @@ _brew_irb() { '--debug[Display any debugging information]' \ '--examples[Show several examples]' \ '--help[Show this message]' \ - '--pry[Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set]' \ + '--pry[Use Pry instead of IRB. Enabled by default if `$HOMEBREW_PRY` is set]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' } @@ -1385,7 +1387,7 @@ _brew_link() { # brew linkage _brew_linkage() { _arguments \ - '--cached[Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous `brew linkage` run]' \ + '--cached[Print the cached linkage values stored in `$HOMEBREW_CACHE`, set by a previous `brew linkage` run]' \ '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ @@ -1510,6 +1512,15 @@ _brew_ls() { '*:installed_cask:__brew_installed_casks' } +# brew mcp-server +_brew_mcp_server() { + _arguments \ + '--debug[Enable debug logging to stderr]' \ + '--help[Show this message]' \ + '--quiet[Make some output more quiet]' \ + '--verbose[Make some output more verbose]' +} + # brew migrate _brew_migrate() { _arguments \ @@ -1554,7 +1565,7 @@ _brew_options() { '(--installed --all)--command[Show options for the specified command]' \ '--compact[Show all options on a single line separated by spaces]' \ '--debug[Display any debugging information]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their options]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their options. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '(--all --command)--installed[Show options for formulae that are currently installed]' \ '--quiet[Make some output more quiet]' \ @@ -1568,7 +1579,7 @@ _brew_outdated() { _arguments \ '--debug[Display any debugging information]' \ '--fetch-HEAD[Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository'\''s HEAD will only be checked for updates when a new stable or development version has been released]' \ - '--greedy[Also include outdated casks with `auto_updates true` or `version :latest`]' \ + '--greedy[Also include outdated casks with `auto_updates true` or `version :latest`. Enabled by default if `$HOMEBREW_UPGRADE_GREEDY` is set]' \ '--greedy-auto-updates[Also include outdated casks including those with `auto_updates true`]' \ '--greedy-latest[Also include outdated casks including those with `version :latest`]' \ '--help[Show this message]' \ @@ -1730,7 +1741,7 @@ _brew_readall() { '--aliases[Verify any alias symlinks in each tap]' \ '--arch[Read using the given CPU architecture. (Pass `all` to simulate all architectures.)]' \ '--debug[Display any debugging information]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '--no-simulate[Don'\''t simulate other system configurations when checking formulae and casks]' \ '--os[Read using the given operating system. (Pass `all` to simulate all operating systems.)]' \ @@ -1746,15 +1757,15 @@ _brew_reinstall() { _arguments \ '(--formula)--adopt[Adopt existing artifacts in the destination that are identical to those being installed. Cannot be combined with `--force`]' \ '(--formula)--appdir[Target location for Applications (default: `/Applications`)]' \ - '--ask[Ask for confirmation before downloading and upgrading formulae. Print bottles and dependencies download size, install and net install size]' \ + '--ask[Ask for confirmation before downloading and upgrading formulae. Print download, install and net install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set]' \ '(--formula)--audio-unit-plugindir[Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)]' \ - '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled)]' \ + '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ '(--cask --force-bottle)--build-from-source[Compile formula from source even if a bottle is available]' \ '(--formula)--colorpickerdir[Target location for Color Pickers (default: `~/Library/ColorPickers`)]' \ '--debug[If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory]' \ '(--cask)--debug-symbols[Generate debug symbols on build. Source will be retained in a cache directory]' \ '(--formula)--dictionarydir[Target location for Dictionaries (default: `~/Library/Dictionaries`)]' \ - '--display-times[Print install times for each package at the end of the run]' \ + '--display-times[Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set]' \ '(--formula)--fontdir[Target location for Fonts (default: `~/Library/Fonts`)]' \ '--force[Install without checking for previously installed keg-only or non-migrated versions]' \ '(--cask --build-from-source)--force-bottle[Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation]' \ @@ -1767,13 +1778,13 @@ _brew_reinstall() { '(--formula)--keyboard-layoutdir[Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)]' \ '(--formula)--language[Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask'\''s default language. The default value is the language of your system]' \ '(--formula)--mdimporterdir[Target location for Spotlight Plugins (default: `~/Library/Spotlight`)]' \ - '--no-binaries[Disable/enable linking of helper executables (default: enabled)]' \ - '--no-quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--no-binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ + '--no-quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '(--formula)--prefpanedir[Target location for Preference Panes (default: `~/Library/PreferencePanes`)]' \ '(--formula)--qlplugindir[Target location for Quick Look Plugins (default: `~/Library/QuickLook`)]' \ - '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '--quiet[Make some output more quiet]' \ - '(--formula)--require-sha[Require all casks to have a checksum]' \ + '(--formula)--require-sha[Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set]' \ '(--formula)--screen-saverdir[Target location for Screen Savers (default: `~/Library/Screen Savers`)]' \ '(--formula)--servicedir[Target location for Services (default: `~/Library/Services`)]' \ '(--formula)--skip-cask-deps[Skip installing cask dependencies]' \ @@ -1878,7 +1889,7 @@ _brew_search() { '(--repology --macports --fink --opensuse --fedora --archlinux --ubuntu)--debian[Search for text in the given database]' \ '--debug[Display any debugging information]' \ '(--pull-request)--desc[Search for formulae with a description matching text and casks with a name or description matching text]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '(--repology --macports --fink --opensuse --archlinux --debian --ubuntu)--fedora[Search for text in the given database]' \ '(--repology --macports --opensuse --fedora --archlinux --debian --ubuntu)--fink[Search for text in the given database]' \ '--formula[Search for formulae]' \ @@ -1927,7 +1938,7 @@ _brew_sh() { _arguments \ '--cmd[Execute commands in a non-interactive shell]' \ '--debug[Display any debugging information]' \ - '--env[Use the standard `PATH` instead of superenv'\''s when `std` is passed]' \ + '--env[Use the standard `$PATH` instead of superenv'\''s when `std` is passed]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--verbose[Make some output more verbose]' \ @@ -1989,7 +2000,7 @@ _brew_tap() { _arguments \ '--custom-remote[Install or change a tap with a custom remote. Useful for mirrors]' \ '--debug[Display any debugging information]' \ - '--eval-all[Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if `$HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all formulae, casks and aliases in the new tap to check their validity. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--force[Force install core taps even under API mode]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ @@ -2064,12 +2075,13 @@ _brew_test() { # brew tests _brew_tests() { _arguments \ - '(--only)--changed[Only runs tests on files that were changed from the master branch]' \ + '(--only)--changed[Only runs tests on files that were changed from the `main` branch]' \ '--coverage[Generate code coverage reports]' \ '--debug[Enable debugging using `ruby/debug`, or surface the standard `odebug` output]' \ '--fail-fast[Exit early on the first failing test]' \ '--generic[Run only OS-agnostic tests]' \ '--help[Show this message]' \ + '--no-parallel[Run tests serially]' \ '--online[Include tests that use the GitHub API and tests that use any of the taps for official external commands]' \ '(--changed)--only[Run only `test_script_spec.rb`. Appending `:line_number` will start at a specific line]' \ '--profile[Run the test suite serially to find the n slowest tests]' \ @@ -2111,7 +2123,7 @@ _brew_unbottled() { _arguments \ '--debug[Display any debugging information]' \ '(--total --lost)--dependents[Skip getting analytics data and sort by number of dependents instead]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them. Implied if `HOMEBREW_EVAL_ALL` is set]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '(--dependents --total)--lost[Print the `homebrew/core` commits where bottles were lost in the last week]' \ '--quiet[Make some output more quiet]' \ @@ -2259,6 +2271,20 @@ _brew_update_maintainers() { '--verbose[Make some output more verbose]' } +# brew update-perl-resources +_brew_update_perl_resources() { + _arguments \ + '--debug[Display any debugging information]' \ + '--help[Show this message]' \ + '--ignore-errors[Continue processing even if some resources can'\''t be resolved]' \ + '--print-only[Print the updated resource blocks instead of changing formula]' \ + '--quiet[Make some output more quiet]' \ + '--silent[Suppress any output]' \ + '--verbose[Make some output more verbose]' \ + - formula \ + '*:formula:__brew_formulae' +} + # brew update-python-resources _brew_update_python_resources() { _arguments \ @@ -2317,7 +2343,7 @@ _brew_update_test() { '--help[Show this message]' \ '--keep-tmp[Retain the temporary directory containing the new repository clone]' \ '--quiet[Make some output more quiet]' \ - '--to-tag[Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags]' \ + '--to-tag[Set `$HOMEBREW_UPDATE_TO_TAG` to test updating between tags]' \ '--verbose[Make some output more verbose]' } @@ -2325,15 +2351,15 @@ _brew_update_test() { _brew_upgrade() { _arguments \ '(--formula)--appdir[Target location for Applications (default: `/Applications`)]' \ - '--ask[Ask for confirmation before downloading and upgrading formulae. Print bottles and dependencies download size, install and net install size]' \ + '--ask[Ask for confirmation before downloading and upgrading formulae. Print download, install and net install sizes of bottles and dependencies. Enabled by default if `$HOMEBREW_ASK` is set]' \ '(--formula)--audio-unit-plugindir[Target location for Audio Unit Plugins (default: `~/Library/Audio/Plug-Ins/Components`)]' \ - '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled)]' \ + '(--formula)--binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ '(--cask --force-bottle)--build-from-source[Compile formula from source even if a bottle is available]' \ '(--formula)--colorpickerdir[Target location for Color Pickers (default: `~/Library/ColorPickers`)]' \ '--debug[If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory]' \ '(--cask)--debug-symbols[Generate debug symbols on build. Source will be retained in a cache directory]' \ '(--formula)--dictionarydir[Target location for Dictionaries (default: `~/Library/Dictionaries`)]' \ - '--display-times[Print install times for each package at the end of the run]' \ + '--display-times[Print install times for each package at the end of the run. Enabled by default if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set]' \ '--dry-run[Show what would be upgraded, but do not actually upgrade anything]' \ '(--cask)--fetch-HEAD[Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository'\''s HEAD will only be checked for updates when a new stable or development version has been released]' \ '(--formula)--fontdir[Target location for Fonts (default: `~/Library/Fonts`)]' \ @@ -2350,14 +2376,14 @@ _brew_upgrade() { '(--formula)--keyboard-layoutdir[Target location for Keyboard Layouts (default: `/Library/Keyboard Layouts`)]' \ '(--formula)--language[Comma-separated list of language codes to prefer for cask installation. The first matching language is used, otherwise it reverts to the cask'\''s default language. The default value is the language of your system]' \ '(--formula)--mdimporterdir[Target location for Spotlight Plugins (default: `~/Library/Spotlight`)]' \ - '--no-binaries[Disable/enable linking of helper executables (default: enabled)]' \ - '--no-quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '--no-binaries[Disable/enable linking of helper executables (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_BINARIES` is set]' \ + '--no-quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '(--cask)--overwrite[Delete files that already exist in the prefix while linking]' \ '(--formula)--prefpanedir[Target location for Preference Panes (default: `~/Library/PreferencePanes`)]' \ '(--formula)--qlplugindir[Target location for Quick Look Plugins (default: `~/Library/QuickLook`)]' \ - '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled)]' \ + '(--formula)--quarantine[Disable/enable quarantining of downloads (default: enabled). Enabled by default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set]' \ '--quiet[Make some output more quiet]' \ - '(--formula)--require-sha[Require all casks to have a checksum]' \ + '(--formula)--require-sha[Require all casks to have a checksum. Enabled by default if `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set]' \ '(--formula)--screen-saverdir[Target location for Screen Savers (default: `~/Library/Screen Savers`)]' \ '(--formula)--servicedir[Target location for Services (default: `~/Library/Services`)]' \ '(--formula)--skip-cask-deps[Skip installing cask dependencies]' \ @@ -2377,7 +2403,7 @@ _brew_uses() { _arguments \ '(--formula)--cask[Include only casks]' \ '--debug[Display any debugging information]' \ - '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their dependents]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their dependents. Enabled by default if `$HOMEBREW_EVAL_ALL` is set]' \ '--help[Show this message]' \ '--include-build[Include formulae that specify formula as a `:build` dependency]' \ '--include-implicit[Include formulae that have formula as an implicit dependency for downloading and unpacking source files]' \ diff --git a/docs/.mdl_ruleset.rb b/docs/.mdl_ruleset.rb index 7cf80606d7..fab331a825 100644 --- a/docs/.mdl_ruleset.rb +++ b/docs/.mdl_ruleset.rb @@ -8,3 +8,17 @@ rule "HB034", "Bare unstyled URL used" do doc.matching_text_element_lines(%r{(?<=\s)https?://}) end end +rule "HB100", "Full URL for internal link used" do + tags :links, :url + aliases "no-full-urls-for-internal-links" + check do |doc| + doc.matching_lines(%r{\]\(https://docs.brew.sh/.+?\)}) + end +end +rule "HB101", "File extension missing from internal link" do + tags :links, :url + aliases "file-extension-required-for-internal-links" + check do |doc| + doc.matching_lines(/\]\((?!#|\w+:)(?>[^#.)]+)(?!\.\w+)/) + end +end diff --git a/docs/.rubocop.yml b/docs/.rubocop.yml index cc101165e6..14a4d70231 100644 --- a/docs/.rubocop.yml +++ b/docs/.rubocop.yml @@ -37,6 +37,8 @@ Style/TopLevelMethodDefinition: Lint/NonAtomicFileOperation: Enabled: false -# The markdown linter config files don't need to be typed strict. +# We're not using Sorbet for the documentation. Sorbet/StrictSigil: Enabled: false +Sorbet/BlockMethodDefinition: + Enabled: false diff --git a/docs/Acceptable-Casks.md b/docs/Acceptable-Casks.md index 2146d0c2e3..5813f17c49 100644 --- a/docs/Acceptable-Casks.md +++ b/docs/Acceptable-Casks.md @@ -36,7 +36,7 @@ These versions also live in the main repository at [Homebrew/homebrew-cask](http ### Regional and Localized -When an app exists in more than one language or has different regional editions, [the `language` stanza should be used to switch between languages or regions](https://docs.brew.sh/Cask-Cookbook#stanza-language). +When an app exists in more than one language or has different regional editions, [the `language` stanza should be used to switch between languages or regions](Cask-Cookbook.md#stanza-language). ### Trial and Freemium versions @@ -111,7 +111,7 @@ Common reasons to reject a cask entirely: * An app from a code repository that is not notable enough (under 30 forks, 30 watchers, 75 stars). * [Electronic Identification (eID) software](https://github.com/Homebrew/homebrew-cask/issues/59021). * App requires [SIP to be disabled](https://github.com/Homebrew/homebrew-cask/pull/41890) to be installed and/or used. -* App installer is a `pkg` that requires [`allow_untrusted: true`](https://docs.brew.sh/Cask-Cookbook#pkg-allow_untrusted). +* App installer is a `pkg` that requires [`allow_untrusted: true`](Cask-Cookbook.md#pkg-allow_untrusted). * App is a trial version, and the only way to acquire the full version is through the Mac App Store. * Similarly (and trickier to spot), the app has moved to the Mac App Store but still provides old versions via direct download. We reject these in all official repositories so users don’t get stuck using an old version, wrongly thinking they’re using the most up-to-date one (which, amongst other things, might be a security risk). * App is unmaintained, i.e. no releases in the last year, or [explicitly discontinued](https://github.com/Homebrew/homebrew-cask/pull/22699). @@ -120,7 +120,7 @@ Common reasons to reject a cask entirely: * Or if the Cask has a download URL that is both behind a login/registration form and from a host that differs from the homepage. * Cask is unreasonably difficult to maintain. Examples have included [Audacity](https://github.com/Homebrew/homebrew-cask/pull/27517) and [older Java development casks](https://github.com/Homebrew/homebrew-cask/issues/57387). * Cask has been rejected before due to an issue we cannot fix, and the new submission doesn’t fix that. An example would be the [first submission of `soapui`](https://github.com/Homebrew/homebrew-cask/pull/4939), whose installation problems were not fixed in the two [subsequent](https://github.com/Homebrew/homebrew-cask/pull/9969) [submissions](https://github.com/Homebrew/homebrew-cask/pull/10606). -* Cask is a duplicate. These submissions mostly occur when the [token reference](https://docs.brew.sh/Cask-Cookbook#token-reference) was not followed. +* Cask is a duplicate. These submissions mostly occur when the [token reference](Cask-Cookbook.md#token-reference) was not followed. * The author has [specifically asked us not to include it](https://github.com/Homebrew/homebrew-cask/pull/5342). * App is both open-source and CLI-only (i.e. it only uses the `binary` artifact). In that case, and [in the spirit of deduplication](https://github.com/Homebrew/homebrew-cask/issues/15603), submit it first to [homebrew/core](https://github.com/Homebrew/homebrew-core) as a formula that builds from source. If it is rejected, you may then try again as a cask (link to the issue from your pull request so we can see the discussion and reasoning for rejection). * App is open-source and has a GUI but no compiled versions (or only old ones) are provided. It’s better to have them in [homebrew/core](https://github.com/Homebrew/homebrew-core) so users don’t get perpetually outdated versions. See [`gedit`](https://github.com/Homebrew/homebrew-cask/pull/23360) for example. diff --git a/docs/Acceptable-Formulae.md b/docs/Acceptable-Formulae.md index fa8f6d2ea2..a5e3e94c06 100644 --- a/docs/Acceptable-Formulae.md +++ b/docs/Acceptable-Formulae.md @@ -40,7 +40,7 @@ Software that can upgrade itself does not integrate well with Homebrew formulae' ### We don’t like install scripts that download unversioned things -We don't like install scripts that are pulling from the master branch of Git repositories or unversioned, unchecksummed tarballs. These should ideally use `resource` blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like `cargo`, `gem` and `pip` to download versioned libraries during installation. There's no need to reproduce the functionality of any language package manager with `resource` blocks when we can call it instead. +We don't like install scripts that are pulling from the default branch of Git repositories or unversioned, unchecksummed tarballs. These should ideally use `resource` blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like `cargo`, `gem` and `pip` to download versioned libraries during installation. There's no need to reproduce the functionality of any language package manager with `resource` blocks when we can call it instead. ### We don’t like binary formulae diff --git a/docs/Adding-Software-to-Homebrew.md b/docs/Adding-Software-to-Homebrew.md index 694c0b24aa..306a25926c 100644 --- a/docs/Adding-Software-to-Homebrew.md +++ b/docs/Adding-Software-to-Homebrew.md @@ -222,9 +222,9 @@ Example: 1. The folder `Simple Floating Clock` contains the application `SimpleFloatingClock.app`. 1. So, the `app` stanza should include the subfolder as a relative path: - ```ruby +```ruby app "Simple Floating Clock/SimpleFloatingClock.app" - ``` +``` ### Testing and auditing the cask @@ -271,7 +271,7 @@ Hop into your tap and check to make sure your new cask is there: ```console $ cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask $ git status -On branch master +On branch main Untracked files: (use "git add ..." to include in what will be committed) Casks/m/my-new-cask.rb @@ -353,19 +353,19 @@ Now go to the [`homebrew-cask` GitHub repository](https://github.com/Homebrew/ho ##### c) manually create a pull request on GitHub -Otherwise, click the `Contribute > Open pull request` button and choose to `compare across forks`. The base fork should be `Homebrew/homebrew-cask @ master`, and the head fork should be `my-github-username/homebrew-cask @ my-new-cask-branch`. You can also add any further comments to your pull request at this stage. +Otherwise, click the `Contribute > Open pull request` button and choose to `compare across forks`. The base fork should be `Homebrew/homebrew-cask @ main`, and the head fork should be `my-github-username/homebrew-cask @ my-new-cask-branch`. You can also add any further comments to your pull request at this stage. -##### Congratulations! +##### Congratulations You are done now, and your cask should be pulled in or otherwise noticed in a while. If a maintainer suggests some changes, just make them on the `my-new-cask-branch` branch locally and [push](#pushing). ### Cleaning up -After your pull request is submitted, you should get yourself back onto `master`, so that `brew update` will pull down new casks properly: +After your pull request is submitted, you should get yourself back onto `main`, so that `brew update` will pull down new casks properly: ```bash cd "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask -git checkout master +git checkout main ``` If earlier you set the variable `HOMEBREW_NO_AUTO_UPDATE` and `HOMEBREW_NO_INSTALL_FROM_API` then clean it up with: diff --git a/docs/Autobump.md b/docs/Autobump.md new file mode 100644 index 0000000000..0beaf0bac0 --- /dev/null +++ b/docs/Autobump.md @@ -0,0 +1,33 @@ +--- +last_review_date: "2025-06-16" +--- + +# Autobump + +[BrewTestBot](BrewTestBot.md) automatically checks for available updates of packages that are in Homebrew's "autobump list" for official repositories. These packages should not have to be bumped (i.e versions increased) manually by a contributor. Instead, every 3 hours a GitHub Action opens a new pull request to upgrade to the latest version of a formula/cask, if needed. + +## Excluding packages from autobumping + +By default, all new formulae and casks from [Homebrew/core](https://github.com/Homebrew/homebrew-core) and [Homebrew/cask](https://github.com/Homebrew/homebrew-cask) repositories are autobumped. To exclude a package from being autobumped, it must: + +1. have a `deprecate!` or `disable!` call +2. have a `livecheck do` block containing a `skip` call +3. has no `no_autobump!` call + +There are other formula or cask-specific reasons listed in the Formula Cookbook and Cask Cookbook respectively. + +To use `no_autobump!`, a reason for exclusion must be provided. We prefer use of one of the supported symbols. These can be found in the [`NO_AUTOBUMP_REASONS_LIST`](https://rubydoc.brew.sh/top-level-namespace.html#NO_AUTOBUMP_REASONS_LIST-constant). + +The reasons can be specified by their symbols: + +```ruby +no_autobump! because: :bumped_by_upstream +``` + +If none of the existing reasons fit, a custom reason can be provided as a string: + +```ruby +no_autobump! because: "some unique reason" +``` + +If there are multiple packages with a similar custom reason, it be added to `NO_AUTOBUMP_REASONS_LIST`. diff --git a/docs/Brew-Bundle-and-Brewfile.md b/docs/Brew-Bundle-and-Brewfile.md index 27c7ead3fd..c13a0e741c 100644 --- a/docs/Brew-Bundle-and-Brewfile.md +++ b/docs/Brew-Bundle-and-Brewfile.md @@ -10,7 +10,7 @@ It uses `Brewfile`s to provide a declarative interface for installing/upgrading Rather than specifying the `brew` commands you wish to run, you can specify the state you wish to reach. -See also the [`brew bundle` section of `man brew`](https://docs.brew.sh/Manpage#bundle-subcommand) or `brew bundle --help`. +See also the [`brew bundle` section of `man brew`](Manpage.md#bundle-subcommand) or `brew bundle --help`. ## Basic Usage @@ -86,9 +86,9 @@ Adding a `Brewfile` to a project's repository (like you might a `package.json`, It allows you to tell users to run a single command to install all dependencies for a project and start any services. -As Homebrew supports both macOS, Linux and WSL: you can have this single command setup project dependencies on three operating systems and in continuous integration services like GitHub Actions (where it's installed by default on macOS and easily on Linux with [`Homebrew/actions/setup-homebrew`](https://github.com/Homebrew/actions/tree/master/setup-homebrew)). +As Homebrew supports both macOS, Linux and WSL: you can have this single command setup project dependencies on three operating systems and in continuous integration services like GitHub Actions (where it's installed by default on macOS and easily on Linux with [`Homebrew/actions/setup-homebrew`](https://github.com/Homebrew/actions/tree/HEAD/setup-homebrew)). -See [GitHub's "Scripts To Rule Them All" `script/bootstrap` example](https://github.com/github/scripts-to-rule-them-all/blob/master/script/bootstrap) +See [GitHub's "Scripts To Rule Them All" `script/bootstrap` example](https://github.com/github/scripts-to-rule-them-all/blob/HEAD/script/bootstrap) for how you might use a `Brewfile` and `brew bundle` to install project dependencies with Homebrew. ### `brew bundle dump` diff --git a/docs/Brew-Livecheck.md b/docs/Brew-Livecheck.md index e186436ae4..6f69c0c0c6 100644 --- a/docs/Brew-Livecheck.md +++ b/docs/Brew-Livecheck.md @@ -1,23 +1,26 @@ --- -last_review_date: "1970-01-01" +last_review_date: 2025-05-28 --- # `brew livecheck` The `brew livecheck` command finds the newest version of a formula or cask's software by checking upstream. Livecheck has [strategies](https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy) to identify versions from various sources, such as Git repositories, websites, etc. -## Behavior +## Behaviour When livecheck isn't given instructions for how to check for upstream versions, it does the following by default: -1. For formulae: Collect the `stable`, `head`, and `homepage` URLs, in that order (resources simply use their `url`). For casks: Collect the `url` and `homepage` URLs, in that order. +1. Collect a list of URLs to check. + * For formulae: use their `stable`, `head`, and `homepage` URLs, in that order. + * For formula resources: use their `url`. + * For casks: use their `url` and `homepage` URLs, in that order. 1. Determine if any strategies apply to the first URL. If not, try the next URL. 1. If a strategy can be applied, use it to check for new versions. 1. Return the newest version (or an error if versions could not be found at any available URLs). -It's sometimes necessary to override this default behavior to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block. +It's sometimes necessary to override this default behaviour to create a working check. If a source doesn't provide the newest version, we need to check a different one. If livecheck doesn't correctly match version text, we need to provide an appropriate regex or `strategy` block. -This can be accomplished by adding a `livecheck` block to the formula/cask/resource. For more information on the available methods, please refer to the [`Livecheck` class documentation](https://rubydoc.brew.sh/Livecheck). +This can be accomplished by adding a `livecheck` block to the formula/cask/resource. For more information on the available methods, please refer to the [`Livecheck` class](https://rubydoc.brew.sh/Livecheck) documentation. ## Creating a check @@ -47,9 +50,9 @@ The `livecheck` block regex restricts matches to a subset of the fetched content * **Regexes should be made case insensitive, whenever possible**, by adding `i` at the end (e.g. `/.../i` or `%r{...}i`). This improves reliability, as the regex will handle changes in letter case without needing modifications. -* **Regexes should only use a capturing group around the version text**. For example, in `/href=.*?example-v?(\d+(?:\.\d+)+)(?:-src)?\.t/i`, we're only using a capturing group around the version test (matching a version like `1.2`, `1.2.3`, etc.) and we're using non-capturing groups elsewhere (e.g. `(?:-src)?`). +* **Regexes should only use a capturing group around the version text**. For example, in `/href=.*?example-v?(\d+(?:\.\d+)+)(?:-src)?\.t/i`, we're only using a capturing group around the version text (matching a version like `1.2`, `1.2.3`, etc.) and we're using non-capturing groups elsewhere (e.g. `(?:-src)?`). -* **Anchor the start/end of the regex, to restrict the scope**. For example, on HTML pages we often match file names or version directories in `href` attribute URLs (e.g. `/href=.*?example[._-]v?(\d+(?:\.\d+)+)\.zip/i`). The general idea is that limiting scope will help exclude unwanted matches. +* **Anchor the start/end of the regex to restrict its scope**. For example, on HTML pages we often match file names or version directories in `href` attribute URLs (e.g. `/href=.*?example[._-]v?(\d+(?:\.\d+)+)\.zip/i`). The general idea is that limiting scope will help exclude unwanted matches. * **Avoid generic catchalls like `.*` or `.+`** in favor of something non-greedy and/or contextually appropriate. For example, to match characters within the bounds of an HTML attribute, use `[^"' >]+?`. @@ -112,9 +115,17 @@ end The referenced formula/cask should be in the same tap, as a reference to a formula/cask from another tap will generate an error if the user doesn't already have it tapped. +A formula resource whose version stays in sync with its parent formula versioning can use the same check with `formula :parent`. + +```ruby +livecheck do + formula :parent +end +``` + ### `POST` requests -Some checks require making a `POST` request and that can be accomplished by adding a `post_form` or `post_json` option to a `livecheck` block `url`. +Some checks require making a `POST` request, which can be accomplished by adding a `post_form` or `post_json` option to a `livecheck` block `url`. ```ruby livecheck do @@ -126,7 +137,7 @@ livecheck do end ``` -`post_form` is used for form data and `post_json` is used for JSON data. livecheck will encode the provided hash value to the appropriate format before making the request. +`post_form` is used for form data and `post_json` is used for JSON data. Livecheck will encode the provided hash value to the appropriate format before making the request. `POST` support only applies to strategies that use `Strategy::page_headers` or `::page_content` (directly or indirectly), so it does not apply to `ExtractPlist`, `Git`, `GithubLatest`, `GithubReleases`, etc. @@ -219,7 +230,7 @@ end A `strategy` block for `GithubLatest` receives the parsed JSON data from the GitHub API for a repository's "latest" release, along with a regex. When a regex is not provided in a `livecheck` block, the strategy's default regex is passed into the `strategy` block instead. -By default, the strategy matches version text in the release's tag or title but a `strategy` block can be used to check any of the fields in the release JSON. The logic in the following `strategy` block is similar to the default behavior but only checks the release tag instead, for the sake of demonstration: +By default, the strategy matches version text in the release's tag or title but a `strategy` block can be used to check any of the fields in the release JSON. The logic in the following `strategy` block is similar to the default behaviour but only checks the release tag instead, for the sake of demonstration: ```ruby livecheck do @@ -240,7 +251,7 @@ You can find more information on the response JSON from this API endpoint in the A `strategy` block for `GithubReleases` receives the parsed JSON data from the GitHub API for a repository's most recent releases, along with a regex. When a regex is not provided in a `livecheck` block, the strategy's default regex is passed into the `strategy` block instead. -By default, the strategy matches version text in each release's tag or title but a `strategy` block can be used to check any of the fields in the release JSON. The logic in the following `strategy` block is similar to the default behavior but only checks the release tag instead, for the sake of demonstration: +By default, the strategy matches version text in each release's tag or title but a `strategy` block can be used to check any of the fields in the release JSON. The logic in the following `strategy` block is similar to the default behaviour but only checks the release tag instead, for the sake of demonstration: ```ruby livecheck do @@ -343,7 +354,7 @@ A `strategy` block for `Sparkle` receives an `item` which has methods for the `v brew find-appcast '/path/to/application.app' ``` -The default pattern for the `Sparkle` strategy is to generate `"#{item.short_version},#{item.version}"` from `sparkle:shortVersionString` and `sparkle:version` if both are set. In the example below, the `url` also includes a download ID which is needed: +The default pattern for the `Sparkle` strategy is to generate `"#{item.short_version},#{item.version}"` from `sparkle:shortVersionString` and `sparkle:version` if both are set. In the example below, the returned value also includes a needed download ID from the `url`: ```ruby livecheck do @@ -363,6 +374,17 @@ livecheck do end ``` +If the value returned by `item` is not the most recent or not what's desired, passing `items` instead will allow iterating over all the items in the feed: + +```ruby +livecheck do + url "https://www.example.com/example.xml" + strategy :sparkle do |items| + items.find { |item| item.channel.nil? }&.short_version + end +end +``` + #### `Xml` `strategy` block A `strategy` block for `Xml` receives an `REXML::Document` object and, if provided, a regex. For example, if the XML contains a `versions` element with nested `version` elements and their inner text contains the version string, we could extract it using a regex as follows: @@ -416,6 +438,20 @@ livecheck do end ``` +Note that if a package uses this livecheck strategy it will be excluded from [autobumping](Autobump.md) as this strategy has negative impact on CI time. + +### `throttle` + +For software with extremely frequent releases that don't all need to be published as formula/cask updates, livecheck can be set to reduce how many versions it surfaces by using `throttle`. In this example, only versions whose last component is divisible by 10 will be returned. + +```ruby +livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + throttle 10 +end +``` + ### `skip` Livecheck automatically skips some formulae/casks for a number of reasons (deprecated, disabled, etc.). However, on rare occasions we need to use a `livecheck` block to do a manual skip. The `skip` method takes a string containing a very brief reason for skipping. diff --git a/docs/Cask-Cookbook.md b/docs/Cask-Cookbook.md index 7d750b8ac4..32684f0fef 100644 --- a/docs/Cask-Cookbook.md +++ b/docs/Cask-Cookbook.md @@ -56,6 +56,8 @@ Having a common order for stanzas makes casks easier to update and parse. Below livecheck + no_autobump! + deprecate! disable! @@ -173,6 +175,7 @@ Each cask must declare one or more [artifacts](https://rubydoc.brew.sh/Cask/Arti | `container nested:` | no | Relative path to an inner container that must be extracted before moving on with the installation. This allows for support of `.dmg` inside `.tar`, `.zip` inside `.dmg`, etc. (Example: [blocs.rb](https://github.com/Homebrew/homebrew-cask/blob/aa461148bbb5119af26b82cccf5003e2b4e50d95/Casks/b/blocs.rb#L17-L19)) | | `container type:` | no | Symbol to override container-type autodetect. May be one of: `:air`, `:bz2`, `:cab`, `:dmg`, `:generic_unar`, `:gzip`, `:otf`, `:pkg`, `:rar`, `:seven_zip`, `:sit`, `:tar`, `:ttf`, `:xar`, `:zip`, `:naked`. (Example: [parse.rb](https://github.com/Homebrew/homebrew-cask/blob/aa461148bbb5119af26b82cccf5003e2b4e50d95/Casks/p/parse.rb#L10)) | | `auto_updates` | no | `true`. Asserts that the cask artifacts auto-update. Use if `Check for Updates…` or similar is present in an app menu, but not if it only opens a webpage and does not do the download and installation for you. | +| [`no_autobump!`](#stanza-no_autobump) | no | Allowed symbol or a string. Excludes cask from autobumping if set. | ## Stanza descriptions @@ -641,6 +644,24 @@ Every `livecheck` block must contain a `url`, which can be either a string or a Refer to the [`brew livecheck`](Brew-Livecheck.md) documentation for how to write a `livecheck` block. +### Stanza: `no_autobump!` + +The `no_autobump!` stanza excludes the cask for autobump list. That means the future updates will be handled by Homebrew contributors rather than by an automated process. + +To use this stanza, a reason must be provided. The preferred way is to use one of the available symbols. These symbols can be found in the [`NO_AUTOBUMP_REASONS_LIST`](https://rubydoc.brew.sh/top-level-namespace.html#NO_AUTOBUMP_REASONS_LIST-constant). + +```ruby +no_autobump! because: :incompatible_version_format +``` + +A custom reason can be provided if none of the available symbols fits: + +```ruby +no_autobump! because: "some unique reason" +``` + +Refer to [Autobump](Autobump.md) page for more information about the autobump process in Homebrew. + ### Stanza: `name` `name` accepts a UTF-8 string defining the name of the software, including capitalization and punctuation. It is used to help with searchability and disambiguation. @@ -1149,7 +1170,7 @@ The special value `version :latest` is used when: * `url` does not contain any version information and there is no way to retrieve the version using a `livecheck`, or * having a correct value for `version` is too difficult or impractical, even with our automated systems. For example, [chromium.rb](https://github.com/Homebrew/homebrew-cask/blob/aa461148bbb5119af26b82cccf5003e2b4e50d95/Casks/c/chromium.rb#L4) which releases multiple versions per day. -In both cases, using the special value [`sha256 :no_check`](#special-value-no_check) is also required. +In both cases, using the special value [`sha256 :no_check`](#special-value-no_check) is also required. Casks that use `version :latest` are excluded from [autobumping](Autobump.md). ### Stanza: `zap` @@ -1321,6 +1342,7 @@ Software vendors are often inconsistent with their naming. By enforcing strict n * Prevent duplicate submissions * Minimize renaming events * Unambiguously boil down the name of the software into a unique identifier +* Avoid conflicts with Homebrew/homebrew-core formulae Details of software names and brands will inevitably be lost in the conversion to a minimal token. To capture the vendor’s full name for a distribution, use the [`name`](#stanza-name) within a cask, which accepts an unrestricted UTF-8 string. @@ -1362,7 +1384,9 @@ Details of software names and brands will inevitably be lost in the conversion t * If the result of this process is a generic term, such as “Macintosh Installer”, try prepending the name of the vendor or developer, followed by a hyphen. If that doesn’t work, then just create the best name you can, based on the vendor’s web page. -* If the result conflicts with the name of an existing cask, make yours unique by prepending the name of the vendor or developer, followed by a hyphen. Example: [unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/u/unison.rb) and [panic-unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/p/panic-unison.rb). +* If the result conflicts with the name of an existing cask or Homebrew/homebrew-core formula, make yours unique by prepending the name of the vendor or developer, followed by a hyphen. Example: [unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/u/unison.rb) and [panic-unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/p/panic-unison.rb). + +* If the result still conflicts with the name of an existing Homebrew/homebrew-core formula, adjust the name to better describe the difference by e.g. appending `-app`. Example: `appium` formula and `appium-desktop` cask, `angband` formula and `angband-app` cask. * Inevitably, there are a small number of exceptions not covered by the rules. Don’t hesitate to [use the forum](https://github.com/orgs/Homebrew/discussions) if you have a problem. diff --git a/docs/Common-Issues-for-Core-Contributors.md b/docs/Common-Issues-for-Core-Contributors.md index afe762643b..a7b29460a8 100644 --- a/docs/Common-Issues-for-Core-Contributors.md +++ b/docs/Common-Issues-for-Core-Contributors.md @@ -21,7 +21,7 @@ Alternative instructions using `pr-pull`: * `git reset --hard ` in `homebrew/core` to reset to the commit before all the commits created by `brew pr-pull`. * `brew pr-pull ` to upload the right bottles. Add the `--warn-on-upload-failure` switch if the bottles have been partially uploaded and you're certain that the bottle checksums will match the checksums already present in the `bottle do` block of the formula. -* `git reset --hard origin/master` to return to the latest commit and discard the commits made by `brew pr-pull`. +* `git reset --hard origin/HEAD` to return to the latest commit and discard the commits made by `brew pr-pull`. ### `ld: internal error: atom not found in symbolIndex(__ZN10SQInstance3GetERK11SQObjectPtrRS0_) for architecture x86_64` diff --git a/docs/Common-Issues.md b/docs/Common-Issues.md index 30d29ae5de..cc4d2c122a 100644 --- a/docs/Common-Issues.md +++ b/docs/Common-Issues.md @@ -110,8 +110,8 @@ Don't follow the advice here but fix by using When installing Homebrew, if the initial download fails with something like: - error: Not a valid ref: refs/remotes/origin/master - fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree. + error: Not a valid ref: refs/remotes/origin/main + fatal: ambiguous argument 'refs/remotes/origin/main': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' @@ -229,7 +229,7 @@ Help us by [submitting a fix](https://github.com/Homebrew/homebrew-cask/blob/HEA ### Cask - source is not there -First, you need to identify which artifact is not being handled correctly anymore. It’s explicit in the error message: if it says `It seems the App source…'` then the problem is with the [`app`](https://docs.brew.sh/Cask-Cookbook#stanza-app) stanza. This pattern is the same across [all artifacts](https://docs.brew.sh/Cask-Cookbook#at-least-one-artifact-stanza-is-also-required). +First, you need to identify which artifact is not being handled correctly anymore. It’s explicit in the error message: if it says `It seems the App source…'` then the problem is with the [`app`](Cask-Cookbook.md#stanza-app) stanza. This pattern is the same across [all artifacts](Cask-Cookbook.md#at-least-one-artifact-stanza-is-also-required). Fixing this error is typically easy, and requires only a bit of time on your part. Start by downloading the package for the cask: `brew fetch `. The last line of output will inform you of the location of the download. Navigate there and manually unpack it. As an example, let's say the structure inside the archive is as follows: @@ -246,19 +246,19 @@ Now, if we find this when looking at the cask with `brew cat `: The cask expects `SomeApp.app` to be in the top directory of the archive (see how it says simply `SomeApp.app`) but the developer has since moved it to be inside a `Files` directory. All we have to do is update that line of the cask to follow the new structure: `app "Files/SomeApp.app"`. -Note that occasionally the app’s name changes completely (from `SomeApp.app` to `OtherApp.app`, let's say). In these instances, the filename of the cask itself, as well as its token, must also change. Consult the [`token reference`](https://docs.brew.sh/Cask-Cookbook#token-reference) for complete instructions on the new name. +Note that occasionally the app’s name changes completely (from `SomeApp.app` to `OtherApp.app`, let's say). In these instances, the filename of the cask itself, as well as its token, must also change. Consult the [`token reference`](Cask-Cookbook.md#token-reference) for complete instructions on the new name. Help us by [submitting a fix](https://github.com/Homebrew/homebrew-cask/blob/HEAD/CONTRIBUTING.md#updating-a-cask). If you get stumped, [open an issue](https://github.com/Homebrew/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and where you’re having trouble. ### Cask - wrong number of arguments -Make sure the issue really lies with your macOS version. To do so, try to install the software manually. If it is incompatible with your macOS version, it will tell you. In that case, there is nothing we can do to help you install the software, but we can add a [`depends_on macos:`](https://docs.brew.sh/Cask-Cookbook#depends_on-macos) stanza to prevent the cask from being installed on incompatible macOS versions. +Make sure the issue really lies with your macOS version. To do so, try to install the software manually. If it is incompatible with your macOS version, it will tell you. In that case, there is nothing we can do to help you install the software, but we can add a [`depends_on macos:`](Cask-Cookbook.md#depends_on-macos) stanza to prevent the cask from being installed on incompatible macOS versions. Help us by [submitting a fix](https://github.com/Homebrew/homebrew-cask/blob/HEAD/CONTRIBUTING.md#updating-a-cask). If you get stumped, [open an issue](https://github.com/Homebrew/homebrew-cask/issues/new?template=01_bug_report.md) explaining your steps so far and where you’re having trouble. ## Other local issues -If your Homebrew installation gets messed up (and fixing the issues found by `brew doctor` doesn't solve the problem), reinstalling Homebrew may help to reset to a normal state. To easily reinstall Homebrew, use `brew bundle` to automatically restore your installed formulae and casks. To do so, run `brew bundle dump`, [uninstall](https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew), [reinstall](https://docs.brew.sh/Installation) and run `brew bundle install`. +If your Homebrew installation gets messed up (and fixing the issues found by `brew doctor` doesn't solve the problem), reinstalling Homebrew may help to reset to a normal state. To easily reinstall Homebrew, use `brew bundle` to automatically restore your installed formulae and casks. To do so, run `brew bundle dump`, [uninstall](FAQ.md#how-do-i-uninstall-homebrew), [reinstall](Installation.md) and run `brew bundle install`. ## Possible `curl` issues diff --git a/docs/FAQ.md b/docs/FAQ.md index 7ea38280ca..6dca0305e5 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -222,7 +222,7 @@ There are a few ideas to fix this problem: So we let software be. Anything installed with Homebrew Cask should behave the same as if it were installed manually. But since we also want to support software that doesn’t self-upgrade, we add [`auto_updates true`](https://github.com/Homebrew/homebrew-cask/blob/aa461148bbb5119af26b82cccf5003e2b4e50d95/Casks/a/alfred.rb#L18) to casks for software that does, which excludes them from `brew upgrade`. -Casks which use `version :latest` are also excluded, because we have no way to track their installed version. It helps to ask the developers of such software to provide versioned releases (i.e. include the version in the path of the download `url`). +Casks which use [`version :latest`](Cask-Cookbook.md#special-value-latest) are also excluded, because we have no way to track their installed version. It helps to ask the developers of such software to provide versioned releases (i.e. include the version in the path of the download `url`). If you still want to force software to be upgraded via Homebrew Cask, you can reference it specifically in the `upgrade` command: diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index 94d1285545..9c8f169978 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -33,7 +33,7 @@ A *formula* is a package definition written in Ruby. It can be created with `bre Homebrew uses Git for storing formulae and contributing to the project. -As of [Homebrew 4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/), formulae are downloaded as JSON from which is automatically regenerated by a scheduled [Homebrew/formulae.brew.sh](https://github.com/Homebrew/formulae.brew.sh) job from the `master` branch of the Homebrew/homebrew-core repository. +As of [Homebrew 4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/), formulae are downloaded as JSON from which is automatically regenerated by a scheduled [Homebrew/formulae.brew.sh](https://github.com/Homebrew/formulae.brew.sh) job from the default branch of the Homebrew/homebrew-core repository. Homebrew installs formulae to the Cellar at `$(brew --cellar)` and then symlinks some of the installation into the prefix at `$(brew --prefix)` (e.g. `/opt/homebrew`) so that other programs can see what's going on. We suggest running `brew ls` on a few of the kegs in your Cellar to see how it is all arranged. @@ -43,7 +43,7 @@ Packages are installed according to their formulae. Read over a simple one, e.g. Make sure you run `brew update` before you start. This ensures your Homebrew installation is a Git repository. -To create or edit formulae locally, you'll need to first [tap `homebrew/core`](https://docs.brew.sh/FAQ#can-i-edit-formulae-myself) if you haven't previously. This clones the Homebrew/homebrew-core Git repository to `$(brew --repository homebrew/core)`. As you're developing, you'll also need to set `HOMEBREW_NO_INSTALL_FROM_API=1` in your shell environment or before any `install`, `reinstall` or `upgrade` commands to force `brew` to use the local repository instead of the API. +To create or edit formulae locally, you'll need to first [tap `homebrew/core`](FAQ.md#can-i-edit-formulae-myself) if you haven't previously. This clones the Homebrew/homebrew-core Git repository to `$(brew --repository homebrew/core)`. As you're developing, you'll also need to set `HOMEBREW_NO_INSTALL_FROM_API=1` in your shell environment or before any `install`, `reinstall` or `upgrade` commands to force `brew` to use the local repository instead of the API. Before submitting a new formula make sure your package: @@ -322,7 +322,7 @@ Some advice for specific cases: * If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples. A good example is [`tinyxml2`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/t/tinyxml2.rb)'s test, which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully. * If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc. * If the software cannot function without credentials or requires a virtual machine, docker instance, etc. to run, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected. This is preferred over mocking a dependency. -* Homebrew comes with a number of [standard test fixtures](https://github.com/Homebrew/brew/tree/master/Library/Homebrew/test/support/fixtures), including numerous sample images, sounds, and documents in various formats. You can get the file path to a test fixture with e.g. `test_fixtures("test.svg")`. +* Homebrew comes with a number of [standard test fixtures](https://github.com/Homebrew/brew/tree/HEAD/Library/Homebrew/test/support/fixtures), including numerous sample images, sounds, and documents in various formats. You can get the file path to a test fixture with e.g. `test_fixtures("test.svg")`. * If your test requires a test file that isn't a standard test fixture, you can install it from a source repository during the `test` phase with a [`resource`](https://rubydoc.brew.sh/Formula#resource-class_method) block, like this: ```ruby @@ -402,7 +402,7 @@ brew update # required in more ways than you think (initialises the Homebrew/bre cd "$(brew --repository homebrew/core)" # Create a new git branch for your formula so your pull request is easy to # modify if any changes come up during review. -git checkout -b origin/master +git checkout -b origin/HEAD git add Formula/f/foo.rb git commit ``` @@ -427,13 +427,13 @@ Now you just need to push your commit to GitHub. If you haven’t forked Homebrew yet, [go to the Homebrew/homebrew-core repository and hit the Fork button](https://github.com/Homebrew/homebrew-core). -If you have already forked Homebrew on GitHub, then you can manually push (just make sure you have been pulling from the `Homebrew/homebrew-core` master): +If you have already forked Homebrew on GitHub, then you can manually push (just make sure you have been pulling from the `Homebrew/homebrew-core` default branch): ```sh git push https://github.com/myname/homebrew-core/ ``` -Now, [open a pull request](https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request) for your changes. +Now, [open a pull request](How-To-Open-a-Homebrew-Pull-Request.md) for your changes. * One formula per commit; one commit per formula. * Keep merge commits out of the pull request. @@ -517,7 +517,7 @@ The `std_*_args` methods, as well as the arguments they pass, are: "-o=#{output}" ``` -It also provides a convenient way to set `-ldflags`, `-gcflags`, and `-tags`, see examples: [`babelfish`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/b/babelfish.rb) and [`wazero`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/w/wazero.rb) formulae. +It also provides a convenient way to set `-ldflags`, `-gcflags`, and `-tags`, see examples: [`babelfish`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/b/babelfish.rb) and [`wazero`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/w/wazero.rb) formulae. #### `std_meson_args` @@ -643,7 +643,7 @@ stable do end ``` -Embedded (__END__) patches can be declared like so: +Embedded (**END**) patches can be declared like so: ```ruby patch :DATA @@ -746,35 +746,43 @@ end For `url`/`regex` guidelines and additional `livecheck` block examples, refer to the [`brew livecheck` documentation](Brew-Livecheck.md). For more technical information on the methods used in a `livecheck` block, please refer to the [`Livecheck` class documentation](https://rubydoc.brew.sh/Livecheck). -### Unstable versions (`head`) +### Excluding formula from autobumping -Formulae can specify an alternate download for the upstream project’s development cutting-edge source (e.g. `master`/`main`/`trunk`) using [`head`](https://rubydoc.brew.sh/Formula#head-class_method), which can be activated by passing `--HEAD` when installing. Specifying it is done in the same manner as [`url`](https://rubydoc.brew.sh/Formula#url-class_method): +By default, all new formulae in the Homebrew/core repository are autobumped. It means that future updates will be handled automatically by Homebrew CI jobs, and contributors do not have to do it manually. + +Sometimes, we want to exclude a formula from this list, for one reason or another. It can be done by adding the `no_autobump!` method in the formula definition, for example: ```ruby class Foo < Formula # ... - head "https://github.com/some/package.git", branch: "main" # the default is "master" -end -``` + url "https://example.com/foo-1.0.tar.gz" -You can also bundle the URL and any `head`-specific dependencies and resources in a `head do` block. - -```ruby -class Foo < Formula - # ... - - head do - url "https://svn.code.sf.net/p/project/code/trunk" - depends_on "pkg-config" => :build + livecheck do + url "https://example.com/foo/download.html" + regex(/href=.*?foo[._-]v?(\d+(?:\.\d+)+)\.t/i) end + + no_autobump! because: :bumped_by_upstream end ``` -You can test whether the [`head`](https://rubydoc.brew.sh/Formula#head-class_method) is being built with `build.head?` in the `install` method. +To use this method, a reason must be provided. The preferred way is to use one of the available symbols. These reasons can be found in the [`NO_AUTOBUMP_REASONS_LIST`](https://rubydoc.brew.sh/top-level-namespace.html#NO_AUTOBUMP_REASONS_LIST-constant). + +```ruby +no_autobump! because: :incompatible_version_format +``` + +A custom reason can be provided if none of the available symbols fits: + +```ruby +no_autobump! because: "some unique reason" +``` + +More information about the autobump process can be found on the [Autobump](Autobump.md) page. ### URL download strategies -When parsing a download URL, Homebrew auto-detects the resource type it points to, whether archive (e.g. tarball, zip) or version control repository (e.g. Git, SVN, Mercurial) and chooses an appropriate download strategy. Some strategies can be passed additional options to alter what's downloaded. For example, to use a specific commit, tag, or branch from a repository, specify [`url`](https://rubydoc.brew.sh/Formula#url-class_method) or [`head`](https://rubydoc.brew.sh/Formula#head-class_method) with the `:tag` and `:revision`, `:revision`, or `:branch` options, like so: +When parsing a download URL, Homebrew auto-detects the resource type it points to, whether archive (e.g. tarball, zip) or version control repository (e.g. Git, Subversion, Mercurial) and chooses an appropriate download strategy. Some strategies can be passed additional options to alter what's downloaded. For example, to fetch a formula's source code and infer its version number from a specific tag in a Git repository (useful for packages that rely on Git submodules), specify [`url`](https://rubydoc.brew.sh/Formula#url-class_method) with the `:tag` and `:revision` options, like so: ```ruby class Foo < Formula @@ -785,7 +793,28 @@ class Foo < Formula end ``` -If not inferable, specify which of Homebrew’s built-in download strategies to use with the `using:` option. For example: +If fetching from a Subversion or Mercurial repository, specify `revision` and `version` separately: + +```ruby +class Bar < Formula + # ... + url "https://svn.code.sf.net/p/package/code/stable", revision: "4687" + version "12.1.8" +end +``` + +To fetch specific revisions of Subversion externals, specify `revisions`: + +```ruby +class Baz < Formula + # ... + url "svn://source.something.org/package/trunk/", + revisions: { trunk: "22916", "libsomething" => "31045" } + version "7.2.11" +end +``` + +If not inferable, specify which of Homebrew's built-in download strategies to use with the `using:` option. For example: ```ruby class Nginx < Formula @@ -799,18 +828,18 @@ end Homebrew offers these anonymous download strategies. -| `:using` value | download strategy | -| ---------------- | ----------------------------- | -| `:bzr` | `BazaarDownloadStrategy` | -| `:curl` | `CurlDownloadStrategy` | -| `:cvs` | `CVSDownloadStrategy` | -| `:fossil` | `FossilDownloadStrategy` | -| `:git` | `GitDownloadStrategy` | -| `:hg` | `MercurialDownloadStrategy` | -| `:homebrew_curl` | `HomebrewCurlDownloadStrategy` | -| `:nounzip` | `NoUnzipCurlDownloadStrategy` | -| `:post` | `CurlPostDownloadStrategy` | -| `:svn` | `SubversionDownloadStrategy` | +| `using:` value | download strategy | requirements | +| ---------------- | -------------------------------- | ------------ | +| `:bzr` | fetch from Bazaar repository | `breezy` installed | +| `:curl` | download using `curl` (default) | | +| `:cvs` | fetch from CVS repository | `cvs` installed | +| `:fossil` | fetch from Fossil repository | `fossil` installed | +| `:git` | fetch from Git repository | `git` installed | +| `:hg` | fetch from Mercurial repository | `hg` installed | +| `:homebrew_curl` | download using brewed `curl` | `curl` installed | +| `:nounzip` | download without decompressing | | +| `:post` | download using `curl` via POST | `data:` [hash of parameters](Cask-Cookbook.md#additional-url-parameters) | +| `:svn` | fetch from Subversion repository | `svn` installed | If you need more control over the way files are downloaded and staged, you can create a custom download strategy and specify it with the `:using` option: @@ -828,6 +857,42 @@ class Foo < Formula end ``` +### Unstable versions (`head`) + +Formulae can specify an alternate download for the upstream project's development/cutting-edge source (e.g. `master`/`main`/`trunk`) using [`head`](https://rubydoc.brew.sh/Formula#head-class_method), which can be activated by passing `--HEAD` when installing. Specifying it is done in the same manner as [`url`](https://rubydoc.brew.sh/Formula#url-class_method), with added conventions for fetching from version control repositories: + +* Git repositories need `branch:` specified to fetch a branch other than "master". If the repository is very large, specify `only_path` to [limit the checkout to one path](Cask-Cookbook.md#git-urls). + + ```sh +head "https://github.com/some/package.git", branch: "main" + ``` + +* Mercurial repositories need `branch:` specified to fetch a branch other than "default". + +* Subversion repositories can specify `trust_cert: true` to [skip interactive certificate prompts](Cask-Cookbook.md#subversion-urls). + +* CVS repositories can specify `module:` to check out a specific module. + +You can also bundle the URL and any `head`-specific dependencies and resources in a `head do` block. + +```ruby +class Foo < Formula + # ... + + head do + url "https://hg.sr.ht/~user/foo", using: :hg, branch: "develop" + + depends_on "pkg-config" => :build + + resource "package" do + url "https://github.com/other/package.git", branch: "main" + end + end +end +``` + +You can test whether the [`head`](https://rubydoc.brew.sh/Formula#head-class_method) is being built with `build.head?` in the `install` method. + ### Compiler selection Sometimes a package fails to build when using a certain compiler. Since recent [Xcode versions](Xcode.md) no longer include a GCC compiler we cannot simply force the use of GCC. Instead, the correct way to declare this is with the [`fails_with`](https://rubydoc.brew.sh/Formula#fails_with-class_method) DSL method. A properly constructed [`fails_with`](https://rubydoc.brew.sh/Formula#fails_with-class_method) block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example: @@ -1296,11 +1361,11 @@ Packages requiring MPI should use [OpenMPI](https://www.open-mpi.org/) by adding Packages requiring BLAS/LAPACK linear algebra interfaces should link to [OpenBLAS](https://www.openblas.net/) by adding `depends_on "openblas"` and (if built with CMake) passing `-DBLA_VENDOR=OpenBLAS` to CMake, rather than Apple's Accelerate framework or the default reference `lapack` implementation. Apple's implementation of BLAS/LAPACK is outdated and may introduce hard-to-debug problems. The reference `lapack` formula is fine, although it is not actively maintained or tuned. -## How to start over (reset to upstream `master`) +## How to start over (reset to upstream) -Have you created a real mess in Git which stops you from creating a commit you want to submit to us? You might want to consider starting again from scratch. Your changes to the Homebrew `master` branch can be reset by running: +Have you created a real mess in Git which stops you from creating a commit you want to submit to us? You might want to consider starting again from scratch. Your changes to the Homebrew `main` branch can be reset by running: ```sh -git checkout -f master -git reset --hard origin/master +git checkout -f main +git reset --hard origin/HEAD ``` diff --git a/docs/Homebrew-Leadership-Responsibilities.md b/docs/Homebrew-Leadership-Responsibilities.md index e007d29f6e..ae2c472ba8 100644 --- a/docs/Homebrew-Leadership-Responsibilities.md +++ b/docs/Homebrew-Leadership-Responsibilities.md @@ -34,12 +34,12 @@ last_review_date: "1970-01-01" - Ask someone to bring a conference/table microphone for people to be able to remotely participate in AGM - Reconsider current OpenCollective invoice hourly rates based on e.g. inflation - February after the AGM: - - Add the minutes of the AGM to Homebrew/brew's [governance archives](https://github.com/Homebrew/brew/tree/master/docs/governance) + - Add the minutes of the AGM to Homebrew/brew's [governance archives](https://github.com/Homebrew/brew/tree/HEAD/docs/governance) - Create an [issue in Homebrew/brew](https://github.com/Homebrew/brew/issues?q=is%3Aissue+in%3Atitle+membership+) to survey members who did not vote in the election whether they wish to remain or step down as members - Members that are not maintainers should be a least one of: - An current or previously active maintainer, PLC/TSC member or Project Leader - A long-standing member of the Homebrew community (e.g. been submitting good bug reports for over two years) - - After the survey issue is closed, list the current year's members in a new file within the [governance archives](https://github.com/Homebrew/brew/tree/master/docs/governance) + - After the survey issue is closed, list the current year's members in a new file within the [governance archives](https://github.com/Homebrew/brew/tree/HEAD/docs/governance) - October: arrange in-person AGM - Offer to pay for Homebrew maintainers who are at least one of: - active Homebrew maintainers (i.e. not just contributors) diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md index d8283b3ccc..525d92fd68 100644 --- a/docs/Homebrew-and-Python.md +++ b/docs/Homebrew-and-Python.md @@ -11,7 +11,7 @@ Homebrew will install the necessary Python 3 version that is needed to make your ## Python 3 Homebrew provides formulae for the newest and maintained releases of Python 3 (`python@3.y`) (). -We keep older `python@3.y` versions according to our [versioned formulae guidelines](https://docs.brew.sh/Versions). +We keep older `python@3.y` versions according to our [versioned formulae guidelines](Versions.md). **Important:** Python may be upgraded to a newer version at any time. Consider using a version manager such as `pyenv` if you require stability of minor or patch versions for virtual environments. diff --git a/docs/Homebrew-brew-Maintainer-Guide.md b/docs/Homebrew-brew-Maintainer-Guide.md index ed60b143df..b02389f256 100644 --- a/docs/Homebrew-brew-Maintainer-Guide.md +++ b/docs/Homebrew-brew-Maintainer-Guide.md @@ -46,7 +46,7 @@ A coverage report is generated by Codecov for every PR, and its results are show Codecov should be used as a guide to indicate when more tests are probably needed, but it's unrealistic for every line of code to have a test associated with it, especially when testing would require a slow integration test. For this reason, it's okay to merge PRs that fail the Codecov check if necessary, but this should be avoided if possible. -CodeCov also monitors CI jobs for every push to `Homebrew/brew` to detect flaky tests and track them over time. The reports are available on [CodeCov](https://app.codecov.io/gh/Homebrew/brew/tests/master). +CodeCov also monitors CI jobs for every push to `Homebrew/brew` to detect flaky tests and track them over time. The reports are available on [CodeCov](https://app.codecov.io/gh/Homebrew/brew/tests/main). CodeCov can be used as a guide to identify which flaky tests are causing the most disruption to the CI suite. To make the biggest improvements to the reliability of the build, we can focus on the most disruptive flaky tests first (i.e. the tests causing the most intermittent failures). diff --git a/docs/Homebrew-homebrew-cask-Maintainer-Guide.md b/docs/Homebrew-homebrew-cask-Maintainer-Guide.md index 078c46f1bf..8bf3ed4d6e 100644 --- a/docs/Homebrew-homebrew-cask-Maintainer-Guide.md +++ b/docs/Homebrew-homebrew-cask-Maintainer-Guide.md @@ -30,4 +30,4 @@ Finally, make sure to thank the contributor for submitting a PR! ## Other Tips -A maintainer can easily rebase a PR onto the latest `master` branch by adding a `/rebase` comment. `BrewTestBot` will automatically rebase the PR and add a reaction to the comment once the rebase is in progress and complete. +A maintainer can easily rebase a PR onto the latest default branch by adding a `/rebase` comment. `BrewTestBot` will automatically rebase the PR and add a reaction to the comment once the rebase is in progress and complete. diff --git a/docs/Homebrew-homebrew-core-Maintainer-Guide.md b/docs/Homebrew-homebrew-core-Maintainer-Guide.md index 7d2ea6addf..69d797ec48 100644 --- a/docs/Homebrew-homebrew-core-Maintainer-Guide.md +++ b/docs/Homebrew-homebrew-core-Maintainer-Guide.md @@ -33,7 +33,7 @@ PRs modifying formulae that don't need bottles or making changes that don't requ Otherwise, you should use `brew pr-pull` (or `rebase`/`cherry-pick` contributions). -Don’t `rebase` until you finally `push`. Once `master` is pushed, you can’t `rebase`: **you’re a maintainer now!** +Don’t `rebase` until you finally `push`. Once `main` is pushed, you can’t `rebase`: **you’re a maintainer now!** Cherry-picking changes the date of the commit, which kind of sucks. @@ -172,7 +172,7 @@ For an explanation of why this happens, read the [Ubuntu 11.04 Toolchain documen Some formulae (e.g. Python, OpenSSL, ICU, Boost) have a large number of dependents. This makes updating these formulae (or their dependents) difficult because the standard procedure involves updating a large number of formulae in a single pull request. An alternative procedure that can significantly simplify this process is to use a staging branch. -The idea of using a staging branch is to merge updates and publish bottles for the affected formula to a non-default branch. This allows work to be done incrementally in smaller PRs, instead of in one giant PR that touches many formulae. When the staging branch is ready, it can be merged to the `master`/default branch. +The idea of using a staging branch is to merge updates and publish bottles for the affected formula to a non-default branch. This allows work to be done incrementally in smaller PRs, instead of in one giant PR that touches many formulae. When the staging branch is ready, it can be merged to the `main`/default branch. Before making use of a staging branch, there is one important disadvantage to consider: once you have merged bottle updates to the staging branch, it is **very difficult** to take them back. This typically involves deleting uploaded bottles, which will occasionally require an owner of the Homebrew GitHub organisation to delete uploaded bottles one at a time. @@ -184,15 +184,15 @@ Here is a rough outline of how to use a staging branch: 1. Open an issue in homebrew-core inviting contributors to help. Be sure to include instructions for how to do so, and a checklist of formulae that need to be updated. See [Homebrew/homebrew-core#134251](https://github.com/Homebrew/homebrew-core/issues/134251) for an example. -1. Open a _draft_ PR that merges the staging branch into the `master` branch. This allows you to keep track of the work done so far. You may wish to apply the [`no long build conflict`](https://github.com/Homebrew/homebrew-core/labels/no%20long%20build%20conflict) label to this PR to avoid conflicting changes from being merged to the `master` branch. +1. Open a _draft_ PR that merges the staging branch into the `main` branch. This allows you to keep track of the work done so far. You may wish to apply the [`no long build conflict`](https://github.com/Homebrew/homebrew-core/labels/no%20long%20build%20conflict) label to this PR to avoid conflicting changes from being merged to the `main` branch. -1. Open PRs targeting the staging branch that update the affected formulae. Each PR should touch as few formulae as possible. The typical PR that targets the staging branch will update only one formula at a time. Staging branch PRs can be merged using the same process as PRs that target the `master` branch. Ideally, these PRs should be opened in [topological order](https://en.wikipedia.org/wiki/Topological_sorting) according to the dependency graph, but we don't currently have good tooling for generating a topological sort. (Help wanted.) +1. Open PRs targeting the staging branch that update the affected formulae. Each PR should touch as few formulae as possible. The typical PR that targets the staging branch will update only one formula at a time. Staging branch PRs can be merged using the same process as PRs that target the `main` branch. Ideally, these PRs should be opened in [topological order](https://en.wikipedia.org/wiki/Topological_sorting) according to the dependency graph, but we don't currently have good tooling for generating a topological sort. (Help wanted.) 1. Label PRs that target the staging branch with the [`staging-branch-pr`](https://github.com/Homebrew/homebrew-core/labels/staging-branch-pr) label for ease of tracking and review. (TODO: Add some automation for this to homebrew-core.) -1. Monitor the draft PR you created in step 3 above for merge conflicts. If you encounter a merge conflict, you must resolve those conflicts in a staging branch PR that merges the `master` branch into the staging branch. +1. Monitor the draft PR you created in step 3 above for merge conflicts. If you encounter a merge conflict, you must resolve those conflicts in a staging branch PR that merges the `main` branch into the staging branch. -1. When the staging branch is ready to be merged into `master`, mark the draft PR as ready for review and merge it into the `master` branch. Your PR may spend a long time in the merge queue waiting for the bottle fetch tests to run. +1. When the staging branch is ready to be merged into `main`, mark the draft PR as ready for review and merge it into the `main` branch. Your PR may spend a long time in the merge queue waiting for the bottle fetch tests to run. For examples of uses of the staging branch, see homebrew-core PRs labelled [`openssl-3-migration-staging`](https://github.com/Homebrew/homebrew-core/labels/openssl-3-migration), [Homebrew/homebrew-core#134260](https://github.com/Homebrew/homebrew-core/pull/134260), or [Homebrew/homebrew-core#133611](https://github.com/Homebrew/homebrew-core/pull/133611). diff --git a/docs/Homebrew-on-Linux.md b/docs/Homebrew-on-Linux.md index 9c6bae5452..1b55fbebea 100644 --- a/docs/Homebrew-on-Linux.md +++ b/docs/Homebrew-on-Linux.md @@ -61,7 +61,14 @@ To install build tools, paste at a terminal prompt: sudo apt-get install build-essential procps curl file git ``` -- **Fedora, CentOS Stream, or RHEL** +- **Fedora** + + ```sh + sudo dnf group install development-tools + sudo dnf install procps-ng curl file + ``` + +- **CentOS Stream or RHEL** ```sh sudo dnf group install 'Development Tools' @@ -76,7 +83,7 @@ To install build tools, paste at a terminal prompt: ### ARM32 (Tier 3 Support) -Homebrew can run on 32-bit ARM (e.g. Raspberry Pi and others), but as they lack bottles (binary packages) they are a [Tier 3 supported platform](https://docs.brew.sh/Support-Tiers#tier-3) +Homebrew can run on 32-bit ARM systems (e.g. Raspberry Pi and others), but as they lack bottles (binary packages) they are a [Tier 3 supported platform](Support-Tiers.md#tier-3). You may need to install your own Ruby using your system package manager, a PPA, or `rbenv/ruby-build` as we don't distribute a Homebrew Portable Ruby for ARM32. diff --git a/docs/How-To-Open-a-Homebrew-Pull-Request.md b/docs/How-To-Open-a-Homebrew-Pull-Request.md index 8257319ac7..78f85b232c 100644 --- a/docs/How-To-Open-a-Homebrew-Pull-Request.md +++ b/docs/How-To-Open-a-Homebrew-Pull-Request.md @@ -10,11 +10,11 @@ The type of change you want to make influences which of Homebrew's main reposito ## Submit a new version of an existing formula -1. Use [`brew bump-formula-pr`](Manpage#bump-formula-pr-options-formula) to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-formula-pr --help` to learn more. +1. Use [`brew bump-formula-pr`](Manpage.md#bump-formula-pr-options-formula) to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-formula-pr --help` to learn more. ## Submit a new version of an existing cask -1. Use [`brew bump-cask-pr`](Manpage#bump-cask-pr-options-cask) to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-cask-pr --help` to learn more. +1. Use [`brew bump-cask-pr`](Manpage.md#bump-cask-pr-options-cask) to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-cask-pr --help` to learn more. ## Set up your own fork of the Homebrew repository @@ -38,7 +38,7 @@ The type of change you want to make influences which of Homebrew's main reposito ### Formulae-related pull request -Before creating a new formula, please read [Acceptable Formulae](https://docs.brew.sh/Acceptable-Formulae). +Before creating a new formula, please read [Acceptable Formulae](Acceptable-Formulae.md). 1. [Fork the Homebrew/homebrew-core repository on GitHub](https://github.com/Homebrew/homebrew-core/fork). * This creates a personal remote repository that you can push to. This is needed because only Homebrew maintainers have push access to the main repositories. @@ -64,7 +64,7 @@ Before creating a new formula, please read [Acceptable Formulae](https://docs.br ### Cask-related pull request -Before creating a new cask, please read [Acceptable Casks](https://docs.brew.sh/Acceptable-Casks). +Before creating a new cask, please read [Acceptable Casks](Acceptable-Casks.md). 1. [Fork the Homebrew/homebrew-cask repository on GitHub](https://github.com/Homebrew/homebrew-cask/fork). * This creates a personal remote repository that you can push to. This is needed because only Homebrew maintainers have push access to the main repositories. @@ -92,22 +92,22 @@ Before creating a new cask, please read [Acceptable Casks](https://docs.brew.sh/ To make changes on a new branch and submit it for review, create a GitHub pull request with the following steps: -1. Check out the `master` branch: +1. Check out the `main` branch: ```sh - git checkout master + git checkout main ``` -2. Retrieve new changes to the `master` branch: +2. Retrieve new changes to the `main` branch: ```sh brew update ``` -3. Create a new branch from the latest `master` branch: +3. Create a new branch from the latest default branch: ```sh - git checkout -b origin/master + git checkout -b origin/HEAD ``` 4. Make your changes. For formulae or casks, use `brew edit` or your favourite text editor, using the guidelines in the [Formula Cookbook](Formula-Cookbook.md) or [Cask Cookbook](Cask-Cookbook.md) for reference. @@ -157,7 +157,7 @@ To make changes based on feedback: 3. Squash new commits into one commit per formula: ```sh - git rebase --interactive origin/master + git rebase --interactive origin/HEAD ``` * If you are working on a PR for a single formula, `git commit --amend` is a convenient way of keeping your commits squashed as you go. diff --git a/docs/Installation.md b/docs/Installation.md index fc2412b421..32d1c285e9 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -65,7 +65,7 @@ Technically, you can just extract (or `git clone`) Homebrew wherever you want. H **TL;DR: pick another prefix at your peril!** ```sh -mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip-components 1 -C homebrew +mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/main | tar xz --strip-components 1 -C homebrew ``` or: @@ -104,12 +104,12 @@ eval "$(/bin/brew shellenv)" ``` Replace `` with the directory where Homebrew is installed on your system. -You can find Homebrew's default install location [in this FAQ entry](https://docs.brew.sh/FAQ#why-should-i-install-homebrew-in-the-default-location). +You can find Homebrew's default install location in [this FAQ entry](FAQ.md#why-should-i-install-homebrew-in-the-default-location). -For more insight, re-run the installer or inspect [the installer's source](https://github.com/Homebrew/install/blob/deacfa6a6e62e5f4002baf9e1fac7a96e9aa5d41/install.sh#L1072-L1088) +For more insight, re-run the installer or inspect [the installer's source](https://github.com/Homebrew/install/blob/956abfa01f0d1dba285e6d3da86587ed428f19fe/install.sh#L1075-L1091) to see how the installer constructs the path it recommends. -See [Tips and Tricks > Loading Homebrew from the same dotfiles on different operating systems](Tips-and-Tricks.md#loading-homebrew-from-the-same-dotfiles-on-different-operating-systems) +See [this tip in Tips and Tricks](Tips-and-Tricks.md#load-homebrew-from-the-same-dotfiles-on-different-operating-systems) for another way to handle this across multiple operating systems. ## Uninstallation diff --git a/docs/Manpage.md b/docs/Manpage.md index bce11be419..485221bd24 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -102,9 +102,9 @@ If no search term is provided, all locally available formulae are listed. ## COMMANDS -### `alias` \[*`alias`* ... \| *`alias`*=*`command`*\] +### `alias` \[`--edit`\] \[*`alias`*\|*`alias`*=*`command`*\] -Show existing aliases. If no aliases are given, print the whole list. +Show an alias's command. If no alias is given, print the whole list. `--edit` @@ -239,8 +239,8 @@ flags which will help with finding keg-only dependencies like `openssl`, : `install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew - install` if needed. This is enabled by default if - `$HOMEBREW_BUNDLE_NO_UPGRADE` is set. + install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is + set. `--upgrade` @@ -258,8 +258,8 @@ flags which will help with finding keg-only dependencies like `openssl`, `--services` -: Temporarily start services while running the `exec` or `sh` command. This is - enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set. +: Temporarily start services while running the `exec` or `sh` command. Enabled + by default if `$HOMEBREW_BUNDLE_SERVICES` is set. `-f`, `--force` @@ -268,9 +268,9 @@ flags which will help with finding keg-only dependencies like `openssl`, `--cleanup` -: `install` performs cleanup operation, same as running `cleanup --force`. This - is enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and - `--global` is passed. +: `install` performs cleanup operation, same as running `cleanup --force`. + Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` + is passed. `--all` @@ -278,15 +278,15 @@ flags which will help with finding keg-only dependencies like `openssl`, `--formula` -: `list` or `dump` Homebrew formula dependencies. +: `list`, `dump` or `cleanup` Homebrew formula dependencies. `--cask` -: `list` or `dump` Homebrew cask dependencies. +: `list`, `dump` or `cleanup` Homebrew cask dependencies. `--tap` -: `list` or `dump` Homebrew tap dependencies. +: `list`, `dump` or `cleanup` Homebrew tap dependencies. `--mas` @@ -298,18 +298,18 @@ flags which will help with finding keg-only dependencies like `openssl`, `--vscode` -: `list` or `dump` VSCode (and forks/variants) extensions. +: `list`, `dump` or `cleanup` VSCode (and forks/variants) extensions. `--no-vscode` -: `dump` without VSCode (and forks/variants) extensions. This is enabled by - default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set. +: `dump` without VSCode (and forks/variants) extensions. Enabled by default if + `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set. `--describe` : `dump` adds a description comment above each line, unless the dependency does - not have a description. This is enabled by default if - `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` is set. + not have a description. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_DESCRIBE` + is set. `--no-restart` @@ -397,8 +397,7 @@ required and recommended dependencies. If any version of each formula argument is installed and no other options are passed, this command displays their actual runtime dependencies (similar to -`brew linkage`), which may differ from the current versions' stated dependencies -if the installed versions are outdated. +`brew linkage`), which may differ from a formula's declared dependencies. *Note:* `--missing` and `--skip-recommended` have precedence over `--include-*`. @@ -524,7 +523,7 @@ first search, making that search slower than subsequent ones. `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to search - their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set. + their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `--formula` @@ -537,7 +536,7 @@ first search, making that search slower than subsequent ones. ### `developer` \[*`subcommand`*\] Control Homebrew's developer mode. When developer mode is enabled, `brew update` -will update Homebrew to the latest commit on the `master` branch instead of the +will update Homebrew to the latest commit on the `main` branch instead of the latest stable version along with some other behaviour changes. `brew developer` \[`state`\] @@ -627,7 +626,8 @@ binaries for *`cask`*s. For files, also print SHA-256 checksums. `--[no-]quarantine` -: Disable/enable quarantining of downloads (default: enabled). +: Disable/enable quarantining of downloads (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set. `--formula` @@ -723,7 +723,7 @@ Display brief statistics for your Homebrew installation. If a *`formula`* or `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to print - their JSON. Implied if `$HOMEBREW_EVAL_ALL` is set. + their JSON. `--variations` @@ -763,7 +763,8 @@ upgrade *`formula`* if it is already installed but outdated. `--display-times` -: Print install times for each package at the end of the run. +: Print install times for each package at the end of the run. Enabled by default + if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set. `-f`, `--force` @@ -781,8 +782,9 @@ upgrade *`formula`* if it is already installed but outdated. `--ask` -: Ask for confirmation before downloading and installing formulae. Print bottles - and dependencies download size and install size. +: Ask for confirmation before downloading and installing formulae. Print + download and install sizes of bottles and dependencies. Enabled by default if + `$HOMEBREW_ASK` is set. `--formula` @@ -884,15 +886,18 @@ upgrade *`formula`* if it is already installed but outdated. `--[no-]binaries` -: Disable/enable linking of helper executables (default: enabled). +: Disable/enable linking of helper executables (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_BINARIES` is set. `--require-sha` -: Require all casks to have a checksum. +: Require all casks to have a checksum. Enabled by default if + `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set. `--[no-]quarantine` -: Disable/enable quarantining of downloads (default: enabled). +: Disable/enable quarantining of downloads (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set. `--adopt` @@ -1046,6 +1051,14 @@ repository if no formula or cask is provided. : Treat all named arguments as casks. +### `mcp-server` \[`--debug`\] + +Starts the Homebrew MCP (Model Context Protocol) server. + +`-d`, `--debug` + +: Enable debug logging to stderr. + ### `migrate` \[*`options`*\] *`installed_formula`*\|*`installed_cask`* \[...\] Migrate renamed packages to new names, where *`formula`* are old names of @@ -1102,7 +1115,7 @@ Show install options specific to *`formula`*. `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to show - their options. + their options. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `--command` @@ -1145,6 +1158,7 @@ otherwise. `-g`, `--greedy` : Also include outdated casks with `auto_updates true` or `version :latest`. + Enabled by default if `$HOMEBREW_UPGRADE_GREEDY` is set. `--greedy-latest` @@ -1207,8 +1221,8 @@ all items or checking if any current formulae/casks have Ruby issues. `--eval-all` -: Evaluate all available formulae and casks, whether installed or not. Implied - if `$HOMEBREW_EVAL_ALL` is set. +: Evaluate all available formulae and casks, whether installed or not. Enabled + by default if `$HOMEBREW_EVAL_ALL` is set. `--no-simulate` @@ -1234,7 +1248,8 @@ for the reinstalled formulae or, every 30 days, for all formulae. `--display-times` -: Print install times for each package at the end of the run. +: Print install times for each package at the end of the run. Enabled by default + if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set. `-f`, `--force` @@ -1247,8 +1262,9 @@ for the reinstalled formulae or, every 30 days, for all formulae. `--ask` -: Ask for confirmation before downloading and upgrading formulae. Print bottles - and dependencies download size, install and net install size. +: Ask for confirmation before downloading and upgrading formulae. Print + download, install and net install sizes of bottles and dependencies. Enabled + by default if `$HOMEBREW_ASK` is set. `--formula` @@ -1287,15 +1303,18 @@ for the reinstalled formulae or, every 30 days, for all formulae. `--[no-]binaries` -: Disable/enable linking of helper executables (default: enabled). +: Disable/enable linking of helper executables (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_BINARIES` is set. `--require-sha` -: Require all casks to have a checksum. +: Require all casks to have a checksum. Enabled by default if + `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set. `--[no-]quarantine` -: Disable/enable quarantining of downloads (default: enabled). +: Disable/enable quarantining of downloads (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set. `--adopt` @@ -1332,7 +1351,7 @@ Perform a substring search of cask tokens and formula names for *`text`*. If `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to search - their descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set. + their descriptions. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `--pull-request` @@ -1464,12 +1483,12 @@ run Bundler if necessary for that command. Valid shells: bash\|csh\|fish\|pwsh\|sh\|tcsh\|zsh Print export statements. When run in a shell, this installation of Homebrew will -be added to your `PATH`, `MANPATH`, and `INFOPATH`. +be added to your `$PATH`, `$MANPATH`, and `$INFOPATH`. The variables `$HOMEBREW_PREFIX`, `$HOMEBREW_CELLAR` and `$HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` -directories are first and second respectively in your `PATH`. Consider adding +directories are first and second respectively in your `$PATH`. Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.bash_profile` or ~/.zprofile` on macOS and ~/.bashrc` or ~/.zshrc` on Linux) with: `eval "$(brew shellenv)"\` @@ -1527,8 +1546,8 @@ HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync. `--eval-all` -: Evaluate all the formulae, casks and aliases in the new tap to check validity. - Implied if `$HOMEBREW_EVAL_ALL` is set. +: Evaluate all formulae, casks and aliases in the new tap to check their + validity. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `-f`, `--force` @@ -1663,7 +1682,8 @@ for the upgraded formulae or, every 30 days, for all formulae. `--display-times` -: Print install times for each package at the end of the run. +: Print install times for each package at the end of the run. Enabled by default + if `$HOMEBREW_DISPLAY_INSTALL_TIMES` is set. `-f`, `--force` @@ -1681,8 +1701,9 @@ for the upgraded formulae or, every 30 days, for all formulae. `--ask` -: Ask for confirmation before downloading and upgrading formulae. Print bottles - and dependencies download size, install and net install size. +: Ask for confirmation before downloading and upgrading formulae. Print + download, install and net install sizes of bottles and dependencies. Enabled + by default if `$HOMEBREW_ASK` is set. `--formula` @@ -1745,15 +1766,18 @@ for the upgraded formulae or, every 30 days, for all formulae. `--[no-]binaries` -: Disable/enable linking of helper executables (default: enabled). +: Disable/enable linking of helper executables (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_BINARIES` is set. `--require-sha` -: Require all casks to have a checksum. +: Require all casks to have a checksum. Enabled by default if + `$HOMEBREW_CASK_OPTS_REQUIRE_SHA` is set. `--[no-]quarantine` -: Disable/enable quarantining of downloads (default: enabled). +: Disable/enable quarantining of downloads (default: enabled). Enabled by + default if `$HOMEBREW_CASK_OPTS_QUARANTINE` is set. ### `uses` \[*`options`*\] *`formula`* \[...\] @@ -1780,7 +1804,7 @@ dependency for their stable builds. `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to show - their dependents. + their dependents. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `--include-implicit` @@ -1951,7 +1975,7 @@ checks. Will exit with a non-zero status if any errors are found. `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to audit - them. Implied if `HOMEBREW_EVAL_ALL` is set. + them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. `--new` @@ -1963,10 +1987,6 @@ checks. Will exit with a non-zero status if any errors are found. : Audit for app signatures, which are required by macOS on ARM. -`--token-conflicts` - -: Audit for token conflicts. - `--tap` : Check formulae and casks within the given tap, specified as @@ -2115,7 +2135,8 @@ displays whether a pull request has been opened with the URL. `--eval-all` -: Evaluate all formulae and casks. +: Evaluate all formulae and casks. Enabled by default if `$HOMEBREW_EVAL_ALL` is + set. `--repology` @@ -2414,6 +2435,10 @@ see: : Create a basic template for an Autotools-style build. +`--cabal` + +: Create a basic template for a Cabal build. + `--cask` : Create a basic template for a cask. @@ -2547,9 +2572,9 @@ Build bottles for these formulae with GitHub Actions. ### `edit` \[*`options`*\] \[*`formula`*\|*`cask`*\|*`tap`* ...\] -Open a *`formula`*, *`cask`* or *`tap`* in the editor set by `EDITOR` or -`HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is -provided. +Open a *`formula`*, *`cask`* or *`tap`* in the editor set by `$EDITOR` or +`$HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument +is provided. `--formula` @@ -2711,7 +2736,7 @@ Enter the interactive Homebrew Ruby shell. `--pry` -: Use Pry instead of IRB. Implied if `HOMEBREW_PRY` is set. +: Use Pry instead of IRB. Enabled by default if `$HOMEBREW_PRY` is set. ### `linkage` \[*`options`*\] \[*`installed_formula`* ...\] @@ -2735,14 +2760,14 @@ provided, check all kegs. Raises an error if run on uninstalled formulae. `--cached` -: Print the cached linkage values stored in `HOMEBREW_CACHE`, set by a previous +: Print the cached linkage values stored in `$HOMEBREW_CACHE`, set by a previous `brew linkage` run. ### `livecheck`, `lc` \[*`options`*\] \[*`formula`*\|*`cask`* ...\] Check for newer versions of formulae and/or casks from upstream. If no formula or cask argument is passed, the list of formulae and casks to check is taken -from `HOMEBREW_LIVECHECK_WATCHLIST` or `~/.homebrew/livecheck_watchlist.txt`. +from `$HOMEBREW_LIVECHECK_WATCHLIST` or `~/.homebrew/livecheck_watchlist.txt`. `--full-name` @@ -3064,11 +3089,11 @@ Enter an interactive shell for Homebrew's build environment. Use years-battle-hardened build logic to help your `./configure && make && make install` and even your `gem install` succeed. Especially handy if you run Homebrew in an Xcode-only configuration since it adds tools like `make` to your -`PATH` which build systems would not find otherwise. +`$PATH` which build systems would not find otherwise. `--env` -: Use the standard `PATH` instead of superenv's when `std` is passed. +: Use the standard `$PATH` instead of superenv's when `std` is passed. `-c`, `--cmd` @@ -3176,12 +3201,16 @@ Run Homebrew's unit and integration tests. `--changed` -: Only runs tests on files that were changed from the master branch. +: Only runs tests on files that were changed from the `main` branch. `--fail-fast` : Exit early on the first failing test. +`--no-parallel` + +: Run tests serially. + `--only` : Run only `_spec.rb`. Appending `:` will start at a @@ -3259,7 +3288,7 @@ Show the unbottled dependents of formulae. `--eval-all` : Evaluate all available formulae and casks, whether installed or not, to check - them. Implied if `HOMEBREW_EVAL_ALL` is set. + them. Enabled by default if `$HOMEBREW_EVAL_ALL` is set. ### `unpack` \[*`options`*\] *`formula`* \[...\] @@ -3291,6 +3320,22 @@ Update SPDX license data in the Homebrew repository. Update the list of maintainers in the `Homebrew/brew` README. +### `update-perl-resources` \[*`options`*\] *`formula`* \[...\] + +Update versions for CPAN resource blocks in *`formula`*. + +`-p`, `--print-only` + +: Print the updated resource blocks instead of changing *`formula`*. + +`-s`, `--silent` + +: Suppress any output. + +`--ignore-errors` + +: Continue processing even if some resources can't be resolved. + ### `update-python-resources` \[*`options`*\] *`formula`* \[...\] Update versions for PyPI resource blocks in *`formula`*. @@ -3342,11 +3387,11 @@ Update the list of GitHub Sponsors in the `Homebrew/brew` README. ### `update-test` \[*`options`*\] Run a test of `brew update` with a new repository clone. If no options are -passed, use `origin/master` as the start commit. +passed, use `origin/main` as the start commit. `--to-tag` -: Set `HOMEBREW_UPDATE_TO_TAG` to test updating between tags. +: Set `$HOMEBREW_UPDATE_TO_TAG` to test updating between tags. `--keep-tmp` @@ -3734,7 +3779,7 @@ Database update for `brew which-formula`. ## CUSTOM EXTERNAL COMMANDS Homebrew, like `git`(1), supports external commands. These are executable -scripts that reside somewhere in the `PATH`, named `brew-`*`cmdname`* or +scripts that reside somewhere in the `$PATH`, named `brew-`*`cmdname`* or `brew-`*`cmdname`*`.rb`, which can be invoked like `brew` *`cmdname`*. This allows you to create your own commands without modifying Homebrew's internals. @@ -3781,7 +3826,7 @@ files: User-specific environment files take precedence over prefix-specific files and prefix-specific files take precedence over system-wide files (unless -`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` is set, see below). +`$HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` is set, see below). Note that these files do not support shell variable expansion e.g. `$HOME` or command execution e.g. `$(cat file)`. @@ -4329,7 +4374,7 @@ command execution e.g. `$(cat file)`. `HOMEBREW_SUDO_THROUGH_SUDO_USER` -: If set, Homebrew will use the `SUDO_USER` environment variable to define the +: If set, Homebrew will use the `$SUDO_USER` environment variable to define the user to `sudo`(8) through when running `sudo`(8). `HOMEBREW_SVN` @@ -4443,8 +4488,8 @@ Homebrew's Project Leader is Mike McQuaid. Homebrew's Project Leadership Committee is Colin Dean, Michka Popoff, Mike McQuaid, Patrick Linnane and Vanessa Gennarelli. -Homebrew's Technical Steering Committee is Bo Anderson, FX Coudert, Mike McQuaid -and Rylan Polster. +Homebrew's Technical Steering Committee is Bo Anderson, Issy Long, Michael Cho, +Mike McQuaid and Ruoyu Zhong. Homebrew's maintainers are Alexander Bayandin, Bevan Kay, Bo Anderson, Branch Vincent, Caleb Xu, Carlo Cabrera, Daeho Ro, Douglas Eichelberger, Dustin diff --git a/docs/New-Maintainer-Checklist.md b/docs/New-Maintainer-Checklist.md index 1661901b9c..fc3c95b70a 100644 --- a/docs/New-Maintainer-Checklist.md +++ b/docs/New-Maintainer-Checklist.md @@ -82,7 +82,7 @@ Now sit back, relax and let the new maintainers handle more of our contributions ## PLC -If a maintainer or member is elected to the Homebrew's [Project Leadership Committee](https://docs.brew.sh/Homebrew-Governance#4-project-leadership-committee): +If a maintainer or member is elected to the Homebrew's [Project Leadership Committee](Homebrew-Governance.md#4-project-leadership-committee): - Invite them to the [**@Homebrew/plc** team](https://github.com/orgs/Homebrew/teams/plc/members) - Make them [billing managers](https://github.com/organizations/Homebrew/settings/billing) and [moderators](https://github.com/organizations/Homebrew/settings/moderators) on the Homebrew GitHub organisation @@ -92,7 +92,7 @@ When they cease to be a PLC member, revoke or downgrade their access to all of t ## TSC -If a maintainer is elected to the Homebrew's [Technical Steering Committee](https://docs.brew.sh/Homebrew-Governance#7-technical-steering-committee): +If a maintainer is elected to the Homebrew's [Technical Steering Committee](Homebrew-Governance.md#7-technical-steering-committee): - Invite them to the [**@Homebrew/tsc** team](https://github.com/orgs/Homebrew/teams/tsc/members) - Make them [billing managers](https://github.com/organizations/Homebrew/settings/billing) and [moderators](https://github.com/organizations/Homebrew/settings/moderators) on the Homebrew GitHub organisation @@ -111,12 +111,12 @@ When they cease to be an owner, revoke or downgrade their access to all of the a ## Members -People who are either not eligible or willing to be Homebrew maintainers but have shown continued involvement in the Homebrew community may be admitted by a majority vote of the [Project Leadership Committee](https://docs.brew.sh/Homebrew-Governance#4-project-leadership-committee). +People who are either not eligible or willing to be Homebrew maintainers but have shown continued involvement in the Homebrew community may be admitted by a majority vote of the [Project Leadership Committee](Homebrew-Governance.md#4-project-leadership-committee). When admitted as members: - Invite them as a single-channel guest to the #members channel on the [`machomebrew` private Slack](https://machomebrew.slack.com/admin/invites) (and ensure they've read the [communication guidelines](Maintainer-Guidelines.md#communication)) and ask them to use their real name there (rather than a pseudonym they may use on e.g. GitHub). -- Add them to the current year's membership list in the [governance archives](https://github.com/Homebrew/brew/tree/master/docs/governance). +- Add them to the current year's membership list in the [governance archives](https://github.com/Homebrew/brew/tree/HEAD/docs/governance). If they are interested in doing ops/infrastructure/system administration work: diff --git a/docs/Node-for-Formula-Authors.md b/docs/Node-for-Formula-Authors.md index e599e920c9..b549d8b4b8 100644 --- a/docs/Node-for-Formula-Authors.md +++ b/docs/Node-for-Formula-Authors.md @@ -50,7 +50,7 @@ Node modules should be installed to `libexec`. This prevents the Node modules fr In the following we distinguish between two types of Node modules installed using formulae: -- formulae for standard Node modules compatible with npm's global module format which should use [`std_npm_args`](#installing-global-style-modules-with-std_npm_args-to-libexec) (like [`angular-cli`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/a/angular-cli.rb) or [`webpack`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/w/webpack.rb)) +- formulae for standard Node modules compatible with npm's global module format which should use [`std_npm_args`](#installing-global-style-modules-with-std_npm_args-to-libexec) (like [`angular-cli`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/angular-cli.rb) or [`webpack`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/w/webpack.rb)) - formulae where the `npm install` call is not the only required install step (e.g. need to also compile non-JavaScript sources) which have to use [`std_npm_args`](#installing-module-dependencies-locally-with-std_npm_args) (like [`emscripten`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/e/emscripten.rb) or [`grunt-cli`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/g/grunt-cli.rb)) What both methods have in common is that they are setting the correct environment for using npm inside Homebrew and are returning the arguments for invoking `npm install` for their specific use cases. This includes fixing an important edge case with the npm cache (caused by Homebrew's redirection of `HOME` during the build and test process) by using our own custom `npm_cache` inside `HOMEBREW_CACHE`, which would otherwise result in very long build times and high disk space usage. diff --git a/docs/Prose-Style-Guidelines.md b/docs/Prose-Style-Guidelines.md index ad64206f5a..c5e2907884 100644 --- a/docs/Prose-Style-Guidelines.md +++ b/docs/Prose-Style-Guidelines.md @@ -1,5 +1,5 @@ --- -last_review_date: "2025-02-08" +last_review_date: 2025-05-22 --- # Prose Style Guidelines @@ -23,7 +23,7 @@ Homebrew's audience includes users with a wide range of education and experience We strive for "correct" but not "fancy" usage. Think newspaper article, not academic paper. -This is a set of guidelines to be applied using human judgement, not a set of hard and fast rules. It is like [Garner's Modern American Usage](https://en.wikipedia.org/wiki/Garner's_Modern_American_Usage). It is less like the [Ruby Style Guide](https://github.com/rubocop-hq/ruby-style-guide#the-ruby-style-guide). All guidelines here are open to interpretation and discussion. 100% conformance to these guidelines is *not* a goal. +This is a set of guidelines to be applied using human judgement, not a set of hard and fast rules. It is more like [Garner's Modern American Usage](https://en.wikipedia.org/wiki/Garner's_Modern_American_Usage) and less like the [Ruby Style Guide](https://github.com/rubocop-hq/ruby-style-guide#the-ruby-style-guide). All guidelines here are open to interpretation and discussion. 100% conformance to these guidelines is *not* a goal. The intent of this document is to help authors make decisions about clarity, style, and consistency. It is not to help settle arguments about who knows English better. Don't use this document to be a jerk. @@ -53,6 +53,8 @@ We prefer: * Use a subordinate list item instead of dropping a multi-sentence paragraph-long item into a list of sentence fragments * Prefer Markdown over other markup formats unless their specific features are needed * GitHub Flavoured Markdown. GitHub's implementation is the standard, period. +* Link to other documentation pages with relative links to the Markdown filename rather than the full URL + * e.g. `FAQ.md` instead of `https://docs.brew.sh/FAQ` ### Typographical conventions diff --git a/docs/README.md b/docs/README.md index 6016f8924a..d9846e02e4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ last_review_date: "1970-01-01" These are the source files for the [Homebrew documentation site](https://docs.brew.sh/). -A [GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/docs.yml) is run to validate each change before the site is deployed to GitHub Pages. +A [GitHub Action](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/docs.yml) is run to validate each change before the site is deployed to GitHub Pages. ## Usage diff --git a/docs/Rakefile b/docs/Rakefile index 9d58bcb719..dc07a35c13 100644 --- a/docs/Rakefile +++ b/docs/Rakefile @@ -34,13 +34,16 @@ task test: :build do ], ignore_urls: [ "/", - %r{https://formulae.brew.sh"}, + %r{https://formulae.brew.sh}, %r{https://github.com/}, + %r{https://homebrew.1password.com/}, "https://legacy.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors", + "https://metacpan.org/pod/local::lib", ], cache: { timeframe: { - external: "1h", + external: "1d", + internal: "1h", }, }, ).run diff --git a/docs/Releases.md b/docs/Releases.md index e4a39c03f7..d20352279d 100644 --- a/docs/Releases.md +++ b/docs/Releases.md @@ -17,8 +17,8 @@ Since Homebrew 1.0.0 most Homebrew users (those who haven't run a `dev-cmd` or s 2. Ensure that: - no code changes have happened for at least a couple of hours (ideally 4 hours), - at least one Homebrew/homebrew-core pull request CI job has completed successfully, - - the state of the Homebrew/brew `master` CI job is clear (i.e. main jobs green or green after rerunning) - - you are confident there are no major regressions on the current `master` branch. + - the state of the Homebrew/brew `main` CI job is clear (i.e. main jobs green or green after rerunning) + - you are confident there are no major regressions on the current `main` branch. 3. Run `brew release` to create a new draft release. For major or minor version bumps, pass `--major` or `--minor`, respectively. @@ -42,4 +42,4 @@ If this is a major or minor release (e.g. X.0.0 or X.Y.0) then there are a few m - Pros: gets a wider reach and user feedback - Cons: negative comments are common and people take this as a chance to complain about Homebrew (regardless of their usage) -Please do not manually create a release based on older commits on the `master` branch. It's very hard to judge whether these have been sufficiently tested by users or if they will cause negative side effects with the current state of Homebrew/homebrew-core. If a new branch is needed ASAP but there are things on `master` that cannot be released yet (e.g. new deprecations and you want to make a patch release) then revert the relevant PRs, follow the process above and then revert the reverted PRs to reapply them on `master`. +Please do not manually create a release based on older commits on the `main` branch. It's very hard to judge whether these have been sufficiently tested by users or if they will cause negative side effects with the current state of Homebrew/homebrew-core. If a new branch is needed ASAP but there are things on `main` that cannot be released yet (e.g. new deprecations and you want to make a patch release) then revert the relevant PRs, follow the process above and then revert the reverted PRs to reapply them on `main`. diff --git a/docs/Support-Tiers.md b/docs/Support-Tiers.md index 2f5baf9193..5a98f0c72e 100644 --- a/docs/Support-Tiers.md +++ b/docs/Support-Tiers.md @@ -22,7 +22,7 @@ A Tier 1 supported configuration is one in which: For Tier 1 support, Homebrew on macOS must be all of: - running on official Apple hardware (e.g. not a "Hackintosh" or VM) -- running a version of macOS supported by Apple on that hardware +- running the latest patch release of a macOS version supported by Apple on that hardware - running a version of macOS with Homebrew CI coverage (i.e. the latest stable or prerelease version, two preceding versions) - installed in the default prefix (i.e. `/opt/homebrew` on Apple Silicon, `/usr/local` on Intel x86_64) - running on a supported architecture (i.e. Apple Silicon or Intel x86_64) diff --git a/docs/Tips-and-Tricks.md b/docs/Tips-and-Tricks.md index 198f1b914f..9f63453288 100644 --- a/docs/Tips-and-Tricks.md +++ b/docs/Tips-and-Tricks.md @@ -1,5 +1,5 @@ --- -last_review_date: "1970-01-01" +last_review_date: 2025-07-15 redirect_from: - /Tips-N'-Tricks --- @@ -26,7 +26,7 @@ Sometimes it's faster to download a file via means other than the strategies tha Downloads are saved in the `downloads` subdirectory of Homebrew's cache directory (as specified by `brew --cache`, e.g. `~/Library/Caches/Homebrew`) and renamed as `---`. The command `brew --cache --build-from-source ` will print the expected path of the cached download, so after downloading the file, you can run `mv the_tarball "$(brew --cache --build-from-source )"` to relocate it to the cache. -You can also pre-cache the download by using the command `brew fetch ` which also displays the SHA-256 hash. This can be useful for updating formulae to new versions. +You can also pre-cache the download by using the command `brew fetch ` which also displays its SHA-256 hash. This can be useful for updating formulae to new versions. ## Install stuff without the Xcode CLT @@ -49,12 +49,17 @@ brew install --only-dependencies $ brew irb ==> Interactive Homebrew Shell Example commands available with: `brew irb --examples` -irb(main):001:0> Formulary.factory("ace").methods - Object.methods -=> [:install, :test, :test_defined?, :sbin, :pkgshare, :elisp, -:frameworks, :kext_prefix, :any_version_installed?, :etc, :pkgetc, +brew(main):001> Formulary.factory("ace").methods - Object.methods +=> +[:test, + :install, + :valid_platform?, ... -:on_macos, :on_linux, :debug?, :quiet?, :verbose?, :with_context] -irb(main):002:0> + :debug?, + :verbose?, + :quiet?] + [:install, :test, :test_defined?, :sbin, :pkgshare, :elisp, +brew(main):002> ``` ## Hide the beer mug emoji when finishing a build @@ -89,6 +94,70 @@ $ brew install --cask --adopt textmate 🍺 textmate was successfully installed! ``` +## Define aliases for Homebrew commands + +Use [`brew alias`](Manpage.md#alias---edit-aliasaliascommand) to define custom commands that run other commands in `brew` or your shell, similar to the `alias` shell builtin. + +```shell +# Add aliases +$ brew alias ug='upgrade' +$ brew alias i='install' + +# Print all aliases +$ brew alias + +# Print one alias +$ brew alias i + +# Use your aliases like any other command +$ brew i git + +# Remove an alias +$ brew unalias i + +# Aliases can include other aliases +$ brew alias show='info' +$ brew alias print='show' +$ brew print git # will run `brew info git` +``` + +Note that names of stock Homebrew commands can't be used as aliases. + +All aliased commands are prefixed with `brew`, unless they start with `!` or `%`: + +```shell +$ brew alias ug='upgrade' +# `brew ug` → `brew upgrade` + +$ brew alias status='!git status' +# `brew status` → `git status` +``` + +You may need single quotes to prevent your shell from interpreting `!`, but `%` will work for both quote types. + +```shell +# Use shell expansion to preserve a local variable +$ mygit=/path/to/my/git +$ brew alias git="%$mygit" +# `brew git status` → `/path/to/my/git status` +``` + +Aliases can be opened in `$EDITOR` with the `--edit` flag. + +```shell +# Edit alias 'brew foo', creating if necessary +$ brew alias --edit foo +# Create and edit alias 'brew foo' +$ brew alias --edit foo=bar + +# This works too +$ brew alias foo --edit +$ brew alias foo=bar --edit + +# Open all aliases in $EDITOR +$ brew alias --edit +``` + ## Editor plugins ### Visual Studio Code @@ -119,7 +188,7 @@ Terminal needs an extra hint on where to find manpages installed by Homebrew bec ```sh sudo mkdir -p /usr/local/etc/man.d -echo "MANPATH /opt/homebrew/share/man" | sudo tee -a /usr/local/etc/man.d/homebrew.man.conf +echo "MANPATH $(brew --prefix)/share/man" | sudo tee -a /usr/local/etc/man.d/homebrew.man.conf ``` If you're using Homebrew on macOS Intel, you should also fix permissions afterwards with: @@ -143,7 +212,7 @@ export HOMEBREW_ARTIFACT_DOMAIN_NO_FALLBACK=1 export HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN="$(printf 'anonymous:' | base64)" ``` -## Loading Homebrew from the same dotfiles on different operating systems +## Load Homebrew from the same dotfiles on different operating systems Some users may want to use the same shell initialization files on macOS and Linux. Use this to detect the likely Homebrew installation directory and load Homebrew when it's found. diff --git a/docs/Typechecking.md b/docs/Typechecking.md index a7599ea936..6a29bf5341 100644 --- a/docs/Typechecking.md +++ b/docs/Typechecking.md @@ -1,12 +1,12 @@ --- -last_review_date: "2025-02-08" +last_review_date: 2025-05-22 --- # Type Checking With Sorbet -The majority of the code in Homebrew is written in Ruby which is a dynamic language. To avail the benefits of static type checking, we have set up Sorbet in our codebase which provides the benefits of static type checking to dynamic languages like Ruby. +The majority of the code in Homebrew is written in Ruby which is a dynamic language. To avail the benefits of static type checking, we have set up [Sorbet](https://sorbet.org/) in our codebase which provides the benefits of static type checking to dynamic languages like Ruby. -The [Sorbet Documentation] is a good place to get started if you want to dive deeper into Sorbet and its abilities. +The [Sorbet Documentation](https://sorbet.org/docs/overview) is a good place to get started if you want to dive deeper into Sorbet and its abilities. ## Sorbet in the Homebrew Codebase @@ -34,45 +34,41 @@ For more information on how to express more complex types, refer to the official ### Ruby interface files (`.rbi`) -[RBI files](https://sorbet.org/docs/rbi) help Sorbet learn about constants, ancestors and methods defined in ways it doesn’t understand natively. We can also create an RBI file to help Sorbet understand dynamic definitions. Some of these files are autogenerated (see the next section) and some are manually written ([example]). +[RBI files](https://sorbet.org/docs/rbi) help Sorbet learn about constants, ancestors and methods defined in ways it doesn't understand natively. We can also create an RBI file to help Sorbet understand dynamic definitions. Some of these files are automatically generated (see the next section) and some are manually written, e.g. [`on_system.rbi`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/on_system.rbi). -There are also a very small number of files that Homebrew loads before sorbet-runtime, such as `utils/gems.rb`. Those files cannot have type signatures alongside the code itself, so RBI files are used there instead to retain static type checking. - -[example]: https://github.com/Homebrew/brew/blob/9d4000b15cb6ffa8c11f49372f7016d05aaa0851/Library/Homebrew/extend/ENV.rbi +There are also a very small number of files that Homebrew loads before `sorbet-runtime`, such as `utils/gems.rb`. Those files cannot have type signatures alongside the code itself, so RBI files are used there instead to retain static type checking. ### The [`Library/Homebrew/sorbet`] directory -[`Library/Homebrew/sorbet`]: https://github.com/Homebrew/brew/tree/master/Library/Homebrew/sorbet +[`Library/Homebrew/sorbet`]: https://github.com/Homebrew/brew/tree/HEAD/Library/Homebrew/sorbet -- The `rbi` directory contains all Ruby Interface (`.rbi`) files auto-generated by running `brew typecheck --update`: +The `rbi` directory contains all Ruby Interface (`.rbi`) files auto-generated by running `brew typecheck --update`: - - `gems`: RBI files for all gems are generated using [Tapioca](https://github.com/Shopify/tapioca#tapioca). - - `dsl`: RBI files autogenerated by our [Tapioca compilers](https://github.com/Homebrew/brew/tree/master/Library/Homebrew/sorbet/tapioca/compilers). - - `upstream.rbi`: This file is not auto-generated and is a manually written file that contains temporary workarounds for upstream Sorbet issues. This file is typically empty. +- `gems`: RBI files for all gems are generated using [Tapioca](https://github.com/Shopify/tapioca#tapioca). +- `dsl`: RBI files auto-generated by our [Tapioca compilers](https://github.com/Homebrew/brew/tree/HEAD/Library/Homebrew/sorbet/tapioca/compilers). +- `upstream.rbi`: This file is manually written and contains temporary workarounds for upstream Sorbet issues. It is typically empty. -- The `config` file is a newline-separated list of arguments to pass to `srb tc`, the same as if they’d been passed on the command line. Arguments in the config file are always passed first, followed by arguments provided on the command line. We use it to ignore Gem directories which we do not wish to type check. +The `tapioca` directory contains configuration files and compilers for Tapioca, allowing Sorbet to type check the dynamically generated components of the codebase. -- Every Ruby file in the codebase has a magic `# typed: ` comment at the top, where `` is one of [Sorbet's strictness levels], usually `false`, `true` or `strict`. The `false` files only report errors related to the syntax, constant resolution and correctness of the method signatures, but no type errors. Our long-term goal is to move all `false` files to `true` and start reporting type errors on those files as well. Therefore, when adding new files, you should ideally mark it with `# typed: true` and work out any resulting type errors. - -[Sorbet's strictness levels]: https://sorbet.org/docs/static#file-level-granularity-strictness-levels +The `config` file is a newline-separated list of arguments to pass to `srb tc`, the same as if they'd been passed on the command line. Arguments in the config file are always passed first, followed by arguments provided on the command line. We use it to ignore e.g. gem directories which we do not wish to type check. ## Using `brew typecheck` -When run without any arguments, `brew typecheck`, will run considering the strictness levels set in each of the individual Ruby files in the core Homebrew codebase. However, when it is run on a specific file or directory, more errors may show up since Sorbet cannot resolve constants defined outside the scope of the specified file. These problems can be solved with RBI files. Currently `brew typecheck` provides `--quiet`, `--file`, `--dir` and `--ignore` options but you can explore more options with `srb tc --help` and pass them with `srb tc`. +Every Ruby file in the codebase has a magic `# typed: ` comment at the top, where `` is one of [Sorbet's strictness levels](https://sorbet.org/docs/static#file-level-granularity-strictness-levels), usually `false`, `true` or `strict`. The `false` files only report errors related to the syntax, constant resolution and correctness of the method signatures, but no type errors. Our long-term goal is to move all `false` files to `true` and start reporting type errors on those files as well. Therefore, when adding new files, you should ideally mark it with `# typed: true` and work out any resulting type errors. + +When run without any arguments, `brew typecheck` will run considering the strictness levels set in each of the individual Ruby files in the core Homebrew codebase. However, when run on a specific file or directory, more errors may show up since Sorbet cannot resolve constants defined outside the scope of the specified file. These problems can be solved with RBI files. Currently `brew typecheck` provides `--quiet`, `--file`, `--dir` and `--ignore` options, but you can explore more options with `srb tc --help` and pass them with `srb tc`. ## Resolving Type Errors -Sorbet reports type errors along with an error reference code, which can be used to look up more information on how to debug the error, or what causes the error in the [Sorbet Documentation]. Here is how to debug some common type errors: +Sorbet reports type errors along with an error reference code, which can be used to look up more information on how to debug the error, or what causes the error in the [Sorbet Documentation](https://sorbet.org/docs/overview). Here's how to debug some common type errors: - Using `T.reveal_type`: in files which are `true` or higher, by wrapping a variable or method call in `T.reveal_type`, Sorbet will show us what type it thinks that variable has in the output of `srb tc`. This is particularly useful when writing [method signatures](https://sorbet.org/docs/sigs) and debugging. Make sure to remove this line from your code before committing your changes, since this is just a debugging tool. - One of the most frequent errors that we've encountered is `7003: Method does not exist.` Since Ruby is a very dynamic language, methods can be defined in ways Sorbet cannot see statically. In such cases, check if the method exists at runtime; if not, then Sorbet has caught a future bug! But, it is also possible that even though a method exists at runtime, Sorbet cannot see it. In such cases, we use [`.rbi` files](#ruby-interface-files-rbi). -- Since Sorbet does not automatically assume that Kernel is to be included in Modules, we may encounter many errors while trying to use methods like `puts`, `ohai`, `odebug` etc. There are generally two approaches to fixing this: +- Since Sorbet does not automatically assume that `Kernel` is to be included in modules, we may encounter many errors while trying to use methods like `puts`, `ohai`, `odebug` etc. There are generally two approaches to fixing this: - - If you are using `module_function` but never run `include ModuleName` anywhere, remove the `module_definition` and convert all methods to class methods (prepend the name with `self.`) - - If you do include the module elsewhere, add a `requires_ancestor` to the module defining what types of classes this module can be included in. This may be as simple as a `requires_ancestor { Kernel }`, which most classes are a descendant from. + - If you are using `module_function` but never run `include ModuleName` anywhere, remove the `module_definition` and convert all methods to class methods (prepend the name with `self.`). + - If you do include the module elsewhere, add a `requires_ancestor` to the module defining what types of classes this module can be included in. This may be as simple as a `requires_ancestor { Kernel }`, which most classes are descended from. - The tips above are very generic and apply to lots of cases. For some common gotchas when using Sorbet, refer to the [Sorbet Error Reference](https://sorbet.org/docs/error-reference) and [FAQ](https://sorbet.org/docs/faq). - -[Sorbet Documentation]: https://sorbet.org/docs/overview diff --git a/docs/governance/2019-moss-track-iii-grant-nomination.md b/docs/governance/2019-moss-track-iii-grant-nomination.md index 3c7aeadcd4..56431ad8f6 100644 --- a/docs/governance/2019-moss-track-iii-grant-nomination.md +++ b/docs/governance/2019-moss-track-iii-grant-nomination.md @@ -44,7 +44,7 @@ Homebrew aims to be the missing package manager for macOS (and Linux). Its prima ### What copyright license or licenses cover the project's source code? -Homebrew's code is licensed under a BSD 2-clause license. Homebrew also vendors three dependencies, which are all MIT licensed (). +Homebrew's code is licensed under a BSD 2-clause license. Homebrew also vendors three dependencies, which are all MIT licensed (). ### Does the project contain any proprietary code, or depend on or use a proprietary web service? If so, please give details diff --git a/docs/index.md b/docs/index.md index af1627ba70..58eaa29bd7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -52,6 +52,7 @@ last_review_date: "2025-02-08" - [Node for Formula Authors](Node-for-Formula-Authors.md) - [Python for Formula Authors](Python-for-Formula-Authors.md) - [`brew livecheck`](Brew-Livecheck.md) +- [Autobump](Autobump.md) - [Migrating a Formula to a Tap](Migrating-A-Formula-To-A-Tap.md) - [Renaming a Formula](Rename-A-Formula.md) - [Building Against Non-Homebrew Dependencies](Building-Against-Non-Homebrew-Dependencies.md) diff --git a/docs/vale-styles/Homebrew/README.md b/docs/vale-styles/Homebrew/README.md index 1b087e5b53..12de474ec9 100644 --- a/docs/vale-styles/Homebrew/README.md +++ b/docs/vale-styles/Homebrew/README.md @@ -1,7 +1,7 @@ --- -last_review_date: "1970-01-01" +last_review_date: 2025-05-22 --- # Vale Styles -Based on Homebrew's [Prose Style Guidelines](http://docs.brew.sh/Prose-Style-Guidelines.html). +Based on Homebrew's [Prose Style Guidelines](/docs/Prose-Style-Guidelines.md). diff --git a/manpages/brew.1 b/manpages/brew.1 index 70c81844ec..1678fe2dbe 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1,5 +1,5 @@ .\" generated by kramdown -.TH "BREW" "1" "May 2025" "Homebrew" +.TH "BREW" "1" "July 2025" "Homebrew" .SH NAME brew \- The Missing Package Manager for macOS (or Linux) .SH "SYNOPSIS" @@ -62,8 +62,8 @@ List all installed formulae\. .SS "\fBsearch\fP \fR[\fItext\fP|\fB/\fP\fItext\fP\fB/\fP]" Perform a substring search of cask tokens and formula names for \fItext\fP\&\. If \fItext\fP is flanked by slashes, it is interpreted as a regular expression\. The search for \fItext\fP is extended online to \fBhomebrew/core\fP and \fBhomebrew/cask\fP\&\. If no search term is provided, all locally available formulae are listed\. .SH "COMMANDS" -.SS "\fBalias\fP \fR[\fIalias\fP \.\.\. | \fIalias\fP=\fIcommand\fP]" -Show existing aliases\. If no aliases are given, print the whole list\. +.SS "\fBalias\fP \fR[\fB\-\-edit\fP] \fR[\fIalias\fP|\fIalias\fP=\fIcommand\fP]" +Show an alias\[u2019]s command\. If no alias is given, print the whole list\. .TP \fB\-\-edit\fP Edit aliases in a text editor\. Either one or all aliases may be opened at once\. If the given alias doesn\[u2019]t exist it\[u2019]ll be pre\-populated with a template\. @@ -145,7 +145,7 @@ Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP \fBinstall\fP prints output from commands as they are run\. \fBcheck\fP lists all missing dependencies\. .TP \fB\-\-no\-upgrade\fP -\fBinstall\fP does not run \fBbrew upgrade\fP on outdated dependencies\. \fBcheck\fP does not check for outdated dependencies\. Note they may still be upgraded by \fBbrew install\fP if needed\. This is enabled by default if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. +\fBinstall\fP does not run \fBbrew upgrade\fP on outdated dependencies\. \fBcheck\fP does not check for outdated dependencies\. Note they may still be upgraded by \fBbrew install\fP if needed\. Enabled by default if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. .TP \fB\-\-upgrade\fP \fBinstall\fP runs \fBbrew upgrade\fP on outdated dependencies, even if \fB$HOMEBREW_BUNDLE_NO_UPGRADE\fP is set\. @@ -157,25 +157,25 @@ Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP Run \fBinstall\fP before continuing to other operations e\.g\. \fBexec\fP\&\. .TP \fB\-\-services\fP -Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. This is enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. +Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. Enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP \fBinstall\fP runs with \fB\-\-force\fP/\fB\-\-overwrite\fP\&\. \fBdump\fP overwrites an existing \fBBrewfile\fP\&\. \fBcleanup\fP actually performs its cleanup operations\. .TP \fB\-\-cleanup\fP -\fBinstall\fP performs cleanup operation, same as running \fBcleanup \-\-force\fP\&\. This is enabled by default if \fB$HOMEBREW_BUNDLE_INSTALL_CLEANUP\fP is set and \fB\-\-global\fP is passed\. +\fBinstall\fP performs cleanup operation, same as running \fBcleanup \-\-force\fP\&\. Enabled by default if \fB$HOMEBREW_BUNDLE_INSTALL_CLEANUP\fP is set and \fB\-\-global\fP is passed\. .TP \fB\-\-all\fP \fBlist\fP all dependencies\. .TP \fB\-\-formula\fP -\fBlist\fP or \fBdump\fP Homebrew formula dependencies\. +\fBlist\fP, \fBdump\fP or \fBcleanup\fP Homebrew formula dependencies\. .TP \fB\-\-cask\fP -\fBlist\fP or \fBdump\fP Homebrew cask dependencies\. +\fBlist\fP, \fBdump\fP or \fBcleanup\fP Homebrew cask dependencies\. .TP \fB\-\-tap\fP -\fBlist\fP or \fBdump\fP Homebrew tap dependencies\. +\fBlist\fP, \fBdump\fP or \fBcleanup\fP Homebrew tap dependencies\. .TP \fB\-\-mas\fP \fBlist\fP or \fBdump\fP Mac App Store dependencies\. @@ -184,13 +184,13 @@ Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. Th \fBlist\fP or \fBdump\fP Whalebrew dependencies\. .TP \fB\-\-vscode\fP -\fBlist\fP or \fBdump\fP VSCode (and forks/variants) extensions\. +\fBlist\fP, \fBdump\fP or \fBcleanup\fP VSCode (and forks/variants) extensions\. .TP \fB\-\-no\-vscode\fP -\fBdump\fP without VSCode (and forks/variants) extensions\. This is enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_VSCODE\fP is set\. +\fBdump\fP without VSCode (and forks/variants) extensions\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_VSCODE\fP is set\. .TP \fB\-\-describe\fP -\fBdump\fP adds a description comment above each line, unless the dependency does not have a description\. This is enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_DESCRIBE\fP is set\. +\fBdump\fP adds a description comment above each line, unless the dependency does not have a description\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_DESCRIBE\fP is set\. .TP \fB\-\-no\-restart\fP \fBdump\fP does not add \fBrestart_service\fP to formula lines\. @@ -241,7 +241,7 @@ Show Homebrew and system configuration info useful for debugging\. If you file a .SS "\fBdeps\fP \fR[\fIoptions\fP] \fR[\fIformula\fP|\fIcask\fP \.\.\.]" Show dependencies for \fIformula\fP\&\. When given multiple formula arguments, show the intersection of dependencies for each formula\. By default, \fBdeps\fP shows all required and recommended dependencies\. .P -If any version of each formula argument is installed and no other options are passed, this command displays their actual runtime dependencies (similar to \fBbrew linkage\fP), which may differ from the current versions\[u2019] stated dependencies if the installed versions are outdated\. +If any version of each formula argument is installed and no other options are passed, this command displays their actual runtime dependencies (similar to \fBbrew linkage\fP), which may differ from a formula\[u2019]s declared dependencies\. .P \fINote:\fP \fB\-\-missing\fP and \fB\-\-skip\-recommended\fP have precedence over \fB\-\-include\-*\fP\&\. .TP @@ -326,7 +326,7 @@ Search just names for \fItext\fP\&\. If \fItext\fP is flanked by slashes, it is Search just descriptions for \fItext\fP\&\. If \fItext\fP is flanked by slashes, it is interpreted as a regular expression\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Implied if \fB$HOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. @@ -334,7 +334,7 @@ Treat all named arguments as formulae\. \fB\-\-cask\fP Treat all named arguments as casks\. .SS "\fBdeveloper\fP \fR[\fIsubcommand\fP]" -Control Homebrew\[u2019]s developer mode\. When developer mode is enabled, \fBbrew update\fP will update Homebrew to the latest commit on the \fBmaster\fP branch instead of the latest stable version along with some other behaviour changes\. +Control Homebrew\[u2019]s developer mode\. When developer mode is enabled, \fBbrew update\fP will update Homebrew to the latest commit on the \fBmain\fP branch instead of the latest stable version along with some other behaviour changes\. .TP \fBbrew developer\fP [\fBstate\fP] Display the current state of Homebrew\[u2019]s developer mode\. @@ -393,7 +393,7 @@ Download source packages (for eventual bottling) rather than a bottle\. Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation\. .TP \fB\-\-[no\-]quarantine\fP -Disable/enable quarantining of downloads (default: enabled)\. +Disable/enable quarantining of downloads (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_QUARANTINE\fP is set\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. @@ -450,7 +450,7 @@ Print a JSON representation\. Currently the default value for \fIversion\fP is \ Print JSON of formulae that are currently installed\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to print their JSON\. Implied if \fB$HOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not, to print their JSON\. .TP \fB\-\-variations\fP Include the variations hash in each formula\[u2019]s JSON output\. @@ -476,7 +476,7 @@ Unless \fB$HOMEBREW_NO_INSTALL_UPGRADE\fP is set, \fBbrew install\fP \fIformula\ If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. .TP \fB\-\-display\-times\fP -Print install times for each package at the end of the run\. +Print install times for each package at the end of the run\. Enabled by default if \fB$HOMEBREW_DISPLAY_INSTALL_TIMES\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP Install formulae without checking for previously installed keg\-only or non\-migrated versions\. When installing casks, overwrite existing files (binaries and symlinks are excluded, unless originally from the same cask)\. @@ -488,7 +488,7 @@ Print the verification and post\-install steps\. Show what would be installed, but do not actually install anything\. .TP \fB\-\-ask\fP -Ask for confirmation before downloading and installing formulae\. Print bottles and dependencies download size and install size\. +Ask for confirmation before downloading and installing formulae\. Print download and install sizes of bottles and dependencies\. Enabled by default if \fB$HOMEBREW_ASK\fP is set\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. @@ -551,13 +551,13 @@ Delete files that already exist in the prefix while linking\. Treat all named arguments as casks\. .TP \fB\-\-[no\-]binaries\fP -Disable/enable linking of helper executables (default: enabled)\. +Disable/enable linking of helper executables (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_BINARIES\fP is set\. .TP \fB\-\-require\-sha\fP -Require all casks to have a checksum\. +Require all casks to have a checksum\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_REQUIRE_SHA\fP is set\. .TP \fB\-\-[no\-]quarantine\fP -Disable/enable quarantining of downloads (default: enabled)\. +Disable/enable quarantining of downloads (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_QUARANTINE\fP is set\. .TP \fB\-\-adopt\fP Adopt existing artifacts in the destination that are identical to those being installed\. Cannot be combined with \fB\-\-force\fP\&\. @@ -656,6 +656,11 @@ Treat all named arguments as formulae\. .TP \fB\-\-cask\fP Treat all named arguments as casks\. +.SS "\fBmcp\-server\fP \fR[\fB\-\-debug\fP]" +Starts the Homebrew MCP (Model Context Protocol) server\. +.TP +\fB\-d\fP, \fB\-\-debug\fP +Enable debug logging to stderr\. .SS "\fBmigrate\fP \fR[\fIoptions\fP] \fIinstalled_formula\fP|\fIinstalled_cask\fP \fR[\.\.\.]" Migrate renamed packages to new names, where \fIformula\fP are old names of packages\. .TP @@ -689,7 +694,7 @@ Show all options on a single line separated by spaces\. Show options for formulae that are currently installed\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to show their options\. +Evaluate all available formulae and casks, whether installed or not, to show their options\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-command\fP Show options for the specified \fIcommand\fP\&\. @@ -715,7 +720,7 @@ Print output in JSON format\. There are two versions: \fBv1\fP and \fBv2\fP\&\. Fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\[u2019]s HEAD will only be checked for updates when a new stable or development version has been released\. .TP \fB\-g\fP, \fB\-\-greedy\fP -Also include outdated casks with \fBauto_updates true\fP or \fBversion :latest\fP\&\. +Also include outdated casks with \fBauto_updates true\fP or \fBversion :latest\fP\&\. Enabled by default if \fB$HOMEBREW_UPGRADE_GREEDY\fP is set\. .TP \fB\-\-greedy\-latest\fP Also include outdated casks including those with \fBversion :latest\fP\&\. @@ -752,7 +757,7 @@ Verify any alias symlinks in each tap\. Syntax\-check all of Homebrew\[u2019]s Ruby files (if no \fItap\fP is passed)\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not\. Implied if \fB$HOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-no\-simulate\fP Don\[u2019]t simulate other system configurations when checking formulae and casks\. @@ -767,7 +772,7 @@ Unless \fB$HOMEBREW_NO_INSTALL_CLEANUP\fP is set, \fBbrew cleanup\fP will then b If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. .TP \fB\-\-display\-times\fP -Print install times for each package at the end of the run\. +Print install times for each package at the end of the run\. Enabled by default if \fB$HOMEBREW_DISPLAY_INSTALL_TIMES\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP Install without checking for previously installed keg\-only or non\-migrated versions\. @@ -776,7 +781,7 @@ Install without checking for previously installed keg\-only or non\-migrated ver Print the verification and post\-install steps\. .TP \fB\-\-ask\fP -Ask for confirmation before downloading and upgrading formulae\. Print bottles and dependencies download size, install and net install size\. +Ask for confirmation before downloading and upgrading formulae\. Print download, install and net install sizes of bottles and dependencies\. Enabled by default if \fB$HOMEBREW_ASK\fP is set\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. @@ -803,13 +808,13 @@ Create a Git repository, useful for creating patches to the software\. Treat all named arguments as casks\. .TP \fB\-\-[no\-]binaries\fP -Disable/enable linking of helper executables (default: enabled)\. +Disable/enable linking of helper executables (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_BINARIES\fP is set\. .TP \fB\-\-require\-sha\fP -Require all casks to have a checksum\. +Require all casks to have a checksum\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_REQUIRE_SHA\fP is set\. .TP \fB\-\-[no\-]quarantine\fP -Disable/enable quarantining of downloads (default: enabled)\. +Disable/enable quarantining of downloads (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_QUARANTINE\fP is set\. .TP \fB\-\-adopt\fP Adopt existing artifacts in the destination that are identical to those being installed\. Cannot be combined with \fB\-\-force\fP\&\. @@ -832,7 +837,7 @@ Search for casks\. Search for formulae with a description matching \fItext\fP and casks with a name or description matching \fItext\fP\&\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Implied if \fB$HOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-pull\-request\fP Search for GitHub pull requests containing \fItext\fP\&\. @@ -920,9 +925,9 @@ Installs and configures Homebrew\[u2019]s Ruby\. If \fBcommand\fP is passed, it .SS "\fBshellenv\fP \fR[\fIshell\fP \.\.\.]" Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh .P -Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fP, \fBMANPATH\fP, and \fBINFOPATH\fP\&\. +Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fB$PATH\fP, \fB$MANPATH\fP, and \fB$INFOPATH\fP\&\. .P -The variables \fB$HOMEBREW_PREFIX\fP, \fB$HOMEBREW_CELLAR\fP and \fB$HOMEBREW_REPOSITORY\fP are also exported to avoid querying them multiple times\. To help guarantee idempotence, this command produces no output when Homebrew\[u2019]s \fBbin\fP and \fBsbin\fP directories are first and second respectively in your \fBPATH\fP\&\. Consider adding evaluation of this command\[u2019]s output to your dotfiles (e\.g\. \fB~/\.bash_profile\fP or ~/\.zprofile\fB on macOS and ~/\.bashrc\fP or ~/\.zshrc\fB on Linux) with: \fPeval \[u201c]$(brew shellenv)\[u201d]` +The variables \fB$HOMEBREW_PREFIX\fP, \fB$HOMEBREW_CELLAR\fP and \fB$HOMEBREW_REPOSITORY\fP are also exported to avoid querying them multiple times\. To help guarantee idempotence, this command produces no output when Homebrew\[u2019]s \fBbin\fP and \fBsbin\fP directories are first and second respectively in your \fB$PATH\fP\&\. Consider adding evaluation of this command\[u2019]s output to your dotfiles (e\.g\. \fB~/\.bash_profile\fP or ~/\.zprofile\fB on macOS and ~/\.bashrc\fP or ~/\.zshrc\fB on Linux) with: \fPeval \[u201c]$(brew shellenv)\[u201d]` .P The shell can be specified explicitly with a supported shell name parameter\. Unknown shells will output POSIX exports\. .SS "\fBtab\fP \fR[\fIoptions\fP] \fIinstalled_formula\fP|\fIinstalled_cask\fP \fR[\.\.\.]" @@ -955,7 +960,7 @@ Install or change a tap with a custom remote\. Useful for mirrors\. Add missing symlinks to tap manpages and shell completions\. Correct git remote refs for any taps where upstream HEAD branch has been renamed\. .TP \fB\-\-eval\-all\fP -Evaluate all the formulae, casks and aliases in the new tap to check validity\. Implied if \fB$HOMEBREW_EVAL_ALL\fP is set\. +Evaluate all formulae, casks and aliases in the new tap to check their validity\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP Force install core taps even under API mode\. @@ -1034,7 +1039,7 @@ Unless \fB$HOMEBREW_NO_INSTALL_CLEANUP\fP is set, \fBbrew cleanup\fP will then b If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\. .TP \fB\-\-display\-times\fP -Print install times for each package at the end of the run\. +Print install times for each package at the end of the run\. Enabled by default if \fB$HOMEBREW_DISPLAY_INSTALL_TIMES\fP is set\. .TP \fB\-f\fP, \fB\-\-force\fP Install formulae without checking for previously installed keg\-only or non\-migrated versions\. When installing casks, overwrite existing files (binaries and symlinks are excluded, unless originally from the same cask)\. @@ -1046,7 +1051,7 @@ Print the verification and post\-install steps\. Show what would be upgraded, but do not actually upgrade anything\. .TP \fB\-\-ask\fP -Ask for confirmation before downloading and upgrading formulae\. Print bottles and dependencies download size, install and net install size\. +Ask for confirmation before downloading and upgrading formulae\. Print download, install and net install sizes of bottles and dependencies\. Enabled by default if \fB$HOMEBREW_ASK\fP is set\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. If no named arguments are specified, upgrade only outdated formulae\. @@ -1088,13 +1093,13 @@ Also include casks with \fBversion :latest\fP\&\. Also include casks with \fBauto_updates true\fP\&\. .TP \fB\-\-[no\-]binaries\fP -Disable/enable linking of helper executables (default: enabled)\. +Disable/enable linking of helper executables (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_BINARIES\fP is set\. .TP \fB\-\-require\-sha\fP -Require all casks to have a checksum\. +Require all casks to have a checksum\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_REQUIRE_SHA\fP is set\. .TP \fB\-\-[no\-]quarantine\fP -Disable/enable quarantining of downloads (default: enabled)\. +Disable/enable quarantining of downloads (default: enabled)\. Enabled by default if \fB$HOMEBREW_CASK_OPTS_QUARANTINE\fP is set\. .SS "\fBuses\fP \fR[\fIoptions\fP] \fIformula\fP \fR[\.\.\.]" Show formulae and casks that specify \fIformula\fP as a dependency; that is, show dependents of \fIformula\fP\&\. When given multiple formula arguments, show the intersection of formulae that use \fIformula\fP\&\. By default, \fBuses\fP shows all formulae and casks that specify \fIformula\fP as a required or recommended dependency for their stable builds\. .P @@ -1110,7 +1115,7 @@ Only list formulae and casks that are currently installed\. Only list formulae and casks that are not currently installed\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to show their dependents\. +Evaluate all available formulae and casks, whether installed or not, to show their dependents\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-include\-implicit\fP Include formulae that have \fIformula\fP as an implicit dependency for downloading and unpacking source files\. @@ -1223,7 +1228,7 @@ Run additional, slower style checks that require a network connection\. Only check formulae and casks that are currently installed\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to audit them\. Implied if \fBHOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not, to audit them\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-new\fP Run various additional style checks to determine if a new formula or cask is eligible for Homebrew\. This should be used when creating new formulae or casks and implies \fB\-\-strict\fP and \fB\-\-online\fP\&\. @@ -1231,9 +1236,6 @@ Run various additional style checks to determine if a new formula or cask is eli \fB\-\-[no\-]signing\fP Audit for app signatures, which are required by macOS on ARM\. .TP -\fB\-\-token\-conflicts\fP -Audit for token conflicts\. -.TP \fB\-\-tap\fP Check formulae and casks within the given tap, specified as \fIuser\fP\fB/\fP\fIrepo\fP\&\. .TP @@ -1326,7 +1328,7 @@ Check only formulae\. Check only casks\. .TP \fB\-\-eval\-all\fP -Evaluate all formulae and casks\. +Evaluate all formulae and casks\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .TP \fB\-\-repology\fP Use Repology to check for outdated packages\. @@ -1525,6 +1527,9 @@ Generate a formula or, with \fB\-\-cask\fP, a cask for the downloadable file at \fB\-\-autotools\fP Create a basic template for an Autotools\-style build\. .TP +\fB\-\-cabal\fP +Create a basic template for a Cabal build\. +.TP \fB\-\-cask\fP Create a basic template for a cask\. .TP @@ -1618,7 +1623,7 @@ Dispatch bottle for Linux x86_64 (using self\-hosted runner)\. \fB\-\-linux\-wheezy\fP Use Debian Wheezy container for building the bottle on Linux\. .SS "\fBedit\fP \fR[\fIoptions\fP] \fR[\fIformula\fP|\fIcask\fP|\fItap\fP \.\.\.]" -Open a \fIformula\fP, \fIcask\fP or \fItap\fP in the editor set by \fBEDITOR\fP or \fBHOMEBREW_EDITOR\fP, or open the Homebrew repository for editing if no argument is provided\. +Open a \fIformula\fP, \fIcask\fP or \fItap\fP in the editor set by \fB$EDITOR\fP or \fB$HOMEBREW_EDITOR\fP, or open the Homebrew repository for editing if no argument is provided\. .TP \fB\-\-formula\fP Treat all named arguments as formulae\. @@ -1726,7 +1731,7 @@ Enter the interactive Homebrew Ruby shell\. Show several examples\. .TP \fB\-\-pry\fP -Use Pry instead of IRB\. Implied if \fBHOMEBREW_PRY\fP is set\. +Use Pry instead of IRB\. Enabled by default if \fB$HOMEBREW_PRY\fP is set\. .SS "\fBlinkage\fP \fR[\fIoptions\fP] \fR[\fIinstalled_formula\fP \.\.\.]" Check the library links from the given \fIformula\fP kegs\. If no \fIformula\fP are provided, check all kegs\. Raises an error if run on uninstalled formulae\. .TP @@ -1740,9 +1745,9 @@ Exit with a non\-zero status if any undeclared dependencies with linkage are fou For every library that a keg references, print its dylib path followed by the binaries that link to it\. .TP \fB\-\-cached\fP -Print the cached linkage values stored in \fBHOMEBREW_CACHE\fP, set by a previous \fBbrew linkage\fP run\. +Print the cached linkage values stored in \fB$HOMEBREW_CACHE\fP, set by a previous \fBbrew linkage\fP run\. .SS "\fBlivecheck\fP, \fBlc\fP \fR[\fIoptions\fP] \fR[\fIformula\fP|\fIcask\fP \.\.\.]" -Check for newer versions of formulae and/or casks from upstream\. If no formula or cask argument is passed, the list of formulae and casks to check is taken from \fBHOMEBREW_LIVECHECK_WATCHLIST\fP or \fB~/\.homebrew/livecheck_watchlist\.txt\fP\&\. +Check for newer versions of formulae and/or casks from upstream\. If no formula or cask argument is passed, the list of formulae and casks to check is taken from \fB$HOMEBREW_LIVECHECK_WATCHLIST\fP or \fB~/\.homebrew/livecheck_watchlist\.txt\fP\&\. .TP \fB\-\-full\-name\fP Print formulae and casks with fully\-qualified names\. @@ -1951,10 +1956,10 @@ Only generate public API documentation\. \fB\-\-open\fP Open generated documentation in a browser\. .SS "\fBsh\fP \fR[\fB\-\-env=\fP] \fR[\fB\-\-cmd=\fP] \fR[\fIfile\fP]" -Enter an interactive shell for Homebrew\[u2019]s build environment\. Use years\-battle\-hardened build logic to help your \fB\&\./configure && make && make install\fP and even your \fBgem install\fP succeed\. Especially handy if you run Homebrew in an Xcode\-only configuration since it adds tools like \fBmake\fP to your \fBPATH\fP which build systems would not find otherwise\. +Enter an interactive shell for Homebrew\[u2019]s build environment\. Use years\-battle\-hardened build logic to help your \fB\&\./configure && make && make install\fP and even your \fBgem install\fP succeed\. Especially handy if you run Homebrew in an Xcode\-only configuration since it adds tools like \fBmake\fP to your \fB$PATH\fP which build systems would not find otherwise\. .TP \fB\-\-env\fP -Use the standard \fBPATH\fP instead of superenv\[u2019]s when \fBstd\fP is passed\. +Use the standard \fB$PATH\fP instead of superenv\[u2019]s when \fBstd\fP is passed\. .TP \fB\-c\fP, \fB\-\-cmd\fP Execute commands in a non\-interactive shell\. @@ -2026,11 +2031,14 @@ Include tests that use the GitHub API and tests that use any of the taps for off Enable debugging using \fBruby/debug\fP, or surface the standard \fBodebug\fP output\. .TP \fB\-\-changed\fP -Only runs tests on files that were changed from the master branch\. +Only runs tests on files that were changed from the \fBmain\fP branch\. .TP \fB\-\-fail\-fast\fP Exit early on the first failing test\. .TP +\fB\-\-no\-parallel\fP +Run tests serially\. +.TP \fB\-\-only\fP Run only \fB_spec\.rb\fP\&\. Appending \fB:\fP will start at a specific line\. .TP @@ -2084,7 +2092,7 @@ Print the number of unbottled and total formulae\. Print the \fBhomebrew/core\fP commits where bottles were lost in the last week\. .TP \fB\-\-eval\-all\fP -Evaluate all available formulae and casks, whether installed or not, to check them\. Implied if \fBHOMEBREW_EVAL_ALL\fP is set\. +Evaluate all available formulae and casks, whether installed or not, to check them\. Enabled by default if \fB$HOMEBREW_EVAL_ALL\fP is set\. .SS "\fBunpack\fP \fR[\fIoptions\fP] \fIformula\fP \fR[\.\.\.]" Unpack the source files for \fIformula\fP into subdirectories of the current working directory\. .TP @@ -2103,6 +2111,17 @@ Overwrite the destination directory if it already exists\. Update SPDX license data in the Homebrew repository\. .SS "\fBupdate\-maintainers\fP" Update the list of maintainers in the \fBHomebrew/brew\fP README\. +.SS "\fBupdate\-perl\-resources\fP \fR[\fIoptions\fP] \fIformula\fP \fR[\.\.\.]" +Update versions for CPAN resource blocks in \fIformula\fP\&\. +.TP +\fB\-p\fP, \fB\-\-print\-only\fP +Print the updated resource blocks instead of changing \fIformula\fP\&\. +.TP +\fB\-s\fP, \fB\-\-silent\fP +Suppress any output\. +.TP +\fB\-\-ignore\-errors\fP +Continue processing even if some resources can\[u2019]t be resolved\. .SS "\fBupdate\-python\-resources\fP \fR[\fIoptions\fP] \fIformula\fP \fR[\.\.\.]" Update versions for PyPI resource blocks in \fIformula\fP\&\. .TP @@ -2135,10 +2154,10 @@ Exclude these packages when finding resources\. .SS "\fBupdate\-sponsors\fP" Update the list of GitHub Sponsors in the \fBHomebrew/brew\fP README\. .SS "\fBupdate\-test\fP \fR[\fIoptions\fP]" -Run a test of \fBbrew update\fP with a new repository clone\. If no options are passed, use \fBorigin/master\fP as the start commit\. +Run a test of \fBbrew update\fP with a new repository clone\. If no options are passed, use \fBorigin/main\fP as the start commit\. .TP \fB\-\-to\-tag\fP -Set \fBHOMEBREW_UPDATE_TO_TAG\fP to test updating between tags\. +Set \fB$HOMEBREW_UPDATE_TO_TAG\fP to test updating between tags\. .TP \fB\-\-keep\-tmp\fP Retain the temporary directory containing the new repository clone\. @@ -2398,7 +2417,7 @@ Evaluate all installed taps, rather than just the core tap\. \fB\-\-max\-downloads\fP Specify a maximum number of formulae to download and update\. .SH "CUSTOM EXTERNAL COMMANDS" -Homebrew, like \fBgit\fP(1), supports external commands\. These are executable scripts that reside somewhere in the \fBPATH\fP, named \fBbrew\-\fP\fIcmdname\fP or \fBbrew\-\fP\fIcmdname\fP\fB\&\.rb\fP, which can be invoked like \fBbrew\fP \fIcmdname\fP\&\. This allows you to create your own commands without modifying Homebrew\[u2019]s internals\. +Homebrew, like \fBgit\fP(1), supports external commands\. These are executable scripts that reside somewhere in the \fB$PATH\fP, named \fBbrew\-\fP\fIcmdname\fP or \fBbrew\-\fP\fIcmdname\fP\fB\&\.rb\fP, which can be invoked like \fBbrew\fP \fIcmdname\fP\&\. This allows you to create your own commands without modifying Homebrew\[u2019]s internals\. .P Instructions for creating your own commands can be found in the docs: .UR https://docs\.brew\.sh/External\-Commands @@ -2424,7 +2443,7 @@ Note that environment variables must have a value set to be detected\. For examp .IP \(bu 4 \fB$XDG_CONFIG_HOME/homebrew/brew\.env\fP if \fB$XDG_CONFIG_HOME\fP is set or \fB~/\.homebrew/brew\.env\fP otherwise (user\-specific) .P -User\-specific environment files take precedence over prefix\-specific files and prefix\-specific files take precedence over system\-wide files (unless \fBHOMEBREW_SYSTEM_ENV_TAKES_PRIORITY\fP is set, see below)\. +User\-specific environment files take precedence over prefix\-specific files and prefix\-specific files take precedence over system\-wide files (unless \fB$HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY\fP is set, see below)\. .P Note that these files do not support shell variable expansion e\.g\. \fB$HOME\fP or command execution e\.g\. \fB$(cat file)\fP\&\. .TP @@ -2833,7 +2852,7 @@ If set, Homebrew will use the given config file instead of \fB~/\.ssh/config\fP .RE .TP \fBHOMEBREW_SUDO_THROUGH_SUDO_USER\fP -If set, Homebrew will use the \fBSUDO_USER\fP environment variable to define the user to \fBsudo\fP(8) through when running \fBsudo\fP(8)\. +If set, Homebrew will use the \fB$SUDO_USER\fP environment variable to define the user to \fBsudo\fP(8) through when running \fBsudo\fP(8)\. .TP \fBHOMEBREW_SVN\fP Use this as the \fBsvn\fP(1) binary\. @@ -2922,7 +2941,7 @@ Homebrew\[u2019]s Project Leader is Mike McQuaid\. .P Homebrew\[u2019]s Project Leadership Committee is Colin Dean, Michka Popoff, Mike McQuaid, Patrick Linnane and Vanessa Gennarelli\. .P -Homebrew\[u2019]s Technical Steering Committee is Bo Anderson, FX Coudert, Mike McQuaid and Rylan Polster\. +Homebrew\[u2019]s Technical Steering Committee is Bo Anderson, Issy Long, Michael Cho, Mike McQuaid and Ruoyu Zhong\. .P Homebrew\[u2019]s maintainers are Alexander Bayandin, Bevan Kay, Bo Anderson, Branch Vincent, Caleb Xu, Carlo Cabrera, Daeho Ro, Douglas Eichelberger, Dustin Rodrigues, Eric Knibbe, FX Coudert, Issy Long, Justin Krehel, Klaus Hipp, Markus Reiter, Michael Cho, Michka Popoff, Mike McQuaid, Nanda H Krishna, Patrick Linnane, Rui Chen, Ruoyu Zhong, Rylan Polster, Sam Ford, Sean Molenaar, Štefan Baebler, Thierry Moisan, Timothy Sutton and William Woodruff\. .P diff --git a/package/scripts/postinstall b/package/scripts/postinstall index dc83014913..b194590df9 100755 --- a/package/scripts/postinstall +++ b/package/scripts/postinstall @@ -93,3 +93,12 @@ mkdir -vp "${user_api_cache_dir}" mv -v "${homebrew_directory}/cache_api/"* "${user_api_cache_dir}" chown -R "${homebrew_pkg_user}:staff" "${user_cache_dir}" rm -vrf "${homebrew_directory}/cache_api" + +# create paths.d file for /opt/homebrew installs +# (/usr/local/bin is already in the PATH) +if [[ -d "/etc/paths.d" && "${homebrew_directory}" == "/opt/homebrew" ]] +then + mkdir -vp /etc/paths.d + echo "/opt/homebrew/bin" >/etc/paths.d/homebrew + chown root:wheel /etc/paths.d/homebrew +fi