Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems setting up PHP_CodeSniffer in Emacs #2046

Open
6 of 9 tasks
charliecodesonline opened this issue Nov 30, 2023 · 1 comment
Open
6 of 9 tasks

Problems setting up PHP_CodeSniffer in Emacs #2046

charliecodesonline opened this issue Nov 30, 2023 · 1 comment

Comments

@charliecodesonline
Copy link

This template is for user support. If you are reporting an actual Flycheck bug, please use the relevant issue template instead.

Checklist

  • I have searched existing issues and StackOverflow for solutions.
  • I have read the Flycheck manual.
  • I have read the Troubleshooting Guide.
  • I have checked my issue has not been reported yet.

Problem description

I have configured a custom ruleset and it is not getting used.

Steps to reproduce

Steps to reproduce the behavior:

  1. Add configuration to init.el
(use-package flycheck
  :ensure t
  :diminish flycheck-mode
  :custom
  (flycheck-php-executable "/usr/bin/php")
  (flycheck-phpcs-executable "/usr/local/bin/phpcs")
  (flycheck-phpcs-standard "/usr/local/bin/.phpcs.xml")
  (flycheck-phpmd-executable "/usr/local/bin/phpmd")
  :init (global-flycheck-mode))
(add-hook 'after-init-hook #'global-flycheck-mode)
  1. Create /usr/local/bin/.phpcs.xml
<?xml version="1.0"?>
<ruleset name="SERStandard">
    <description>My custom coding standard.</description>
    <rule ref="PEAR">
        <exclude name="PEAR.NamingConventions.ValidFunctionName.PrivateNoUndescore" />
    </rule>
</ruleset>
  1. See error
    PEAR.NamingConventions.ValidFunctionName error still occurs in mini buffer window

Expected behavior

A clear and concise description of what you expected to happen.
The rule should no longer be enforced so this error should not be displayed in the minibuffer

Screenshots

If applicable, add screenshots to help explain your problem.

image

System configuration

Syntax checkers for buffer AlphaCharacterState.php in php-mode:

First checker to run:

  php
    - may enable:    yes
    - executable:    Found at /usr/bin/php
    - next checkers: php-phpmd, php-phpcs

Checkers that may run as part of the first checker's chain:

  php-phpmd
    - may enable:    yes
    - executable:    Found at /usr/local/bin/phpmd
    - next checkers: php-phpcs

  php-phpcs
    - may enable: yes
    - may run:    t
    - executable: Found at /usr/local/bin/phpcs

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 33snapshot (package: 20230813.620)
Emacs version:    27.1
System:           x86_64-pc-linux-gnu
Window system:    x

Emacs configuration:

  • Plain Emacs / Custom configuration
  • Spacemacs
  • Doom Emacs
  • Other shared configuration

Additional notes

Add any other context about the problem here.

@bbatsov
Copy link
Contributor

bbatsov commented Feb 11, 2024

@flycheck/php Can someone take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants