Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ArtARTs36/php-merge-request-linter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.15.1
Choose a base ref
...
head repository: ArtARTs36/php-merge-request-linter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 28, 2023

  1. [Optimization] Add diff fragments for fast search in changes (#53)

    * Add DiffFragment
    
    * fix diffmapper
    
    * remove diffline
    
    * remove unless
    
    * up test
    
    * Add tests for Diff
    
    * up version
    
    * fix lint
    
    * fix lint
    ArtARTs36 authored Jul 28, 2023
    Copy the full SHA
    15084ee View commit details

Commits on Jul 29, 2023

  1. [Feature] Add Rule "no ssh keys" (#54)

    * Add NoSshKeysRule
    
    * add ssh key finder
    
    * add service providers
    
    * move providers
    
    * up
    
    * Add EventDispatcherProvider
    
    * Add PrivateKeyFinder
    
    * Add RsaKeyFinderTest
    
    * change test
    
    * fix diff fragment
    
    * Add integration test
    
    * change config
    
    * fix false positive
    
    * split find methods
    
    * add test
    
    * add test
    
    * move test
    
    * fix rule name
    
    * up config
    
    * up config
    
    * Add Rule "@mr-linter/disable_file_extensions"
    
    * add test
    
    * fix stat analyse
    
    * add coverage ignore
    
    * add tests
    
    * add test
    
    * add test
    
    * add test
    
    * up version
    
    * change notification template
    
    * change notification template
    
    * update docs
    ArtARTs36 authored Jul 29, 2023
    Copy the full SHA
    05c36cf View commit details

Commits on Aug 6, 2023

  1. [Feature] Add Comments (#51)

    * Add comments
    ArtARTs36 authored Aug 6, 2023
    Copy the full SHA
    50c285c View commit details
  2. [Docs] Update docs (#55)

    * move examples to array item
    
    * upd doc
    
    * update rules page
    
    * print generic type
    
    * remove unless
    
    * remove unless
    
    * print rule description
    
    * print rule description
    
    * print rule description
    
    * update doc
    
    * add test
    
    * add doc
    
    * add doc
    
    * add doc
    
    * up doc
    
    * up doc
    
    * update comment
    
    * add space
    
    * change linter token
    ArtARTs36 authored Aug 6, 2023
    Copy the full SHA
    89a7647 View commit details
  3. change token for doc push

    ArtARTs36 committed Aug 6, 2023
    Copy the full SHA
    340ccf9 View commit details

Commits on Aug 7, 2023

  1. update rules doc

    ArtARTs36 committed Aug 7, 2023
    Copy the full SHA
    2a16950 View commit details

Commits on Aug 13, 2023

  1. [Feature] Add GitLab CI job token (#57)

    * add job token
    * fix phar building
    ArtARTs36 authored Aug 13, 2023
    Copy the full SHA
    ce18db7 View commit details

Commits on Aug 27, 2023

  1. Update getting-started.md

    ArtARTs36 authored Aug 27, 2023
    Copy the full SHA
    a5131f4 View commit details

Commits on Aug 28, 2023

  1. [Optimization] Catch HTTP exceptions (#56)

    * catch graphql not found exception
    
    * catch and log
    
    * remove exception
    
    * gitlab
    
    * bb
    
    * add http exceptions
    
    * update contract
    
    * add throws
    
    * add FetchMergeRequestException
    
    * catch http exceptions
    
    * fix catch
    
    * catch github
    
    * catch gitlab
    
    * add test
    
    * remove catch
    
    * fix lint
    
    * fix stat-analyse
    
    * add exceptions
    
    * fix lint
    
    * fix stat-analyse
    
    * fix test
    
    * fix test
    
    * fix test
    
    * fix lint
    
    * fix test
    
    * add test
    
    * add test
    
    * add test
    
    * add logs to http client
    
    * fix/add test
    
    * add test
    
    * add test
    
    * add test
    
    * fix lint
    
    * fix lint
    
    * fix test
    
    * up currently not merge request exception
    
    * unwrap sprintf
    
    * catch github update comment
    
    * catch post comment
    
    * catch post comment
    
    * catch auth map exceptions
    
    * remove unless class
    
    * catch load config exceptions
    
    * set as final
    
    * provide subjects
    
    * fix mock
    
    * add test
    
    * fix lint
    
    * add test
    
    * fix lint
    
    * fix mock
    
    * remove CiSystem::isCurrentlyMergeRequest
    
    * catch update comment bb
    
    * catch update comment gl
    
    * catch post comment gl
    
    * fix test
    
    * catch env exception ga
    
    * catch env exception ga
    
    * throw find comment bb
    
    * fix lint
    
    * fix test
    
    * catch get first comment ga
    
    * catch get first comment gl
    
    * fix lint
    
    * up
    
    * update changelog
    ArtARTs36 authored Aug 28, 2023
    Copy the full SHA
    32a3450 View commit details
  2. up example

    ArtARTs36 committed Aug 28, 2023
    Copy the full SHA
    89a5549 View commit details
  3. update docs

    ArtARTs36 committed Aug 28, 2023
    Copy the full SHA
    6f08207 View commit details

Commits on Aug 29, 2023

  1. [Feature] Add title conventional rule (#58)

    * Add rule
    
    * fix test
    
    * update docs
    
    * up version / changelog
    
    * fix ArrayResolver on nullable type
    ArtARTs36 authored Aug 29, 2023
    Copy the full SHA
    63e1a9a View commit details
  2. reduced docker image size

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    dbd37f4 View commit details
  3. remove unless dockerfile

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    77db40f View commit details
  4. update rules page

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    ecb17da View commit details
  5. Copy the full SHA
    8e6be56 View commit details
  6. update review workflow

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    1fc8bfe View commit details
  7. Copy the full SHA
    7014fe3 View commit details
  8. Bump guzzlehttp/psr7 from 2.4.3 to 2.4.5 (#59)

    Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 2.4.3 to 2.4.5.
    - [Release notes](https://github.com/guzzle/psr7/releases)
    - [Changelog](https://github.com/guzzle/psr7/blob/2.6/CHANGELOG.md)
    - [Commits](guzzle/psr7@2.4.3...2.4.5)
    
    ---
    updated-dependencies:
    - dependency-name: guzzlehttp/psr7
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 29, 2023
    Copy the full SHA
    1d1557b View commit details
  9. up version

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    c7391d5 View commit details
  10. add link to docker hub

    ArtARTs36 committed Aug 29, 2023
    Copy the full SHA
    c6fda0f View commit details

Commits on Aug 30, 2023

  1. [Optimization] Update PHP to 8.2 (#60)

    * final / non-empty-string
    
    * print runtime
    
    * add descriptions
    
    * final
    
    * update php to 8.2
    
    * update php to 8.2
    
    * update deps
    
    * readonly
    
    * readonly
    
    * readonly
    
    * readonly
    
    * readonly
    
    * non-empty-string
    
    * up version
    
    * up version
    ArtARTs36 authored Aug 30, 2023
    Copy the full SHA
    6cbcbbb View commit details
  2. fix release

    ArtARTs36 committed Aug 30, 2023
    Copy the full SHA
    dff9a21 View commit details

Commits on Sep 1, 2023

  1. update changelog

    ArtARTs36 committed Sep 1, 2023
    Copy the full SHA
    e5b8b22 View commit details

Commits on Sep 2, 2023

  1. [Feature] Title conventional with task (#61)

    * add group for message
    
    * add group for type and module
    
    * Add task number
    
    * check any project code
    
    * allow many project codes
    
    * use arrayee
    
    * up test
    
    * update docs
    
    * clean rule
    
    * fix lint
    
    * fix stat analyse
    
    * Add ProjectCode helper
    
    * up version
    
    * Add test for ProjectCode helper
    ArtARTs36 authored Sep 2, 2023
    Copy the full SHA
    afba942 View commit details

Commits on Sep 3, 2023

  1. [Optimization] Refactor project codes rules (#62)

    * refactor @mr-linter/title_starts_with_task_number
    
    * refactor @mr-linter/branch_starts_with_task_number
    
    * fix description
    
    * refactor @mr-linter/youtrack/has_issue_link
    
    * refactor @mr-linter/jira/has_issue_link
    
    * update docs
    
    * fix stat analyse
    
    * Add RuleMetadataLoader
    
    * refactor rules page doc
    
    * resolve generic
    
    * update docs
    
    * generic
    
    * upd doc
    
    * upd doc
    
    * upd doc
    
    * fix test
    
    * fix doc
    
    * refactor to use description attribute
    
    * refactor to use description attribute
    
    * fix resolving type of enum
    
    * remove ClassSummary
    
    * fix stay analyse
    
    * add prefix
    
    * add test case
    
    * add test
    
    * up version
    ArtARTs36 authored Sep 3, 2023
    Copy the full SHA
    22b22c0 View commit details
  2. Copy the full SHA
    45aac08 View commit details

Commits on Sep 4, 2023

  1. up version

    ArtARTs36 committed Sep 4, 2023
    Copy the full SHA
    4bdc7d5 View commit details

Commits on Sep 11, 2023

  1. [Feature] Add Rule "changelog_has_new_release" (#63)

    * parsing release
    
    * no generate docs for no described parameters
    
    * optimize search type
    
    * fix lint
    
    * change rule
    
    * virtual default value
    
    * default value
    
    * wrap def val
    
    * lint when 2 lines modified
    
    * up test
    
    * check old tags
    
    * add test for set
    
    * add test for release parser
    
    * add test
    
    * improve set
    
    * remove empty comments from src/
    
    * fix stat analyse
    
    * up version
    
    * test
    
    * print filename
    ArtARTs36 authored Sep 11, 2023
    Copy the full SHA
    cdbd295 View commit details

Commits on Sep 12, 2023

  1. [Feature] Not intersect evaluator (#64)

    * add evaluator
    
    * up doc
    
    * split feature bug
    
    * fix stat analyse
    
    * clean make
    
    * add test
    
    * fix make docs
    
    * up docs
    
    * fix evaluator when values count > 2
    
    * catch invalid environment variable value
    
    * up version
    
    * up version
    
    * add unreleased link to changelog
    ArtARTs36 authored Sep 12, 2023
    Copy the full SHA
    872ab1a View commit details
  2. [Feature] Add Rule "description template" (#65)

    * Add DescriptionTemplateRule
    
    * remove has_any_labels_of
    
    * up doc
    
    * up doc
    
    * add release tag placeholder
    
    * clean
    
    * up self config
    
    * up version
    ArtARTs36 authored Sep 12, 2023
    Copy the full SHA
    cb205ae View commit details
  3. Copy the full SHA
    092271a View commit details
  4. up version

    ArtARTs36 committed Sep 12, 2023
    Copy the full SHA
    7edd54a View commit details

Commits on Sep 13, 2023

  1. [Feature] Add IsNumberEvaluator (#66)

    * Add is number evaluator
    
    * Add containsNumber evaluator
    
    * up docs
    
    * fix lint
    
    * add test
    
    * add security check
    
    * add security check
    
    * fix make security command
    
    * up version
    
    * up version
    
    * up workflow
    
    * up test
    
    * fix test
    ArtARTs36 authored Sep 13, 2023
    Copy the full SHA
    c25de67 View commit details

Commits on Sep 26, 2023

  1. [Optimization] Add tests (#67)

    * Add ObjectCompositeResolverTest
    
    * remove unless polyfills
    
    * up test
    
    * up test
    
    * up test
    
    * up test
    
    * up test
    
    * up test
    
    * up test
    
    * add test for array map
    
    * add test for count proxy
    
    * Add test for Rules
    
    * Add test for Diff
    
    * add test
    
    * fix lint
    
    * remove rule
    
    * add test for Resolver
    
    * add test for ConfigFormat
    
    * add test for LinterFactory
    
    * add tests for tool info subjects
    
    * add test
    
    * add version
    
    * add version
    ArtARTs36 authored Sep 26, 2023
    Copy the full SHA
    eddca60 View commit details
Showing 594 changed files with 17,416 additions and 4,434 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: xdebug

- name: Cache Composer packages
@@ -37,4 +37,4 @@ jobs:
- name: Push docs to site
run: make push-docs
env:
DOCS_RETRIEVER_HTTP_TOKEN: ${{ secrets.MR_LINTER_GITHUB_HTTP_TOKEN }}
DOCS_RETRIEVER_HTTP_TOKEN: ${{ secrets.DOCS_RETRIEVER_GITHUB_HTTP_TOKEN }}
35 changes: 30 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -9,8 +9,19 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: set MR-Linter version
run: echo "MR_LINTER_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
run: echo "MR_LINTER_VERSION=${{ steps.get_release.outputs.tag_name }}" >> $GITHUB_ENV

- name: composer deps
run: composer install --no-interaction --no-dev --prefer-dist --optimize-autoloader
@@ -26,11 +37,25 @@ jobs:
with:
args: gpg --command-fd 0 --pinentry-mode loopback -u temicska99@mail.ru --batch --detach-sign --output bin/build/mr-linter.phar.asc bin/build/mr-linter.phar

- name: release phar
uses: fnkr/github-action-ghr@v1
- name: Upload phar
uses: actions/upload-release-asset@v1
env:
GHR_PATH: bin/build
GITHUB_TOKEN: ${{ secrets.MR_LINTER_GITHUB_HTTP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./bin/build/mr-linter.phar
asset_name: mr-linter.phar
asset_content_type: application/octet-stream

- name: Upload phar.asc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./bin/build/mr-linter.phar.asc
asset_name: mr-linter.phar.asc
asset_content_type: application/octet-stream

- name: build and publish Docker Image
env:
6 changes: 4 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ on:
jobs:
review:

if: github.actor != 'dependabot[bot]'

runs-on: ubuntu-latest

steps:
@@ -20,7 +22,7 @@ jobs:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: xdebug

- name: Cache Composer packages
@@ -38,7 +40,7 @@ jobs:

- name: Review Pull Request
env:
MR_LINTER_GITHUB_HTTP_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MR_LINTER_GITHUB_HTTP_TOKEN: ${{ secrets.MR_LINTER_GITHUB_HTTP_TOKEN }}
MR_LINTER_TELEGRAM_BOT_TOKEN: ${{ secrets.MR_LINTER_TELEGRAM_BOT_TOKEN }}
MR_LINTER_TELEGRAM_CHAT_ID: ${{ secrets.MR_LINTER_TELEGRAM_CHAT_ID }}
MR_LINTER_TIMEZONE: 'Europe/Moscow'
18 changes: 18 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Security

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
security:
name: Local PHP Security Checker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Local PHP Security Checker
uses: docker://pplotka/local-php-security-checker-github-actions
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ name: Testing

on:
push:
branches: [ master, 'dev' ]
branches: [ master ]
pull_request:
branches: [ master, 'dev' ]
branches: [ master ]

jobs:
testing:
@@ -17,7 +17,7 @@ jobs:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: xdebug

- name: Validate composer.json
75 changes: 52 additions & 23 deletions .mr-linter.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
rules:
"@mr-linter/has_any_labels_of":
"@mr-linter/has_any_labels":
labels:
- Feature
- Bug
- Docs
- Tests
- Optimization

"@mr-linter/description_template":
- definition: description must have list of features
template: |
## Added
{text_multiline}
when:
labels:
has: "Feature"

- definition: description must have list of fixed bugs
template: |
## Fixed
{text_multiline}
when:
labels:
has: "Bug"

"@mr-linter/title_must_starts_with_any_prefix":
prefixes:
- '[Feature]'
@@ -17,7 +34,7 @@ rules:

"@mr-linter/description_not_empty": {}

"@mr-linter/update_changelog":
"@mr-linter/changelog_has_new_release":
when:
targetBranch:
equals: "master"
@@ -26,6 +43,10 @@ rules:
- '[Tests]'
- '[Docs]'

"@mr-linter/no_ssh_keys":
stopOnFirstFailure: true
critical: false

"@mr-linter/has_changes":
- changes:
- file: "src/Version.php"
@@ -38,33 +59,23 @@ rules:
- '[Tests]'
- '[Docs]'

"@mr-linter/disable_file_extensions":
extensions:
- pem
- pub

custom:
- definition: "Branch must be in kebab-case"
rules:
sourceBranch:
isKebabCase: true

- definition: "Labels must be in StudlyCase"
rules:
labels:
$all:
isStudlyCase: true

- definition: "Description must have list of fixed bugs"
- definition: "Split feature / bug PR"
rules:
descriptionMarkdown:
containsHeading2: "Fixed"
when:
labels:
has: "Bug"

- definition: "Description must have list of features"
rules:
descriptionMarkdown:
containsHeading2: "Added"
when:
labels:
has: "Feature"
notIntersect:
- Feature
- Bug

notifications:
channels:
@@ -77,7 +88,7 @@ notifications:
lint_finished:
channel: 'dev'
template: |
👀 Review on PR "{{ request.title }}" by {{ request.author.login }} at {{ request.createdAt.format('Y-m-d H:i') }}
👀 Review on PR "{{ request.title | raw }}" by {{ request.author.login }} at {{ request.createdAt.format('Y-m-d H:i') }}
🌲 {{ request.sourceBranch }} ➡ {{ request.targetBranch }}
@@ -86,10 +97,28 @@ notifications:
📉 Notes: {{ result.notes.count }}
{% for note in result.notes %}
- {{ note.description }}
- {{ note.description | raw }}
{% endfor %}
ci:
github_actions:
credentials:
token: 'env(MR_LINTER_GITHUB_HTTP_TOKEN)'

comments:
strategy: 'single'
messages:
- template: |
I found {{ result.notes.count }} notes in your Pull Request:
{% for note in result.notes %}
- {{ note.description | raw }}
{% endfor %}
when:
result.notes:
isEmpty: false
- template: |
I didn't find any notes in your Pull Request.
when:
result.notes:
isEmpty: true
Loading