gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
369 stars 9 forks source link

Fix wrong name in subrepl issue #202

Closed gilch closed 1 year ago

gilch commented 1 year ago

Template quotes need a name defined in the reader to work. The LisspREPL always assumed '__main__', but could have been embedded in some other module, so this assumption was wrong. Now assumes __name__ (all modules have this, or they're broken), and falls back to '__main__' in case it was started with an empty namespace.

codecov[bot] commented 1 year ago

Codecov Report

Merging #202 (f98ab48) into master (711fa79) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #202   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          700       700           
  Branches       111       111           
=========================================
  Hits           700       700           
Impacted Files Coverage Δ
src/hissp/reader.py 100.00% <ø> (ø)
src/hissp/repl.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

gilch commented 1 year ago

Looked through the flake8 output this time. Some of the flake8 warnings are just conflicts with black. It's also not respecting the fmt comments. It's also complaining about some import statements that are not at the top, but those need to be where they are. I've apparently been ignoring these for a while because what's left is useless, but that did allow one real issue to sneak through, which I just fixed. I should look into configuring this better.