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

[master] corrected misleading comment #64210

Merged
merged 1 commit into from
May 9, 2023
Merged

Conversation

hiteshbedre
Copy link
Contributor

@hiteshbedre hiteshbedre commented May 2, 2023

? is used to match a given char defined left to it either zero or single time. Even implementation line talks the same:
https://github.com/rakyll/salt/blob/develop/salt/utils/find.py#L229

class NameOption(Option):
    '''
    Match files with a case-sensitive glob filename pattern.
    Note: this is the 'basename' portion of a pathname.
    The option name is 'name', e.g. {'name' : '*.txt'}.
    '''
    def __init__(self, key, value):
        self.regex = re.compile(value.replace('.', '\\.')
                                     .replace('?', '.?')
                                     .replace('*', '.*') + '$')

    def match(self, dirname, filename, fstat):
        return self.regex.match(filename)

We can able to see ? is getting replaced by .? and .? will match any character either zero and single time.

So I just corrected the commented line so it wont mislead the interpretation.

@hiteshbedre hiteshbedre requested a review from a team as a code owner May 2, 2023 20:05
@hiteshbedre hiteshbedre requested review from Ch3LL and removed request for a team May 2, 2023 20:05
@welcome
Copy link

welcome bot commented May 2, 2023

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title corrected misleading comment [master] corrected misleading comment May 2, 2023
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 21:03 — with GitHub Actions Inactive
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 21:03 — with GitHub Actions Inactive
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 21:03 — with GitHub Actions Inactive
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 22:05 — with GitHub Actions Inactive
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 22:05 — with GitHub Actions Inactive
@hiteshbedre hiteshbedre temporarily deployed to ci May 4, 2023 22:05 — with GitHub Actions Inactive
@Ch3LL Ch3LL merged commit f68e961 into saltstack:master May 9, 2023
@welcome
Copy link

welcome bot commented May 9, 2023

Congratulations on your first PR being merged! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants