Giter VIP home page Giter VIP logo

Comments (4)

kantord avatar kantord commented on August 28, 2024

I would definitely want to add this feature. Actually if you need it urgently, or you would like to contribute you, feel free to create a pull request. I can help you get it merged asap.

It's not so complicated to do this as this only affects the CLI.

I am explaining here how to implement it to make it easy for you. As a first step you can add a new flag/option to supply the remote server URL:

SeaGOAT/seagoat/cli.py

Lines 68 to 107 in 4b6e74a

@click.command()
@click.argument("query")
@click.argument("repo_path", required=False, default=os.getcwd())
@click.option(
"--no-color",
is_flag=True,
help="Disable formatting. Automatically enabled when part of a bash pipeline.",
)
@click.option(
"-l",
"--max-results",
type=int,
default=None,
help="Limit the number of result lines",
)
@click.option(
"-B",
"--context-above",
type=int,
default=None,
help="Include this many lines of context before each result",
)
@click.option(
"-A",
"--context-below",
type=int,
default=None,
help="Include this many lines of context after each result",
)
@click.option(
"-C",
"--context",
type=int,
default=None,
help="Include this many lines of context after and before each result",
)
@click.version_option(version=__version__, prog_name="seagoat")
def seagoat(
query, repo_path, no_color, max_results, context_above, context_below, context
):

then, you just need to make sure that that argument is used instead of getting the server info here:

SeaGOAT/seagoat/cli.py

Lines 120 to 121 in 4b6e74a

server_info = get_server_info(repo_path)
server_address = server_info["address"]

A further improvement could be to create support for config files, and then in those config files there could be a configuration option to match a local folder with a remote server URL so that it always uses the remote server by default.

from seagoat.

kantord avatar kantord commented on August 28, 2024

I am adding good first issue on this one as well, as a releasable implementation can be created without knowledge of the project structure using the information I shared above. Also testing should be easy, you can take inspiration in test_cli.py.

from seagoat.

kantord avatar kantord commented on August 28, 2024

I would also like to note that it should be possible to create a feature that allows local users to import data from a remote server to avoid having to analyze the entire repository locally. Actually you should already be able to do this manually by simply copying the cache folder from the server to the local machine. This would have the added benefit that the users are still able to search their local changes, and even when they are not connected to the internet. And it should also be faster by saving the network overhead

Also I am working on creating a web-based GUI as well, using that your users will be able to search your repositories using SeaGOAT without installing anything on their computer: https://github.com/kantord/SeaGOAT-web

from seagoat.

kantord avatar kantord commented on August 28, 2024

Now that configuration files are supported, this should be even more trivial to implement!

from seagoat.

Related Issues (20)

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.