Skip to content

Linting ruleset #3

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

Closed
szepeviktor opened this issue Aug 3, 2020 · 5 comments
Closed

Linting ruleset #3

szepeviktor opened this issue Aug 3, 2020 · 5 comments
Assignees

Comments

@szepeviktor
Copy link
Contributor

#!/bin/bash
#
# Lint ruleset XML file.
#
# BASH-VERSION  :4.2+
# DEPENDS       :apt-get install wget libxml2-utils

RULESET="CodeatCodingStandard/ruleset.xml"

set -e

# Current directory should be repository root
test -r "$RULESET"

# Check dependencies
hash wget
hash xmllint

# Create temporary directory
mkdir -p tmp

# Download XML schema definitions
wget -nv -N -P tmp/ "https://github.com/squizlabs/PHP_CodeSniffer/raw/master/phpcs.xsd"
wget -nv -N -P tmp/ "https://www.w3.org/2012/04/XMLSchema.xsd"

xmllint --noout --schema tmp/XMLSchema.xsd tmp/phpcs.xsd
xmllint --noout --schema tmp/phpcs.xsd "$RULESET"
diff -B "$RULESET" <(XMLLINT_INDENT="    " xmllint --format "$RULESET")
@szepeviktor
Copy link
Contributor Author

If you develop actual sniffs: https://github.com/PHPCSStandards/PHPCSDevCS

@Mte90 Mte90 changed the title Checking PHPCS standards Linting ruleset Aug 3, 2020
@Mte90
Copy link
Member

Mte90 commented Aug 3, 2020

No I don't develop CS but just use them with some settings.
I will do linting of that file asap.

@Mte90 Mte90 self-assigned this Aug 3, 2020
@szepeviktor
Copy link
Contributor Author

szepeviktor commented Aug 3, 2020

Please consider linting codeat-phpmd.xml too.

I don't know about a PHP-MD schema... but it may exist!

@szepeviktor
Copy link
Contributor Author

@Mte90
Copy link
Member

Mte90 commented Aug 3, 2020

I am already working on an extended script of this one with phpmd :-)

@Mte90 Mte90 closed this as completed in 0563157 Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants