AtomLinter / linter-phpcs

Linter plugin for PHP, using PHP_CodeSniffer.
63 stars 31 forks source link

feat: adding ./bin/ to the list of autoloaded phpcs paths #419

Closed aldavigdis closed 5 years ago

aldavigdis commented 5 years ago

Some the most important projects that we work with at Automattic has executables such as phpcs inside of the ./bin directory as opposed to inside ./vendor/bin/, making linter-phpcs fall back on a global phpcs executable.

I'm certain having tools in the ./bin/ directory but not ./vendor/bin/ is common in other legacy codebases as well.

This PR adds ./bin to the array of directories read by autoExecutableSearch and fixes that issue.

aldavigdis commented 5 years ago

circleci seems to fail here due to a configuration issue.

aldavigdis commented 5 years ago

There's also a similar issue with the PHP 5.6 build in Travis. It seems to be failing due to a network glitch.

simison commented 5 years ago

Works nicely with Atom 1.36.1. I had linter package enabled together with atom-ide-diagnostics which is conflicting, yet everything works smooth.

image image image
aldavigdis commented 5 years ago

Attempting to trigger a new build by closing and re-opening.

aldavigdis commented 5 years ago

Travis is green now, but ci/circleci: beta and ci/circleci: stable are red due to the same configuration issue as before:

#!/bin/bash -eo pipefail
composer global require "squizlabs/php_codesniffer ${PHPCS_VER}"

Changed current directory to /home/atom/.composer

  [UnexpectedValueException]                                              
  Your github oauth token for github.com contains invalid characters: ""  

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

Exited with code 1
Arcanemagus commented 5 years ago

@simison Just for your own information:

Both of those are consumers of the Linter API, so they aren't conflicting necessarily, but having both enabled does the same work twice so it's probably not the best of ideas 😉.

simison commented 5 years ago

@Arcanemagus Yup, I'm aware. Just enabled the linter package temporarily to test this PR since this package seemed to depend on it. :-) Thanks both!

Arcanemagus commented 5 years ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: