@@ -31,7 +31,7 @@ func Test_Ruff(t *testing.T) {
3131
3232 t .Run ("Test_ruff_with_config" , func (t * testing.T ) {
3333 t .Parallel ()
34- container := base ()
34+ container := base ("" )
3535 require .NotNil (t , container )
3636
3737 _ , err := container .
@@ -48,7 +48,7 @@ func Test_Ruff(t *testing.T) {
4848 })
4949 t .Run ("Test_ruff_host_directory_check_file_error" , func (t * testing.T ) {
5050 t .Parallel ()
51- container := base ()
51+ container := base ("" )
5252 require .NotNil (t , container )
5353
5454 _ , err := container .
@@ -61,7 +61,7 @@ func Test_Ruff(t *testing.T) {
6161 })
6262 t .Run ("Test_ruff_error" , func (t * testing.T ) {
6363 t .Parallel ()
64- container := base ()
64+ container := base ("" )
6565 require .NotNil (t , container )
6666
6767 _ , err := container .
@@ -76,7 +76,7 @@ func Test_Ruff(t *testing.T) {
7676 })
7777 t .Run ("Test_ruff_version" , func (t * testing.T ) {
7878 t .Parallel ()
79- container := base ()
79+ container := base ("" )
8080 require .NotNil (t , container )
8181
8282 out , err := container .
@@ -87,7 +87,23 @@ func Test_Ruff(t *testing.T) {
8787 })
8888}
8989
90- func base () * dagger.Container {
91- return c .Container ().
92- From ("ghcr.io/astral-sh/ruff:latest" )
90+ // func base() *dagger.Container {
91+ // return c.Container().
92+ // From("ghcr.io/astral-sh/ruff:latest")
93+ // }
94+
95+ func base (
96+ image string ,
97+ ) * dagger.Container {
98+
99+ defaultImageRepository := "ghcr.io/astral-sh/ruff"
100+ var ctr * dagger.Container
101+
102+ if image != "" {
103+ ctr = c .Container ().From (image )
104+ } else {
105+ ctr = c .Container ().From (defaultImageRepository )
106+ }
107+
108+ return ctr
93109}
0 commit comments