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 lint checks for the archive repo #412

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

shonfeder
Copy link
Contributor

@shonfeder shonfeder commented Jan 1, 2025

Closes #411

To support using the tool in different contexts, this change also extends the
API and CLI to allow specifying groups of related lints to be run. The default
falls back to the current behavior. This may also be useful for down-streaming
the linting into publication tools.

I suggest reviewing by commit, at least initially, since the change sets are
all logically grouped. The diff is not as long as it looks, since 177 lines
are coming from the cram tests.

Extends the Lint api to allow specifying sets of lint checks to run,
allowing us to control which kinds of checks we run in a given case.

The changes in this commit to not add any new checks, but in factoring
out the checks into distinct sets, we do change the order in which lint
errors are reported. The expectations for those tests are updated here
accordingly.
Allows specifing subsets of the cli checks to run. Note that this commit
only updates tests to adapt to the new help output on our existing
erroneous CLI input tests. This all the content of tests stays the same.
This helps to show that this CLI change does not break our existing API.
This shows that we can now just run a subset of the checks.
@shonfeder
Copy link
Contributor Author

shonfeder commented Jan 1, 2025

I need to add another layer of logic here that will bypass fetching sources when we are doing the simpler set of checks, otherwise we waste a lot of http requests for no reason. I'll do that tomorrow.

✔️

@shonfeder shonfeder marked this pull request as draft January 1, 2025 08:45
Only some of our lint checks require fetching data. This adds predicates
to record whether a set of checks requires fetching e.g., the newness of
a package or its source code, and avoids those fetches when not needed.
Prevents output that is noisome when running in large batches.
@shonfeder shonfeder marked this pull request as ready for review January 3, 2025 02:08
@shonfeder shonfeder requested a review from punchagan January 3, 2025 02:08
@shonfeder shonfeder mentioned this pull request Jan 3, 2025
3 tasks
@shonfeder
Copy link
Contributor Author

This has been tested in the intended CI target: ocaml/opam-repository-archive#3

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 lint check for archive repo
1 participant