Giter Site home page Giter Site logo

Comments (2)

gregrickaby avatar gregrickaby commented on June 11, 2024 1

Quick update:

@daveromsey and I were able to get the initial setup and integration with Github done. Up next, adding phpcs.xml and any other tests to verify that Yeoman can stand up the plugin generator.

from generator-plugin-wp.

asharirfan avatar asharirfan commented on June 11, 2024

Quick update:

I have been looking into the PHPCS assertions to run against this repository.

Linting the source code

phpcs command breaks as soon as it detects any syntax errors in the code. The template files in the repository do contain some syntax errors due to some generator placeholders.

I have tried using phpcs:ignore at this line but it does not work.

Generating plugin and linting the code

After this, I tried to generate a temporary sample plugin with yo generator on the Buddy docker container.

  • Installed Node.js in the container.
  • Installed yo generator npm package.
  • Tried generating the plugin using generator-plugin-wp as the generator and got the following errors:
/usr/lib/node_modules/yo/node_modules/conf/index.js:128
            throw err;
            ^

Error: EACCES: permission denied, open '/root/.config/insight-nodejs/insight-yo.json'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at Conf.get store [as store] (/usr/lib/node_modules/yo/node_modules/conf/index.js:108:18)
    at Conf.get (/usr/lib/node_modules/yo/node_modules/conf/index.js:47:27)
    at Insight.get optOut [as optOut] (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:52:22)
    at Object.<anonymous> (/usr/lib/node_modules/yo/lib/cli.js:205:48)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/root/.config/insight-nodejs/insight-yo.json'
}

To resolve these errors, I tried running the chmod command to give permissions to the file mentioned in the error. But this error does not go away even after running the permissions command.

I am stuck on this step until I figure out how to move past this error.

Update

I switched back to ignoring errors in phpcs and found out that we can ignore PHP syntax errors like this: squizlabs/PHP_CodeSniffer#1874 (comment)

I have added the phpcs.xml file for the repository and will be sending the PR shortly.

from generator-plugin-wp.

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.