Skip to content

Conversation

barszcz
Copy link

@barszcz barszcz commented Dec 7, 2024

As discussed on the Gleam Discord, this PR creates a .gitignore file in /input if none exists and ignores all files matching *.txt. This will prevent users from accidentally pushing their puzzle inputs to Github etc, as the AoC folks request that solvers don't publish their inputs.

@logan-connolly
Copy link
Contributor

It seems odd to make this library in charge of handling someone's advent of code project's gitignore. Also, wouldn't this change affect users who version control example input from the puzzles?

AFAIK, it is okay to store the example input. Without it, it makes it difficult for some one to pull down the repository and run/refactor an existing solution. Perhaps, a warning in the README (citing the Advent of Code policy) to not upload actual puzzle input is enough?

@barszcz
Copy link
Author

barszcz commented Dec 8, 2024

To be clear, this creates a .gitignore in the /input directory that only applies to that directory. It leaves the project root .gitignore unchanged. I think that's fine (as @TanklesXL and I discussed), as gladvent manages that directory.

As for the example inputs, this ignores those because @TanklesXL thought it best to take the broadest possible interpretation of "don't share puzzle inputs." I'm not sure it's totally necessary either, but we decided better safe than sorry. I'm open to changing that, though.

If people want to opt out of this behavior for whatever reason, maybe there can be a flag. But this also won't recreate the gitignore if it already exists, so it might be sufficient to tell people in the readme to just edit the gitignore (but not remove it as it'll be recreated then) if they want to check in their inputs, while strongly discouraging them from doing so if they're going to push somewhere public.

@TanklesXL
Copy link
Owner

Hey folks, been busy so I haven't gotten a chance to take a look at this yet

Just wanted to comment saying that if we want to include a gitignore that we do want to ignore example inputs.

From the advent of code guidelines:

Puzzle Inputs
No content at adventofcode.com (including the inputs) is licensed for reproduction or distribution without permission from Advent of Code. See the legal notice on adventofcode.com > About > Legal
Do not publicly share your puzzle input (and likewise do not ask others to share their puzzle inputs).
Do not commit your puzzle input into your repo or at least not do not share the input publicly; use .gitignore or equivalent.

In particular the very first line:

No content at adventofcode.com (including the inputs) is licensed for reproduction or distribution without permission from Advent of Code.

To me this means that even the examples should not be shared.

@barszcz please point this PR at the next branch as it will likely need to be part of gladvent v3

@TanklesXL
Copy link
Owner

We can't stop people from modifying or removing gitignore but that's their prerogative to do so if they choose. We can at least try to set them up in a way that is aligned with the desires of AoC

@TanklesXL
Copy link
Owner

That said, I'm open to collecting more feedback on if users want/think it would be valuable for gladvent to create a .gitignore in the first place

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.

3 participants