Coder Social home page Coder Social logo

Comments (2)

julienanquetil avatar julienanquetil commented on August 21, 2024 2

I Mean the phpcs one for example the default one

name: ExtDN M2 Coding Standard
on: [push, pull_request]

jobs:
  static:
    name: M2 Coding Standard
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-coding-standard@master

if you get a git repo for a magento project and not a module you will get some "false" report (like not what I expect)
inspection on setup/ and other folder

Capture d’écran 2021-09-01 à 12 19 40

my goals is to run phpcs only on app/code/ folder by doing something like

Updating the action.yml like that

name: 'Magento 2 Coding Style'
author: 'ExtDN'
description: 'performs php static code analysis with the Magento 2 Coding Standard'
inputs:
  phpcs_standard:
    description: 'Path to your own PHPCS file or a specific standard. Leave empty to use "Magento2".'
    required: false
  folder_name:
    description: 'Path to run the PHPCS inspection if not the whole project".'
    required: false
runs:
  using: 'docker'
  image: 'docker://extdn/magento-coding-standard-action:latest'
branding:
  icon: 'code'  
  color: 'green'


and then update the entrypoint like

sh -c "/root/.composer/vendor/bin/phpcs --report=checkstyle --standard=$INPUT_PHPCS_STANDARD $GITHUB_WORKSPACE/${INPUT_FOLDER_NAME} -s $*"

and finally be able in the project repo to add the workflow like

name: PHPCS Tests dev
on: [push, pull_request]

jobs:
  static:
    name: Static Code Analysis PHPCS
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-coding-standard@master
        with:
          folder_name: app/code/VENDORNAME

i hope it's more clear ?

I made a "quick & dirty" test by changing the docker image (by forking your's) and got my use case working as expected. Not sure if relevant for everyone but usefull on our case :)

Thanks

from github-actions-m2.

jissereitsma avatar jissereitsma commented on August 21, 2024

Thanks for the suggestion. Just for clearity, which GitHub action are you referring to? I guess the PHPStan version because the PHPCS action does not use composer or Magento or anything - it just installs PHPCS and runs it ... If you could share your setup it would be helpful I guess.

from github-actions-m2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.