Skip to content
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

[Finder] Also consider .git inside the basedir of in() directory #54691

Conversation

nickvergessen
Copy link
Contributor

@nickvergessen nickvergessen commented Apr 22, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix described below
License MIT

Bug description

Previously when the in() directory was the root of your repository the .gitignore was skipped from consideration, which meant potentially all local files are ignored.

E.g. in the Nextcloud community we have the server locally with an .gitignore for the apps/ directory. Now when an app developer develops their own app locally, they put their own git repository inside this ignored apps/ folder.
The CS Fixer rules we use since a long time are:

(new Finder())
	->ignoreVCSIgnored(true)
	->notPath('l10n')
	->notPath('vendor')
	->notPath('vendor-bin')
	->in(__DIR__);

and this worked pretty well with 5.4 and previous versions of the finder. Now that the Nextcloud project finally dropped PHP 8.0 for the latest version and we get the update to Symfony 6.4 the bug become visible locally, but our CI still works as we don't need the "server" repository as a parent when running the CS fixer.

Locally - nested inside "server" repository

~/Nextcloud/server/apps/spreed$ composer run cs:check
> php-cs-fixer fix --dry-run --diff
PHP CS Fixer 3.54.0 15 Keys Accelerate by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.2.18
Loaded config default from "/home/nickv/Nextcloud/30/server/appsbabies/spreed/.php-cs-fixer.dist.php".
Using cache file ".php-cs-fixer.cache".
    0 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]

❌ No files found, all ignored by server/.gitignore

CI without a parent repository

Run composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
 > php-cs-fixer fix --dry-run --diff
PHP CS Fixer 3.54.0 15 Keys Accelerate by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.1.2-1ubuntu2.13
Loaded config default from "/home/runner/actions-runner/_work/spreed/spreed/.php-cs-fixer.dist.php".
   0/502 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%

✅ Correct file list found

5.4

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

nickvergessen added a commit to nextcloud/spreed that referenced this pull request Apr 22, 2024
See symfony/symfony#54691 for more details

Signed-off-by: Joas Schilling <coding@schilljs.com>
@julienfalque
Copy link
Contributor

Nope, this was not intentional.

@nickvergessen nickvergessen force-pushed the bugfix/noid/consider-git-root-within-search-root-6.4 branch from e6ffe96 to fdf5dcc Compare April 23, 2024 07:45
@nickvergessen nickvergessen force-pushed the bugfix/noid/consider-git-root-within-search-root-6.4 branch from fdf5dcc to b31361f Compare April 23, 2024 07:48
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/noid/consider-git-root-within-search-root-6.4 branch from b31361f to af870c6 Compare April 23, 2024 10:36
@fabpot
Copy link
Member

fabpot commented Apr 27, 2024

Thank you @nickvergessen.

@fabpot fabpot merged commit dfc6434 into symfony:6.4 Apr 27, 2024
8 of 10 checks passed
@nickvergessen nickvergessen deleted the bugfix/noid/consider-git-root-within-search-root-6.4 branch April 27, 2024 15:01
This was referenced Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants