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

lint: Do not check *.md files for white noise #4662

Merged
merged 12 commits into from
Jan 7, 2022

Conversation

matej-g
Copy link
Collaborator

@matej-g matej-g commented Sep 16, 2021

Signed-off-by: Matej Gera [email protected]

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

make lint currently clashes with make check-docs due to difference in formatting. To resolve this, I suggest to drop *.md from being checked against white noise in the lint target, as this should be taken care of in check-docs target.

Verification

Ran make lint and make check-docs successfully.

@matej-g
Copy link
Collaborator Author

matej-g commented Sep 16, 2021

Hm OK, so lint seems to be conflicting with check-docs

@matej-g matej-g changed the title lint: Remove white noise lint: Do not check *.md files in lint target Sep 16, 2021
@matej-g matej-g changed the title lint: Do not check *.md files in lint target lint: Do not check *.md files for white noise Sep 16, 2021
@matej-g
Copy link
Collaborator Author

matej-g commented Sep 16, 2021

I think the solution here is to drop *.md files, see the updated description.

@stale
Copy link

stale bot commented Nov 25, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@wiardvanrij
Copy link
Member

Thanks for this. Though I'm somewhat curious as my recent PR did have white noise in the docs. Like the change I made actually looks good and it should be done like that?
I still agree that there is something weird that needs to be fixed tho. WDYT?

@stale stale bot removed the stale label Dec 21, 2021
@matej-g
Copy link
Collaborator Author

matej-g commented Dec 21, 2021

@wiardvanrij The issue I tried to solve here is we have two 'competing' targets - both try to format *.md files, but in fact it seems we want the formatting done by check-docs.

IMHO we should:

  1. Ignore *.md files as part of the lint target (only lint code, not the docs, which makes sense to me)
  2. Do whichever formatting on *.md we want in the check-docs target, including removing whitespace noise (for that, check-docs needs to be adjusted, if it currently does not remove whitespaces properly)

@wiardvanrij
Copy link
Member

yea totally agree. Remove the check on .md files here, add it on the check-docs and we are good!

@matej-g
Copy link
Collaborator Author

matej-g commented Dec 22, 2021

It looks like ultimately, it's mdox fmt that is adding the extra white spaces. I opened bwplotka/mdox#85, perhaps afterwards there won't be need to run the .sh script on top of it.

@matej-g
Copy link
Collaborator Author

matej-g commented Jan 3, 2022

ping @wiardvanrij does this look good to you now?

@wiardvanrij
Copy link
Member

ping @wiardvanrij does this look good to you now?

Yup I think this makes sense! Looks good 👍

Makefile Outdated
@@ -227,7 +227,9 @@ docs: build examples $(MDOX)
check-docs: ## checks docs against discrepancy with flags, links, white noise.
check-docs: build examples $(MDOX)
@echo ">> checking formatting and local/remote links"
PATH=${PATH}:$(GOBIN) $(MDOX) fmt --check -l --links.localize.address-regex="https://thanos.io/.*" --links.validate.config-file=$(MDOX_VALIDATE_CONFIG) $(MD_FILES_TO_FORMAT)
PATH=${PATH}:$(GOBIN) $(MDOX) fmt $(MD_FILES_TO_FORMAT)
Copy link
Member

Choose a reason for hiding this comment

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

Why did we drop --check -l --links.localize.address-regex="https://thanos.io/.*" --links.validate.config-file=$(MDOX_VALIDATE_CONFIG) from here? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤦 Thanks for catching this, I guess I removed it accidentally during some testing. Fixing it right now. It looks like we'll need to drop the --check flag still, since otherwise the mdox command fails (due to diff in white space handling). However, that should be fine, since below we are checking for clean work tree, which would catch any formatting issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ping @GiedriusS - hopefully now all is good, the PR might need one more re-run since doc check failed on a link check...

Copy link
Member

Choose a reason for hiding this comment

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

Restarting 👍

Copy link
Member

Choose a reason for hiding this comment

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

Seems like https://blog.taboola.com/category/engineering/monitoring-and-metering-scale/ doesn't exist anymore? Maybe we can delete link to it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found the link it was moved to, made the change, hopefully now it succeeds.

Copy link
Member

Choose a reason for hiding this comment

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

>> detecting white noise
cannot 'run make docs and commit changes': you have unstaged changes.
M	docs/proposals-accepted/202108-more-granular-query-performance-metrics.md

mhm ((:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It never ends, does it 😏. Fixed now, the formatting also insisted on replacing _ with * in CHANGELOG.md so I added that as well.

squat
squat previously approved these changes Jan 6, 2022
@squat squat enabled auto-merge (squash) January 6, 2022 14:50
Signed-off-by: Matej Gera <[email protected]>
auto-merge was automatically disabled January 6, 2022 15:11

Head branch was pushed to by a user without write access

GiedriusS
GiedriusS previously approved these changes Jan 6, 2022
@GiedriusS GiedriusS enabled auto-merge (squash) January 6, 2022 15:13
auto-merge was automatically disabled January 7, 2022 09:10

Head branch was pushed to by a user without write access

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Jan 7, 2022
@GiedriusS GiedriusS merged commit fa4a40d into thanos-io:main Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants