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

Add linter for checking blog posts #2459

Merged
merged 25 commits into from Apr 26, 2023
Merged

Add linter for checking blog posts #2459

merged 25 commits into from Apr 26, 2023

Conversation

raeidish
Copy link
Contributor

Description

Closes #2432.

Added linter in tools/checkdocs that verifies slugs in markdown files. Would love to get some feedback on the changes

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2023

CLA assistant check
All committers have signed the CLA.

@AlekSi
Copy link
Member

AlekSi commented Apr 18, 2023

Would love to get some feedback on the changes

Then please mark this PR as ready for review

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #2459 (3ac01a5) into main (cf67017) will increase coverage by 0.02%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2459      +/-   ##
==========================================
+ Coverage   27.02%   27.05%   +0.02%     
==========================================
  Files         400      400              
  Lines       19776    19776              
==========================================
+ Hits         5345     5350       +5     
+ Misses      13865    13861       -4     
+ Partials      566      565       -1     

see 2 files with indirect coverage changes

Flag Coverage Δ
integration 5.11% <ø> (ø)
mongodb 5.11% <ø> (ø)
unit 25.65% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@AlekSi AlekSi marked this pull request as ready for review April 18, 2023 09:00
@AlekSi AlekSi self-requested a review as a code owner April 18, 2023 09:00
tools/Taskfile.yml Outdated Show resolved Hide resolved
Taskfile.yml Outdated Show resolved Hide resolved
tools/checkdocs/checkdocs.go Outdated Show resolved Hide resolved
tools/checkdocs/checkdocs_test.go Show resolved Hide resolved
@AlekSi AlekSi added the code/chore Code maintenance improvements label Apr 18, 2023
@AlekSi AlekSi added this to the v1.1.0 milestone Apr 18, 2023
@AlekSi AlekSi requested review from a team and chilagrow April 18, 2023 09:06
Co-authored-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
raeidish and others added 2 commits April 19, 2023 07:18
Co-authored-by: Chi Fujii <chi.fujii@ferretdb.io>
@mergify
Copy link
Contributor

mergify bot commented Apr 19, 2023

@raeidish this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Apr 19, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Apr 19, 2023
@raeidish
Copy link
Contributor Author

Ready for another review @AlekSi

@AlekSi
Copy link
Member

AlekSi commented Apr 19, 2023

CleanShot 2023-04-19 at 13 58 56@2x

Please click those

@AlekSi AlekSi changed the title Added Linter for blogposts in website/blog Add linter for checking blog posts Apr 19, 2023
@raeidish raeidish requested a review from AlekSi April 19, 2023 11:03
Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Very minor comments. Looking good 🤗

tools/checkdocs/checkdocs_test.go Outdated Show resolved Hide resolved
tools/checkdocs/checkdocs_test.go Outdated Show resolved Hide resolved
@raeidish raeidish requested a review from chilagrow April 21, 2023 05:12
@chilagrow chilagrow enabled auto-merge (squash) April 21, 2023 06:09
Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Could you run task lint and fix the warnings of that please? 🤗

@raeidish
Copy link
Contributor Author

Could you run task lint and fix the warnings of that please? hugs

@chilagrow what linting errors are you getting? because apparently I'm not getting any.

works on my machine 😁

@chilagrow
Copy link
Contributor

chilagrow commented Apr 21, 2023

Could you run task lint and fix the warnings of that please? hugs

@chilagrow what linting errors are you getting? because apparently I'm not getting any.

works on my machine grin

That's interesting, below is what I see from task lint @raeidish 🤔

task lint
bin/task lint
task: [lint] bin/golangci-lint run --config=.golangci.yml
task: [lint] bin/golangci-lint run --config=.golangci-new.yml
task: [lint] bin/go-consistent -pedantic ./cmd/... ./internal/... ./build/... ./ferretdb/...
task: [lint] bin/go-sumtype ./...
task: [lint] go vet -vettool=./bin/checkswitch ./...
task: [lint] bin/task -d integration integration-lint
task: [integration-lint] ../bin/golangci-lint run --config=.golangci.yml
task: [integration-lint] ../bin/golangci-lint run --config=.golangci-new.yml
task: [integration-lint] ../bin/go-consistent -pedantic ./...
task: [integration-lint] ../bin/go-sumtype ./...
task: [integration-lint] go vet -vettool=../bin/checkswitch ./...
task: [lint] bin/task -d tools tools-lint
task: [tools-lint] ../bin/golangci-lint run --config=../.golangci.yml ./checkdocs/... ./checkswitch/...
task: [tools-lint] ../bin/golangci-lint run --config=../.golangci-new.yml ./checkdocs/... ./checkswitch/...
Error: checkdocs/checkdocs.go:15:1: package-comments: should have a package comment (revive)
package main
task: Failed to run task "tools-lint": exit status 1
task: Failed to run task "tools-lint": exit status 1
task: Failed to run task "lint": exit status 201
task: Failed to run task "lint": exit status 201
^
Error: checkdocs/checkdocs.go:37:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^
Error: checkdocs/checkdocs.go:43:2: only one cuddle assignment allowed before range statement (wsl)
	for _, slug := range slugs {
	^
Error: checkdocs/checkdocs.go:72:2: only one cuddle assignment allowed before range statement (wsl)
	for _, f := range fs {
	^
Error: Process completed with exit code 201.

auto-merge was automatically disabled April 21, 2023 10:11

Head branch was pushed to by a user without write access

@raeidish raeidish requested a review from chilagrow April 21, 2023 11:23
Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Great work! This is already helping us to identify file name and slug mismatch.

@chilagrow chilagrow enabled auto-merge (squash) April 24, 2023 01:54
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your contribution! 👍

@chilagrow chilagrow merged commit 4c80783 into FerretDB:main Apr 26, 2023
24 of 25 checks passed
chilagrow added a commit that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add linter for checking blog posts
6 participants