Giter Site home page Giter Site logo

basicautoloads.jl's Introduction

BasicAutoloads

Build Status Coverage PkgEval Aqua

BasicAutoloads lets you say "whenever I type this in the REPL, run that for me". It's great for automatically loading interactive tools.

For example, put this in your startup.jl

if isinteractive()
    import BasicAutoloads
    BasicAutoloads.register_autoloads([
        ["@b", "@be"]            => :(using Chairmarks),
        ["@benchmark"]           => :(using BenchmarkTools),
        ["@test", "@testset", "@test_broken", "@test_deprecated", "@test_logs",
        "@test_nowarn", "@test_skip", "@test_throws", "@test_warn", "@inferred"] =>
                                    :(using Test),
        ["@about"]               => :(using About; macro about(x) Expr(:call, About.about, x) end),
    ])
end

Add BasicAutoloads and any packages you want to automatically load to your default environment, and then enjoy the benefits at the REPL:

julia> Test
ERROR: UndefVarError: `Test` not defined in `Main`
Suggestion: check for spelling errors or missing imports.

julia> @test 1+1 == 2 # Test is automatically loaded here
Test Passed

julia> Test
Test

Scripts and such will still need to explicitly load their deps.

For more details, see the docstring of register_autoloads

basicautoloads.jl's People

Contributors

dependabot[bot] avatar lilithhafner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

basicautoloads.jl's Issues

Autoinstall?

I wonder if using SomePackage executed by BasicAutoloads triggers the base Julia autoinstall prompt?
Like

julia> using StatsBase
 │ Package StatsBase not found, but a package named StatsBase is available from
 │ a registry. 
 │ Install package?
 │   (@v1.10) pkg> add StatsBase 
 └ (y/n/o) [y]: 

Doesn't seem so on the first glance...

This is a very convenient feature to have! See https://gist.github.com/aplavin/cb39121225954e37b6fe8efeebfb6404 for an example & autoload implementation that triggers this prompt.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.