#awesome-ci Docker images
Allansible •ansible-lint •awesome-ci •black •checkmake •eslint •file-lint •gofmt •golint •jsonlint •phpcs •pycodestyle •pylint •terraform-docs •terragrunt •yamllint
#awesome-ci Makefiles
AllVisit cytopia/makefiles for seamless project integration, minimum required best-practice code linting and CI.
Runs on
Continuous Integration command line tools for git repositories, file characteristics, syntax errorsand static source code analysis.
Awesome-CI is capable of finding various problems in your code repository as well as fixing themautomatically.
Table of Contents
All checks have the option to only check by one or more file extensions, by shebang as well as to exclude one or more folders from the whole search.
Note: Fixable options are currently in testing phase. Please report any bugs.
Type | Tool | Fixable | Description |
---|---|---|---|
Git | git-conflicts | Scan files and check if they contain git conflicts. | |
Git | git-ignored | Scan git directory and see if ignored files are still in git cache. | |
File | file-cr | ✓ | Scan files and check if they contain CR (Carriage Return only). |
File | file-crlf | ✓ | Scan files and check if they contain CRLF (Windows Line Feeds). |
File | file-empty | Scan files and check if they are empty (0 bytes). | |
File | file-nullbyte-char | ✓ | Scan files and check if they contain a null-byte character (\x00). |
File | file-trailing-newline | ✓ | Scan files and check if they contain a trailing newline. |
File | file-trailing-single-newline | ✓ | Scan files and check if they contain exactly one trailing newline. |
File | file-trailing-space | ✓ | Scan files and check if they contain trailing whitespaces. |
File | file-utf8 | ✓ | Scan files and check if they have a non UTF-8 encoding. |
File | file-utf8-bom | ✓ | Scan files and check if they contain BOM (Byte Order Mark): <U+FEFF> . |
Syntax | syntax-bash | Scan shell files for bash syntax errors. | |
Syntax | syntax-css | Scan CSS files for CSS syntax errors. | |
Syntax | syntax-js | Scan JS files for JS syntax errors. | |
Syntax | syntax-json | Scan files for JSON syntax errors. | |
Syntax | syntax-markdown | Scan files for Markdown syntax errors. | |
Syntax | syntax-perl | Scan Perl files for Perl syntax errors. | |
Syntax | syntax-php | Scan files for PHP syntax errors. | |
Syntax | syntax-python | Scan Python files for Python syntax errors. | |
Syntax | syntax-ruby | Scan Ruby files for Ruby syntax errors. | |
Syntax | syntax-scss | Scan SCSS files for SCSS syntax errors. | |
Syntax | syntax-sh | Scan shell files for /bin/sh syntax errors. | |
Code Conventions | inline-css | Scan files and check if they contain inline css code. | |
Code Conventions | inline-js | Scan files and check if they contain inline javascript code. | |
Regex | regex-grep | egrep (grep -E ) regex version to scan files for an occurance. |
|
Regex | regex-perl | perl regex version to scan files for an occurance. |
All of the above scripts offer the --dry
option which will only show you the built command without actually executing it:
$ regex-grep --path=. --ignore=".git,.svn" --shebang=sh --size --text \
--custom="if[[:space:]]*\[\[" --dry
find . -type f -not \( -path "./.git*" -o -path "./.svn*" \) ! -size 0 -print0 | \
xargs -0 -P 8 -n1 grep -Il '' | \
tr '\n' '\0' | \
xargs -0 -P 8 -n1 awk '/^#!.*(\/sh|[[:space:]]+sh)/{print FILENAME}' | \
tr '\n' '\0' | \
xargs -0 -P 8 -n1 sh -c 'if [ -f "${1}" ]; then grep --color=always -inHE "if[[:space:]]*\[\[" "$1" || true; fi' --
Some of the above scripts offer the --fix
option (see table above), with which you are actually able to fix the problem.You can also combine it with --dry
to see how the actual fix command looks like:
$ file-utf8 --path=dump.sql --fix --dry
find dump.sql -type f -print0 | \
xargs -0 -P 8 -n1 sh -c 'if [ -f "${1}" ]; then isutf8 "$1" >/dev/null || (TERM=vt100 vi -u NONE -n -es -c "set fileencoding=utf8" -c "wq" "$1" > /dev/tty && echo "Fixing: $1" || echo "FAILED: $1"); fi' --
regex-grep
and regex-perl
have a lot of potential for doing custom project validation.
In order to give you an idea, have a look at the compiled Regex Contributions.
Please use pull requests to add useful checks.
git-ignored
) and can be used with the same command line arguments.--custom=""
to overwrite the command itself (this is explained and shown in detail in each command's --help
option).Options:
# Required:
--path # Specify the path where to scan
# Optional pattern (each option is logically and-ed):
--fix # Fix the problems for the specified files (not every check)
--text # Only scan non-binary files
--size # Only scan non-empty files (greater 0 bytes)
--shebang # Only scan files (shell scripts) that match a certain shebang
--extension # Only scan files with these file extensions
--ignore # Ignore files/folders
# Optional misc:
--config # Specify configuration file
--confpre # Alter configuration directive prefix for this check
--verbose # Show files and commands as being processed
--debug # Show additional debug messages
--list # Only show files that would be processed (no processing)
--dry # Show command that would be executed (no processing)
# System
--help # Show help
--info # Show version of required binaries
--version # Show tool version
Awesome-ci requires the following tools to be installed:
dos2unix
eslint
file
git
jsonlint
mdl
perl
php
python
ruby
scss_lint
shellcheck
brew tap cytopia/tap
brew install awesome-ci
# Install to /usr/bin
./configure
make install
# Instal to /usr/local/bin
./configure --prefix=/usr/local
make install
# Install to /opt/bin
./configure --prefix=/opt
make install
Instead of installing awesome-ci and all its required dependencies locally on your computer,you can also use the bundled Docker imagecytopia/awesome-ci which has everythingpre-installed and is built nightly by travis-ci.
docker run -v ${PWD}:/ac cytopia/awesome-ci file-crlf --path=/ac
The above example is using file-crlf
to scan the current directory for files containingWindows newlines:
${PWD}
(the current host directory) is mounted into the container's /ac
directoyfile-crlf
path then points (inside the container) to /ac
(which is the current host directory)/ac
can actually be named by whatever name you wantIf you use an awesome-ci configuration which is not inside the directory you want to check, youwill also have to mount that into the container:
docker run \
-v /host/path/to/awesome-ci.conf:/etc/awesome-ci.conf \
-v ${PWD}:/ac cytopia/awesome-ci file-crlf --path=/ac --config=/etc/awesome-ci.conf
To find out more about awesome-ci, have a look at the following links.
Copyright (c) 2018 cytopia
文章有更新, 更加详细和更常用的预设变量可以参考以下两篇新的文章 GitLab CI/CD关键词(五):变量 variables GitLab CI/CD中的常用预设变量 GitLab CI / CD具有一组默认的预定义变量 ,您可以使用它们而无需任何其他说明。您可以呼叫问题编号,用户名,分支名称,管道和提交ID等。 GitLab为Runner的本地环境提供了预定义的环境变量。 GitLab读取.
安装 npm install vue-awesome-swiper --save 全局引入 import Vue from 'vue' import VueAwesomeSwiper from 'vue-awesome-swiper' // require styles import 'swiper/dist/css/swiper.css' Vue.use(VueAwesomeSwipe
当 swiper 开启 loop 属性实现循环轮播,同时用 vue 的事件绑定语法为每个轮播页绑定事件,当轮播到特定的页面时绑定的事件无法被正常监听。 原因:Swiper 是通过在实际轮播页前后复制若干个页面来实现 loop(首尾相连循环滚动)效果的,因为虽然复制了轮播页元素但 vue 所绑定的事件处理器却没有被复制。 解决方案:Swiper.js 本身提供了一套事件绑定机制,只需要把原代码里 v
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <META http-equiv=Content-Ty
参考资料:LAMP兄弟连CI视频教程 8、数据库操作,query方式(一般情况下CI的AR模型可以搞定,复杂情况用这种方式): //修改配置文件 \application\config\database.php //装载数据库操作类: $this->load->database(); //装载成功后中,会放入超级对象的属性中,默认属性名是db //var_dump($this->db); $sql
Awesome Awesome Node.js A curated list of awesome lists that are about or related to Node.js. Inspired by the awesome list thing, going deeper down the rabbit hole. �� Meta stuff about this awesome li
A curated list of awesome things related to Vite.js This awesome list is for Vite 2.x and onward. Vite 1.x's list is archived. Resources Official Resources 文档 GitHub Repo Release Notes Vue 3 Docs Awes
Awesome Python 是一个资源整理集合,由 vinta 发起和维护。内容包括:Web框架、网络爬虫、网络内容提取、模板引擎、数据库、数据可视化、图片处理、文本处理、自然语言处理、机器学习、日志、代码分析等。 这个系列没有推荐 Python 书籍、经典博文、交互教程,所以另外推荐:《25本免费的Python电子书》、《学习Python编程的11个(教程)资源》、《PythonMonk:Py
Font Awesome 是一个图标工具包。其已经被重新设计并从头构建。除此之外,还增加了一些功能,比如 icon font ligature、SVG 框架、流行的前端库(如 React)的官方 NPM 包,以及对新 CDN 的访问。Font Awesome 已扩展至 7,865 个图标。
awesome-android 收录了来自 github 或其他网站的关于 Android 的大部分库。
The Lithe Project Development Team Awesome CryptoNote A curated list of awesome CryptoNote open-source blockchains, resources, projects, and shiny other things related.Many projects are derived from f