Giter Club home page Giter Club logo

Comments (6)

markstory avatar markstory commented on June 8, 2024

You might be able to just install the pear package for cakephp-codesniffer with composer. I have not done it before, so it might not work. It depends on how phpcs finds other standards. I know that when installed via pear the directory structure has to be correct for everything to work.

from cakephp-codesniffer.

davidsteinsland avatar davidsteinsland commented on June 8, 2024

I was able to install the CakePHP sniffs by installing CakePHP_CodeSniffer via composer, and then symlink the sniff folder to CodeSniffer/Standards/CakePHP.

    "require": {
        "pear-pear.cakephp.org/CakePHP_CodeSniffer": "*"
    },
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.cakephp.org"
        }
    ]

The symlinking can be done via post-install-script and post-update-script.

from cakephp-codesniffer.

markstory avatar markstory commented on June 8, 2024

Would you be able to send us the post-install-script you used? I could add it to the repository and also start publishing a composer package.

from cakephp-codesniffer.

davidsteinsland avatar davidsteinsland commented on June 8, 2024

It's a bit long, hopefully you get it all.

    "post-install-cmd": [
        "if [ ! -h vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/CakePHP ]; then ln -s vendor/pear-pear.cakephp.org/CakePHP_CodeSniffer/PHP/CodeSniffer/Standards/CakePHP/ vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/CakePHP ; fi"
    ]

from cakephp-codesniffer.

markstory avatar markstory commented on June 8, 2024

Thanks 👍 We might need to do this in PHP code as bash + windows = nope.

from cakephp-codesniffer.

davidsteinsland avatar davidsteinsland commented on June 8, 2024

That's a good point. Perhaps using a custom install path would solve the issue? That way composer can install the package directly under squizlabs/php_codesniffer/CodeSniffer/Standards/CakePHP. There would still be some challenges left, however, since the sniffs aren't in the root of the repository.

from cakephp-codesniffer.

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.