forked from phoedos/pmd
Merge branch 'pmd/7.0.x' into kotlin-poc
This commit is contained in:
commit
aa4a8906ce
@ -3384,7 +3384,8 @@
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/242337?v=4",
|
||||
"profile": "https://github.com/jjlharrison",
|
||||
"contributions": [
|
||||
"bug"
|
||||
"bug",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -6566,6 +6567,169 @@
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "MetaBF",
|
||||
"name": "MetaBF",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/101029254?v=4",
|
||||
"profile": "https://github.com/MetaBF",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "btjiong",
|
||||
"name": "Bailey Tjiong",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/15816011?v=4",
|
||||
"profile": "https://github.com/btjiong",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jasonqiu98",
|
||||
"name": "Jason Qiu",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/26801257?v=4",
|
||||
"profile": "https://github.com/jasonqiu98",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "laoseth",
|
||||
"name": "Seth Wilcox",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/16923065?v=4",
|
||||
"profile": "https://github.com/laoseth",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "LiGaOg",
|
||||
"name": "LiGaOg",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/72175888?v=4",
|
||||
"profile": "https://github.com/LiGaOg",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Scrsloota",
|
||||
"name": "Scrsloota",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/91131546?v=4",
|
||||
"profile": "https://github.com/Scrsloota",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "VoidxHoshi",
|
||||
"name": "LaLucid",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/55886143?v=4",
|
||||
"profile": "https://github.com/VoidxHoshi",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "naveensrinivasan",
|
||||
"name": "Naveen",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/172697?v=4",
|
||||
"profile": "https://naveensrinivasan.dev/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lukelukes",
|
||||
"name": "lukelukes",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/45536418?v=4",
|
||||
"profile": "https://github.com/lukelukes",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "vibhory2j",
|
||||
"name": "Vibhor Goyal",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/15845016?v=4",
|
||||
"profile": "https://github.com/vibhory2j",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Ramel0921",
|
||||
"name": "Ramel0921",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/104978096?v=4",
|
||||
"profile": "https://github.com/Ramel0921",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "flyhard",
|
||||
"name": "Per Abich",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/409466?v=4",
|
||||
"profile": "https://github.com/flyhard",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "filipponova",
|
||||
"name": "Filippo Nova",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/12506636?v=4",
|
||||
"profile": "https://github.com/filipponova",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "dalizi007",
|
||||
"name": "dalizi007",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/90743616?v=4",
|
||||
"profile": "https://github.com/dalizi007",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "shiomiyan",
|
||||
"name": "shiomiyan",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/35842766?v=4",
|
||||
"profile": "https://github.com/shiomiyan",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lgemeinhardt",
|
||||
"name": "lgemeinhardt",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1395165?v=4",
|
||||
"profile": "https://github.com/lgemeinhardt",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "HaelC",
|
||||
"name": "Haoliang Chen",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/16898273?v=4",
|
||||
"profile": "https://haelchan.me/",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "FSchliephacke",
|
||||
"name": "FSchliephacke",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10260493?v=4",
|
||||
"profile": "https://github.com/FSchliephacke",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
@ -245,12 +245,15 @@ ${rendered_release_notes}"
|
||||
# Runs the dogfood ruleset with the currently built pmd against itself
|
||||
#
|
||||
function pmd_ci_dogfood() {
|
||||
local mpmdVersion=()
|
||||
./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false
|
||||
sed -i 's/<version>[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *<!-- pmd.dogfood.version -->\)/<version>'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml
|
||||
if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then
|
||||
sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml
|
||||
mpmdVersion=(-Denforcer.skip=true -Dpmd.plugin.version=3.18.0-pmd7-SNAPSHOT)
|
||||
fi
|
||||
./mvnw verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" \
|
||||
"${mpmdVersion[@]}" \
|
||||
-DskipTests \
|
||||
-Dmaven.javadoc.skip=true \
|
||||
-Dmaven.source.skip=true \
|
||||
|
@ -1,10 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<ruleset name="All Java Rules"
|
||||
<ruleset name="All Regression Rules"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>Every java rule in PMD which is used for the regression tests with pmdtester</description>
|
||||
<description>Every apex and java rule in PMD which is used for the regression tests with pmdtester</description>
|
||||
|
||||
<rule ref="category/apex/bestpractices.xml" />
|
||||
<rule ref="category/apex/codestyle.xml" />
|
||||
<rule ref="category/apex/design.xml" />
|
||||
<rule ref="category/apex/documentation.xml" />
|
||||
<rule ref="category/apex/errorprone.xml" />
|
||||
<rule ref="category/apex/multithreading.xml" />
|
||||
<rule ref="category/apex/performance.xml" />
|
||||
<rule ref="category/apex/security.xml" />
|
||||
|
||||
<rule ref="category/java/bestpractices.xml" />
|
||||
<rule ref="category/java/codestyle.xml" />
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd">
|
||||
xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd">
|
||||
<description>Standard Projects</description>
|
||||
|
||||
<project>
|
||||
@ -40,6 +40,7 @@ mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.t
|
||||
<exclude-pattern>.*/build/generated-sources/.*</exclude-pattern>
|
||||
|
||||
<build-command><![CDATA[#!/usr/bin/env bash
|
||||
## Skip gradle execution
|
||||
if test -e classpath.txt; then
|
||||
exit
|
||||
fi
|
||||
@ -146,4 +147,26 @@ EOF
|
||||
<tag>jdk-11+28</tag>
|
||||
<src-subpath>src/java.base</src-subpath>
|
||||
</project>
|
||||
|
||||
<project>
|
||||
<name>Schedul-o-matic-9000</name>
|
||||
<type>git</type>
|
||||
<connection>https://github.com/SalesforceLabs/Schedul-o-matic-9000</connection>
|
||||
<tag>6b1229ba43b38931fbbab5924bc9b9611d19a786</tag>
|
||||
</project>
|
||||
|
||||
<project>
|
||||
<name>fflib-apex-common</name>
|
||||
<type>git</type>
|
||||
<connection>https://github.com/apex-enterprise-patterns/fflib-apex-common</connection>
|
||||
<tag>7e0891efb86d23de62811af56d87d0959082a322</tag>
|
||||
</project>
|
||||
|
||||
<project>
|
||||
<name>apex-link</name>
|
||||
<type>git</type>
|
||||
<connection>https://github.com/nawforce/apex-link</connection>
|
||||
<tag>v2.3.0</tag>
|
||||
<src-subpath>samples</src-subpath>
|
||||
</project>
|
||||
</projectlist>
|
||||
|
@ -27,7 +27,7 @@ function git_repo_sync() {
|
||||
pmd_ci_log_group_start "Git Sync"
|
||||
git remote add pmd-sf "${PMD_SF_USER}@git.code.sf.net:/p/pmd/code"
|
||||
if [ -n "${PMD_CI_BRANCH}" ]; then
|
||||
git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}"
|
||||
retry 5 git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}"
|
||||
pmd_ci_log_success "Successfully pushed ${PMD_CI_BRANCH} to sourceforge"
|
||||
elif [ -n "${PMD_CI_TAG}" ]; then
|
||||
git push pmd-sf tag "${PMD_CI_TAG}"
|
||||
@ -39,6 +39,43 @@ function git_repo_sync() {
|
||||
pmd_ci_log_group_end
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# From: https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746
|
||||
#
|
||||
# Retry a command up to a specific number of times until it exits successfully,
|
||||
# with exponential back off.
|
||||
#
|
||||
# $ retry 5 echo Hello
|
||||
# Hello
|
||||
#
|
||||
# $ retry 5 false
|
||||
# Retry 1/5 exited 1, retrying in 1 seconds...
|
||||
# Retry 2/5 exited 1, retrying in 2 seconds...
|
||||
# Retry 3/5 exited 1, retrying in 4 seconds...
|
||||
# Retry 4/5 exited 1, retrying in 8 seconds...
|
||||
# Retry 5/5 exited 1, no more retries left.
|
||||
#
|
||||
function retry {
|
||||
local retries=$1
|
||||
shift
|
||||
|
||||
local count=0
|
||||
until "$@"; do
|
||||
exit=$?
|
||||
wait=$((2 ** $count))
|
||||
count=$(($count + 1))
|
||||
if [ $count -lt $retries ]; then
|
||||
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
|
||||
sleep $wait
|
||||
else
|
||||
echo "Retry $count/$retries exited $exit, no more retries left."
|
||||
return $exit
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
git_repo_sync
|
||||
|
||||
exit 0
|
||||
|
@ -48,7 +48,7 @@ function regression_tester_uploadBaseline() {
|
||||
--mode single \
|
||||
--local-git-repo ./pmd \
|
||||
--patch-branch "${baseline_branch}" \
|
||||
--patch-config ./pmd/.ci/files/all-java.xml \
|
||||
--patch-config ./pmd/.ci/files/all-regression-rules.xml \
|
||||
--list-of-project ./pmd/.ci/files/project-list.xml --html-flag \
|
||||
--error-recovery
|
||||
pushd target/reports || { echo "Directory 'target/reports' doesn't exist"; exit 1; }
|
||||
|
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.m2/repository
|
||||
@ -34,9 +34,9 @@ jobs:
|
||||
~/.cache
|
||||
~/work/pmd/target/repositories
|
||||
vendor/bundle
|
||||
key: v2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
v2-${{ runner.os }}-
|
||||
v3-${{ runner.os }}-
|
||||
- name: Set up Ruby 2.7
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
2
.github/workflows/git-repo-sync.yml
vendored
2
.github/workflows/git-repo-sync.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV
|
||||
- name: Sync
|
||||
run: .ci/git-repo-sync.sh
|
||||
shell: bash
|
||||
|
11
.github/workflows/troubleshooting.yml
vendored
11
.github/workflows/troubleshooting.yml
vendored
@ -2,6 +2,9 @@ name: troubleshooting
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -13,7 +16,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.m2/repository
|
||||
@ -21,9 +24,9 @@ jobs:
|
||||
~/.cache
|
||||
~/work/pmd/target/repositories
|
||||
vendor/bundle
|
||||
key: v2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
v2-${{ runner.os }}-
|
||||
v3-${{ runner.os }}-
|
||||
- name: Set up Ruby 2.7
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
@ -33,7 +36,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
4
.mvn/wrapper/maven-wrapper.properties
vendored
4
.mvn/wrapper/maven-wrapper.properties
vendored
@ -14,5 +14,5 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
|
||||
|
@ -5,14 +5,14 @@ require 'fileutils'
|
||||
|
||||
@logger = Logger.new(STDOUT)
|
||||
|
||||
def get_args(base_branch, autogen = TRUE, patch_config = './pmd/.ci/files/all-java.xml')
|
||||
def get_args(base_branch, autogen = TRUE, patch_config = './pmd/.ci/files/all-regression-rules.xml')
|
||||
['--local-git-repo', './pmd',
|
||||
'--list-of-project', './pmd/.ci/files/project-list.xml',
|
||||
'--base-branch', base_branch,
|
||||
'--patch-branch', 'HEAD',
|
||||
'--patch-config', patch_config,
|
||||
'--mode', 'online',
|
||||
# autogen ? '--auto-gen-config' : '--filter-with-patch-config',
|
||||
autogen ? '--auto-gen-config' : '--filter-with-patch-config',
|
||||
'--keep-reports',
|
||||
'--error-recovery',
|
||||
'--baseline-download-url', 'https://pmd-code.org/pmd-regression-tester/',
|
||||
@ -29,7 +29,7 @@ def run_pmdtester
|
||||
@summary = PmdTester::Runner.new(get_args(@base_branch)).run
|
||||
|
||||
unless Dir.exist?('target/reports/diff')
|
||||
message("No java rules are changed!", sticky: true)
|
||||
message("No regression tested rules have been changed.", sticky: true)
|
||||
return
|
||||
end
|
||||
|
||||
|
6
Gemfile
6
Gemfile
@ -10,9 +10,9 @@ gem 'danger'
|
||||
# this happens during release (.ci/build.sh and do-release.sh)
|
||||
# but also during regular builds (.ci/build.sh)
|
||||
group :release_notes_preprocessing do
|
||||
gem 'liquid', '>=4.0.0'
|
||||
gem 'safe_yaml', '>=1.0'
|
||||
gem 'rouge', '>= 1.7', '< 4'
|
||||
gem 'liquid'
|
||||
gem 'safe_yaml'
|
||||
gem 'rouge'
|
||||
end
|
||||
|
||||
# vim: syntax=ruby
|
||||
|
36
Gemfile.lock
36
Gemfile.lock
@ -9,10 +9,10 @@ GEM
|
||||
nap
|
||||
open4 (~> 1.3)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
concurrent-ruby (1.1.10)
|
||||
cork (0.3.0)
|
||||
colored2 (~> 3.1)
|
||||
danger (8.4.3)
|
||||
danger (8.6.1)
|
||||
claide (~> 1.0)
|
||||
claide-plugins (>= 0.9.2)
|
||||
colored2 (~> 3.1)
|
||||
@ -26,7 +26,7 @@ GEM
|
||||
octokit (~> 4.7)
|
||||
terminal-table (>= 1, < 4)
|
||||
differ (0.1.2)
|
||||
et-orbi (1.2.6)
|
||||
et-orbi (1.2.7)
|
||||
tzinfo
|
||||
faraday (1.10.0)
|
||||
faraday-em_http (~> 1.0)
|
||||
@ -53,36 +53,36 @@ GEM
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday-retry (1.0.3)
|
||||
fugit (1.5.2)
|
||||
et-orbi (~> 1.1, >= 1.1.8)
|
||||
fugit (1.5.3)
|
||||
et-orbi (~> 1, >= 1.2.7)
|
||||
raabro (~> 1.4)
|
||||
git (1.10.2)
|
||||
git (1.11.0)
|
||||
rchardet (~> 1.8)
|
||||
kramdown (2.3.1)
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
liquid (5.1.0)
|
||||
liquid (5.3.0)
|
||||
logger-colors (1.0.0)
|
||||
mini_portile2 (2.8.0)
|
||||
multipart-post (2.1.1)
|
||||
nap (1.1.0)
|
||||
no_proxy_fix (0.1.2)
|
||||
nokogiri (1.13.3)
|
||||
nokogiri (1.13.6)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
octokit (4.22.0)
|
||||
faraday (>= 0.9)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
open4 (1.3.4)
|
||||
pmdtester (1.3.0)
|
||||
pmdtester (1.5.1)
|
||||
differ (~> 0.1)
|
||||
liquid (>= 4.0)
|
||||
liquid (~> 5.2)
|
||||
logger-colors (~> 1.0)
|
||||
nokogiri (>= 1.11.0.rc4)
|
||||
rufus-scheduler (~> 3.5)
|
||||
nokogiri (~> 1.13)
|
||||
rufus-scheduler (~> 3.8)
|
||||
slop (~> 4.6)
|
||||
public_suffix (4.0.6)
|
||||
public_suffix (4.0.7)
|
||||
raabro (1.4.0)
|
||||
racc (1.6.0)
|
||||
rchardet (1.8.0)
|
||||
@ -95,7 +95,7 @@ GEM
|
||||
sawyer (0.8.2)
|
||||
addressable (>= 2.3.5)
|
||||
faraday (> 0.8, < 2.0)
|
||||
slop (4.9.1)
|
||||
slop (4.9.2)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
tzinfo (2.0.4)
|
||||
@ -107,10 +107,10 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
danger
|
||||
liquid (>= 4.0.0)
|
||||
liquid
|
||||
pmdtester
|
||||
rouge (>= 1.7, < 4)
|
||||
safe_yaml (>= 1.0)
|
||||
rouge
|
||||
safe_yaml
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
|
@ -72,6 +72,14 @@ export RELEASE_VERSION
|
||||
export DEVELOPMENT_VERSION
|
||||
export CURRENT_BRANCH
|
||||
|
||||
# check for SNAPSHOT version of pmd.build-tools.version
|
||||
BUILD_TOOLS_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=pmd.build-tools.version -q -DforceStdout)
|
||||
BUILD_TOOLS_VERSION_RELEASE=${BUILD_TOOLS_VERSION%-SNAPSHOT}
|
||||
if [ "${BUILD_TOOLS_VERSION}" != "${BUILD_TOOLS_VERSION_RELEASE}" ]; then
|
||||
echo "Error: version pmd.build-tools.version is ${BUILD_TOOLS_VERSION} - snapshot is not allowed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RELEASE_RULESET="pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml"
|
||||
|
||||
echo "* Update date info in **docs/_config.yml**."
|
||||
|
@ -1,7 +1,7 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (6.0.4.6)
|
||||
activesupport (6.0.5)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
@ -14,9 +14,8 @@ GEM
|
||||
execjs
|
||||
coffee-script-source (1.11.1)
|
||||
colorator (1.1.0)
|
||||
commonmarker (0.17.13)
|
||||
ruby-enum (~> 0.5)
|
||||
concurrent-ruby (1.1.9)
|
||||
commonmarker (0.23.4)
|
||||
concurrent-ruby (1.1.10)
|
||||
dnsruby (1.61.9)
|
||||
simpleidn (~> 0.1)
|
||||
em-websocket (0.5.3)
|
||||
@ -52,12 +51,12 @@ GEM
|
||||
ffi (1.15.5)
|
||||
forwardable-extended (2.6.0)
|
||||
gemoji (3.0.1)
|
||||
github-pages (223)
|
||||
github-pages (226)
|
||||
github-pages-health-check (= 1.17.9)
|
||||
jekyll (= 3.9.0)
|
||||
jekyll (= 3.9.2)
|
||||
jekyll-avatar (= 0.7.0)
|
||||
jekyll-coffeescript (= 1.1.1)
|
||||
jekyll-commonmark-ghpages (= 0.1.6)
|
||||
jekyll-commonmark-ghpages (= 0.2.0)
|
||||
jekyll-default-layout (= 0.1.4)
|
||||
jekyll-feed (= 0.15.1)
|
||||
jekyll-gist (= 1.5.0)
|
||||
@ -71,7 +70,7 @@ GEM
|
||||
jekyll-relative-links (= 0.6.1)
|
||||
jekyll-remote-theme (= 0.4.3)
|
||||
jekyll-sass-converter (= 1.5.2)
|
||||
jekyll-seo-tag (= 2.7.1)
|
||||
jekyll-seo-tag (= 2.8.0)
|
||||
jekyll-sitemap (= 1.4.0)
|
||||
jekyll-swiss (= 1.0.0)
|
||||
jekyll-theme-architect (= 0.2.0)
|
||||
@ -89,12 +88,12 @@ GEM
|
||||
jekyll-theme-time-machine (= 0.2.0)
|
||||
jekyll-titles-from-headings (= 0.5.3)
|
||||
jemoji (= 0.12.0)
|
||||
kramdown (= 2.3.1)
|
||||
kramdown (= 2.3.2)
|
||||
kramdown-parser-gfm (= 1.1.0)
|
||||
liquid (= 4.0.3)
|
||||
mercenary (~> 0.3)
|
||||
minima (= 2.5.1)
|
||||
nokogiri (>= 1.12.5, < 2.0)
|
||||
nokogiri (>= 1.13.4, < 2.0)
|
||||
rouge (= 3.26.0)
|
||||
terminal-table (~> 1.4)
|
||||
github-pages-health-check (1.17.9)
|
||||
@ -103,13 +102,13 @@ GEM
|
||||
octokit (~> 4.0)
|
||||
public_suffix (>= 3.0, < 5.0)
|
||||
typhoeus (~> 1.3)
|
||||
html-pipeline (2.14.0)
|
||||
html-pipeline (2.14.1)
|
||||
activesupport (>= 2)
|
||||
nokogiri (>= 1.4)
|
||||
http_parser.rb (0.8.0)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (3.9.0)
|
||||
jekyll (3.9.2)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
@ -127,12 +126,12 @@ GEM
|
||||
jekyll-coffeescript (1.1.1)
|
||||
coffee-script (~> 2.2)
|
||||
coffee-script-source (~> 1.11.1)
|
||||
jekyll-commonmark (1.3.1)
|
||||
commonmarker (~> 0.14)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-commonmark-ghpages (0.1.6)
|
||||
commonmarker (~> 0.17.6)
|
||||
jekyll-commonmark (~> 1.2)
|
||||
jekyll-commonmark (1.4.0)
|
||||
commonmarker (~> 0.22)
|
||||
jekyll-commonmark-ghpages (0.2.0)
|
||||
commonmarker (~> 0.23.4)
|
||||
jekyll (~> 3.9.0)
|
||||
jekyll-commonmark (~> 1.4.0)
|
||||
rouge (>= 2.0, < 4.0)
|
||||
jekyll-default-layout (0.1.4)
|
||||
jekyll (~> 3.0)
|
||||
@ -164,7 +163,7 @@ GEM
|
||||
rubyzip (>= 1.3.0, < 3.0)
|
||||
jekyll-sass-converter (1.5.2)
|
||||
sass (~> 3.4)
|
||||
jekyll-seo-tag (2.7.1)
|
||||
jekyll-seo-tag (2.8.0)
|
||||
jekyll (>= 3.8, < 5.0)
|
||||
jekyll-sitemap (1.4.0)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
@ -217,7 +216,7 @@ GEM
|
||||
gemoji (~> 3.0)
|
||||
html-pipeline (~> 2.2)
|
||||
jekyll (>= 3.0, < 5.0)
|
||||
kramdown (2.3.1)
|
||||
kramdown (2.3.2)
|
||||
rexml
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
@ -233,7 +232,7 @@ GEM
|
||||
jekyll-seo-tag (~> 2.1)
|
||||
minitest (5.15.0)
|
||||
multipart-post (2.1.1)
|
||||
nokogiri (1.13.3)
|
||||
nokogiri (1.13.6)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
octokit (4.22.0)
|
||||
@ -241,15 +240,13 @@ GEM
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (4.0.6)
|
||||
public_suffix (4.0.7)
|
||||
racc (1.6.0)
|
||||
rb-fsevent (0.11.1)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.5)
|
||||
rouge (3.26.0)
|
||||
ruby-enum (0.9.0)
|
||||
i18n
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
safe_yaml (1.0.5)
|
||||
@ -272,7 +269,7 @@ GEM
|
||||
thread_safe (~> 0.1)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.8)
|
||||
unf_ext (0.0.8.1)
|
||||
unicode-display_width (1.8.0)
|
||||
zeitwerk (2.5.4)
|
||||
|
||||
|
@ -2,7 +2,7 @@ repository: pmd/pmd
|
||||
|
||||
pmd:
|
||||
version: 7.0.0-SNAPSHOT
|
||||
previous_version: 6.43.0
|
||||
previous_version: 6.46.0
|
||||
date: ??-?????-2022
|
||||
release_type: major
|
||||
|
||||
|
@ -175,6 +175,18 @@ entries:
|
||||
- title: Error Prone
|
||||
output: web, pdf
|
||||
url: /pmd_rules_ecmascript_errorprone.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: HTML Rules
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Index
|
||||
output: web, pdf
|
||||
url: /pmd_rules_html.html
|
||||
- title: Best Practices
|
||||
output: web, pdf
|
||||
url: /pmd_rules_html_bestpractices.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
@ -370,9 +382,18 @@ entries:
|
||||
- title: Apex
|
||||
url: /pmd_languages_apex.html
|
||||
output: web, pdf
|
||||
- title: Java
|
||||
url: /pmd_languages_java.html
|
||||
- title: null
|
||||
output: web, pdf
|
||||
subfolders:
|
||||
- title: Java
|
||||
output: web, pdf
|
||||
subfolderitems:
|
||||
- title: Java Support
|
||||
url: /pmd_languages_java.html
|
||||
output: web, pdf
|
||||
- title: Java Versions
|
||||
url: /pmd_languages_java_versions.html
|
||||
output: web, pdf
|
||||
- title: JSP
|
||||
url: /pmd_languages_jsp.html
|
||||
output: web, pdf
|
||||
@ -385,6 +406,12 @@ entries:
|
||||
- title: Visualforce
|
||||
url: /pmd_languages_visualforce.html
|
||||
output: web, pdf
|
||||
- title: XML and XML dialects
|
||||
url: /pmd_languages_xml.html
|
||||
output: web, pdf
|
||||
- title: HTML
|
||||
url: /pmd_languages_html.html
|
||||
output: web, pdf
|
||||
- title: Developer Documentation
|
||||
output: web, pdf
|
||||
folderitems:
|
||||
|
@ -7,24 +7,92 @@ aliases:
|
||||
type: "xs:string"
|
||||
description: "The qualified name of a Java class, possibly with pairs of brackets to indicate an array type.
|
||||
Can also be a primitive type name."
|
||||
- &node_param
|
||||
name: element
|
||||
type: "xs:element"
|
||||
description: "Any element node"
|
||||
- &needs_typenode "The context node must be a {% jdoc jast::TypeNode %}"
|
||||
- &coord_fun_note |
|
||||
The function is not context-dependent, but takes a node as its first parameter.
|
||||
- &needs_node_ctx "The requires the context node to be an element"
|
||||
|
||||
langs:
|
||||
- name: "Any language"
|
||||
- name: "All languages"
|
||||
ns: "pmd"
|
||||
header: "Functions available to all languages are in the namespace `pmd`."
|
||||
funs:
|
||||
- name: fileName
|
||||
returnType: "xs:string"
|
||||
shortDescription: "Returns the current filename"
|
||||
description: "Returns the current simple filename without path but including the extension.
|
||||
This can be used to write rules that check filename naming conventions.
|
||||
|
||||
<p>This function is available since PMD 6.38.0.</p>"
|
||||
notes: "The function can be called on any node."
|
||||
shortDescription: "Returns the simple name of the current file"
|
||||
description: |
|
||||
Returns the current simple file name, without path but including the extension.
|
||||
This can be used to write rules that check file naming conventions.
|
||||
|
||||
since: 6.38.0
|
||||
notes: *needs_node_ctx
|
||||
examples:
|
||||
- code: "//b[pmd:fileName() = 'Foo.xml']"
|
||||
outcome: "Matches any `<b>` tags in files called `Foo.xml`."
|
||||
|
||||
- name: startLine
|
||||
returnType: "xs:int"
|
||||
parameters:
|
||||
- *node_param
|
||||
shortDescription: "Returns the start line of the given node"
|
||||
description: |
|
||||
Returns the line where the node starts in the source file.
|
||||
Line numbers are 1-based.
|
||||
|
||||
since: 6.44.0
|
||||
notes: *coord_fun_note
|
||||
examples:
|
||||
- code: "//b[pmd:startLine(.) > 5]"
|
||||
outcome: "Matches any `<b>` node which starts after the fifth line."
|
||||
|
||||
- name: endLine
|
||||
returnType: "xs:int"
|
||||
parameters:
|
||||
- *node_param
|
||||
shortDescription: "Returns the end line of the given node"
|
||||
description: |
|
||||
Returns the line where the node ends in the source file.
|
||||
Line numbers are 1-based.
|
||||
|
||||
since: 6.44.0
|
||||
notes: *coord_fun_note
|
||||
examples:
|
||||
- code: "//b[pmd:endLine(.) == pmd:startLine(.)]"
|
||||
outcome: "Matches any `<b>` node which doesn't span more than one line."
|
||||
|
||||
- name: startColumn
|
||||
returnType: "xs:int"
|
||||
parameters:
|
||||
- *node_param
|
||||
shortDescription: "Returns the start column of the given node (inclusive)"
|
||||
description: |
|
||||
Returns the column number where the node starts in the source file.
|
||||
Column numbers are 1-based. The start column is inclusive.
|
||||
|
||||
since: 6.44.0
|
||||
notes: *coord_fun_note
|
||||
examples:
|
||||
- code: "//b[pmd:startColumn(.) = 1]"
|
||||
outcome: "Matches any `<b>` node which starts on the first column of a line"
|
||||
|
||||
- name: endColumn
|
||||
returnType: "xs:int"
|
||||
parameters:
|
||||
- *node_param
|
||||
shortDescription: "Returns the end column of the given node (exclusive)"
|
||||
description: |
|
||||
Returns the column number where the node ends in the source file.
|
||||
Column numbers are 1-based. The end column is exclusive.
|
||||
|
||||
since: 6.44.0
|
||||
notes: *coord_fun_note
|
||||
examples:
|
||||
- code: "//b[pmd:startLine(.) = pmd:endLine(.) and pmd:endColumn(.) - pmd:startColumn(.) = 1]"
|
||||
outcome: "Matches any `<b>` node which spans exactly one character"
|
||||
|
||||
- name: "Java"
|
||||
ns: "pmd-java"
|
||||
|
@ -4,7 +4,11 @@
|
||||
|
||||
### {{ lang.name }}
|
||||
|
||||
{% if lang.header %}
|
||||
{{ lang.header | render_markdown }}
|
||||
{% else %}
|
||||
{{ lang.name }} functions are in the namespace `{{ lang.ns }}`.
|
||||
{% endif %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table width="100%">
|
||||
@ -50,6 +54,10 @@
|
||||
|
||||
<dl>
|
||||
<dd>{{ fun.description | render_markdown }}</dd>
|
||||
{% if fun.since %}
|
||||
<dt>Since</dt>
|
||||
<dd>PMD {{ fun.since }}</dd>
|
||||
{% endif %}
|
||||
<dt>Remarks</dt>
|
||||
<dd>{{ fun.notes | render_markdown }}</dd>
|
||||
|
||||
|
@ -1,12 +1,30 @@
|
||||
<footer>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 footer">
|
||||
<p class="float-right"><img src="{{ "images/logo/pmd-logo-70px.png" }}" alt="PMD logo"/></p>
|
||||
<p>
|
||||
©{{ site.time | date: "%Y" }} {{site.company_name}}. All rights reserved. <br />
|
||||
{% if page.last_updated %}<span>Page last updated:</span> {{page.last_updated}}<br/>{% endif %}
|
||||
Site last generated: {{ site.time | date: "%b %-d, %Y" }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% if site.github_editme_path and page.editmepath != false %}
|
||||
<hr />
|
||||
<div>
|
||||
This documentation is written in markdown. <br />
|
||||
If there is something missing or can be improved, edit this page on
|
||||
github and create a PR:
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://github.com/{{site.github_editme_path}}{{editmepath}}"
|
||||
role="button"
|
||||
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
|
||||
>
|
||||
</div>
|
||||
{% endif %}
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-lg-12 footer">
|
||||
©{{ site.time | date: "%Y" }} {{site.company_name}}. All rights
|
||||
reserved. <br />
|
||||
{% if page.last_updated %}<span>Page last updated:</span>
|
||||
{{page.last_updated}}<br />{% endif %} Site last generated: {{
|
||||
site.time | date: "%b %-d, %Y" }} <br />
|
||||
<p>
|
||||
<img src="{{ "images/logo/pmd-logo-70px.png" }}" alt="PMD
|
||||
logo"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
23
docs/_includes/header.html
Normal file
23
docs/_includes/header.html
Normal file
@ -0,0 +1,23 @@
|
||||
<header>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<a href="./" role="button"
|
||||
><i class="fa fa-home fa-lg"></i
|
||||
></a>
|
||||
» {{page.title}} {% if site.github_editme_path %} {% assign
|
||||
editmepath = page.path %} {% if page.editmepath %} {% assign
|
||||
editmepath = page.editmepath %} {% endif %}{% unless page.editmepath
|
||||
== false %}
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://github.com/{{site.github_editme_path}}{{editmepath}}"
|
||||
class="float-right"
|
||||
role="button"
|
||||
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
|
||||
>
|
||||
{% endunless %} {% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
</header>
|
@ -2,6 +2,7 @@
|
||||
|
||||
<ul id="mysidebar" class="nav">
|
||||
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version | replace: '!PMD_VERSION!', site.pmd.version}}</li>
|
||||
<div class="sidebarTitleDate">Release date: {{site.pmd.date}}</div>
|
||||
{% for entry in sidebar %}
|
||||
{% for folder in entry.folders %}
|
||||
{% if folder.output contains "web" %}
|
||||
|
@ -1,5 +0,0 @@
|
||||
{% comment %}
|
||||
Note: The content of the div-element is filled by javascript. See customscripts.js.
|
||||
{% endcomment %}
|
||||
|
||||
<div id="toc"></div>
|
@ -36,7 +36,7 @@
|
||||
{% unless page.toc == false %}
|
||||
<!-- Sticky TOC column -->
|
||||
<div class="toc-col">
|
||||
{% include toc.html %}
|
||||
<div id="toc"></div>
|
||||
</div>
|
||||
{% endunless %}
|
||||
<!-- /.toc-container-wrapper -->
|
||||
|
@ -2,31 +2,19 @@
|
||||
layout: default
|
||||
---
|
||||
|
||||
{% include header.html %}
|
||||
|
||||
<div class="post-header">
|
||||
<h1 class="post-title-main">{{ page.title }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="post-content">
|
||||
<div class="post-content" {% if site.github_editme_path and page.editmepath != false %}data-github-edit-url="https://github.com/{{site.github_editme_path}}{{editmepath}}"{% endif %}>
|
||||
|
||||
{% if page.summary %}
|
||||
<div class="summary">{{page.summary}}</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>
|
||||
|
||||
|
||||
{% if site.github_editme_path %}
|
||||
|
||||
{% assign editmepath = page.path %}
|
||||
{% if page.editmepath %}
|
||||
{% assign editmepath = page.editmepath %}
|
||||
{% endif %}
|
||||
{% unless page.editmepath == false %}
|
||||
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{{editmepath}}" class="btn btn-outline-secondary githubEditButton" role="button"><i class="fab fa-github fa-lg"></i> Edit me</a>
|
||||
{% endunless %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{content}}
|
||||
|
||||
<div class="tags">
|
||||
@ -43,6 +31,5 @@ layout: default
|
||||
|
||||
</div>
|
||||
|
||||
{{site.data.alerts.hr_shaded}}
|
||||
|
||||
{% include footer.html %}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,10 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
header {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
details {
|
||||
border-radius: 3px;
|
||||
background: #EEE;
|
||||
@ -118,3 +122,9 @@ pre {
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
div.sidebarTitleDate {
|
||||
margin-top:2.5px;
|
||||
margin-bottom:5px;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ li.sidebarTitle {
|
||||
font-weight:normal;
|
||||
font-size:130%;
|
||||
color: #ED1951;
|
||||
margin-bottom:10px;
|
||||
margin-left: 5px;
|
||||
margin-bottom:2.5px;
|
||||
margin-left:5px;
|
||||
|
||||
}
|
@ -84,7 +84,6 @@ li.sidebarTitle {
|
||||
font-weight:normal;
|
||||
font-size:130%;
|
||||
color: #4d94ff;
|
||||
margin-bottom:10px;
|
||||
margin-left: 5px;
|
||||
|
||||
margin-bottom:2.5px;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
@ -1,14 +1,21 @@
|
||||
|
||||
// Detect small devices and move the TOC in line
|
||||
function moveToc(){
|
||||
if(window.innerWidth < 1350){
|
||||
$( "#toc" ).detach().appendTo("#inline-toc").removeClass("position-fixed");
|
||||
$( '#toc' ).detach().appendTo('#inline-toc').removeClass('position-fixed');
|
||||
} else {
|
||||
$( "#toc" ).detach().appendTo(".toc-col").addClass("position-fixed");
|
||||
$( '#toc' ).detach().appendTo('.toc-col').addClass('position-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
$(document).ready(function () {
|
||||
// This handles the automatic toc. Use ## for subheads to auto-generate the on-page minitoc.
|
||||
// If you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc.
|
||||
$('#toc').toc({
|
||||
minimumHeaders: 0,
|
||||
listType: 'ul',
|
||||
showSpeed: 0,
|
||||
headers: 'h2,h3,h4',
|
||||
});
|
||||
|
||||
$('#mysidebar').height($(".nav").height());
|
||||
|
||||
@ -18,18 +25,31 @@ $( document ).ready(function() {
|
||||
var h = $(window).height();
|
||||
//console.log (h);
|
||||
if (h > 600) {
|
||||
$( "#mysidebar" ).attr("class", "nav position-fixed");
|
||||
$( '#mysidebar' ).attr('class', 'nav position-fixed');
|
||||
}
|
||||
|
||||
// activate tooltips. although this is a bootstrap js function, it must be activated this way in your theme.
|
||||
$('[data-toggle="tooltip"]').tooltip({
|
||||
placement : 'top'
|
||||
placement: 'top',
|
||||
});
|
||||
|
||||
/**
|
||||
* AnchorJS
|
||||
*/
|
||||
anchors.add('h2,h3,h4,h5');
|
||||
|
||||
// Add an "Edit on GitHub" button to each header (except h1)
|
||||
let url = $('div.post-content').data('githubEditUrl');
|
||||
if ( url !== undefined ) {
|
||||
$('div.post-content')
|
||||
.find(':header:not(h1)')
|
||||
.append(
|
||||
' <a class="edit-header" target="_blank" href=' +
|
||||
url +
|
||||
' role="button">✏️️</a>'
|
||||
);
|
||||
}
|
||||
|
||||
// Check if TOC needs to be moved on page load
|
||||
moveToc();
|
||||
|
||||
@ -37,10 +57,10 @@ $( document ).ready(function() {
|
||||
// when you're viewing a page.
|
||||
// Note: the class needs to be added before navgoco is initialized. Navgoco uses then this information
|
||||
// to expand the menus.
|
||||
$("li.active").parents('li').toggleClass("active");
|
||||
$( 'li.active' ).parents('li').toggleClass('active');
|
||||
|
||||
// Initialize navgoco with default options
|
||||
$("#mysidebar").navgoco({
|
||||
$( '#mysidebar' ).navgoco({
|
||||
caretHtml: '',
|
||||
accordion: true,
|
||||
openClass: 'active',
|
||||
@ -51,10 +71,6 @@ $( document ).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// This handles the automatic toc. Use ## for subheads to auto-generate the on-page minitoc.
|
||||
// If you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc.
|
||||
$('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3,h4' });
|
||||
|
||||
// Initialize jekyll search in topnav.
|
||||
SimpleJekyllSearch.init({
|
||||
searchInput: document.getElementById('search-input'),
|
||||
@ -85,4 +101,6 @@ $( document ).ready(function() {
|
||||
});
|
||||
|
||||
// Check if TOC needs to be moved on window resizing
|
||||
$(window).resize(function () {moveToc();});
|
||||
$(window).resize(function () {
|
||||
moveToc();
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user