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

checks for .editorconfig .gitattributes .gitignore #67

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

kanthesha
Copy link
Contributor

We want to make sure that for a given project:

.editorconfig is present and matches the same content as in the module template
.gitattributes is present and matches the same content as in the module template
.gitignore is present, and the project's version of the file starts with the template's version

@kanthesha kanthesha marked this pull request as ready for review March 14, 2024 10:01
@kanthesha kanthesha requested a review from a team as a code owner March 14, 2024 10:01
Copy link
Collaborator

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

description: 'Is `.gitignore` present, and does it conform?',
dependencies: [],
execute: async (ruleExecutionArguments) => {
return await fileConforms('.gitignore', ruleExecutionArguments);
Copy link
Collaborator

@mcmire mcmire Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the ticket, I had suggested that we perform a partial match by checking that the projects's version of .gitignore starts with the template's version. This would allow projects to add more lines to .gitignore without violating lint. However, I am not 100% sure that this would be necessary yet. Most of the projects which are already in alignment do not have extra lines in .gitignore, and the ones which aren't have a completely different .gitignore. I think it would be valuable to only check that Yarn v3 lines are present if Yarn v3 is installed, but that seems like a separate ticket. All that to say... I think this change is good for now, and we can fine-tune it in a future PR, when we review how well these rules work for real-world projects.

@kanthesha kanthesha merged commit e48dfe4 into main Mar 14, 2024
24 checks passed
@kanthesha kanthesha deleted the dotfiles-validation branch March 14, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dotfile-related checks
2 participants