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 support for flake.lock #6166

Merged
merged 2 commits into from
Feb 17, 2023
Merged

Add support for flake.lock #6166

merged 2 commits into from
Feb 17, 2023

Conversation

figsoda
Copy link
Contributor

@figsoda figsoda commented Nov 18, 2022

Make flake.lock files JSON and mark them as generated.

Description

flake.lock is the lock file for Nix flakes generated by the nix command.

Checklist:

  • I am associating a language with a new file extension
    • The new extension is used in hundreds of repositories on github.com:
      24.7k results for path:**/flake.lock
    • I have included a real-world usage sample:
      • Sample source:
      • Sample license(s):
    • I have included a change to the heuristics
  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

@figsoda figsoda requested a review from a team as a code owner November 18, 2022 00:50
lib/linguist/generated.rb Outdated Show resolved Hide resolved
@Alhadis
Copy link
Collaborator

Alhadis commented Nov 19, 2022

Looks great. Real-world distribution checks out. Just to confirm the origin of the sample you've added, this is one that you've created, correct? I saw your username listed in one of the fields, but I'd rather not go off an assumption.

@figsoda
Copy link
Contributor Author

figsoda commented Nov 19, 2022

It is, it is copied from https://github.com/figsoda/cfg/blob/main/flake.lock, probably one commit or so behind main

@figsoda
Copy link
Contributor Author

figsoda commented Nov 19, 2022

The test fail seems to be because that name is the full path of the file, maybe something like !!name.match((^|\/)flake\.lock$) would work?

@Alhadis
Copy link
Collaborator

Alhadis commented Nov 19, 2022

The test fail seems to be because that name is the full path of the file

Shit, you're right. 🤔 So many of these tests are interrogating only the basename(3) of a file path, it didn't occur to me that there might be a dirname(3) component. And, of course, it doesn't help that the property in question has a misleading name/description…

In any case, these oversights are beyond the scope of this PR. For now, we'll just get these tests passing.

Copy link
Member

@lildude lildude 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.

Note: this PR will not be merged until close to when the next release is made. See here for more details.

@lildude lildude merged commit 3f6d887 into github-linguist:master Feb 17, 2023
@figsoda figsoda deleted the flake-lock branch February 17, 2023 14:21
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants