GithubHelp home page GithubHelp logo

wayneashleyberry / phplint Goto Github PK

View Code? Open in Web Editor NEW
63.0 63.0 14.0 279 KB

Lightning fast concurrent PHP linter for Node.js, Grunt & Gulp! ⚡️

License: MIT License

JavaScript 99.28% PHP 0.72%
grunt gulp linter node php

phplint's Introduction

Hey 👋️ My name is Wayne. I'm a Principle Software Engineer at GoDaddy working on Studio — an app formerly known as Over. Previously, I co-founded Next with Shawn and functioned as the Lead Developer & CTO. You can reach me on Twitter or LinkedIn. I share open-source projects here and have some old creative work up on Dribbble.

📌️ Zero downtime deployments with Go and Kubernetes

"If you’re writing Go then you’re probably aware that graceful shutdown was added to the http package in 1.8. The HTTP server also adds support for graceful shutdown, allowing servers to minimize downtime by shutting down only after serving all requests that are in flight. Similarly, If you’re using Kubernetes then I’m sure you’re aware of, and hopefully using rolling updates for your deployments." — Continue reading on my blog...

🕑️ The Most Exciting Feature of Go 1.18

"It’s been 5 years since I wrote about the most exciting feature of Go 1.8 and there have been significant improvements in the language, toolchain and ecosystem since then. I’m not going to cover any of that… Go 1.18 is around the corner, being set to release in February of 2022, and the release notes already describe a very exciting, albeit small, feature. Go 1.18 brings generics, fuzz testing, improved support for IP address types and faster image drawing operations amongst other things." — Continue reading on my blog...

Follow me on Mastodon

phplint's People

Contributors

dependabot[bot] avatar ferencb avatar gabceb avatar jamesrwhite avatar jimbocoder avatar juhq avatar pyxze avatar wayneashleyberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

phplint's Issues

Showing the line number of the error?

Adding -d display_errors=1 to the command line argument usually does it but I don't find a way to do it using this wrapper.

Any tips how to do it? Thanks.

Cannot exclude files using grunt

I'm in a situation where I need to explicitly exclude some files that fail verification because I won't fix these anytime soon. I expected that I would be able to do something like:

['files/**/*', 'files/my_file_to_exclude.php']

But with grunt this definition doesn't work. It seems that, contrary to the CLI and gulp, you don't leverage globby before you call iterate.

HHVM support

Hi there,
I replaced the phpCmd with hhvm and the script fails when "spawing" the process because of the -v switch.

I tried passing hhvm --php so the -v option would be supported but without success.

I think that, instead of passing -v, we should use the --version switch or make it configurable somehow.

Thank you,

How to suppress "No syntax errors detected" messages?

When I run my gulp commands that include the phpLint job, when all my PHP is correct, I get the following output, one per file:

No syntax errors detected in src/server/sessionEnd.php

Is there a way to suppress this? Ideally, I would like to see output only when there is a syntax error.

The code I am using:

gulp.task('lint:php', lintPHP);

function lintPHP(callback) {
  return phplint(['src/**/*.php'],
                 {limit: 10, stdout: true, stderr: true},
                 function(err, stdout, stderr) {
    if(err) {
      process.exit(1);
    } else {
      callback();
    }
  });
}

You can see that this is basically a cut/paste from the gulp example on the README along with some of the options as seen in the Grunt example. I have also removed the callback(err) call since it was just printing a useless stack-trace (below). I was trying to play around with the options and calls but couldn't get quite what I was looking for.

# This is the second part of the output if I include the callback(err) call 
# before the process.exit(1) as in the original example

[10:16:18] 'lint:php' errored after 474 ms
[10:16:18] Error: Command failed: /bin/sh -c php -l src/server/leaderboardRequest.php

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

Using phplint with gulp.src and pipe

Is it possible to use phplint with gulp.src and pipe?

For example, I would like to do something along the lines of:

gulp.task('php', php);

function php(callback) {
  return gulp.src(['src/**/*.php'])
      .pipe(phpStuff1)
      .pipe(phpStuff2)
      .pipe(phplint({limit: 10}))
      .pipe(phpStuff3)
      .pipe(gulp.dest('dist'));
};

os.tmpDir deprecated warning

More of a note to myself to fix this:

DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

Its common in a lot of older programs will try and PR this soon.

config json to set options

Other linters (like tslint) have the option to create a .json to define what the code checker should check for (eol, whitespaces, class constructors, etc.). I cannot see this here. Is that possible, or planned?

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.