Run commands after another
Ex.
mkdir temp & cd temp & ls
Run commands after another if the previous command SUCCEEDS
Ex.
mkdir temp && cd temp && ls
Run commands after another if the previous command FAILS
Ex.
mkdir temp || echo 'mkdir failed'
Run commands after another
Ex.
mkdir temp & cd temp & ls
Run commands after another if the previous command SUCCEEDS
Ex.
mkdir temp && cd temp && ls
Run commands after another if the previous command FAILS
Ex.
mkdir temp || echo 'mkdir failed'
This is an example of a Makefile the compiles all *.cpp files in the current folder and turns them all into individual executables
CC=g++ CFLAGS=-c -Wall SOURCES = $(wildcard *.cpp) EXECS = $(SOURCES:%.cpp=%) all: $(EXECS) clean: rm $(EXECS)
Tested on OSX 10.14 and GNU Make 3.81
This is a nice tool to get a unified look for all the imports of a codebase. A custom import order rule is set in the TreeWalker module (Checker->TreeWalker). Eg.
<module name="Checker"> <property name="severity" value="warning"> <module name="TreeWalker"> <module name="CustomImportOrder"> <property name="customImportOrderRules" value=" STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SPECIAL_IMPORT ###SAME_PACKAGE(3)###STATIC"> <property name="standardPackageRegExp" value="java\.|javax\."/> <property name="thirdPartyPackageRegExp" value="org\.|com\."/> <property name="specialImportsRegExp" value="se.my.packages*"/> ...
In the example above then following rules apply:
customImportOrderRules – this sets the order of the imports. Here the order is set as:
standardPackageRegExp – this defines what is to be considered a “standard package” in the project. Use regular expression to match import strings that should be included. Correlates with STANDARD_JAVA_PACKAGE in “customImportOrderRules” property
thirdPartyPackageRegExp – defines the third party packages in the project. Use regular expression to match import strings that should be included. Correlates with THIRD_PARTY_PACKAGE in “customImportOrderRules” property
specialImportsRegExp – defines the special packages. Use regular expression to match import strings that should be included. Correlates with SPECIAL_IMPORTS in “customImportOrderRules” property
Rules are evaluated in priority order, so an import can only match one rule:
Custom import order can help to unify your code but it is quite a handfull to configure. This will hopefully help you configure yours
Tested with Checkstyle v8.14