Download the PHP package hostnet/css-sniffer without Composer

On this page you can find all versions of the php package hostnet/css-sniffer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package css-sniffer

IMPORTANT: Due to internal changes this repository will no longer be maintained. If you are using this, or have plans to use this, please consider an alternative like https://stylelint.io/.


The CSS sniffer is build to help improve (and maintain) a consistent code style in CSS and LESS files. It will reduce time figure out another style by enforcing rules. So no longer worrying about tabs vs. spaces, single vs. double quotes or 3 of 6 hex values for colors.

The tool is pretty straight forward, simply run it with the file you would like to inspect. So if you have a css file like so:

Simply run the tool and you will get the following output.

Some builtin sniffs are pretty opinionated. If you disagree you have two options: open an issue to change the current behavior or write your own sniff.

Installation

Using phar (recommended)

Download the phar that is attached to the latest release of the sniffer.

Using composer

Documentation

Basic usuage is as follows:

Examples:

Sniffing for CI

The primary focus of the sniffer is to integrate with any CI tooling. For this, it is recommended to add a csssniff.xml.dist to your project root. This will allow you to configure which files and directories to process when running the sniffer. A common example would be:

This would process the app/styles folder relative from the project root using the Hostnet standard. For more information about the xml structure, see the ruleset configuration documentation.

Output formatting

Multiple output formats are supported. For now there is console (the default), checkstyle and json. The json output looks as follows:

The -p is only a pretty format, this is optional but more readable.

STDIN input

The sniffer can also read from the STDIN. This can be usefull when intergrating the tool in an IDE where you might not have a file but want to pass the contents of an editor. Make sure to add the --stdin to tell the sniffer to read the STDIN. You can also pass a file to allows for you matching rules to work.

License

The hostnet/css-sniffer is licensed under the MIT License, meaning you can reuse the code within proprietary software provided that all copies of the licensed software include a copy of the MIT License terms and the copyright notice.

Get in touch


All versions of css-sniffer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
symfony/console Version ^3.3||^4.0
yannickl88/css-tokenizer Version ^1.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hostnet/css-sniffer contains the following files

Loading the files please wait ....