diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2026-09-03 17:44:02 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2026-09-03 17:44:02 +0100 |
| commit | a3cd4c515e2b06d6171aba8d3f782ed15fdea8fe (patch) | |
| tree | 485e7b82d51791c1997d077d279e285e14e34826 | |
| parent | 10143a3647bbdb8276cd182f5800a436558b5cd7 (diff) | |
| parent | 2b2f13eccf531843bdc8dff5ef6ead8e67bf91e8 (diff) | |
Merge branch 'main' into suliman
| -rw-r--r-- | .php-cs-fixer.dist.php | 40 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/conform.lua | 4 | ||||
| -rw-r--r-- | shell.nix | 13 |
3 files changed, 43 insertions, 14 deletions
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 6e89bee..45421de 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,18 +1,40 @@ <?php -# php84Packages.php-cs-fixer is currently installed. -# The commented out options are because they don't work with 84. -# I tried to install 85 but that installs an old version of cs that is not compatible with php85 -# At some point I can install CS 85. +declare(strict_types=1); -$finder = PhpCsFixer\Finder::create() - ->in(__DIR__); +use PhpCsFixer\Config; +use PhpCsFixer\Finder; -return (new PhpCsFixer\Config()) +$finder = Finder::create() + ->in([ + __DIR__ . '/src', + __DIR__ . '/tests', + __DIR__ . '/public', + ]) + ->name('*.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return (new Config()) ->setRules([ '@PSR12' => true, -# 'strict_param' => true, + 'declare_strict_types' => true, 'array_syntax' => ['syntax' => 'short'], -# 'declare_strict_types' => true, + 'single_quote' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'no_unused_imports' => true, + 'trailing_comma_in_multiline' => [ + 'elements' => ['arrays', 'arguments', 'parameters'], + ], + 'no_superfluous_phpdoc_tags' => [ + 'remove_inheritdoc' => true, + 'allow_mixed' => true, + ], + 'strict_param' => true, + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + ], + 'type_declaration_spaces' => true, ]) + ->setRiskyAllowed(true) ->setFinder($finder); diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index dec12cc..2fb51cd 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -1,6 +1,10 @@ vim.pack.add({ "https://github.com/stevearc/conform.nvim" }) require("conform").setup({ + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, formatters_by_ft = { lua = { "stylua" }, markdown = { "prettier" }, @@ -1,13 +1,16 @@ let nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable"; - pkgs = import nixpkgs { config = {}; overlays = []; }; + pkgs = import nixpkgs { + config = { }; + overlays = [ ]; + }; in pkgs.mkShellNoCC { packages = with pkgs; [ - php84 - php84Packages.composer - php84Packages.php-cs-fixer - php84Packages.php-codesniffer + php85 + php85Packages.composer + php85Packages.php-cs-fixer + php85Packages.php-codesniffer ]; } |
