alister / todotxt-parser
parser for the TodoTxt format
Requires
- php: ^8.1
- symfony/string: ^6.2
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.0
- ergebnis/composer-normalize: ^2.5
- hamcrest/hamcrest-php: ^2
- mockery/mockery: ^1.3
- php-parallel-lint/php-parallel-lint: ^1.2
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^9.5
- psy/psysh: ^0.11.16
- rector/rector: ^0.16
- slevomat/coding-standard: ^8.11
- squizlabs/php_codesniffer: ^3.5
- symfony/console: ^5.4 || ^6.2
- symfony/framework-bundle: ^5.1
- symplify/easy-ci: 11.2.0.72
- vimeo/psalm: ^5.9
README
parser for the TodoTxt format
Installation
Install this package as a dependency using Composer.
composer require alister/todotxt-parser
Contributing
Contributions are welcome! Before contributing to this project, familiarize yourself with CONTRIBUTING.md.
To develop this project, you will need PHP 7.4 or greater, Composer, Node.js, and Yarn.
After cloning this repository locally, execute the following commands:
cd /path/to/repository
composer install
yarn install
Now, you are ready to develop!
Tooling
This project uses Husky and lint-staged to validate all staged changes prior to commit.
Composer Commands
To see all the commands available in the project td
namespace for
Composer, type:
composer list td
Composer Command Autocompletion
If you'd like to have Composer command auto-completion, you may use bamarni/symfony-console-autocomplete. Install it globally with Composer:
composer global require bamarni/symfony-console-autocomplete
Then, in your shell configuration file — usually ~/.bash_profile
or ~/.zshrc
,
but it could be different depending on your settings — ensure that your global
Composer bin
directory is in your PATH
, and evaluate the
symfony-autocomplete
command. This will look like this:
export PATH="$(composer config home)/vendor/bin:$PATH" eval "$(symfony-autocomplete)"
Now, you can use the tab
key to auto-complete Composer commands:
composer td:[TAB][TAB]
Coding Standards
This project follows a superset of PSR-12
coding standards, enforced by PHP_CodeSniffer.
The project PHP_CodeSniffer configuration may be found in phpcs.xml.dist
.
lint-staged will run PHP_CodeSniffer before committing. It will attempt to fix any errors it can, and it will reject the commit if there are any un-fixable issues. Many issues can be fixed automatically and will be done so pre-commit.
You may lint the entire codebase using PHP_CodeSniffer with the following commands:
# Lint composer td:lint # Lint and autofix composer td:lint:fix
Static Analysis
This project uses a combination of PHPStan
and Psalm to provide static analysis of PHP
code. Configurations for these are in phpstan.neon.dist
and psalm.xml
,
respectively.
lint-staged will run PHPStan and Psalm before committing. The pre-commit hook does not attempt to fix any static analysis errors. Instead, the commit will fail, and you must fix the errors manually.
You may run static analysis manually across the whole codebase with the following command:
# Static analysis
composer td:analyze
Project Structure
This project uses pds/skeleton as its base folder structure and layout.
Copyright and License
The alister/todotxt-parser library is copyright © Alister Bulman and licensed for use under the terms of the MIT License (MIT). Please see LICENSE for more information.