#dev-contrib

1 messages · Page 90 of 1

left flume
#

oh

#

I see

subtle kraken
#

don't all embeds have colors?

#

well tags don't

vocal prairie
#

Some of them are set to a black-ish color.

gritty wind
#

hmm why did that embed send twice

#

anyways yeah, some just use the default color

vocal prairie
#

Somebody manually sent it.

subtle kraken
#

I can only recall tags having it to be fair

#

I think all commands respond with color embeds though

left flume
#

Yeah those embeds have a transparent colour

#

For example, !help doesn't have a colour, but !rules does

short snow
#

Hmm we could add blurple color to help command

obsidian patio
#

I think the best way would be to have a helper for it, so it’s all easy to change depending on the occasion. If we want to change the error color, for example, we just do it in the config for the helper. At the same time, we can have auto-set titles, like for errors with error titles

vale ibex
#

Yea, I think we should make constants.Colours describe actions/states rather than colours

#

eg constants.Colours.error is red

obsidian patio
#

We could have both

short snow
vale ibex
short snow
#

Anything on this?

vale ibex
#

I'm @ work atm, so can't look into it too much

stable mountainBOT
#
Of course!

Your reminder will arrive in 2 hours!

short snow
#

Sure

vale ibex
#

So if no one has helped by then I'll give it a look

green oriole
#

what is the context ?

short snow
#

Wikiguess game

green oriole
#

Not sure

#

Maybe you can redact the answer

short snow
#

Redact like?

green oriole
#

If you find part of the answer in the description you can replace it by [redacted]

short snow
#

Oh

#

will do

short snow
#

@green oriole what do u think of using add fields instead of separate embed for each snowflake?

green oriole
#

We want to use a separate embed like we do for !role

short snow
#

It could be spamming tho

#

well it is restricted to staff that’s why

#

ig

tropic bobcat
#

Idea here, !whois bot. Let me explain in the virtual cycling world we use discord and have accounts/teams on zwiftpower. com We often what to find the Discord user on zwiftpower.com. I have built a whois bot. we do !zw whois set 123 and this links the user Discord to the zwiftpower profile.
Now the proposal for Python Discord.

  • Add a whois bot that allows a user to link them to a whitelisted set of urls, github, twitter, gitlab, ... some place they might have a profile.
  • Its optional and the user can update or clear this at any time.
  • If a user does a WHOIS the URL is sent as a DM to them, do we want a notice sent to both users?
  • rate limit?
vale ibex
#

How would this be different to the discord provided social links?

#

IE. if you look at my discord profile you can see my battlenet tag and my steam

tropic bobcat
#

let me look

vale ibex
#

you can add many different type of links there

#

spotify, github etc.

tropic bobcat
#

but I think the short answer is yes, because it would be specific to this guild.

patent pivot
#

I think that the Discord provided feature for this is fine, a good portion of our user base already use their profile to display these socials

tropic bobcat
#

I don't see social links

patent pivot
#

they are there

tropic bobcat
#

oh

patent pivot
#

on mine i have github and twitter and stufff

tropic bobcat
#

didn't recognize what those where

#

So then those are public in every guild?

vale ibex
#

yup

#

If you open Joe's you can see he has a lot more

short snow
#

Lol

patent pivot
#

lol

tropic bobcat
#

Back to my zwiftpower thing then applications.

#

is there a way to get or set this without viewing the user profile?

#

I guess that just needs to be a bot.

patent pivot
#

Bots cannot read or set user connections, no.

#

(without the user approving that access)

tropic bobcat
#

right

#

one of the things we need in the cycling teams is a way for the admins to get and set this.

patent pivot
#

Yeah, we don't really have the same need here, we leave that up to the users.

tropic bobcat
#

Thanks, it would be nice for all problems to be this easy.

patent pivot
#

The benefit of letting Discord handle it is that to connect a profile to Discord you must have it verified by Discord

#

so you can't just claim you are torvalds on GitHub and have that work

tropic bobcat
#

right

stable mountainBOT
#

@vale ibex

It has arrived!

Here's your reminder: [#dev-contrib message](/guild/267624335836053506/channel/635950537262759947/).
[Jump back to when you created the reminder](#dev-contrib message)

vale ibex
#

@short snow You still need help with that?

vocal wolf
#

Thank.

balmy sparrow
#

is this heading meant to be like this?

hardy gorge
#

@cold moon You're an absolute superhero when it comes to implementing important features. Thanks!

subtle kraken
balmy sparrow
#

oh huh. why are there three different patrons roles?

subtle kraken
#

3 different tiers

thorny obsidian
balmy sparrow
#

right 👍

vocal prairie
#

I mentioned an issue about Seasonal Bot being mentioned on the website in #community-meta, is there something I should do about that?

vale ibex
vocal prairie
#

Thank you!

vale ibex
#

Thanks for pointing it out 😄

clever wraith
#

Hey @gritty wind , anything on verification yet?

patent pivot
#

for unsplash?

#

nothing yet

short snow
#

am currently just using ak’s redact idea

cosmic moat
#

@vocal wolf fedex assures me my parts will be here tomorrow

vocal wolf
#

noice

short snow
#

What had happened?

cosmic moat
# short snow What had happened?

gpu had continually shut down, with no way of recovery, this lead to a lot of lost work, to the point where i actually wasn't able to dev anymore

short snow
clever wraith
short snow
#

this is my current logic for wiki guess game

short snow
#

well this is the only think i can possibly think of as of now

#

and fixes every bug i could possibly find

--

#

splitting on , ->
for Junction to match Junction, West Virginia

#

removing () and [] ->
for Call Me Lightning to match Call Me Lightning (song)

tawdry vapor
#

If it's still an issue, you could try to write a heuristic for detecting overly-complex titles.

#

If the random title is too complicated, then you can discard it and get a different random one.

short snow
#

like if it contains -+-*/[]{}()!@#$%^& then run again?

#

Also i have re-structured the trivia cog since it was huge and if i added wiki questions to it, it would be even huger

#

i will remove the pycache, was getting the __all__ through dir() hence it came there

#

trivia_quiz would now change to _cog

#

and the cog would be loaded in __init__

short snow
#

would love to get reviews on bot#1446

tough imp
#

I'll take a look

short snow
tough imp
#

So how do staff feel about this feature? The issue was put back into planning

#

It seems useful, but I wonder if it's necessary to support 10+ embeds, is it ever the case that someone sends more than 10 message links with their report?

short snow
#

i don't think this can ever be a case tho

tough imp
#

In terms of functionality and presentation this probably ought to be reviewed by people who use the channel

#

I can do a code review later

short snow
#

alright!

short snow
#

@vale ibex did u find any other method? For getting the question wiki guess? (I have opened a pr with my current method)

#

@clever wraith my pr still has few stuff to do

#

the wikiguess game

#

especially how it gets the wiki questioms

clever wraith
#

Alright! Just think it looks good so far

clever wraith
short snow
#

Check out the code, i think u must have seen it when u reviewed

green oriole
#

What do you mean by “Idk man, you didn't lint” @clever wraith ?

short snow
#

You awesome descipriotn

#

description*

green oriole
#

Oh, I see

#

I was a joke, my code is linted 😄

clever wraith
short snow
#

Lmao

clever wraith
short snow
#

Code looks good lemme test it once

clever wraith
#

I just have to read I'm not at my computer 😢

short snow
#

I don’t think you should approve a PR without testing

short snow
hybrid oriole
#

Hello there! Where should I ask for candidate to maintain a project? My two co-worker disappeared, and doing things alone is not the best choice out there. I also don't want to leave the community.. Any suggestion?

green oriole
#

Hello @hybrid oriole, you should ask in off-topic, this channel is for Python Discord open source projects :)

hybrid oriole
#

My bad sorry

short snow
#

rarely did machine learning so could be something new for me

green oriole
green oriole
short snow
#

Yeah. Had the same question hence asked here

green oriole
#

defaultdict[dict[..., ...]]

cold island
#

in 3.8 it's still Dict right?

green oriole
#

Ah yeah

#

I'm not 100% sure if there is a typing equivalent for defaultdict

cold island
#

hmmm

#

maybe just Dict? lol

green oriole
#

But that's basically a MutableMapping

cold island
#

I guess I can alias it

green oriole
#

Or Dict, yeah

#

typing.DefaultDict is a thing

#

So there you go

cold island
#

o

#

tnx

patent pivot
#

@short snow what type of setup are we talking in terms of ML

short snow
#

Haven't done anything yet just was found this and thought of asking if it is ok to use

patent pivot
#

hmmm

#

I don't think bringing ML into a project such as lancebot is a great idea

short snow
#

So should I just keep what it is like now

patent pivot
#

while it's a cool idea it's significantly above the current entry bar + lancebot is aimed to run on minimal resources

#

yeah

short snow
#

[python-discord/sir-lancebot] Pull request opened: #618 Wikiguess Game

#

Uhh

#

Will mention the to do and tada

dusky shoreBOT
tough imp
#

Is there any chance that the bot's http_session may get get closed and re-assigned? Basically I'm wondering whether it's guaranteed that the bot's login method will only run once, so that I can store a reference to the http session somewhere instead of looking it up on the bot instance every time

#

Looking at d.py source it doesn't look like login can run more than once, even in the case of a connection reset or similar

#

But the login docstring in our bot subclass says "Re-create the connector..." so I'm not sure whether that may be implying something related

green oriole
#

AFAIK we don't roll out new Http sessions right now, maybe we might in the future for some reason, but I don't think so

tough imp
#

Oh well I just realized that I cannot safely do what I wanted to anyway because the session is still None at init time

green oriole
#

Yeeeppp

tough imp
#

But if you schedule a task in a cog's init that will access the session and try to make a request, is there a guarantee that login will have completed by then? (by the time your task runs)

#

It seems that we connect to Redis before instantiating bot to avoid that kind of a scenario

green oriole
#

I thiiink so

#

It would be nice if you could still check that the instance us here and throw a better exception than an NPE if not

fallen patrol
#

If sir Lancebot throws an error do all core devs get an email?

#

I hope not

#

Since I just caused a few errors

patent pivot
#

if it's the same error then no

#

we get one email per error type

fallen patrol
#

Oof

#

Threw an error on production

#

Tried to make it send a message over 2k characters.

#

#bot-commands message

fallen patrol
#

Whups

patent pivot
#

we didn't get an email

vale ibex
#

!src

stable mountainBOT
fallen patrol
#

👀

patent pivot
#

p sure we have a ssue

fallen patrol
#

But do you have the issue for sir Lancebot?

patent pivot
#

opened from the sentry issue you triggered 😄

fallen patrol
#

I threw the same thing on lance

patent pivot
#

hmmmm

#

which commmand

fallen patrol
#

Well

#

Snake snakify

#

Afaik I can check uwu as well if I get on a computer

static canyon
vale ibex
#

The formal process is raise issue -> core dev approves it -> implement fix -> raise PR -> PR approved by core dev -> merge to main

#

Sometimes for smaller fixes the first 2 can be skipped

#

(If a core dev approves it here)

cold island
#

Will the linter scream at me if I try to use a string as a typehint?

vale ibex
#

A literal string yes, str no

cold island
#

hmmm

vale ibex
#

3.9 brings that

cold island
#

I don't want to import the actual class because that creates a circular import

brazen charm
#

Forward refs are fine

tough imp
#

maybe you can guard the import with if typing.TYPE_CHECKING?

#

if it's only used to annotate

cold island
#

I will now find out what that is, thanks 👍

static canyon
#

@vale ibex would I do this as a bug report issue?

#

If so, for the known impacted platforms should I just say all?

cold island
#

you can open a bug report, yeah

#

yeah, the platforms part is more specific when it's an issue of formatting etc

#

but if it's a logic issue then it naturally affects everything

static canyon
#

Think I've created that correctly lol

clever wraith
#

would appreciate if someone would review

#

sir-lancebot#621

dusky shoreBOT
short snow
#

Can someone reply to this comment bot#1234 and bot#1154

dusky shoreBOT
short snow
vocal prairie
#

I deleted my message since I found the answer.

clever wraith
#

Why sir lance bot doesn't use YAML configuration like @stable mountain ?

clever wraith
#

yeah

short snow
#

You can open a issue about that probably

#

it would easier than doing int(os.env(...., ....)) for every thing

clever wraith
#

bot designed as a fun and beginner-friendly learning environment

I guess they didn't implement it because its' a beginner friendly project focused on simplicity/minimalism

short snow
#

sir-lancebot#618 is up for review 😄

dusky shoreBOT
short snow
#

Have we found out the problem why .ttt is blocking?

green oriole
#

What’s the context behind this one?

sharp timber
#

I'm noticing that ctx.cog.games is never cleared except on restart, and it's looped over fully in several places, like here:

        if opponent is not None and not all(
            opponent not in (player.user for player in g.players) for g in ctx.cog.games if not g.over
        ):
``` which could get ugly if the number of games gets high
#

Calling .ttt actually runs this/similar logic three times

#

.ttt history

dusky shoreBOT
#
Most recent Tic Tac Toe games

#1: @balmy sparrow vs AI (draw)

#2: @left flume :trophy: vs AI

short snow
#

its back... we can merge my PR then

#

after review..

left flume
#

Add this to the help command: py await ctx.send(ctx.author.mention, embed=embed) ^^^^^^^^^^^^^^^^^^

#

instead of sending 2 different msgs

#

I discovered this only because of TizzySaurus so credits to him

#

Its was an efficient feature so I thought I'd suggest it here

#

The bot only sends one message instead of two

green oriole
#

I don’t get it, where do you want to add this?

left flume
#

!help

static canyon
#

When you do !help in a non-bot channel the bot will send two messages

#

One saying "here's the result" and one the actual result

#

They're suggestion merging the two messages into one

left flume
#

ye

gritty wind
#

Also we didn’t fix ttt

#

Just that it comes back online after restarts

green oriole
#

!source help

stable mountainBOT
#
Help Command

An interactive instance for the bot help command.

Source Code
green oriole
left flume
#

alright

#

also, whats the asyncio.sleep for the help command?

green oriole
#

Which line?

left flume
#

Idk but there's an inactivity timeout for the help command isn't it?

#

How long is it before the bot stops responding to any further reactions

green oriole
#

Yep, on the paginator

#

but it doesn’t use asyncio.sleep

left flume
#

oh

#

how long tho?

green oriole
#

It is asking d.py for a certain type of event, and provide a timeout paramater

#

I think it is either set to 2 or 5 minutes

left flume
#

oh I see

#

thanks

short snow
#

@sharp timber You have ticked both (I want to implement, anyone can implement) on sir-lancebot#622

static canyon
dusky shoreBOT
gritty wind
#

If I had to guess

#

it is done that way to avoid problems with the calculation between two years

#

Yeah I think it is

#
future = datetime.datetime(year=2021, month=1, day=10)
past = datetime.datetime(year=2020, month=12, day=15)
past.date() < datetime.datetime.now().date() < future.date()
> False
clever wraith
#

Hey, there's a problem with the .easteravatarify command

#

It's really slow

gritty wind
#

cc @vale ibex

clever wraith
#

Oop

#

.avatareasterify

gritty wind
#

.avatareasterify

clever wraith
#

It types for about a minute

gritty wind
#

yeah I think all the pfp ones are pretty slow

#

.help

#

it is blocking too it seems

#

The blocking part is what chris was looking into fixing

clever wraith
#

Do 8bitify by comparison

gritty wind
#

not sure if anything can be done for the speed 🤔

clever wraith
#

Fair

gritty wind
#

.8bitify

clever wraith
#

It's a bit faster

#

But less processing I guess

gritty wind
#

that is definitely a little faster, but probably just because its a different operation

#

yeah

clever wraith
#

True

gritty wind
#

I guess we could maybe spend time making micro tweaks to speed it up, but even if it takes a minute, I think that's fine for what it is

clever wraith
#

It's probably not worth it

#

The only problem would be the blocking then

green oriole
short snow
#

Chris's PR should reduce it down pretty much
I will give it review tomorrow

static canyon
#

I would've thought there's an easier way but yea that works

gritty wind
#

There probably is

#

you can compare timestamps

vale ibex
#

It won't reduce the cpu load by much

#

but it will make it non-blocking

short snow
#

it would, the number of uses would reduce

#

and not run too many process at one time

vale ibex
#

Yea, it's a big PR, but most of the code is previous code that already existed, just moved into different files

sleek steppe
#

When someone does .<some_group>, it sends help for that group, right? So when it does that, it uses ctx.send_help. Since the bot.help_command is commands.DefaultHelpCommand, it uses the (not so pretty) default help command. So I was thinking, instead of doing

await ctx.send_help(ctx.command)

We should do something like

help_command = ctx.bot.get_command("help")
await help_command(ctx, ctx.command.name)
sleek steppe
#

I mean what would be better would be if we just subclassed commands.HelpCommand.

balmy sparrow
#

Why're we shifting sir lancebot to use poetry instead of pipenv? (Not complaining, I've personally been a fan of poetry :P)

patent pivot
#

We might not, we're just discussing it internally and wanted to give it a try

balmy sparrow
#

Ooh nice

#

Had issues with pipenv on my computer, poetry has always worked like a charm

#

Does one offer anything that the other doesn't? I think I read somewhere that poetry is used for packages or something

#

Maybe that's because of it's publish option

subtle kraken
patent pivot
#

so you can do poetry run task lint

subtle kraken
#

nice

tawdry vapor
#

Can it avoid creating a venv?

patent pivot
#

uhhhh

#

ah

#

yea

#

poetry config settings.virtualenvs.create false

tawdry vapor
#

Preferably use the env var in docker and ci

patent pivot
#

ah

#

founnd it yeah

#

alright just testing locally, build takes a bit because ffmpeg deps

gritty wind
#

what are we using ffmpeg for?

patent pivot
#

uhhhh

#

some voice commands on lancebot iirc

gritty wind
#

hm

#

any idea which ones?

#

I didn't know we had voice commands lol

#

just a cursory search shows none, but I didn't look too hard

patent pivot
#

lol I forget

#

spooky sounds @gritty wind

clever wraith
#

@patent pivot what voice commands oooo

patent pivot
#

.spookysound

#

sadge

gritty wind
#

ah

clever wraith
#

.spookysound

gritty wind
#

that probably doesn't show up in the help menu

patent pivot
#

seems we got rid of it now

gritty wind
#

yeah

patent pivot
#

but never liike

#

changed deps at all

gritty wind
#

Has anyone ever cleaned deps lol

#

poetry should have a command for cleaning up some things, but lobbing parts off and seeing what breaks would be needed to clean everything up

patent pivot
#

if it's in our dep file it won't be cleared up

vocal wolf
#

isn't ffmpeg pretty heavy?

gritty wind
#

does poetry have a post-install hook?

#

or any hooks for that matter

patent pivot
#

to do what

gritty wind
#

we can use it to remove hiredis

#

though that's more of a hypothetical

patent pivot
#

hmm

#

hiredis won't even install so

gritty wind
#

Hm, wdym?

#

It's a required dep

#

Ah I didn't mean install then remove

#

I meant not installing in the first place

patent pivot
#

ah

green oriole
vocal wolf
#

lmao

clever wraith
#

Thanks for the merge

vale ibex
#

@short snow I intend to action the rest of your comments too, just don't have time for the others rn

sleek steppe
cold island
#

bot#1459 is out hyperlemon

dusky shoreBOT
obsidian patio
#

Great work👏

clever wraith
#

@vale ibex congrats on getting mod!

short snow
#

What does auto review do?

#

Got it

#

this looks jnteresting

#

I can try to give it a code review once done. Does it need rhe site pr setup?

patent pivot
#

it does, yeah

short snow
#

Welp, that means i would

#

require a site setup and not use the docker builds

#

Big task!

cold island
#

you can use docker, it just requires some magic

#

I set up everything on my end by starting bot, site, and metricity on the same docker compose project

short snow
#

I meant using the docker compose of bot

#

since that takes it from ghrcio

#

And even need metricity,

cold island
#

youuu don't have to use metricity

#

but you will be limited in the data you can use

#

without manually populating the database

cold island
short snow
#

Hmm, but u think your site pr makes it connect to metricity

cold island
short snow
#

Its given in the contributing guide on the site

cold island
#

You don't have to start up metricity, it will just tell you the user has no messages

short snow
#

Ah ok, got it!

#

Metricity even stores deleted msgs, so do you count them?

cold island
#

With joe's suggestion from ~20 minutes ago, not anymore

short snow
#

Ok cool

#

will role giving dates helpmin review, like contributor role given to them in this date, etc.

#

And we can make all the voice channels as one

#

Voice chat

cold island
#

I just realized I didn't limit the new commands to mods+

short snow
#

Oh lol

floral venture
#

Dumb question: How do I fork the repo with Docker?

short snow
#

Like in the auto review, you include msgs, top channel, date join, etc. We can include on which dates where they given whilemrole, like:

Roles:

  1. Contributors given on {}.
  2. Voice Verified given on {}
cold island
#

hmm

#

we don't actually have that info I think

short snow
#

probably, dpy doesn’t support it, any plans on storing it?

cold island
#

not that I know of

short snow
#

Worth doing tho.

#

We can include it in the !user also

floral venture
#

I am getting the error

Traceback (most recent call last):
  File "bot.py", line 12, in <module>
    from bot import constants
  File "C:\Users\Osa\Documents\GitHub\sir-lancebot\bot\bot.py", line 12, in <module>
    from bot import constants
ImportError: cannot import name 'constants' from partially initialized module 'bot' (most likely due to a circular import) (C:\Users\Osa\Documents\GitHub\sir-lancebot\bot\bot.py)

When I try to start the bot.

brazen charm
#

What would be the use for that data? Don't think it's particularly important to keep track of

thorny obsidian
#

@floral venture how are you starting the bot? like the command you're typing into terminal

thorny obsidian
#

so to run sir-lancebot I think you have to go do: python -m bot since it's running it as a module or something like that

#

make sure you're at the correct level to do so

floral venture
thorny obsidian
#

what level of the directory are you on when you run that command?

floral venture
thorny obsidian
#

can you back out to sir-lancebot and try it again?

floral venture
thorny obsidian
#

Can you screenshot that error? Also, can you check what fakeredis is set to ... somewhere amongst the config files?

floral venture
thorny obsidian
#

yup, $10 that's a redis thing. Give me 5 seconds, let me grab where you need to set fake-redis to true

#

@floral venture In your .env file, do you have USE_FAKEREDIS = true?

floral venture
thorny obsidian
#

Try adding that and that error shoooould go away

floral venture
thorny obsidian
floral venture
thorny obsidian
#

hurmmmm could you screenshot the .env file minute the bot token for me?

thorny obsidian
#

For the first one, can you change it to BOT_DEBUG=True?

floral venture
#

Could it be the fact that I added CHANNEL_ANNOUNCEMENTS twice?

floral venture
thorny obsidian
floral venture
thorny obsidian
#

@floral venture well it's definitely a redis issue. This is from the latest pull of the lancebot?

floral venture
thorny obsidian
#

okay, let me pull the latest then

#

hmmmm, I just pulled it and with my .env file it works just fine.

#

@floral venture are you using pipenv or no?

floral venture
thorny obsidian
#

@floral venture so you're doing pipenv install to setup the environment and then pipenv run python -m bot to get it running?

sleek steppe
floral venture
sleek steppe
vocal prairie
#

Why would you invoke a help command for a command that already works?

sleek steppe
#

?

#

It uses the default command that looks not as good.

#

like this

.[http_status|status|httpstatus] 

Group containing dog and cat http status code commands.

Commands:
  cat Sends an embed with an image of a cat, portraying the status code.
  dog Sends an embed with an image of a dog, portraying the status code.

Type .help command for more info on a command.
You can also type .help category for more info on a category.
#

instead of this

#

see?

#

It might be a command that works, but it doesn't look too good.

vocal prairie
#

Oh, that would be nice.

sleek steppe
#

Ok, would that be a bug or a feature?

#

I'm thinking it would be a bug

#

Actually, I'll make it a feature

thorny obsidian
#

@sleek steppe you're not getting ignored, it's just I would need to really look into it and I don't quite have the time right now. Opening an issue is definitely the best way to go to get eyes on something

sleek steppe
#

Alright, thanks!

floral venture
#

What API is used for the .movies command?

vocal wolf
sleek steppe
#

.source movies

#

It uses the movie db

floral venture
vocal wolf
#

Pretty sure it's free

#

at least there's a free version of it

floral venture
vocal wolf
vocal prairie
vocal wolf
short snow
short snow
#

the pfp is different and the author is different

#

(Sk9's pfp, and lemon is the author)

balmy sparrow
short snow
#

yes

balmy sparrow
#

seems like a super small fix, whoever was working on making the image commands run in executors can add this in too

short snow
#

i will add a comment during the next review on it

vocal wolf
#

@short snow you should discuss that within the issue so we don't lose this to time

short snow
#

i will comment.

vocal wolf
#

ty

short snow
#

was finding the context

#

hence took time

vocal wolf
short snow
#

@cold island I had left two comments on your review on Enhance Incidents msg, did you check them out?

cold island
#

Thanks! I will check them soon

sleek steppe
#

How do you get the emojis when running locally?

obsidian patio
#

Are you referring to emojis like the trashcan?

sleek steppe
#

Yep

obsidian patio
#

For local testing, I'd recommend just replacing it with something else. For example, the trash emoji can be replaced with ❌

sleek steppe
#

How do you replace it?

gritty wind
#

Are you on sir-lancebot or python?

sleek steppe
#

sir-lancebot

gritty wind
#

In that case you really don't need to.

#

If you still want to

#

It's line 154 in the constants file

obsidian patio
#

The trashcan should need to be replaced

gritty wind
#

just make sure to not accidentally commit your changes

#

The program runs fine without it

gritty wind
#

it will produce an error when you paginate or something

#

but it won't stop

sleek steppe
#

Yeah I guess so

cold moon
#

I think we should use 🗑️ instead? This is default emoji

green oriole
#

@celest charm snekbox is made to run stuff from untrusted sources

#

I’d consider a user provided regex and input as untrusted

#

It would make sense to put a memory and resource limit on it

#

Keeping some stuff inside Discord is useful

celest charm
green oriole
#

That’s my two cents on it

celest charm
#

regex101 is instant

#

The only harmful side-effect of regular expressions is taking too much time. (given that their size is limited to 2000)

#

They can't do networking or launch missiles

green oriole
#

They are memory based regex dos attacks, aren’t they?

celest charm
#

no

#

time-based

green oriole
#

Hmm okay

#

We can run it into another thread and kill it after a few seconds if that’s the real issue

celest charm
#

In another process, maybe.

#

Because otherwise it would block

gritty wind
#

if the problem with snekbox that the formatting isn't great, we already do parsing for snkebox results

celest charm
#

I just don't see the need to invoke snekbox. It's like using SpaceX to get to the grocery store

gritty wind
#

if the grocery store was on the moon, that would make sense

#

likewise

thorny obsidian
#

(must.... resist.... otn... a....)

green oriole
#

What if there is a black hole between you and the shop

gritty wind
#

snekbox is for running arbitrary code

celest charm
#

regex isn't arbitrary code

green oriole
#

It is an arbitrary input though

gritty wind
#

I still think we're taking user input

#

and running it through an evaluation process on our end

celest charm
#

lol, we're taking user input in every command

#

and running it through an evaluation process

gritty wind
#

which just seems safer in an isolated environment

celest charm
#

should we run every command in snekbox?

gritty wind
#

that's not the same for every command and you know it

green oriole
#

I mean, between converting a string to an int and executing regex there is a world

#

Regex is dangerous

#

it isn’t advised to execute regex from an unstruted source

#

While casting to an int is fine

gritty wind
#

I honestly don't see the pushback against snekbox

#

is there some reason that we shouldn't use snekbox

celest charm
#

We don't run arbitrary code because it can produce arbitrary side-effects, like talking to the network.

Regex isn't "arbitrarily dangerous". It can simply take much time, which is mitigated:

  1. By running it in a separate process;
  2. By using the regex library
celest charm
celest charm
#

If you want, I can reopen my PR

#

and we'll discuss there

#

but I don't think I'll be able to work on it, I'm busy with other things

green oriole
#

Sure

#

We have all the time in the world

#

Well, maybe not all of it

#

But still

gritty wind
#

again

#

I still don't understand why we can't use snekbox

#

this isn't as dangerous as running user code

#

but also not as safe as an int cast

celest charm
#

Safety isn't measured on a spectrum. There are very specific things that can go wrong.

#

In case of regex, the only side-effect is taking too much time. Do you disagree?

gritty wind
#

I don't know, I'm not a regex expert

#

So? What's the cost related with evaluating random user input in snekbox

green oriole
#

At some point our resources will be gone though

#

We can’t execute a regex for 10 minutes, we simply can’t handle that

gritty wind
#

That can be circumvented with the regex library

celest charm
gritty wind
#

but still, the opportunity for doing something malicious seems greater than the cost of running in snekbox

#

that cost still being a mystery to me

green oriole
#

I guess snekbox has some overhead when transmitting over the network and preparing the process

#

But that’s nothing compared to running a somewhat complicated regex

celest charm
#

The solution with snekbox will:

  1. take more time to execute;
  2. be more complex (because we'll have to construct Python source code for snekbox to be executed and interpret snekbox's results correctly);
  3. take more computational power on snekbox side;
  4. be harder to fix bugs in and to change (because you'll have to setup snekbox to run the command)
green oriole
#

Doesn’t take any additional computational power

celest charm
#

Snekbox will have to set up and tear down the Python interpreter

#

but yes, not too much

gritty wind
#
  1. The time taken for snekbox is not noticeable, go ahead and try the eval command
  2. I don't think that's really true, it's slightly more complex, but nothing crazy
  3. Like starting it up?
  4. That seems like a good trade of for ease of mind to me
#

I mean just look at the eval command

#

that has people trying to break it

#

all the damn time

celest charm
#

I'm not saying it will make the command unusable. I'm just saying that that's the cost.

gritty wind
#

I don't think that's a cost

#

Taking arbitrary input and executing it seems like a no-brainer for snekbox imo

green oriole
#

Resoirces wise, that’s a cost I’m fine with

#

It is worth the investment

gritty wind
#

!e print("this is instantaneous")

stable mountainBOT
#

@gritty wind :white_check_mark: Your eval job has completed with return code 0.

this is instantaneous
celest charm
#

It's not arbitrary code, for christ sake

green oriole
#

Arbitrary data?

celest charm
#

I also already said that every command takes arbitrary data.
Arbitrary code is dangerous because it can do harmful side-effects, like networking.

green oriole
#

.>

gritty wind
#

Ok here are my final thoughts on this

#

Regex is input that we put through more dangerous evaluation that something like an int cast. There is no real cost imo associated with snekbox evaluation. Peace of mind can sometimes come at the cost of minor redundancies.

celest charm
#

Okay, you can write the command if you want

#

"Interpreting untrusted arbitrary user input as an integer is unsafe. We don't know what happens if a user finds some special input that explodes the computer. So we'll do it in snekbox."

#

Excuse me for the tone.

#

My point is that if there's some bug in re/regex that causes some behaviour other than timeout, it's a bug, similar to a bug in the integer parsing.

green oriole
#

Was the regex library timeout proven to be unreliable?

celest charm
#

No.

green oriole
#

Well, not sure why it has be rejected then

gritty wind
#

I'm not gonna keep arguing this. I don't think you're wrong

#

But I also think I'm not wrong

fallen patrol
#

but its a bug. We can plan something might happen, but if it does, we may not know it happened. If regex were to break snekbox, then there's bigger problems, such as snekbox having a glaring security issue that needs to be fixed.
I think I'm following, correct me if I'm off here

green oriole
#

I honestly think all three are good solutions, maybe there is one better than the other, but in the end they all work

celest charm
gritty wind
#

I'm not trying to account for bugs in the std library

#

that's not what I'm arguing

celest charm
#

I'm not saying you are

gritty wind
#

what I'm saying is that regex is a language that can be exploited, at least easier than something like an integer conversion

fallen patrol
gritty wind
#

If the cost of evaluating in snekbox is low

#

and the benefit is that it's less likely to mess up a critical thing in the server's infrastructure

#

Then I think its an ok tradeoff

#

that being said

#

I understand you wanting to keep things simple

#

and rely on existing tools

celest charm
#

I just think the fear is not rational. You haven't provided any justification to believe that there is a risk of something other than time consumption in regular expressions.

#

well, other than that it's a more complex language than integers

green oriole
#

If the timeout was proven to be unreliable, it will slow down our whole infra and make the bot OOM

celest charm
#

We could just use re and wrap it in standard timeout prevention from stdlib

fallen patrol
gritty wind
#

It's not about past exploits/current limitations exclusively

#

As a more complex language

gritty wind
#

it is more likely for exploits to be found in it

#

then for something relatively simpler like type casts

celest charm
#

alright, let's just stop this

#

If so many people are worried about potential exploits, alright, let's make it call snekbox.

green oriole
#

I am okay with killing a thread after a certain amount of time

#

that should be safe enough

#

or process

celest charm
#

Same. (can't really kill a thread, so a process)

vocal prairie
#

Quick question. I'm working on improving the pagination (and the trash can) experience by deleting reactions that aren't from the OP, so how would I be able to test this code? Because as far as I know, @stable mountain is customized for this server specifically.

gritty wind
#

we have a guide on setting up the bot, and a server template to help you get it done

#

So you may need to take some time to set things up

#

you can find the guide

#

here

vocal prairie
#

Thanks you!

sleek steppe
#

sir-lancebot#624 🙂

sleek steppe
#

Can someone review this issue?

vocal prairie
#

Is there a more updated server template? I can see the one in the website for setting up the bot testing, but that doesn't have all the channels.

gritty wind
#

The template shouldn’t require any new channels

#

But it also doesn’t have all the channels

#

You just need the ones listed in the guide

vocal prairie
#

Oh ok.

#

I was looking more at the config.yml file, so I guess I confused myself.

vocal wolf
gritty wind
#

Oh

#

I can assign you?

#

We can remove the field name as well in the shortened version

#

I'll add that now

sleek steppe
#

Can anyone look at sir-lancebot#624 ?

vocal wolf
#

I can do this PR

fallen patrol
#

smh

#

snekbox, pipenv has a glitch

sleek steppe
#

How long does it usually take for someone to respond to an issue lol?

vocal wolf
#

Which issue are you referring to?

sleek steppe
#

It's not a big one

vocal wolf
#

@sleek steppe approved. You can begin working on it whenever. Just a confirmation: You're intending to make .games send the first embed when help is needed?

sleek steppe
vocal wolf
#

Right

sleek steppe
#

All of them use ctx.send_help

vocal wolf
#

Sounds good to me

sleek steppe
#

I'm also ready to PR now 🙂

vocal wolf
sleek steppe
#

Well, not yet but I've pushed

vocal wolf
#

huh

#

yeah go ahead with the PR lol

#

But next time I suggest waiting for an issue to be approved before working on it

#

Users have gone ahead in the past to make a PR and get rejected because their changes were not discussed

sleek steppe
#

Sorry I guess I was a little impatient

vocal wolf
#

np

cold island
#

yeah it's not a problem, it might just turn out to be a waste of time on your end if it ends up rejected

fallen patrol
#

👀

#

help

#

I'm trying to run a snekbox, but having trouble with docker-compose

sharp timber
#

That's probably redis

#

@fallen patrol try setting fakeredis to true in the env file

fallen patrol
#

WAIT SNEKBOX USES REDIS?

#

why???

sharp timber
#

I don't think it does

#

but snekbox doesn't make http requests I don't think? Does it?

#

What's the rest of that error

fallen patrol
#

👀

#

hm

#

I didn't make a .env

#

brb time to check how .env files work 😰

#

okay so

#

as I continue to find an issue i continue to fix the issue

#

docker was not running as a service

#

currently is building the image

tawdry vapor
#

snekbox doesn't use redis. That environment variable would do nothing.

fallen patrol
#

ye

#

hm

#

what kind of request does snekbot what

#

!src e

stable mountainBOT
#
Command: eval

Run Python code and get the results.

Source Code
tawdry vapor
#

That's the source for the command, not for the server.

fallen patrol
#

no i know

#

the server is running now

#

I have to make the client part side to test it

#

…where does the bot make the requests

tawdry vapor
#

It's all in that file

fallen patrol
#

which file

tawdry vapor
#

The one linked to you by the command above

fallen patrol
#

ah

#

data = {"input": code}

#

and json equals that

#

👏

#

got a snekbox running now

vocal wolf
#

bot#1452 needs review.

sleek steppe
#

sir-lancebot#625 needs review 👀

short snow
#

!remind 5h ^^^ and chris’ move pfp commands

stable mountainBOT
#
I got you.

Your reminder will arrive in 5 hours!

fallen patrol
#

👀 why was snake snakify updated to use an embed?

stable mountainBOT
#

@short snow

It has arrived!

Here's your reminder: ^^^ and chris’ move pfp commands.
[Jump back to when you created the reminder](#dev-contrib message)

fallen patrol
#

!remind 1s wait I can use this here?

stable mountainBOT
#
I'll allow it.

Your reminder will arrive in 1 second!

#

@fallen patrol

It has arrived!

Here's your reminder: wait I can use this here?.
[Jump back to when you created the reminder](#dev-contrib message)

fallen patrol
#

Oh okay

fallen patrol
#

Of someone had answer

short snow
stable mountainBOT
#
Missing required argument

content

fallen patrol
short snow
#

nvm, am free now. Will review them

cinder wharf
#

I'm quite new to docker, does the docker image for snekbox host the API on the local host? How would I use the API from a python program from the same local host?

eternal owl
short snow
#

@cold island i have a question, is this the way, we use multiple line strings in bot or just your method:

review = f"They were nominated **{nomination_times}** before"
review += f", but their nomination was called off **{rejection_times}**."

I mean the way you use += to add strings

cold island
#

This isn't a multiple line string, I still want everything to be written in the same line, it was just too long to be written as such in the code. I could in retrospect do:

review = (
  f"They were nominated **{nomination_times}** before"
  f", but their nomination was called off **{rejection_times}**."
)

I think

#

I just went with the style that was already in the cog

short snow
#

Yeah, i meant why don't didn't u use () and used += instead

#

oh ok, might wanna change it?

cold island
#

Yeah that might be a good idea

short snow
#

should i add it is as a comment on my review or you will just do it

cold island
#

Either is fine

#

You can add a comment if you want credit for the change lol

short snow
#

my pr is gonna come like tomorrow, so your choice

#

lol, no need 😄

#

also the spelling of maxiumum in _cog is wrong

#

it should be maximum

#

but you haven't change that part, so i can't comment there

green oriole
#

....... lol

vocal wolf
short snow
green oriole
#

What do you mean?

short snow
#

like, all the arguments need to be on separate line

#

and

green oriole
#

Well, yes

short snow
#
def func(
  a,b,c
):
``` is bad
#

ok thanks

cinder wharf
#

And btw, is there any precautions I should take?

fallen patrol
#

¯_(ツ)_/¯

short snow
#

is there a grammarly plugin for pycharm prof?

vocal wolf
#

Doesn't pycharm already check grammer automatically?

green oriole
#

There’s the JB plugin...uhhh...

#

Grazzle?

sleek steppe
#

@short snow what do you think would be a good attribute name for the help command? Since help_command is already taken up.

green oriole
#

I personally think the current solution is fine

#

We may run into issues of the cog is reloaded

sleek steppe
#

Yep or if it's unloaded entirely.

#

Which hopefully doesn't happen

green oriole
#

I don't mind have it error out of it is unloaded honestly

sleek steppe
#

Maybe I should check if help_command is None and if it is use ctx.send_help

#

Or does it not matter

green oriole
#

I guess we can have a utility function doing that

short snow
#

anything is fine

#

for me

#

hence i gave a approve

clever wraith
#

!remind 20m review chris's pfp executors PR (sir-lancebot#597)

stable mountainBOT
#
Of course!

Your reminder will arrive in 1 year and 8 months!

dusky shoreBOT
clever wraith
#

oh great

#

!remind 20 minutes review chris's pfp executors PR (sir-lancebot#597)

stable mountainBOT
#
Bad argument

minutes is not a valid duration string.

dusky shoreBOT
stable mountainBOT
#
Command Help

!remind [mentions]... <expiration> <content>
Can also use: reminder, reminders, remindme

Commands for managing your reminders.

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

short snow
#

Welp, try your best not pollute these channels

clever wraith
#

yup

#

how do I review again?

fallen patrol
#

Out of curiosity

#

Is there any talk to update snekbox to a different framework

sleek steppe
clever wraith
#

ok

short snow
green oriole
fallen patrol
#

What is falcon?

#

ASGI framework? 😓

short snow
#

They are talking about nsjail most probably

fallen patrol
#

Oh, no, the api framework

green oriole
#

We are using falcon for the API framework

fallen patrol
#

Cause I was going to mess around with ns_jail and possibly use it for my own stuff.

#

*snekbox

#

**with licensed credit

#

:D

green oriole
#

I don't understand what you are asking

fallen patrol
#

And since I intend to rewrite the framework to a different one, FastAPI, if it was already in the works I'd either wait or help.

green oriole
#

Alright, I don't think we plan to change it

#

It works fairly well right now, and we only have one route

fallen patrol
#

Cause I know a different point is planned to be rewritten

#

Yeah

#

I think that's the dB api to be rewritten in FastAPI

green oriole
#

Ah yeah, we are going to separate it from the Django website and rewrite it in FastAPI

fallen patrol
#

Ye

short snow
#

sir-lancebot#605 needs review 😄

dusky shoreBOT
left flume
#

So this is what I made for sir-lancebot issue#613. I hope this is okay. I'll then modify it according to the contributor guidelines if needed. Just wanted a staff member to kinda like review it...

https://paste.pythondiscord.com/zozekigasi.py

clever wraith
#

sir-lancebot#613

dusky shoreBOT
clever wraith
#

@left flume nice, maybe add uhh the ability to play against other players?

left flume
#

well thats something that i cant do...

#

but if im given some time, ill try adding it

sleek steppe
stable mountainBOT
#
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](../../api.html#discord-api-events) for a list of events and their parameters.... [read more](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.wait_for)
sleek steppe
#

but maybe it would have to do that in the dms or something.

sleek steppe
left flume
#

thanks

#

why would it need to be in dms tho?

sleek steppe
#

So they can't see each other's choices.

green oriole
#

bot.utils.extensions I'd say

sleek steppe
#

Would invoke_help_command(ctx, *commands) suffice?

left flume
#

oh, I see

green oriole
#

I think so

sleek steppe
#

why does this happen why I try to login to github thonk

clever wraith
#

@sleek steppe issues with github apparently

sleek steppe
#

oh right

green oriole
#

Uh oh

sleek steppe
#

Ok, it seems to be working now.

sleek steppe
green oriole
#

Well, that's an utility to retrieve an extension I guess

sleek steppe
vocal wolf
#

Also, I do think we should keep the dynamic_message attribute as we need to access it when checking if the ID can be edited at all when a channel is moved.

tough imp
#

Okay let me explain ~ btw you definitely don't need to address that comment, it was just thoughts that I had when looking over the code

vocal wolf
#

I've resolved everything else besides this so far, I think the feature is nearing completion.

grim tide
#

how does the bot know when to unmute/unban someone? I know they store the timestamp in a db, but how will the bot know the timestamp is over?

tough imp
#

So we're keeping a set of available help channels, but so does d.py, we use their representation when the set is empty:

self.available_help_channels = set(
  c for c in self.available_category.channels if not _channel.is_excluded_channel(c)
)

So what I was thinking is, could we always use self.available_category.channels and not keep our own? Because that category should remain up-to-date even when the bot itself doesn't move the channel. If you don't keep your own state, you lose the burden of maintaining it, and you don't risk desync in case someone other than the bot moves the channel

#

But I think the problem with looking at self.available_category.channels is that it may not be up-to-date yet - I'm hypothesising a little bit, but I believe that when you send a channel move request to the API, even if you await it, it doesn't mean that we've received the "channel move" event back from Discord, so the self.available_category.channels may be lagging behind

tough imp
grim tide
#

i see. thanks :))

tough imp
#

That's an oversimplification, but in general I believe that's how it works

grim tide
#

yeah my instinctive approach is to keep a local cache of the db and check it every second for any timestamps that match the current one, but I figured that is too resource intensive and also it's prone to error (e.g. accidentally skipped a second) - so that's a bad idea

#

but thanks for explaining anyway :)

tough imp
#

There is a scheduler abstraction that the bot uses to handle this

#

But I'm not familiar with it

gritty wind
#

The skipping a second problem can be solved by checking if a timestamp is current or in the past

#

but the tasks system seems much simpler

grim tide
#

and less resource intensive (imagine checking a database every single second)

vocal wolf
tough imp
#

If you can live with a little imprecision, you could just query every e.g. 5 minutes, and un-do all infractions that are in the past

vocal wolf
#

But having the set in general isn't the best idea, yeah

tough imp
#

You could probably do the check in the database, so that you're not pulling the whole table every time, just select expired infractions

#

Imprecise but simple

grim tide
#

actually, saying that, SQL is designed for a lot of queries so i don't see this being too big of a different tbf

tough imp
#

I have another wild idea that I haven't put much thought into - could we utilize a channel change listener? That should receive all events, not only those triggered by the bot

#

And check if a help channel was moved ~ if so, update the message

#

But yeah, feel free to keep what you have

tough imp
#

Unless your infraction table is gargantuan it should be a simple select that gets processed very quickly

grim tide
#

this server has a tendency towards nosql from what i could see; but I'm not experienced with any nosql except json so I'll prefer sql whenever possible

gritty wind
#

We have a ton of sql, especially for @stable mountain, but I doubt you'll be dealing with enough data for it to matter

#

so do what you feel comfortable with

grim tide
#

thanks

vocal wolf
tough imp
vocal wolf
#

@tough imp Thank you for showing me de wey that self.bot.http methods are a thing, because I didn't know they existed.

green oriole
tough imp
vocal wolf
#

ye

tough imp
#

I dont think a Message.edit really does much apart from passing its own ID and the channel ID to the HTTP method anyway

fallen patrol
#

Or is bot.http standard on dpy

sleek steppe
fallen patrol
#

O

short snow
short snow
#

Why don't we have black code formatter in our linter?

gritty wind
#

If you want, you can try configuring black for your setup

#

That being said

#

I’m fairly against it, because we try to be as open and accommodating to as many styles as possible

#

While maintaining a workable code base

sleek steppe
#

sir-lancebot#625 needs review. (finally got flake8 to be happy lol)

short snow
#

will have a look

sleek steppe
#

Also, is there away to run flake8 so it can pass the checks first try?

gritty wind
#

What's the first failure?

sleek steppe
#

The imports

gritty wind
#

Are you running flake8 directly, or through the lint command?

sleek steppe
#

I ran flake8 directly

#

Also with pre-commit

gritty wind
#

Well to only run it once, it would have to be auto fixing

#

and it doesn't auto correct imports

sleek steppe
#

Why did it pass though?

gritty wind
#

If it passed after the first run, something has modified them since, but it isn't flake

#

What IDE are you using?

sleek steppe
#

vscode

gritty wind
#

I'm not sure what's fixing it then :P

sleek steppe
#

It didn't get modified though, I had to change them myself.

gritty wind
#

Ah right

#

So that's why it passed the second time then, no?

sleek steppe
#

I pushed 3 times, and flake8 passed all three times.

gritty wind
#

Ah got you

#

Your hooks are most likely not using the flake8 plugins

#

There is a workaround

#

one secc

#

Putting this in .git\hooks\pre-commit

#

It's a bit hacky but pipenv and pre-commit don't play nice in some contexts

thorny obsidian
#

Ah, the windows, vscode, and pre-commit thingy

gritty wind
#

you can drop vscode, it's on pycharm too :P

#

just windows pain

thorny obsidian
#

I literally have it in a section for my personal PyDis notes

gritty wind
#

We should just PR that to pre-commit lol

tawdry vapor
#

Why does the hook have to be modified. Is it not just a git configuration issue?

#

I didn't have to modify my hook and I don't have problems with line ending hooks

thorny obsidian
#

I don't really use git on the command line. I like to use it within vscode or git kraken. To get it to play nice with vscode on windows, I ended up having to modify the pre-commit.

gritty wind
#

The hook runs completely out of the venv when run with a GUI on windows

tawdry vapor
#

Your editor should respect your gitconfig. And you'd need to configure line endings in your editor too.

gritty wind
#

The line endings thing is pretty easy to change, but idk what’s up with the venv thing

tawdry vapor
#

Also i am pretty sure autocrlf must be false, not input.

gritty wind
#

At one point I tried switching it to system in the precommit config, but that seems to have been changed on master with no effect

tawdry vapor
#

Never mind, doesn't seem to matter...

however, if a file with CRLF endings accidentally gets introduced, then you may want Git to fix it. You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

gritty wind
#

Isn’t input just whatever is on the repo

tawdry vapor
#

Input is what I quoted above.,

gritty wind
#

Ah no

#

Alright

#

Fair enough

thorny obsidian
#

Yeah, habit from using VSCode for work stuff that I forget to change my line endings and the like. Sometimes I do my work stuff on my beefier desktop, so I forget to revert. And you presume a lot about me having any sort of proper gitconfig lemon_sweat

tawdry vapor
#

Well it's a legitimate concern if many contributors encounter issues with the line ending hook. It's not a particularly important hook, so if it comes down to it, we can get rid of it. Requiring the hook to be modified is far from ideal. However, I'm trying to see if there is a more reasonable solution like just editing the gitconfig

gritty wind
#

I mean I don't think removing it will help much in this instance

#

the worst thing it does is give a false sense of security

#

when it works it works, when it doesn't it just lints without the plugins

tawdry vapor
#

I mean removing just the line ending hook. Is there a bigger issue that I'm not understanding?

gritty wind
#

Ah, thought you were talking about flake8

tawdry vapor
#

A fix was pushed for flake8 a few months ago.

#

At least I thought it was. Maybe there's a different issue now.

thorny obsidian
#

Oh these are my notes from awhile ago. I think Numerlor confirmed that it was fixed so is less of an issue

gritty wind
#

I thought it was too

gritty wind
thorny obsidian
#

I don't think the line ending hook is that bad. Maybe it's worth having a "hey, if you're on windows let's fix your line-endings" thing in the contribution guide

tawdry vapor
#

Unfortunately git doesn't have provisions for letting us check in local configs

#

Despite having a repository-local config feature

#

We could have a pipenv script to set the right settings.

gritty wind
#

Hmm

#

Isn't there an option for that hook to have it match the pre-existing line endings?

#

By default on windows, it'll clone in CRLF but push in LF

#

So whatever the hook does on windows doesn't really matter