-
Notifications
You must be signed in to change notification settings - Fork 40
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
[META][DX] Automate phpcs code checks (linting) against all backdrop/backdrop PRs. #3213
Comments
@quicksketch for
should we be adding the |
…here to Backdrop coding standards.
@quicksketch there are probably going to be a fair amount of these lower_case class names; here is what I did so far: // @codingStandardsIgnoreStart
// @TODO: Make all classes CamelCase and class methods lowerComelCase in 2.x.
class views_plugin_argument_default_book_root extends views_plugin_argument_default_node { class views_plugin_argument_default_book_root extends views_plugin_argument_default_node {
function get_argument() { function get_argument() {
// Use the argument_default_node plugin to get the nid argument. // Use the argument_default_node plugin to get the nid argument.
@@ -19,3 +21,4 @@ class views_plugin_argument_default_book_root extends views_plugin_argument_defa
} }
} }
} }
// @codingStandardsIgnoreEnd seem appropriate? what do you think? |
…dhere to Backdrop coding standeards.
I successfully ran the command and got I like |
I know the php version for that version of phpcs is > php 5.3 so i'm not sure we could do that |
Does it need a version number...? As a "command line tool" and "not a module" (source: https://www.drupal.org/project/coder) can't we just have a 1.x branch that has Backdrop's up-to-date coding standards?
What if we called it something like |
Good catch, ...but even drush has versions: https://github.com/backdrop-contrib/backdrop-drush-extension/releases
I like that 👍 |
Why change the name from coder though, if it's the same thing? Won't it be easier for people coming from Drupal?
|
What percentage of Backdrop sites using Coder will be coming from Drupal...? 😉 Edit: If it's easier to keep the name, that's fine. Was just a suggestion that made more sense to me. |
In today's weekly meeting @quicksietch pointed out that in the future we may also want to include javascript testing, and that we might want the code for those js tests to live in the same project as the code for our PHP tests. That way, if we made a change to our coding standards that affected both, we could update the project with one PR. So maybe including
Right now: 100% of people using coder are coming from Drupal. But as Backdrop grows that number should decrease :) |
Here're some thing that might be of interest:
If they don't suit, there are plenty of others: https://github.com/marketplace?type=actions&query=phpcs |
It seems we got hung up on the name. But that aside...
We need to decide if we fork Drupal's Coder module, or if we just pull the @docwilmot is the current maintainer for |
I'm asking again now because I'm wanting to add PHPCS checks to Bee, and I'd rather not have to download the entire |
Just including the directory makes sense. |
@docwilmot Do you want to do that, or you'd rather someone else maintain that part of the code...? |
I'm not sure, where to add the PR, but it seems that I got some basic linter setup working, which only fires on updated/added files and adds annotations. Example: |
That looks great @indigoxela! I'm a fan of the GitHub Actions to avoid a lot of custom scripting in our own repository. Now if we can work out applying Backdrop-specific code style. |
@quicksketch is this https://github.com/backdrop/backdrop/pull/3749/files#diff-a036b60d22557d7f21abeaecaa42088f12680e7d72056f9d7de8c0db426984a6R32 not backdrop specific? idk ... it's been a few years lolz; |
Since this was originally raised for Zen.CI and since |
Describe your issue or idea
Run
phpcs
Backdrop code standards checks against all backdrop/backdrop PRs.Actual behavior (if reporting a bug)
Expected behavior (if reporting a bug)
phpcs
checks in ZenCIThere are two PRs on the table to enable this to happen:
To run the
phpcs
checks locally follow the instructions in the README.md here: https://packagist.org/packages/backdrop/coderHere is an example of running
phpcs
locally against one file:and the output:
https://github.com/backdrop/backdrop/tree/phpcs
rather than the1.x
branch until we get complete covergeEach participant should self assign themselves a core module and add it to the list here:
core/includes
database
@serundeputymysql
@serundeputyfiletransfer
core/modules
admin_bar
@serundeputyblock
@serundeputybook
@serundeputyckeditor
color
comment
config
contact
contextual
dashboard
date
dblog
email
entity
field
field_ui
file
filter
image
installer
language
layout
link
locale
menu
node
path
redirect
search
simpletest
syslog
system
taxonomy
translation
update
user
views
views_ui
The text was updated successfully, but these errors were encountered: