8000 [Yaml] Add --exclude and negatable --parse-tags option to lint:yaml command by christingruber · Pull Request #39641 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Add --exclude and negatable --parse-tags option to lint:yaml command #39641

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

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

christingruber
Copy link
Contributor
@christingruber christingruber commented Dec 28, 2020
Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets None
License MIT
Doc PR symfony/symfony-docs#14780

Added a new --exclude option to exclude one or more specific files from multiple file list:

lint:yaml dirname --exclude=/dirname/foo.yml --exclude=/dirname/bar.yml

Allow negatable for the parse tags option with --no-parse-tags and increase the symfony/console dependency to version 5.3

@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 5.x 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

@christingruber christingruber force-pushed the feature/yaml-linter-config branch from d73e797 to 3bcfd1d Compare December 28, 2020 18:57
@derrabus derrabus added the Yaml label Dec 28, 2020
@carsonbot carsonbot changed the title Adds YAML lint config [Yaml] Adds YAML lint config Dec 28, 2020
@jderusse jderusse added this to the 5.x milestone Dec 28, 2020
Copy link
Member
@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

I think we should also add a test that handles a call of the command with a config file being passed as well as other options.

8000
@christingruber
Copy link
Contributor Author
christingruber commented Jan 5, 2021

I think we should also add a test that handles a call of the command with a config file being passed as well as other options.

I've added a simple mixed test, settings from yaml config will have priority in this case

@christingruber christingruber force-pushed the feature/yaml-linter-config branch from 1ca3b9b to 85a507f Compare January 5, 2021 20:25
@christingruber
Copy link
Contributor Author

I have changed the load order to allow overrides by console args...

@christingruber christingruber force-pushed the feature/yaml-linter-config branch from 85a507f to 3609488 Compare January 11, 2021 18:52
@christingruber
Copy link
Contributor Author

A short overview for the last changes:

I have added some tests which handles mixed arguments from config and options from console. I have also changed the load order to allow overrides by console options. With that it is possible to override the values ​​provided from lint config by console options. @xabbuh

@christingruber christingruber force-pushed the feature/yaml-linter-config branch 3 times, most recently from f09c5e1 to 6a964b3 Compare January 14, 2021 11:27
@christingruber christingruber requested a review from xabbuh January 15, 2021 13:13
@christingruber christingruber force-pushed the feature/yaml-linter-config branch from 6a964b3 to cbdda1f Compare January 20, 2021 15:11
@javiereguiluz
Copy link
Member

I'm divided about this proposal. I love the new options that you added to the command but I'm not sure about providing support for a new config file specifically to run this command.

Just asking: if we keep all the new command options, could a makefile task be an alternative to this config file? You would add the values of all the command options to create a very long command ... but since it's a Makefile, you don't have to actually type or remember the long command, only a short alias. Maybe it's not possible, I don't know.

As a poor version of the Makefile, a simple lint.sh or lint.bat script in the bin/ dir of the project could work too to avoid passing all the long option values. Cheers!

@christingruber
Copy link
Contributor Author

@javiereguiluz Thanks for your feedback.

No problem I think we can hold the --exclude option and drop the config part. If so, I can refactor and rebase the branch in the next days. OK?

@javiereguiluz
Copy link
Member

@christingruber thanks ... but maybe we should wait for other comments from @symfony/mergers first. The reason is that in my previous comment I only gave my opinion ... and a single person opinion is not important. Better see what's the general consensus about what to do here. Thanks!

< 8000 /div>
Copy link
Member
@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Wow, what a great PR. Well done. I like that you added tests and a good description in the changelog. I also like the implementation.

I do agree with @javiereguiluz, Let's not add a config file. If we would go the config file route, we must also support different formats and it would make sense to allow other commands to have config files too. It will be a large feature and Im not sure about that route. I think the workarounds mentioned before is better.

I would be happy to see this PR with only the exclude feature.

@OskarStark OskarStark requested review from stof and jderusse August 7, 2021 18:15
Copy link
Member
@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Great. Thank you for this PR.

I added some questions. Also, can you make sure the PR description is up to date? It will make it easier to understand this feature after the PR is merged.

chalasr
chalasr approved these changes Aug 9, 2021
@christingruber christingruber changed the title [Yaml] Adds YAML lint config [Yaml] Adds ---exclude and negatable --parse-tags option to lint:yaml command Aug 9, 2021
@christingruber christingruber changed the title [Yaml] Adds ---exclude and negatable --parse-tags option to lint:yaml command [Yaml] Add exclude and negatable parse-tags option to lint:yaml command Aug 9, 2021
@christingruber christingruber changed the title [Yaml] Add exclude and negatable parse-tags option to lint:yaml command [Yaml] Add --exclude and negatable --parse-tags option to lint:yaml command Aug 9, 2021
@christingruber
Copy link
Contributor Author

I added some questions. Also, can you make sure the PR description is up to date?...

Hi @Nyholm,

thanks for your Feedback, I updated the MR description / changelog and the composer deps. (See my further comments)

Copy link
Member
@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Thank you.

I like this feature and the implementation. I also appreciate that you updated the PR description and that you prepared a doc PR.

Well done.

Copy link
Contributor
@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

One minor

@christingruber christingruber force-pushed the feature/yaml-linter-config branch 3 times, most recently from 2f64ce5 to 312b6f2 Compare August 14, 2021 18:33
@christingruber christingruber force-pushed the feature/yaml-linter-config branch 3 times, most recently from 3cc8818 to 5a37229 Compare August 14, 2021 20:28
@chalasr chalasr force-pushed the feature/yaml-linter-config branch from 5a37229 to 55704f3 Compare August 14, 2021 21:44
@chalasr
Copy link
Member
chalasr commented Aug 14, 2021

Thank you @christingruber.

@chalasr chalasr merged commit a9753d7 into symfony:5.4 Aug 14, 2021
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Sep 23, 2021
…on (christingruber)

This PR was merged into the 5.4 branch.

Discussion
----------

[Yaml] Adds chapters for YAML lint --exclude option

Adds the new chapters for the yaml lint ``--exclude`` and ``--config`` options.

See the feature pull: symfony/symfony#39641

Commits
-------

9b0fe51 Add the docs for the new --exclude option
This was referenced Nov 5, 2021
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.

0