You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.2 KiB

10 years ago
10 years ago
11 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin McCorkell <robin@mccorkell.me.uk>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OC\Core\Command\App;
  27. use Symfony\Component\Console\Command\Command;
  28. use Symfony\Component\Console\Input\InputArgument;
  29. use Symfony\Component\Console\Input\InputInterface;
  30. use Symfony\Component\Console\Input\InputOption;
  31. use Symfony\Component\Console\Output\OutputInterface;
  32. class CheckCode extends Command {
  33. protected $checkers = [];
  34. protected function configure() {
  35. $this
  36. ->setName('app:check-code')
  37. ->setDescription('check code to be compliant')
  38. ->addArgument(
  39. 'app-id',
  40. InputArgument::REQUIRED,
  41. 'check the specified app'
  42. )
  43. ->addOption(
  44. 'checker',
  45. 'c',
  46. InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
  47. 'enable the specified checker(s)',
  48. [ 'private', 'deprecation', 'strong-comparison' ]
  49. )
  50. ->addOption(
  51. '--skip-checkers',
  52. null,
  53. InputOption::VALUE_NONE,
  54. 'skips the the code checkers to only check info.xml, language and database schema'
  55. )
  56. ->addOption(
  57. '--skip-validate-info',
  58. null,
  59. InputOption::VALUE_NONE,
  60. 'skips the info.xml/version check'
  61. );
  62. }
  63. protected function execute(InputInterface $input, OutputInterface $output): int {
  64. $output->writeln('<error>The app code checker doesn\t check anything and this command will be removed in Nextcloud 23</error>');
  65. return 0;
  66. }
  67. }