databricks-cli/project
Pieter Noordhuis a7bf7ba6c5
Reload .gitignore files if they have changed (#190)
This commit changes the code in repository.go to lazily load gitignore
files as opposed to the previous eager approach. This means that the
signature of the `Ignore` function family has changed to return `(bool,
error)`.

This lazy approach fits better when other code is responsible for
recursively walking the file tree, because we never know up front which
gitignore files need to be loaded to compute the ignores. It also means
we no longer have to "prime" the `Repository` instance with a particular
directory we're interested in and rather let calls to `Ignore` load
whatever is needed.

The fileset wrapper under `git/` internally taints all gitignore objects
to force a call to [os.Stat] followed by a reload if they have changed,
before calling into the [fileset.FileSet] functions for recursively
listing files.
2023-01-31 18:34:36 +01:00
..
testdata Added creation of .gitignore for bricks project with cache dir path (#88) 2022-11-08 13:51:08 +01:00
README.md Added basic project configuration 2022-05-14 19:55:00 +02:00
config.go Run unit tests on windows and macos (#103) 2022-11-28 11:34:25 +01:00
config_test.go Store project object in context.Context instead of global (#61) 2022-09-16 11:06:58 +02:00
environment.go Add environments to project configuration (#68) 2022-09-22 13:40:11 +02:00
environment_test.go Add environments to project configuration (#68) 2022-09-22 13:40:11 +02:00
flavor.go Comment out flavor.go (#60) 2022-09-15 09:46:11 +02:00
project.go Reload .gitignore files if they have changed (#190) 2023-01-31 18:34:36 +01:00
project_test.go Reload .gitignore files if they have changed (#190) 2023-01-31 18:34:36 +01:00
root.go Reduce nesting (#72) 2022-09-22 15:03:30 +02:00
root_test.go Store project object in context.Context instead of global (#61) 2022-09-16 11:06:58 +02:00

README.md

Project Configuration

Good implicit defaults is better than explicit complex configuration.

Regardless of current working directory, bricks finds project root with databricks.yml file up the directory tree. Technically, there might be couple of different Databricks Projects in the same Git repository, but the recommended scenario is to have just one databricks.yml in the root of Git repo.