This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn { | |
buzzfizz | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async function (config) { | |
try { | |
// Negative Lookahead on comments line | |
const key = `^(?!#)${config.param}`; | |
// Get Base image from Dockerfile.CI | |
const dockerfileCIResults = await findStringByKey(config, key); | |
const dockerFileConfig = { path: 'Dockerfile', param: config.param }; | |
const dockerfileResults = await findStringByKey(dockerFileConfig, key); | |
if (dockerfileCIResults.length > 0) { | |
// Compare the last FROM ocurrency for both files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageDefinition[result] { | |
data.neodora.files["go.mod"] == null | |
ciImage := last_image_from_file(input) | |
normalImage := trim_suffix(last_image_from_file(data.neodora.files.Dockerfile), "-dev") | |
ciImage != normalImage | |
result = { | |
"ciImage": ciImage, | |
"normalImage": normalImage, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_deny_different_images { | |
imageDefinition[{ | |
"ciImage": "node:14-alpine", | |
"normalImage": "php:16-alpine", | |
}] with input as [[{ | |
"Cmd": "from", | |
"Flags": [], | |
"JSON": false, | |
"Stage": 0, | |
"SubCmd": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Obj struct { | |
foo int | |
bar string | |
} | |
func (o *Obj) ToString() string { | |
return fmt.Sprintf(“obj: %d %s”, o.foo, o.bar) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Option func(*Obj) | |
func Foo(foo int) Option { | |
return func(obj *Obj) { | |
obj.foo = foo | |
} | |
} | |
func Bar(bar string) Option { | |
return func(obj *Obj) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func New(opts …Option) *Obj { | |
obj := new(Obj) | |
for _, opt := range opts { | |
opt(obj) | |
} | |
return obj | |
} |
OlderNewer