-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dd/359/do_with_docker_v5 #5
base: master
Are you sure you want to change the base?
dd/359/do_with_docker_v5 #5
Conversation
NB: лучше ссылаться на PR вот так: #4 |
Вынеси, пожалуйста, добавление необходимых докеры файлов в отдельный коммит. |
aef47f8
to
b49f3c2
Compare
готово |
|
||
require 'lua-nucleo' -- for import() | ||
|
||
-- for lfs.chdir(), lfs.currentdir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очень странные манипуляции. Объясни, что тут происходит, пожалуйста.
Откуда берется первый lfs? Почему не использовать конструкцию вида new_lfw = require 'lfs'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проблема: когда импортится lfs, он без-условно пишет свою таблицу в глобальную переменную
решение: 1)в переменную orig_lfs сохраняется предыдущее значение lfs (скорее всего, null)
2)require-им lfs
3)в new_lfs пишем то, что установил модуль при загрузке
4)восстанавливаем глобальную lfs её оригинальным, старым значением
создаем для удобства локальную (внутри модуля) lfs, которая выглядит привычно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Во-первых, в Lua нет null'а, есть nil.
Во-вторых, я не понимаю, почему нельзя просто сделать local lfs = require 'lfs'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть (оставить пока как есть)
Дополнительно: мне не нравится, что обертки над LFS находятся в одном файле с кодом docker'а. Конструктивных предложений нет, но читать тяжело. |
b49f3c2
to
6f454b4
Compare
готово. перезапушено (форспуш) |
sock:close() | ||
break | ||
end | ||
sock:send(line.."\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Потерял пробелы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть
test/cases/0030-docker.lua
Outdated
-------------------------------------------------------------------------------- | ||
|
||
local log, dbg, spam, log_error | ||
= import 'lua-aplicado/log.lua' { 'make_loggers' } ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отступ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"=" должно быть точно под "l" из "log" (подвинуть на 1 вперед), или "=" должно быть на 2 пробела от начала?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Под log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть
----------------------------------------------------------------------- | ||
|
||
local log, dbg, spam, log_error | ||
= import 'lua-aplicado/log.lua' { 'make_loggers' } ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, по историческим причинам гайдлайны не разрешают писать так импорт в одну строку.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очень странно. Попроси AG прокомментировать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
гайдлайны это разрешают (по крайней мере для логгеров), вот там даже цитата есть
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть (оставлено в одну строку)
pk-test/docker.lua
Outdated
'do_with_docker() is called with arguments: dir =', | ||
cfg_dir, | ||
'handler =', | ||
handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем так много строк?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в одну строку они не поместятся в 80 символов
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А в две? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
есть (сделано в две)
6f454b4
to
307f0d3
Compare
готово. перезапушено (форспуш) 2 |
same as PR #4 (do_with_docker() feature and it's tests, reformatted according Lua-coding-guidelines) but without devel history
upd:
= no changes in code
= test passes successfully
* 2 commits -> 3 commits