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

Introduce linting #34

Merged
merged 5 commits into from Jan 30, 2024
Merged

Introduce linting #34

merged 5 commits into from Jan 30, 2024

Conversation

kfcampbell
Copy link
Member

This PR adds linting to the project with a configuration derived from an internal project. I've added script/lint.sh for local invocations and .github/workflows/lint.yml for PR invocations. As a bonus, we should see annotations on our PRs when linting errors are introduced.

I've had to ignore one error in our generated code: in pkg/github/markdown/raw_request_builder.go, this line does not check for errors when executing. As this is an upstream Kiota issue, I've chosen to ignore it for now.

@kfcampbell kfcampbell marked this pull request as ready for review January 30, 2024 19:11
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Copy link

what-the-diff bot commented Jan 30, 2024

PR Summary

  • Setup of Automated Code Quality Checks
    We've now put a system in place (through a file named .github/workflows/lint.yml) that automatically checks our code's quality every time updates are made to the main branch or new code proposals are put forward. This helps us to ensure that the code we produce is up to the mark and follows best practices. This system uses a tool known as golangci-lint to perform these checks.

  • Configurations for Code Checks
    A file named .golangci.toml has been added that specifies how the aforementioned automated code checks should behave. It includes a list of checks that are to be performed and provides additional settings for how they should evaluate the code.

  • Improvements to Code Documentation
    The file pkg/authentication/example_test.go has been modified to improve how it explains what certain parts of our code do. A function within this file, ExampleUnauthenticatedRequest, has been renamed to ExampleApiClient_Octocat, and we've added additional comments to describe its purpose more optimally. We've also updated some parts of this function to improve its output.

  • Script to Manually Run Code Checks
    A new file named script/lint.sh has been added that allows you to manually implement the golangci-lint check on our repository. This script ensures the necessary version of golangci-lint is installed and then initiates the code analysis.

Copy link
Collaborator

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

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

🎉 💥

@nickfloyd nickfloyd merged commit a853d98 into main Jan 30, 2024
4 checks passed
@nickfloyd nickfloyd deleted the linting branch January 30, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants