Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/linters/codespell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
abl
activater
afterall
agains
als
ans
bais
bu
cacheing
checkin
childs
compliancy
curren
deleteable
feeded
fo
implementor
implementors
ist
mot
nd
noe
notin
ois
optiona
ore
ot
overriden
precence
resetable
reseted
re-use
seperator
sie
slashs
speakin
splited
splitted
vew
vie
Comment on lines +1 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these are from the "./api/src/client" directory. Can we ignore that location too?

47 changes: 47 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Lint

on: [pull_request]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-24.04
steps:
- name: Check Out
uses: actions/checkout@v4
- name: Install
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for not looking at this sooner!

I see that it mentions --all-files here. Does this mean all files in the project or only those in the pull request? Can it be just the latter?

37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
default_stages: [pre-commit, pre-push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
minimum_pre_commit_version: '3.2.0'
repos:
- repo: meta
hooks:
- id: identity
name: run identity check
- id: check-hooks-apply
name: run check hooks apply
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: run codespell
description: check spelling with codespell
args: [--ignore-words=.github/linters/codespell.txt]
exclude: ^api/src/main/resources/jakarta/faces/.*$
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ declare var Implementation: any;
* response test
* the idea is simply to pass in a dom
* the context and a response xml and then check what happens
* we do not need to to through the entire ajax cyle for that.
* we do not need to go through the entire ajax cycle for that.
*/
describe('Tests of the various aspects of the response protocol functionality', function () {

Expand Down
2 changes: 1 addition & 1 deletion api/src/client/typescript/mona_dish/Messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {_global$} from "./Global";
/**
* generic crypto interface
* to encrypt messages before they are sent
* to the message bus oder the underlying bus system
* to the message bus over the underlying bus system
*
* The idea is to make it as easy as possible, you can use for instance crypto js to
* handle everything
Expand Down
2 changes: 1 addition & 1 deletion api/src/client/typescript/mona_dish/SourcesCollectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function calculateSkips(next_strm: IStreamDataSource<any>) {
* Every data source which feeds data into the lazy stream
* or stream generally must implement this interface
*
* It is basically an iteratable to the core
* It is basically an iterable to the core
*/
export interface IStreamDataSource<T> {

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/jakarta/faces/component/UIData.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public boolean invokeOnComponent(FacesContext context, String clientId, ContextC
}
}

// Now Look throught facets on this UIComponent
// Now Look through facets on this UIComponent
if (this.getFacetCount() > 0)
{
for (Iterator<UIComponent> it = this.getFacets().values().iterator(); !returnValue && it.hasNext();)
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/META-INF/licenses/dojo-LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dojo is availble under *either* the terms of the modified BSD license *or* the
Dojo is available under *either* the terms of the modified BSD license *or* the
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
license to receive this code under (except as noted in per-module LICENSE
files). Some modules may not be the copyright of the Dojo Foundation. These
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* Quarkus does not support servletContext.getResourcePaths("/"), which is used for
* AUTOMATIC_EXTENSIONLESS_MAPPING.
* Therefor we scan for views on build time and reuse it here.
* Therefore we scan for views on build time and reuse it here.
*/
public class QuarkusResourceHandler extends ResourceHandlerWrapper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public void handleResourceRequest(FacesContext facesContext) throws IOException
return;
}

// We neet to get an instance of HttpServletResponse, but sometimes
// We need to get an instance of HttpServletResponse, but sometimes
// the response object is wrapped by several instances of
// ServletResponseWrapper (like ResponseSwitch).
// Since we are handling a resource, we can expect to get an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean execute(FacesContext facesContext)
: Level.WARNING;
if (log.isLoggable(level))
{
log.log(level, "Cicle over buildView-PreRenderViewEvent on RENDER_RESPONSE phase "
log.log(level, "Circle over buildView-PreRenderViewEvent on RENDER_RESPONSE phase "
+ "reaches maximal limit, please check listeners for infinite recursion.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ && isFirstUIColumn(parent.getParent(), column))
}

// Get the component's renderer.
// Note that getRenderer(FacesContext context) is definded in UIComponent,
// Note that getRenderer(FacesContext context) is defined in UIComponent,
// but it is protected, so we have to use reflection!
Renderer renderer = null;
try
Expand Down Expand Up @@ -1002,7 +1002,7 @@ && getVisitedFacetCount(context.getFacesContext(), parent) ==
// remove the visited facet count from the attribute map
removeVisitedFacetCount(context.getFacesContext(), parent);

// check for componentes that visit their children multiple times
// check for components that visit their children multiple times
if (parent instanceof UIData uidata)
{
if (uidata.getRowIndex() != uidata.getRowCount() - 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ protected void renderOutputLinkStart(FacesContext facesContext, UIOutput output)
writer.getCharacterEncoding());
href = hrefBuf.toString();
}
// check for the fragement attribute
// check for the fragment attribute
String fragmentAttr = null;
if (output instanceof HtmlOutputLink link)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected boolean hasNewspaperTableSpacer(UIComponent component)

/**
* @param component dataTable
* @return whether dataTable has newspaper columns layed out horizontally
* @return whether dataTable has newspaper columns laid out horizontally
*/
protected boolean isNewspaperHorizontalOrientation(UIComponent component)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static HttpServletRequest getHttpServletRequest(ExternalContext ec)
}

/**
* Trys to obtain a HttpServletResponse from the Response.
* Note that this method also trys to unwrap any ServletResponseWrapper
* Tries to obtain a HttpServletResponse from the Response.
* Note that this method also tries to unwrap any ServletResponseWrapper
* in order to retrieve a valid HttpServletResponse.
* @param response
* @return if found, the HttpServletResponse, null otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private WebXmlParser()
}

/**
* Parses the web.xml and web-fragements.xml for error pages.
* Parses the web.xml and web-fragments.xml for error pages.
* "null" as key represents the default error page. Otherwise, the key is the exception class.
*
* @param context the External Context or NULL if checking current classload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This class represents a supported {@link ViewDeclarationLanguage} in the application. Notably,
* the default ViewDeclarationLanguageFactory maintains an ordered list of supported languages for
* the purpose of determining which one to use for a given view id by calling the {@link #handles}
* method of each ofthe registered support and using the first match.
* method of each of the registered support and using the first match.
*
* @author Simon Lessard (latest modification by $Author$)
* @version $Revision$ $Date$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,17 +451,17 @@ final static String compressELText(String text)
//int firstCharLocation = getFirstTextCharLocationIgnoringSpacesTabsAndCarriageReturn(text);
int firstCharLocation = -1;
int leftChar = 0; // 0=first char on left 1=\n 2=\r 3=\r\n
int lenght = text.length();
int length = text.length();
String leftText = null;
for (int j = 0; j < lenght; j++)
for (int j = 0; j < length; j++)
{
char c = text.charAt(j);
if (leftChar == 0)
{
if (c == '\r')
{
leftChar = 2;
if (j+1 < lenght)
if (j+1 < length)
{
if (text.charAt(j+1) == '\n')
{
Expand All @@ -486,7 +486,7 @@ final static String compressELText(String text)
}
if (firstCharLocation == -1)
{
firstCharLocation = lenght;
firstCharLocation = length;
}
// Define the character on the left
if (firstCharLocation > 0)
Expand All @@ -503,7 +503,7 @@ final static String compressELText(String text)
leftText = "\r\n";
break;
default:
leftText = (lenght > 1) ? text.substring(0,1) : text;
leftText = (length > 1) ? text.substring(0,1) : text;
break;
}
}
Expand Down Expand Up @@ -584,17 +584,17 @@ else if (ins instanceof LiteralXMLInstruction)
{
int firstCharLocation = -1;
int leftChar = 0; // 0=first char on left 1=\n 2=\r 3=\r\n
int lenght = text.length();
int length = text.length();
String leftText = null;
for (int j = 0; j < lenght; j++)
for (int j = 0; j < length; j++)
{
char c = text.charAt(j);
if (leftChar == 0)
{
if (c == '\r')
{
leftChar = 2;
if (j+1 < lenght)
if (j+1 < length)
{
if (text.charAt(j+1) == '\n')
{
Expand All @@ -619,7 +619,7 @@ else if (ins instanceof LiteralXMLInstruction)
}
if (firstCharLocation == -1)
{
firstCharLocation = lenght;
firstCharLocation = length;
}
// Define the character on the left
if (firstCharLocation > 0)
Expand All @@ -636,7 +636,7 @@ else if (ins instanceof LiteralXMLInstruction)
leftText = "\r\n";
break;
default:
leftText = (lenght > 1) ? text.substring(0,1) : text;
leftText = (length > 1) ? text.substring(0,1) : text;
break;
}
}
Expand All @@ -645,7 +645,7 @@ else if (ins instanceof LiteralXMLInstruction)
leftText = "";
}

if (firstCharLocation == lenght && lenght > 1)
if (firstCharLocation == length && length > 1)
{
// All the instruction is space, replace with an instruction
// with only one space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ public boolean invokeOnComponent(FacesContext context, String clientId,
}
}

// Now Look throught facets on this UIComponent
// Now Look through facets on this UIComponent
if (this.getFacetCount() > 0)
{
for (Iterator<UIComponent> it = this.getFacets().values().iterator(); !returnValue && it.hasNext();)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public final class CompositeComponentELUtils
* - [^\\w\\.\\(] - There must be no word character, dot, or left parenthesis directly before cc.attrs
* - cc\\.attrs\\. - "cc.attrs." must occur
* - [^\\.]* - There must be no dot after cc.attrs to indicate a method invocation on cc.attrs
* - (\\(.*)? - If there is a left paranthesis after cc.attrs, a dot is allowed again
* - (\\(.*)? - If there is a left parenthesis after cc.attrs, a dot is allowed again
*/
public static final Pattern CC_ATTRS_METHOD_EXPRESSION_REGEX
= Pattern.compile("[^\\(]*[^\\w\\.\\(]cc\\.attrs\\.[^\\.]*(\\(.*)?");
Expand Down Expand Up @@ -417,7 +417,7 @@ private static UIComponent lookForCompositeComponentOnStack(final FacesContext f
}

/**
* Trys to get the composite component using getCompositeComponentBasedOnLocation()
* Tries to get the composite component using getCompositeComponentBasedOnLocation()
* and saves it in an attribute on the FacesContext, which is then used by
* CompositeComponentImplicitObject.
* @param facesContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static void createFieldDebugInfo(FacesContext facesContext,
newValue = Arrays.deepToString((Object[]) newValue);
}

// NOTE that the call stack does not make much sence here
// NOTE that the call stack does not make much sense here

// create the debug-info array
// structure:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void initFaces(ServletContext servletContext)
if ("false".equals(useEncryption))
{
log.warning(StateUtils.USE_ENCRYPTION + " is set to false. "
+ "This is unsecure and should only be used for local or intranet applications!");
+ "This is insecure and should only be used for local or intranet applications!");
}
else
{
Expand Down
Loading