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

feat(config-validator): throw an error when the config cannot be found #23815

Merged
merged 10 commits into from
Nov 15, 2023

Conversation

liby
Copy link
Contributor

@liby liby commented Aug 11, 2023

Changes

Throw an error when the config cannot be found.

alias ls='exa --reverse --sort=modified --group-directories-first' 
alias la='ls --all'
alias ll='la --long --git'

Before

SCR-20230811-qtsq

After

SCR-20230811-qwmk

Context

Closes: #16025

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

wrong place, that code isn't called by the config validator

@liby liby force-pushed the feature/exit-if-config-file-not-found branch from 6f61780 to 7796bdb Compare August 11, 2023 11:22
@liby
Copy link
Contributor Author

liby commented Aug 11, 2023

wrong place, that code isn't called by the config validator

Sorry, I have already updated the code and description. Please take a look when you have time.

@liby liby requested a review from viceice August 11, 2023 11:25
@liby liby force-pushed the feature/exit-if-config-file-not-found branch from 7796bdb to 16ce00a Compare August 11, 2023 11:54
@liby liby changed the title fix(util/cache): throw an error when the config cannot be found feat(config-validator): enhance configuration file detection and validation Aug 11, 2023
@viceice viceice changed the title feat(config-validator): enhance configuration file detection and validation feat(config-validator): throw an error when the config cannot be found Aug 11, 2023
viceice
viceice previously approved these changes Aug 11, 2023
…dation

- Refactor the code to use a single function for validating and setting a flag if a valid configuration file is found
- Introduce a flag to track if any configuration files are found and exit with an error if none are detected
- Improve code readability and reduce redundancy by encapsulating repeated logic
@liby liby force-pushed the feature/exit-if-config-file-not-found branch from 16ce00a to dae7636 Compare August 11, 2023 12:39
@liby liby requested a review from viceice August 11, 2023 12:39
@liby
Copy link
Contributor Author

liby commented Aug 11, 2023

Oh, the Lint check didn't pass, so I need to force push the formatted code, sry~

@viceice
Copy link
Member

viceice commented Aug 11, 2023

please don't force push

@liby
Copy link
Contributor Author

liby commented Aug 11, 2023

In fact, force pushing won't affect the code review (especially since the changes in this PR are not substantial), and you can observe the changes before and after the force push by clicking on 'compare'. Of course, I'm just expressing my personal opinion, and I choose to respect the 'Do not force push to your pull request branch' guideline. I'll take care of it from now on.

image

@viceice
Copy link
Member

viceice commented Aug 11, 2023

we don't have the time to compare force push.

we also do squash merge, so no need for a clean PR gut history

lib/config-validator.ts Outdated Show resolved Hide resolved
@liby liby requested a review from rarkins October 15, 2023 07:27
lib/config-validator.ts Outdated Show resolved Hide resolved
…date`

Merged the functionality of `validateAndSetFlag` directly into `validate` function to streamline the validation process. This change was suggested to simplify the codebase since validate was only being called from `validateAndSetFlag`.
auto-merge was automatically disabled October 23, 2023 12:11

Head branch was pushed to by a user without write access

@liby liby requested a review from rarkins October 23, 2023 12:15
lib/config-validator.ts Outdated Show resolved Hide resolved
lib/config-validator.ts Outdated Show resolved Hide resolved
@liby liby requested a review from rarkins October 23, 2023 12:42
rarkins
rarkins previously approved these changes Oct 23, 2023
@rarkins
Copy link
Collaborator

rarkins commented Oct 23, 2023

No need to push from main if there's no updates

viceice
viceice previously approved these changes Nov 15, 2023
@viceice viceice added this pull request to the merge queue Nov 15, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2023
@rarkins rarkins added this pull request to the merge queue Nov 15, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2023
@viceice
Copy link
Member

viceice commented Nov 15, 2023

needs prettier fix

@rarkins rarkins dismissed stale reviews from viceice and themself via 4641ac2 November 15, 2023 19:54
@viceice viceice added this pull request to the merge queue Nov 15, 2023
Merged via the queue into renovatebot:main with commit 9b33fee Nov 15, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.60.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@liby liby deleted the feature/exit-if-config-file-not-found branch November 16, 2023 08:21
@viceice viceice added the regression Issue about a regression bug, or the PR caused it label Nov 19, 2023
viceice added a commit that referenced this pull request Nov 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Issue about a regression bug, or the PR caused it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

renovate-config-validator reports "INFO: Config validated successfully" when no config exists
4 participants